/*
 * Shiguang Notes visual layer for discuz_blog.
 *
 * This file intentionally contains presentation rules only. All Discuz!
 * templates, hooks, forms, ids, loops and JavaScript behaviour remain owned
 * by the original template files. The .discuzx5 scope keeps the touch theme
 * unchanged even though both variants share common/header_common.php.
 */

body.discuzx5 {
    --sg-paper: #ffffff;
    --sg-paper-soft: #ffffff;
    --sg-ink: #1a1a1a;
    --sg-muted: #666666;
    --sg-line: #eeeeee;
    --sg-green: #4a8577;
    --sg-red: #3b82f6;
    --sg-shadow: 0 12px 32px rgba(0, 0, 0, .06);
    --sg-overlay: rgba(0, 0, 0, .5);
    --sg-card-bg: #ffffff;
    --sg-card-border: var(--sg-line);
    --sg-header-bg: transparent;
    --sg-header-border: transparent;
    --sg-text-primary: var(--sg-ink);
    --sg-text-secondary: var(--sg-muted);
    --sg-text-muted: #999999;
    --sg-text-light: rgba(255, 255, 255, .92);
    --sg-link-hover: var(--sg-red);
    --sg-button-primary: var(--sg-red);
    --sg-button-primary-hover: #2563eb;
    --sg-button-secondary: rgba(59, 130, 246, .10);
    --sg-button-secondary-hover: rgba(59, 130, 246, .18);
    --sg-input-bg: #fafafa;
    --sg-input-border: var(--sg-line);
    --sg-input-focus: var(--sg-red);
    --sg-hover-bg: rgba(0, 0, 0, .04);
    --sg-category-bg: #f5f5f5;
    --sg-category-hover: rgba(59, 130, 246, .08);
    --sg-category-text: #666666;
    --sg-rank-bg: #f5f5f5;
    --sg-rank-text: #999999;
    --sg-quote-bg: rgba(59, 130, 246, .08);
    --sg-quote-border: var(--sg-red);
    --sg-quote-text: #3b82f6;
    --sg-footer-bg: #fafafa;
    --sg-footer-border: var(--sg-line);
    --sg-footer-text: #999999;
    --sg-rnav-bg: rgba(255, 255, 255, .98);
    --sg-rnav-hover: var(--sg-red);
    --sg-feature-shade: linear-gradient(180deg, rgba(0, 0, 0, .04) 5%, rgba(0, 0, 0, .16) 42%, rgba(0, 0, 0, .82) 100%);
    --sg-hero-shade: linear-gradient(180deg, rgba(14, 12, 10, .06) 8%, rgba(14, 12, 10, .18) 42%, rgba(14, 12, 10, .82) 100%);
    --sg-hero-no-cover: linear-gradient(135deg, transparent 50%, rgba(59, 130, 246, .07)), linear-gradient(180deg, transparent, rgba(255, 255, 255, .34));
    --sg-gradient-primary: linear-gradient(120deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .85)), radial-gradient(circle at 88% 22%, rgba(59, 130, 246, .12), transparent 20%), radial-gradient(circle at 72% 80%, rgba(74, 133, 119, .10), transparent 28%);
    --dz-bodybg: var(--sg-paper);
    --dz-color: var(--sg-red);
    --dz-alink: var(--sg-ink);
    --dz-ahover: var(--sg-red);
    --dz-ahot: var(--sg-red);
    --dz-fa: var(--sg-ink);
    --dz-fb: #555555;
    --dz-fc: var(--sg-muted);
    --dz-fd: #cccccc;
    --dz-ff: var(--sg-paper-soft);
    --dz-nvbg: var(--sg-red);
    --dz-nvtxt: var(--sg-red);
    --dz-nvbga: var(--sg-red);
    --dz-nvtxta: #fff;
    --dz-bga: var(--sg-line);
    --dz-bgb: #f5f5f5;
    --dz-bgc: #fafafa;
    --dz-bgd: rgba(59, 130, 246, .10);
    --dz-bgf: var(--sg-paper-soft);
    --dz-btnbg: rgba(59, 130, 246, .10);
    --dz-btntxt: var(--sg-red);
    --dz-btnbga: var(--sg-red);
    --dz-btntxta: #fff;
    --dz-bordera: var(--sg-line);
    --dz-borderb: var(--sg-line);
    --dz-borderc: #dddddd;
    --dz-borderd: rgba(59, 130, 246, .28);
    --dz-radius-s: 6px;
    --dz-radius-m: 9px;
    --dz-radius-xl: 12px;
    --dz-radius-b: 7px;
    --dz-shadow: var(--sg-shadow);
    margin: 0;
    color: var(--sg-ink);
    font-family: "PingFang SC", "Noto Serif SC", "Songti SC", "Microsoft YaHei", sans-serif;
    background: var(--sg-paper);
    transition: background-color .35s ease, color .35s ease;
}

body.discuzx5[data-theme="dark"] {
    --sg-paper: #0d0d0f;
    --sg-paper-soft: #16161a;
    --sg-ink: #f0f0f2;
    --sg-muted: #8a8a90;
    --sg-line: #2a2a30;
    --sg-green: #5cb8a8;
    --sg-red: #60a5fa;
    --sg-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    --sg-overlay: rgba(0, 0, 0, .75);
    --sg-card-bg: rgba(22, 22, 26, .92);
    --sg-card-border: var(--sg-line);
    --sg-header-bg: transparent;
    --sg-header-border: transparent;
    --sg-text-primary: var(--sg-ink);
    --sg-text-secondary: var(--sg-muted);
    --sg-text-muted: #6a6a72;
    --sg-text-light: rgba(240, 240, 242, .9);
    --sg-link-hover: var(--sg-red);
    --sg-button-primary: var(--sg-red);
    --sg-button-primary-hover: #3b82f6;
    --sg-button-secondary: rgba(96, 165, 250, .12);
    --sg-button-secondary-hover: rgba(96, 165, 250, .20);
    --sg-input-bg: var(--sg-paper-soft);
    --sg-input-border: var(--sg-line);
    --sg-input-focus: var(--sg-red);
    --sg-hover-bg: rgba(42, 42, 48, .55);
    --sg-category-bg: rgba(42, 42, 48, .6);
    --sg-category-hover: rgba(96, 165, 250, .12);
    --sg-category-text: #9a9a9f;
    --sg-rank-bg: #2a2a30;
    --sg-rank-text: #6a6a72;
    --sg-quote-bg: rgba(96, 165, 250, .08);
    --sg-quote-border: var(--sg-red);
    --sg-quote-text: #93c5fd;
    --sg-footer-bg: rgba(22, 22, 26, .9);
    --sg-footer-border: var(--sg-line);
    --sg-footer-text: #6a6a72;
    --sg-rnav-bg: rgba(22, 22, 26, .95);
    --sg-rnav-hover: var(--sg-red);
    --sg-feature-shade: linear-gradient(180deg, rgba(0, 0, 0, .1) 5%, rgba(0, 0, 0, .3) 42%, rgba(0, 0, 0, .88) 100%);
    --sg-hero-shade: linear-gradient(180deg, rgba(0, 0, 0, .12) 8%, rgba(0, 0, 0, .35) 42%, rgba(0, 0, 0, .9) 100%);
    --sg-hero-no-cover: linear-gradient(135deg, transparent 50%, rgba(96, 165, 250, .08)), linear-gradient(180deg, transparent, rgba(22, 22, 26, .4));
    --sg-gradient-primary: linear-gradient(120deg, rgba(22, 22, 26, .96), rgba(22, 22, 26, .82)), radial-gradient(circle at 88% 22%, rgba(96, 165, 250, .12), transparent 20%), radial-gradient(circle at 72% 80%, rgba(92, 184, 168, .10), transparent 28%);
    --dz-bodybg: var(--sg-paper);
    --dz-color: var(--sg-red);
    --dz-alink: var(--sg-ink);
    --dz-ahover: var(--sg-red);
    --dz-ahot: var(--sg-red);
    --dz-fa: var(--sg-ink);
    --dz-fb: #a0a0a5;
    --dz-fc: var(--sg-muted);
    --dz-fd: #5a5a62;
    --dz-ff: var(--sg-paper-soft);
    --dz-nvbg: var(--sg-red);
    --dz-nvtxt: var(--sg-red);
    --dz-nvbga: var(--sg-red);
    --dz-nvtxta: #fff;
    --dz-bga: var(--sg-line);
    --dz-bgb: #1e1e22;
    --dz-bgc: #1a1a1f;
    --dz-bgd: rgba(96, 165, 250, .10);
    --dz-bgf: var(--sg-paper-soft);
    --dz-btnbg: rgba(96, 165, 250, .12);
    --dz-btntxt: var(--sg-red);
    --dz-btnbga: var(--sg-red);
    --dz-btntxta: #fff;
    --dz-bordera: var(--sg-line);
    --dz-borderb: var(--sg-line);
    --dz-borderc: #3a3a40;
    --dz-borderd: rgba(96, 165, 250, .25);
}

body.discuzx5 a {
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}

body.discuzx5 .wp,
body.discuzx5.dz_wide .wp,
body.discuzx5 .dz_btm_layer {
    width: min(1180px, calc(100% - 48px));
    min-width: 0;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

body.discuzx5 #wp {
    min-height: calc(100vh - 220px);
}

body.discuzx5 #pt {
    margin: 18px auto;
    padding: 0 2px;
    background: transparent;
    border: 0 !important;
    box-shadow: none;
}

body.discuzx5 #pt .z,
body.discuzx5 #pt .z a,
body.discuzx5 #pt .z em,
body.discuzx5 #pt .z span {
    color: #91887d;
}

/* Header */
body.discuzx5 #dz_btm_layer.topbox {
    position: sticky;
    top: 0;
    z-index: 199;
}

body.discuzx5 .dz_layer_top {
    border-bottom: 1px solid var(--sg-header-border);
    background: var(--sg-header-bg) !important;
    box-shadow: none;
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    transition: all .35s ease;
}

body.discuzx5 .dz_layer_top.scrolled {
    border-bottom: 1px solid var(--sg-header-border);
    background: var(--sg-header-bg) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

body.discuzx5 .dz_btm_layer {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 86px;
    padding: 0;
}

body.discuzx5 .dz_nav .dz_nav_logo {
    display: flex;
    flex: 0 0 180px;
    align-items: center;
    height: 86px;
    margin: 0;
}

body.discuzx5 .dzlogo {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    height: 52px;
}

body.discuzx5 .dz_nav .dz_nav_logo img {
    float: none;
    width: auto;
    max-width: 180px;
    height: auto;
    max-height: 48px;
}

/* Present the existing site name as the handwritten wordmark used by the
 * reference page. The real logo remains in the DOM for links and fallbacks. */
body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    align-content: center;
    width: 180px;
    max-width: 180px;
    height: 64px;
    overflow: visible;
    color: var(--sg-text-primary);
    text-decoration: none;
}

body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo img {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo::before {
    content: attr(title);
    overflow: hidden;
    font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo::after {
    content: "记录思考，也收藏生活";
    margin-top: 7px;
    overflow: hidden;
    color: var(--sg-text-muted);
    font-size: 12px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.discuzx5 .dz_layer_nav {
    float: none;
    flex: 1 1 auto;
    width: auto !important;
    height: 86px;
    overflow: hidden;
}

body.discuzx5 .dz_layer_nav ul {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 2.4vw, 40px);
    height: 86px;
}

body.discuzx5 .dz_layer_nav ul li {
    float: none;
}

body.discuzx5 .dz_layer_nav ul li a,
body.discuzx5 .dz_layer_nav ul .dz_menumore a {
    height: 86px;
    margin: 0;
    padding: 0;
    line-height: 86px;
    color: var(--sg-text-primary) !important;
    font-size: 15px;
    letter-spacing: 0;
}

body.discuzx5 .dz_layer_nav ul li a::before,
body.discuzx5 .dz_layer_nav ul li a::after {
    display: none;
}

body.discuzx5 .dz_layer_nav ul li a::after {
    position: absolute;
    right: auto;
    bottom: 18px;
    left: 50%;
    display: block;
    width: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--sg-button-primary) !important;
    content: "";
    transform: translateX(-50%);
}

body.discuzx5 .dz_layer_nav ul li.a a::after,
body.discuzx5 .dz_layer_nav ul li a:hover::after {
    width: 28px;
}

body.discuzx5 .dz_layer_dl {
    float: none;
    flex: 0 0 auto;
}

body.discuzx5 .header-right {
    height: 86px;
}

body.discuzx5 .header-searcher {
    margin-right: 14px;
}

body.discuzx5 .header-searcher .search-input {
    width: 216px !important;
    height: 44px;
    padding: 0 44px 0 14px;
    border: 1px solid var(--sg-input-border);
    border-radius: 10px;
    background: var(--sg-input-bg);
    color: var(--sg-text-primary);
}

body.discuzx5 .header-searcher .search-icon {
    width: 44px;
    height: 44px;
    background-image: url(../svg/search.svg);
}

body.discuzx5 .header-user-login .login_btn {
    margin-right: 0;
    padding: 7px 18px;
    border-radius: 9px;
    background: var(--sg-button-primary);
    box-shadow: 0 10px 22px rgba(59, 130, 246, .18);
}

body.discuzx5 .header-user-login .login_btn a {
    color: #fff;
}

body.discuzx5 .header-user-avatar img {
    width: 40px;
    height: 40px;
    border: 2px solid var(--sg-card-bg);
    border-radius: 50%;
    box-shadow: var(--sg-shadow);
}

/* Cards and common controls */
body.discuzx5 .bm,
body.discuzx5 .bn,
body.discuzx5 .km_mbm {
    margin-bottom: 18px;
}

body.discuzx5 .bm:not(.bw0),
body.discuzx5 .dz_bm,
body.discuzx5 .ct2 .sd .bm,
body.discuzx5 .ct2 .mn .bm,
body.discuzx5 .portal_side .drag > .area > .block {
    border: 1px solid var(--sg-card-border) !important;
    border-radius: 9px;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 .bm_h {
    border-color: var(--sg-card-border);
    background: transparent;
}

body.discuzx5 .bm_h h1,
body.discuzx5 .bm_h h2,
body.discuzx5 .bm_h h3,
body.discuzx5 .bm_h strong,
body.discuzx5 .ts,
body.discuzx5 .xs2 {
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
}

body.discuzx5 .pn,
body.discuzx5 .pnc,
body.discuzx5 a.pnc,
body.discuzx5 .pgsbtn,
body.discuzx5 .dz_rbox_btn {
    border-radius: 7px;
    background: var(--sg-button-primary);
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(59, 130, 246, .14);
}

body.discuzx5 .px,
body.discuzx5 .pt,
body.discuzx5 .ps,
body.discuzx5 select,
body.discuzx5 textarea {
    border-color: var(--sg-input-border);
    border-radius: 8px;
    background: var(--sg-input-bg);
    color: var(--sg-text-primary);
}

body.discuzx5 .p_pop,
body.discuzx5 .p_pof,
body.discuzx5 .sllt {
    border: 1px solid var(--sg-card-border);
    border-radius: 9px;
    background: var(--sg-input-bg);
    box-shadow: var(--sg-shadow);
}

/* Aggregated blog home: category tabs + article list + DIY sidebar. */


body.discuzx5 .portal_container_wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 24px;
    margin-top: 34px;
}

body.discuzx5 .timeline_container {
    min-width: 0;
    margin: 0;
}

body.discuzx5 .timeline_content {
    display: block;
}

body.discuzx5 .portal_nav {
    position: static;
    width: auto;
    max-height: none;
    margin: 0;
    overflow: visible;
    border: 1px solid var(--sg-card-border);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 .portal_nav_container {
    min-width: 0;
    height: auto;
    padding: 0 26px;
    overflow-x: auto;
}

body.discuzx5 .portal_nav ul {
    display: flex;
    gap: 36px;
    min-width: max-content;
    border-bottom: 1px solid var(--sg-card-border);
}

body.discuzx5 .portal_nav li a {
    position: relative;
    padding: 22px 0 20px;
    border-radius: 0;
    background: transparent !important;
    color: var(--sg-text-secondary) !important;
    font-size: 16px;
}

body.discuzx5 .portal_nav li.a a,
body.discuzx5 .portal_nav li a:hover {
    color: var(--sg-text-primary) !important;
}

body.discuzx5 .portal_nav li.a a::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--sg-button-primary);
    content: "";
}

body.discuzx5 .timeline_entry_list {
    float: none;
    width: auto;
}

body.discuzx5 .timeline_entry_list_container {
    padding: 0 26px 12px;
    border: 1px solid var(--sg-card-border);
    border-top: 0;
    border-radius: 0 0 9px 9px;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 .portal_side {
    width: 310px;
    flex-shrink: 0;
    margin-right: 20px;
}



body.discuzx5 #ct.ct2:not(:has(> .sd > *)) > .mn {
    float: none;
    width: 100%;
}

body.discuzx5 #ct.ct2:not(:has(> .sd > *)) > .sd {
    display: none;
}

body.discuzx5 .portal_side .bm_h h2,
body.discuzx5 .portal_side .blocktitle {
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: 22px;
}

/* Article rows shared by the aggregate and forum list pages. */
body.discuzx5 .forumportal_listc {
    margin-bottom: 0;
}

body.discuzx5 .forumportal_listc li.kmlist {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    column-gap: 28px;
    min-height: 160px;
    padding: 28px 0;
    border-top: 1px solid var(--sg-card-border);
}

body.discuzx5 .forumportal_listc li.kmlist:first-child {
    border-top: 0;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmtit {
    grid-column: 2;
    grid-row: 1;
    height: auto;
    margin: 4px 0 10px;
    overflow: visible;
    white-space: normal;
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmtxt {
    grid-column: 2;
    grid-row: 2;
    max-height: 52px;
    margin: 0 0 18px;
    color: var(--sg-text-secondary);
    font-size: 14px;
    line-height: 1.85;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmfoot {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    height: auto;
    min-height: 24px;
    margin: 0;
    color: var(--sg-text-secondary);
    line-height: 24px;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_onebox,
body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 220px !important;
    min-width: 0;
    max-width: none;
    height: 160px;
    margin: 0;
    overflow: hidden;
    border-radius: 7px;
    background: var(--sg-hover-bg);
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_onebox .kmimg,
body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box .kmshowimg:first-child {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 0;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box .kmshowimg:not(:first-child) {
    display: none;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_onebox img,
body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box img {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) {
    grid-template-columns: minmax(0, 1fr);
}

body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) > .kmtit,
body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) > .kmtxt,
body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) > .kmfoot {
    grid-column: 1;
}

body.discuzx5 .forumportal_listc .kmfoot .kmimg {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

body.discuzx5 .forumportal_listc .kmfoot .kmico_bk {
    padding: 2px 9px;
    border-radius: 5px;
    background: rgba(74, 133, 119, .12);
    color: var(--sg-green);
}

body.discuzx5 .forumportal_listc .kmtit span.kmico {
    border-radius: 5px;
    background: var(--sg-green);
}

body.discuzx5 .forumportal_listc .kmtit span.kmding,
body.discuzx5 .forumportal_listc .kmtit span.kmjing {
    background: var(--sg-button-primary);
}

/* Aggregate-home DIY feature module: a five-slide lead story plus two cards. */
body.discuzx5 #diy1 .sg-diy-feature-frame,
body.discuzx5 #diy1 .sg-diy-feature-frame > .column,
body.discuzx5 #diy1 .sg-diy-feature-block,
body.discuzx5 #diy1 .sg-diy-feature-block .dxb_bc {
    width: 100%;
    margin: 0;
    padding: 0;
}

body.discuzx5 .sg-diy-feature-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 18px;
    height: 394px;
    margin-top: 34px;
}

body.discuzx5 .sg-diy-feature-card {
    min-width: 0;
    min-height: 0;
}

body.discuzx5 .sg-diy-feature-card {
    position: relative;
    overflow: hidden;
    border-radius: 9px;
    background: #292620;
}

body.discuzx5 .sg-diy-feature-card__media,
body.discuzx5 .sg-diy-feature-card__shade {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

body.discuzx5 .sg-diy-feature-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

body.discuzx5 .sg-diy-feature-card:hover .sg-diy-feature-card__media img {
    transform: scale(1.025);
}

body.discuzx5 .sg-diy-feature-card__shade {
    z-index: 1;
    background: var(--sg-feature-shade);
    pointer-events: none;
}

body.discuzx5 .sg-diy-feature-card__content {
    position: absolute;
    z-index: 2;
    right: 34px;
    bottom: 30px;
    left: 34px;
    color: #fff;
    pointer-events: none;
}

body.discuzx5 .sg-diy-feature-card__content a {
    color: inherit !important;
    pointer-events: auto;
}

body.discuzx5 .sg-diy-feature-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    box-sizing: border-box;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--sg-button-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
}

body.discuzx5 .sg-diy-feature-tag--green {
    background: var(--sg-green);
}

body.discuzx5 .sg-diy-feature-tag:empty {
    display: none;
}

body.discuzx5 .sg-diy-feature-summary {
    display: -webkit-box;
    max-width: 700px;
    margin: 0 0 20px;
    overflow: hidden;
    color: rgba(255, 255, 255, .9);
    font-size: 15px;
    line-height: 1.8;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body.discuzx5 .sg-diy-feature-meta,
body.discuzx5 .sg-diy-feature-author {
    display: flex;
    align-items: center;
}

body.discuzx5 .sg-diy-feature-meta {
    flex-wrap: wrap;
    gap: 10px 16px;
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
    line-height: 30px;
}

body.discuzx5 .sg-diy-feature-author {
    gap: 9px;
}

body.discuzx5 .sg-diy-feature-author img {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    object-fit: cover;
}

body.discuzx5 .sg-diy-feature-dots {
    position: absolute;
    z-index: 4;
    right: 30px;
    bottom: 30px;
    display: flex;
    gap: 10px;
}

body.discuzx5 .sg-diy-feature-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .86);
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    transition: background-color .2s ease, transform .2s ease;
}

body.discuzx5 .sg-diy-feature-dots button:hover,
body.discuzx5 .sg-diy-feature-dots button:focus-visible {
    transform: scale(1.18);
}

body.discuzx5 .sg-diy-feature-dots button.is-active {
    background: var(--sg-button-primary);
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(-n + 5) {
    grid-column: 1;
    grid-row: 1 / span 2;
    visibility: hidden;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .55s ease, visibility .55s ease;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-item--1,
body.discuzx5 .sg-diy-feature-grid.has-js > .sg-diy-feature-card.is-active {
    visibility: visible;
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
}

body.discuzx5 .sg-diy-feature-grid.has-js > .sg-diy-feature-item--1:not(.is-active) {
    visibility: hidden;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-item--6 {
    grid-column: 2;
    grid-row: 1;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-item--7 {
    grid-column: 2;
    grid-row: 2;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(-n + 5) h2 {
    max-width: 720px;
    margin: 16px 0 10px;
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(30px, 3.1vw, 42px);
    font-weight: 600;
    line-height: 1.25;
    text-wrap: balance;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(-n + 5) .sg-diy-feature-tag--category,
body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) .sg-diy-feature-tag--lead,
body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) .sg-diy-feature-summary,
body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) .sg-diy-feature-author {
    display: none !important;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) .sg-diy-feature-card__content {
    right: 22px;
    bottom: 22px;
    left: 22px;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) h2 {
    display: -webkit-box;
    margin: 14px 0 8px;
    overflow: hidden;
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) .sg-diy-feature-meta {
    gap: 8px;
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(n + 6) .sg-diy-feature-date::after {
    margin-left: 8px;
    content: "·";
}

body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-dots {
    position: relative;
    right: auto;
    bottom: auto;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: end;
    justify-self: end;
    margin: 0 30px 30px 0;
}

body.discuzx5 .portal_container .timeline_entry_list_container {
    padding: 0 26px 24px;
}



/* Forum index and category pages. */
body.discuzx5 #chart {
    margin: 26px 0 22px;
    padding: 18px 22px;
    border: 1px solid var(--sg-card-border);
    border-radius: 9px;
    background: var(--sg-card-bg) !important;
    box-shadow: var(--sg-shadow);
}

body.discuzx5 .fl.bm,
body.discuzx5 .fl .bmw,
body.discuzx5 .boardnav .bml{
    overflow: hidden;
    border: 1px solid var(--sg-card-border) !important;
    border-radius: 9px;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 .fl .bm_h,
body.discuzx5 .boardnav .bml > .bm_h {
    padding: 18px 22px;
    border-bottom: 1px solid var(--sg-card-border);
    margin: 0;
}

body.discuzx5 .fl .bm_h h2,
body.discuzx5 .boardnav .bml h1 {
    color: var(--sg-text-primary);
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: 24px;
}

body.discuzx5 .fl_tb td.fl_g {
    padding: 20px;
    border-radius: 9px;
}

body.discuzx5 .fl_tb td.fl_g:hover {
    background: var(--sg-hover-bg);
}

body.discuzx5 .dz_list_top {
    margin: 0;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--sg-card-border);
    border-radius: 0;
    background: transparent;
}

body.discuzx5 #threadlist > .bm_c {
    padding: 0 26px 12px;
}

body.discuzx5 #autopbn,
body.discuzx5 .pgbtn a {
    margin: 18px auto;
    border: 1px solid var(--sg-line);
    border-radius: 7px;
    background: #fffaf2;
    color: var(--sg-muted);
}

body.discuzx5 .boardnav > #ct > .mn > .bml {
    position: relative;
    margin-bottom: 24px;
}

/* Forum list heading mirrors the category-page hero from the static reference. */
body.discuzx5 .boardnav .sg-forum-page-heading {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 240px;
    padding: 0;
    background: var(--sg-gradient-primary);
}

body.discuzx5 .boardnav .sg-forum-page-heading > .bm_h.sg-forum-page-heading__content {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    min-height: 238px;
    padding: 42px;
    border: 0;
    background: transparent;
    margin: 0;
}

body.discuzx5 .sg-forum-page-heading__tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    box-sizing: border-box;
    height: 28px;
    padding: 0 12px;
    border-radius: 5px;
    background: var(--sg-button-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

body.discuzx5 .boardnav .sg-forum-page-heading h1 {
    margin: 18px 0 12px;
    font-size: clamp(34px, 4vw, 52px) !important;
    font-weight: 500;
    line-height: 1.18;
}

body.discuzx5 .boardnav .sg-forum-page-heading h1 a {
    color: var(--sg-text-primary);
}

body.discuzx5 .sg-forum-page-heading__intro {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0;
    overflow: hidden;
    color: var(--sg-text-secondary);
    font-size: 17px;
    line-height: 1.9;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body.discuzx5 .sg-forum-page-heading__intro > * {
    display: inline;
    margin: 0;
}

body.discuzx5 .sg-forum-page-heading__rules-link {
    position: absolute;
    top: 53px;
    left: 112px;
    display: inline-flex;
    gap: 5px;
    align-items: center;
    box-sizing: border-box;
    height: 28px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid rgba(59, 130, 246, .22);
    border-radius: 5px;
    background: rgba(59, 130, 246, .06);
    color: var(--sg-red);
    font-size: 13px;
    line-height: 1;
}

body.discuzx5 .sg-forum-page-heading__rules-link em {
    display: none;
}

body.discuzx5 .boardnav .sg-forum-page-heading > .sg-forum-page-heading__meta {
    position: relative;
    z-index: 2;
    margin: -20px 42px 28px;
    padding: 18px 20px;
}

body.discuzx5 .sg-forum-page-heading__meta:has(> .sg-forum-rules-panel[style*="display:none"]):not(:has(> .sg-forum-page-heading__extra)) {
    display: none;
}

/* Thread type filter: keep the native filter links and fold script, restyle only. */
body.discuzx5 #thread_types.ttp {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    height: auto !important;
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid var(--sg-card-border);
    border-radius: 9px;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 #thread_types.ttp li {
    float: none;
    padding: 0;
}

body.discuzx5 #thread_types.ttp a,
body.discuzx5 #thread_types.ttp strong {
    display: inline-flex;
    float: none;
    align-items: center;
    min-height: 36px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--sg-card-border);
    border-radius: 7px;
    background: var(--sg-input-bg);
    color: var(--sg-text-secondary) !important;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

body.discuzx5 #thread_types.ttp li:not(.a) a:hover,
body.discuzx5 #thread_types.ttp li:not(.a) strong:hover {
    border-color: rgba(74, 133, 119, .48);
    background: rgba(74, 133, 119, .08);
    color: var(--sg-green) !important;
}

body.discuzx5 #thread_types.ttp li.a a,
body.discuzx5 #thread_types.ttp li.a strong {
    border-color: var(--sg-button-primary);
    background: var(--sg-button-primary);
    color: #fff !important;
    box-shadow: 0 5px 14px rgba(59, 130, 246, .16);
}

body.discuzx5 #thread_types.ttp .num {
    display: inline-block;
    min-width: 20px;
    height: 20px;
    box-sizing: border-box;
    margin-left: 7px;
    padding: 0 6px;
    border-radius: 10px;
    background: rgba(74, 133, 119, .13);
    color: var(--sg-green) !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

body.discuzx5 #thread_types.ttp li.a .num {
    background: rgba(255, 255, 255, .24);
    color: #fff !important;
}

body.discuzx5 .thread_fold {
    color: var(--sg-text-secondary);
    font-weight: 500;
    transition: color .18s ease;
}

body.discuzx5 .thread_fold:hover {
    color: var(--sg-button-primary);
}

/* Thread detail: preserve Discuz table structure, present it as a reading card. */
body.discuzx5.dz_pg_viewthread #ct {
    max-width: none;
    min-width: 0;
}

body.discuzx5 #postlist {
    overflow: hidden;
    border: 1px solid var(--sg-card-border) !important;
    border-radius: 9px;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 #postlist .posthead {
    border-bottom: 1px solid var(--sg-card-border);
    background:
        radial-gradient(circle at 88% 22%, rgba(59, 130, 246, .12), transparent 22%),
        radial-gradient(circle at 72% 80%, rgba(74, 133, 119, .12), transparent 30%),
        rgba(255, 255, 255, .92);
}

body.discuzx5 #postlist .posthead .plc {
    padding: 34px 38px;
}

body.discuzx5 #postlist .posthead .ts {
    margin: 8px 0 12px;
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 600;
    line-height: 1.25;
}

body.discuzx5 #postlist .posthead .side_btn svg path:last-child {
    fill: var(--sg-red);
}

/* Article-detail hero: native thread data, Shiguang static-page composition. */
body.discuzx5 #postlist .posthead.sg-thread-hero,
body.discuzx5 #postlist .posthead.sg-thread-hero > tbody,
body.discuzx5 #postlist .posthead.sg-thread-hero > tbody > tr {
    display: block;
    width: 100%;
}

body.discuzx5 #postlist .posthead.sg-thread-hero {
    position: relative;
    height: 430px;
    overflow: hidden;
    border: 0;
    background:
        radial-gradient(circle at 84% 24%, rgba(59, 130, 246, .20), transparent 25%),
        radial-gradient(circle at 68% 76%, rgba(74, 133, 119, .18), transparent 32%),
        var(--sg-paper);
    margin-bottom: 40px;
}

body.discuzx5 #postlist .posthead.sg-thread-hero .pls {
    display: none;
}

body.discuzx5 #postlist .posthead.sg-thread-hero .plc {
    position: relative;
    display: block;
    width: 100%;
    height: 430px;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

body.discuzx5 .sg-thread-hero__media,
body.discuzx5 .sg-thread-hero__shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

body.discuzx5 .sg-thread-hero__media {
    object-fit: cover;
    object-position: center;
}

body.discuzx5 .sg-thread-hero__shade {
    z-index: 1;
    background: var(--sg-hero-shade);
}

body.discuzx5 .sg-thread-hero:not(.has-cover) .sg-thread-hero__shade {
    background: var(--sg-hero-no-cover);
}

body.discuzx5 .sg-thread-hero__content {
    position: absolute;
    z-index: 2;
    right: 42px;
    bottom: 38px;
    left: 42px;
    color: var(--sg-text);
}

body.discuzx5 .sg-thread-hero.has-cover .sg-thread-hero__content,
body.discuzx5 .sg-thread-hero.has-cover .sg-thread-hero__content a,
body.discuzx5 .sg-thread-hero.has-cover .sg-thread-hero__content .xg1 {
    color: #fff !important;
}

body.discuzx5 .sg-thread-hero__tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    box-sizing: border-box;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--sg-button-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
}

body.discuzx5 #postlist .posthead.sg-thread-hero .ts {
    display: block;
    max-width: 760px;
    margin: 18px 0 20px;
    color: inherit;
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(36px, 3.55vw, 52px) !important;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.02em;
    text-wrap: balance;
}

body.discuzx5 #postlist .posthead.sg-thread-hero .ts a,
body.discuzx5 #postlist .posthead.sg-thread-hero .ts span {
    color: inherit !important;
}

body.discuzx5 #postlist .posthead.sg-thread-hero > tbody > tr > .plc > .xg1 {
    display: inline-flex;
    align-items: center;
    margin: -12px 0 16px;
    color: var(--sg-muted);
}

body.discuzx5 .sg-thread-hero__meta,
body.discuzx5 .sg-thread-hero__author {
    display: flex;
    align-items: center;
}

body.discuzx5 .sg-thread-hero__meta {
    flex-wrap: wrap;
    gap: 12px 18px;
    color: var(--sg-muted);
    font-size: 15px;
    line-height: 38px;
}

body.discuzx5 .sg-thread-hero.has-cover .sg-thread-hero__meta {
    color: rgba(255, 255, 255, .92);
}

body.discuzx5 .sg-thread-hero__author {
    gap: 10px;
    color: inherit !important;
}

body.discuzx5 .sg-thread-hero__avatar {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .78);
    border-radius: 50%;
    background: #e9e2d8;
    color: var(--sg-red);
    object-fit: cover;
    text-align: center;
}

body.discuzx5 .sg-thread-hero__avatar--anonymous {
    font-weight: 700;
    line-height: 34px;
}

body.discuzx5 #postlist .posthead.sg-thread-hero .side_btn {
    display: none;
}

body.discuzx5 #postlist .sg-first-post .sg-post-native-meta {
    display: none;
}

body.discuzx5 #postlist .sg-first-post .pi {
    min-height: 28px;
    padding: 10px 22px;
    border-color: var(--sg-card-border);
    background: var(--sg-card-bg);
}

body.discuzx5 #postlist .viewthread_table,
body.discuzx5 #postlist > div[id^="post_"] {
    border-color: var(--sg-card-border);
}

body.discuzx5 #postlist .plc {
    background: transparent;
}

body.discuzx5 #postlist .pls {
    background: var(--sg-hover-bg);
    border-color: var(--sg-card-border);
}

body.discuzx5 #postlist .t_f,
body.discuzx5 #postlist .t_fsz,
body.discuzx5 #postlist .pcb {
    color: var(--sg-text-primary);
    font-size: 16px;
    line-height: 2;
}

body.discuzx5 #postlist .t_f h1,
body.discuzx5 #postlist .t_f h2,
body.discuzx5 #postlist .t_f h3 {
    margin: 30px 0 14px;
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    line-height: 1.4;
}

body.discuzx5 #postlist .t_f blockquote,
body.discuzx5 #postlist .quote {
    margin: 24px 0;
    padding: 18px 22px;
    border: 0;
    border-left: 4px solid var(--sg-quote-border);
    background: var(--sg-quote-bg);
    color: var(--sg-quote-text);
}

body.discuzx5 #postlist .pi,
body.discuzx5 #postlist .po,
body.discuzx5 #postlist .pob {
    border-color: var(--sg-card-border);
}

/* Native thread actions: links and onclick handlers remain untouched. */
body.discuzx5 #postlist #p_btn {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 30px 0 36px !important;
    padding: 0 28px;
}

body.discuzx5 #postlist #p_btn > a {
    display: inline-flex;
    float: none;
    align-items: center;
    min-height: 40px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 17px;
    border: 1px solid var(--sg-card-border);
    border-radius: 7px;
    background: var(--sg-input-bg);
    color: var(--sg-text-secondary) !important;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

body.discuzx5 #postlist #p_btn > a > i {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-style: normal;
}

body.discuzx5 #postlist #p_btn > a em {
    margin: 0;
    color: var(--sg-green) !important;
    font-size: 18px;
}

body.discuzx5 #postlist #p_btn #k_favorite em,
body.discuzx5 #postlist #p_btn #recommend_add em {
    color: var(--sg-red) !important;
}

body.discuzx5 #postlist #p_btn #recommend_subtract em {
    color: #8e867c !important;
}

body.discuzx5 #postlist #p_btn > a:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, .42);
    background: var(--sg-button-secondary-hover);
    color: var(--sg-button-primary) !important;
}

body.discuzx5 #postlist #p_btn span {
    margin-left: 1px;
    color: inherit !important;
    font-size: 12px;
}

body.discuzx5 #f_pst,
body.discuzx5 .fastpost {
    overflow: hidden;
    border: 1px solid var(--sg-card-border) !important;
    border-radius: 9px;
    background: var(--sg-card-bg);
    box-shadow: var(--sg-shadow);
}

/* Footer and floating tools. */
body.discuzx5 .dz_footc {
    margin-top: 42px;
    border-top: 1px solid var(--sg-footer-border);
    background: var(--sg-footer-bg) !important;
    box-shadow: none;
}

body.discuzx5 .dz_footc_nav {
    padding: 24px 0 18px;
    border-color: var(--sg-footer-border) !important;
}

body.discuzx5 .dz_footc_copy,
body.discuzx5 .dz_footc_copy a,
body.discuzx5 .dz_footc_nav a,
body.discuzx5 .dz_footc_nav .pipe {
    color: var(--sg-footer-text) !important;
}

body.discuzx5 .dz_footc_dico {
    background: transparent;
}

body.discuzx5 .dz_rnav a {
    border: 1px solid var(--sg-card-border);
    border-radius: 50%;
    background: var(--sg-rnav-bg);
    color: var(--sg-button-primary);
    box-shadow: var(--sg-shadow);
}

body.discuzx5 .dz_rnav a:hover {
    background: var(--sg-button-primary);
    color: #fff;
}

@media (max-width: 1180px) {
    body.discuzx5 .dz_btm_layer {
        gap: 16px;
    }

    body.discuzx5 .dz_nav .dz_nav_logo {
        flex-basis: 160px;
    }

    body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo {
        width: 160px;
        max-width: 160px;
    }

    body.discuzx5 .dz_layer_nav ul {
        justify-content: flex-start;
        gap: 16px;
    }

    body.discuzx5 .header-searcher .search-input {
        width: 170px !important;
    }

    body.discuzx5 .portal_container_wrap {
        grid-template-columns: minmax(0, 1fr) 310px;
    }
}

@media (max-width: 960px) {
    body.discuzx5 .wp,
    body.discuzx5.dz_wide .wp,
    body.discuzx5 .dz_btm_layer,
    body.discuzx5 .portal_container {
        width: min(100% - 28px, 1180px);
    }

    body.discuzx5 .dz_btm_layer {
        flex-wrap: nowrap;
        gap: 14px;
        height: 86px;
        padding: 0;
    }

    body.discuzx5 .dz_nav .dz_nav_logo,
    body.discuzx5 .header-right {
        height: 86px;
    }

    body.discuzx5 .dz_layer_nav {
        order: initial;
        flex-basis: auto;
        height: 86px;
        overflow: hidden;
    }

    body.discuzx5 .dz_layer_nav ul {
        justify-content: flex-start;
        gap: 14px;
        width: auto;
        height: 86px;
    }

    body.discuzx5 .dz_layer_nav ul li a,
    body.discuzx5 .dz_layer_nav ul .dz_menumore a {
        height: 86px;
        line-height: 86px;
    }

    body.discuzx5 .dz_layer_nav ul li a::after {
        bottom: 18px;
    }

    body.discuzx5 .dz_layer_dl {
        margin-left: auto;
    }

    body.discuzx5 .portal_container_wrap,
    body.discuzx5 .ct2,
    body.discuzx5.dz_wide .ct2 {
        grid-template-columns: 1fr;
    }

    body.discuzx5 .portal_container_wrap {
        display: grid;
    }

    body.discuzx5 .ct2 .mn,
    body.discuzx5.dz_wide .ct2 .mn,
    body.discuzx5 .ct2 .sd,
    body.discuzx5.dz_wide .ct2 .sd {
        float: none;
        width: auto;
    }

    body.discuzx5 .forumportal_listc li.kmlist {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_onebox,
    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
        width: 180px !important;
        height: 140px;
    }

    body.discuzx5 #postlist .pls {
        width: 170px;
    }
}

@media (max-width: 680px) {
    body.discuzx5 .sg-diy-feature-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 380px 220px 220px;
        height: auto;
    }

    body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-card:nth-of-type(-n + 5) {
        grid-column: 1;
        grid-row: 1;
    }

    body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-item--6 {
        grid-column: 1;
        grid-row: 2;
    }

    body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-item--7 {
        grid-column: 1;
        grid-row: 3;
    }

    body.discuzx5 .sg-diy-feature-grid > .sg-diy-feature-dots {
        grid-column: 1;
        grid-row: 1;
        margin: 0 22px 20px 0;
    }

    body.discuzx5 .sg-diy-feature-card__content {
        right: 22px;
        bottom: 24px;
        left: 22px;
    }

    body.discuzx5 .sg-diy-feature-summary {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    body.discuzx5 .header-searcher {
        display: none;
    }

    body.discuzx5 .portal_nav_container,
    body.discuzx5 .timeline_entry_list_container,
    body.discuzx5 #threadlist > .bm_c {
        padding-right: 18px;
        padding-left: 18px;
    }

    body.discuzx5 .forumportal_listc li.kmlist,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_onebox,
    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
        grid-column: 1;
        grid-row: 1;
        width: 100% !important;
        height: 220px;
        margin-bottom: 16px;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmtit,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) > .kmtit {
        grid-column: 1;
        grid-row: 2;
        font-size: 21px;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmtxt,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) > .kmtxt {
        grid-column: 1;
        grid-row: 3;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmfoot,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_onebox, > .kmimg_box)) > .kmfoot {
        grid-column: 1;
        grid-row: 4;
    }

    body.discuzx5 #postlist .pls {
        display: none;
    }

    body.discuzx5 #postlist .posthead .plc {
        padding: 26px 22px;
    }

    body.discuzx5 #postlist .posthead .ts {
        font-size: 30px;
    }

    body.discuzx5 .dz_footc_dico {
        display: none;
    }

    body.discuzx5 .dz_footc_nav {
        height: auto;
        margin-right: 0;
    }
}




.sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-card {
  padding: 24px;
}

.side-card h2 {
  margin: 0 0 20px;
  font-family: "STSong", "Noto Serif SC", serif;
  font-size: 22px;
  color: var(--sg-text-primary);
}

.about-card {
  text-align: center;
}

.about-card h2 {
  text-align: left;
}

.profile {
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  border-radius: 50%;
}

.about-card h3 {
  margin: 0 0 10px;
  font-family: "STSong", "Noto Serif SC", serif;
  font-size: 22px;
  color: var(--sg-text-primary);
}

.about-card p {
  margin: 0 auto 22px;
  max-width: 280px;
  color: var(--sg-text-secondary);
  line-height: 1.75;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 18px 0;
  border-top: 1px solid var(--sg-card-border);
  border-bottom: 1px solid var(--sg-card-border);
}

.stats span {
  color: var(--sg-text-secondary);
  font-size: 13px;
}

.stats span + span {
  border-left: 1px solid var(--sg-card-border);
}

.stats b {
  display: block;
  margin-top: 5px;
  color: var(--sg-text-primary);
  font-size: 22px;
}

.socials {
  display: flex;
  justify-content: space-around;
  padding-top: 20px;
}

.socials a {
  color: var(--sg-text-secondary);
}

.ranking-card ol {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hot;
}

.ranking-card li {
  display: grid;
  grid-template-columns: 26px 1fr 76px;
  column-gap: 10px;
  align-items: center;
  counter-increment: hot;
}

.ranking-card li::before {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sg-rank-bg);
  color: var(--sg-rank-text);
  font-size: 12px;
  content: counter(hot);
}

.ranking-card li:nth-child(-n + 3)::before {
  background: var(--sg-button-primary);
  color: #fff;
}

.ranking-card span {
  align-self: end;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ranking-card em {
  grid-column: 2;
  align-self: start;
  color: var(--sg-text-secondary);
  font-size: 13px;
  font-style: normal;
}

.ranking-card img {
  grid-column: 3;
  grid-row: 1 / span 2;
  height: 52px;
  border-radius: 5px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.category-grid a {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 13px 8px;
  border-radius: 6px;
  background: var(--sg-category-bg);
  color: var(--sg-text-secondary);
}

.more-link,
.section-title a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--sg-text-secondary);
  font-size: 14px;
}

.more-link {
  width: 100%;
  margin-top: 20px;
}
.more-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.subscribe-card {
  position: relative;
  overflow: hidden;
}

.subscribe-card p {
  margin: -8px 0 14px;
  color: var(--sg-text-secondary);
}

.subscribe-card form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 78px;
  border: 1px solid var(--sg-card-border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--sg-input-bg);
}

.subscribe-card input,
.subscribe-card button {
  height: 42px;
  border: 0;
  outline: 0;
}

.subscribe-card input {
  padding: 0 13px;
}

.subscribe-card button {
  background: var(--sg-button-primary);
  color: #fff;
  cursor: pointer;
}

.qr-area {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  color: var(--sg-text-secondary);
}

.qr-code {
  display: grid;
  grid-template-columns: repeat(6, 10px);
  gap: 3px;
  padding: 8px;
  background: var(--sg-input-bg);
  border: 1px solid var(--sg-card-border);
}

.qr-code span {
  width: 10px;
  height: 10px;
  background: #111;
}

.qr-code span:nth-child(3n) {
  background: transparent;
}

.recommend-section {
  margin-top: 34px;
  margin-bottom: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-family: "STSong", "Noto Serif SC", serif;
  font-size: 24px;
  color: var(--sg-text-primary);
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.recommend-grid article {
  height: 150px;
}

.recommend-grid div {
  position: absolute;
  left: 22px;
  right: 16px;
  bottom: 18px;
  z-index: 1;
  color: #fff;
}

.recommend-grid article::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .68));
  content: "";
}

.recommend-grid h3 {
  margin: 0 0 8px;
  font-family: "STSong", "Noto Serif SC", serif;
  font-size: 21px;
}

.recommend-grid p {
  margin: 0;
}

.article-panel,
.side-card {
  border: 1px solid var(--sg-card-border);
  border-radius: 9px;
  background: var(--sg-card-bg);
  box-shadow: var(--sg-shadow);
}
.sg-viewthread-layout , .sg-forumdisplay-layout{    margin-top: 34px;}
/* Native Discuz DIY modules in the Shiguang visual system. */
body.discuzx5 .sg-diy-sidebar .drag,
body.discuzx5 .sg-forumdisplay-diy,
body.discuzx5 .sg-viewthread-recommend,
body.discuzx5 .sg-diy-frame,
body.discuzx5 .sg-diy-frame > .column {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.discuzx5 .sg-diy-sidebar #diy2,
body.discuzx5 .sg-forumdisplay-diy #diy2 {
  display: grid;
  gap: 18px;
}

body.discuzx5 .sg-diy-block,
body.discuzx5 .sg-diy-block .dxb_bc {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.discuzx5 .sg-diy-card {
  overflow: hidden;
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid var(--sg-card-border);
  border-radius: 9px;
  background: var(--sg-card-bg);
  box-shadow: var(--sg-shadow);
      margin-bottom: 20px;
}

body.discuzx5 .sg-diy-card + .sg-diy-card {
  margin-top: 18px;
}

body.discuzx5 .sg-diy-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
}

body.discuzx5 .sg-diy-card__title h2 {
  margin: 0;
  color: var(--sg-text-primary);
  font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}


body.discuzx5 .sg-diy-about {
  text-align: center;
}

body.discuzx5 .sg-diy-about .sg-diy-card__title {
  text-align: left;
}

body.discuzx5 .sg-diy-about__avatar {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto 15px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(48, 35, 21, .13);
}

body.discuzx5 .sg-diy-about__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.discuzx5 .sg-diy-about h3 {
  margin: 0 0 9px;
  font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
}

body.discuzx5 .sg-diy-about h3 a {
  color: var(--sg-text-primary);
}

body.discuzx5 .sg-diy-about__bio {
  margin: 0 auto 20px;
  color: var(--sg-text-secondary);
  line-height: 1.75;
}

body.discuzx5 .sg-diy-about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px 0 0;
  border-top: 1px solid var(--sg-card-border);
}

body.discuzx5 .sg-diy-about__stats span {
  color: var(--sg-text-secondary);
  font-size: 12px;
}

body.discuzx5 .sg-diy-about__stats span + span {
  border-left: 1px solid var(--sg-card-border);
}

body.discuzx5 .sg-diy-about__stats b {
  display: block;
  margin-bottom: 4px;
  color: var(--sg-text-primary);
  font-size: 20px;
}

body.discuzx5 .sg-diy-hot-list,
body.discuzx5 .sg-diy-thread-list,
body.discuzx5 .sg-diy-member-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.discuzx5 .sg-diy-hot-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

body.discuzx5 .sg-diy-hot-list__rank {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sg-rank-bg);
  color: var(--sg-rank-text);
  font-size: 12px;
}

body.discuzx5 .sg-diy-hot-list li:nth-child(-n + 3) .sg-diy-hot-list__rank {
  background: var(--sg-button-primary);
  color: #fff;
}

body.discuzx5 .sg-diy-hot-list a,
body.discuzx5 .sg-diy-thread-list a {
  overflow: hidden;
  color: var(--sg-text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.discuzx5 .sg-diy-hot-list em {
  color: var(--sg-text-secondary);
  font-size: 12px;
  font-style: normal;
}

body.discuzx5 .sg-diy-category-grid,
body.discuzx5 .sg-diy-forum-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.discuzx5 .sg-diy-category-grid a,
body.discuzx5 .sg-diy-forum-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--sg-category-bg);
  color: var(--sg-text-secondary);
}

body.discuzx5 .sg-diy-category-grid a:hover,
body.discuzx5 .sg-diy-forum-grid a:hover {
  border-color: rgba(74, 133, 119, .32);
  background: rgba(74, 133, 119, .08);
  color: var(--sg-green);
}

body.discuzx5 .sg-diy-category-grid span,
body.discuzx5 .sg-diy-forum-grid span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.discuzx5 .sg-diy-category-grid em,
body.discuzx5 .sg-diy-forum-grid em {
  margin-left: 6px;
  color: var(--sg-text-secondary);
  font-size: 12px;
  font-style: normal;
}

body.discuzx5 .sg-diy-member-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

body.discuzx5 .sg-diy-member-list img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

body.discuzx5 .sg-diy-member-list a {
  overflow: hidden;
  color: var(--sg-text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.discuzx5 .sg-diy-member-list em {
  color: var(--sg-text-secondary);
  font-size: 12px;
  font-style: normal;
}

body.discuzx5 .sg-viewthread-recommend {
  width: auto;
  max-width: none;
  margin: 0;
}

body.discuzx5 .sg-diy-detail-frame {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body.discuzx5 .sg-diy-detail-frame > .column {
  float: none;
  width: auto;
}

body.discuzx5 .sg-diy-thread-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--sg-line);
}

body.discuzx5 .sg-diy-thread-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

body.discuzx5 .sg-diy-thread-list em {
  color: #9b9389;
  font-size: 12px;
  font-style: normal;
}

@media (min-width: 1101px) {
  body.discuzx5 .sg-viewthread-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
  }

  body.discuzx5 .sg-viewthread-main,
  body.discuzx5 .sg-viewthread-sidebar {
    min-width: 0;
  }

  body.discuzx5 .sg-viewthread-sidebar .sg-diy-detail-frame {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body.discuzx5 .sg-viewthread-sidebar {
    margin-top: 24px;
  }
}

@media (max-width: 860px) {
  body.discuzx5 .sg-diy-detail-frame {
    grid-template-columns: 1fr;
  }
}

body.discuzx5 .sg-theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 8px;
  padding: 0;
  border: 1px solid var(--sg-card-border);
  border-radius: 7px;
  background: var(--sg-input-bg);
  color: var(--sg-text-secondary);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

body.discuzx5 .sg-theme-toggle:hover {
  border-color: var(--sg-button-primary);
  color: var(--sg-button-primary);
}

body.discuzx5 .sg-theme-toggle svg {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity .25s ease;
}

body.discuzx5 .sg-theme-icon-light {
  opacity: 1;
}

body.discuzx5 .sg-theme-icon-dark {
  opacity: 0;
}

body.discuzx5[data-theme="dark"] .sg-theme-icon-light {
  opacity: 0;
}

body.discuzx5[data-theme="dark"] .sg-theme-icon-dark {
  opacity: 1;
}
