﻿/*
 * 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: #f7f8fa;
    --sg-paper-soft: #fff;
    --sg-ink: #1a1a1a;
    --sg-muted: #666666;
    --sg-line: #eeeeee;
    --sg-green: #4a8577;
    --sg-red: #3b82f6;
    --sg-shadow: none;
    --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);
    background-image: radial-gradient(600px 400px at 10% 10%, rgba(59, 130, 246, .15), transparent 70%),
    radial-gradient(500px 500px at 90% 5%, rgba(96, 165, 250, .12), transparent 70%),
    radial-gradient(400px 300px at 50% -5%, rgba(147, 197, 253, .10), transparent 70%);
    background-attachment: fixed;
    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: none;
    --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);
    background-image: radial-gradient(600px 400px at 10% 10%, rgba(59, 130, 246, .20), transparent 70%),
    radial-gradient(500px 500px at 90% 5%, rgba(37, 99, 235, .15), transparent 70%),
    radial-gradient(400px 300px at 50% -5%, rgba(96, 165, 250, .12), transparent 70%);
    background-attachment: fixed;
}

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: none;
    -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: none;
}

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: none;
}

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: none;
    border-radius: 12px;
    background: var(--sg-card-bg);
    box-shadow: none;
    padding: 16px;
}

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

body.discuzx5 .portal_nav ul {
    display: flex;
    gap: 10px;
    min-width: max-content;
    border-bottom: none;
    flex-wrap: wrap;
}

body.discuzx5 .portal_nav li a {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--sg-hover-bg);
    color: var(--sg-text-secondary) !important;
    font-size: 14px;
    transition: all .2s ease;
}

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

body.discuzx5 .portal_nav li.a a {
    background: var(--sg-button-primary);
    color: #fff !important;
}

body.discuzx5 .portal_nav li.a a::after {
    display: none;
}

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

body.discuzx5 .timeline_entry_list_container {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

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;
    display: flex;
    flex-direction: column;
}

body.discuzx5 .forumportal_listc li.kmlist {
    display: block;
    min-height: 0;
    margin: 30px 0;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: var(--sg-card-bg);
}

body.discuzx5 .forumportal_listc li.kmlist > .kmtit {
    height: auto;
    margin: 12px 0 8px;
    overflow: visible;
    white-space: normal;
    font-family: "STSong", "Noto Serif SC", "Songti SC", serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmtxt {
    max-height: none;
    margin: 0 0 12px;
    color: var(--sg-text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmfoot {
    height: auto;
    min-height: 24px;
    margin: 0;
    color: var(--sg-text-secondary);
    line-height: 24px;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
    width: 100% !important;
    max-width: none;
    height: auto;
    margin: 0 0 12px;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--sg-hover-bg);
    display: grid;
    gap: 4px;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box.km_img_1 {
    grid-template-columns: 1fr;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box.km_img_2 {
    grid-template-columns: 1fr 1fr;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box.km_img_3 {
    grid-template-columns: 1fr 1fr 1fr;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box.km_img_many {
    grid-template-columns: 1fr 1fr 1fr;
}

body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box .kmshowimg {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

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

body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_box)) {
    padding: 20px;
}

body.discuzx5 .forumportal_listc .kmfoot {
    display: block;
    padding-top: 16px;
    margin-top: 12px !important;
    color: var(--sg-text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

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: var(--sg-button-primary);
    color: #fff;
}

body.discuzx5 .forumportal_listc .kmfoot .kmpl,
body.discuzx5 .forumportal_listc .kmfoot .kmck {
    float: right;
    margin-left: 15px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--sg-text-secondary);
}

body.discuzx5 .forumportal_listc .kmfoot .kmck:before,
body.discuzx5 .forumportal_listc .kmfoot .kmpl:before {
    float: none;
    margin: 0;
    width: 18px;
    height: 18px;
    background-size: contain;
    opacity: 0.7;
}

body.discuzx5 .forumportal_listc .kmtit {
    margin: 12px 0 8px !important;
}

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);
}

body.discuzx5 .forumportal_listc .kmtit a {
    color: var(--sg-text-primary);
    text-decoration: none;
}

body.discuzx5 .forumportal_listc .kmtit a:hover {
    color: 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: none;
    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 0px 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: none;
    border-radius: 7px;
    background: var(--sg-button-primary);
    color: #fff;
}

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: none;
}

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: blog single-content page — 885px locked width (ref: zhouerer.com). */
body.discuzx5.dz_pg_viewthread #ct,
body.discuzx5.dz_pg_viewthread .wp,
body.discuzx5.dz_pg_viewthread .dz_btm_layer {
    width: 885px;
    max-width: 885px;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
}
body.discuzx5.dz_pg_viewthread #ct {
    float: none;
}

/* Nav bar: hide layer nav menu + login area, center logo */
body.discuzx5.dz_pg_viewthread .dz_layer_nav,
body.discuzx5.dz_pg_viewthread .dz_layer_dl {
    display: none !important;
}
body.discuzx5.dz_pg_viewthread .dz_nav {
    justify-content: center;
}
body.discuzx5.dz_pg_viewthread .dz_nav .dz_nav_logo {
    flex: 0 0 auto;
    margin: 0 auto;
}

/* Responsive: relax 885px lock on narrow screens */
@media (max-width: 900px) {
    body.discuzx5.dz_pg_viewthread #ct,
    body.discuzx5.dz_pg_viewthread .wp,
    body.discuzx5.dz_pg_viewthread .dz_btm_layer {
        width: min(100% - 28px, 885px);
        max-width: 100%;
    }
}

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);
}

/* When a hero banner is present, flush the padding so the cover image
   spans the full width of the postlist card edge-to-edge. */
body.discuzx5 #postlist:has(> .posthead.sg-thread-hero) {
    padding: 0;
}
/* Restore horizontal reading margins for everything that follows the hero. */
body.discuzx5 #postlist:has(> .posthead.sg-thread-hero) > .sg-first-post,
body.discuzx5 #postlist:has(> .posthead.sg-thread-hero) > .pl,
body.discuzx5 #postlist:has(> .posthead.sg-thread-hero) > .ad {
    padding-left: 44px;
    padding-right: 44px;
}
body.discuzx5 #postlist:has(> .posthead.sg-thread-hero) > :last-child {
    padding-bottom: 36px;
}

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;
    width: 100%;
    height: 430px;
    overflow: hidden;
    border: 0;
    border-radius: 8px 8px 0 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: 0 0 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 {
    overflow: visible;
    height: auto;
    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: #444;
    font-size: 20px;
    line-height: 1.714285714;
    font-family: 'source-han-serif-sc', 'Noto Serif SC', 'Songti SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', SimSun, serif;
}

/* Heading prefix: single "# " for all headings (ref: zhouerer.com) */
body.discuzx5 #postlist .t_f h1:before,
body.discuzx5 #postlist .t_f h2:before,
body.discuzx5 #postlist .t_f h3:before,
body.discuzx5 #postlist .t_f h4:before,
body.discuzx5 #postlist .t_f h5:before,
body.discuzx5 #postlist .t_f h6:before {
    content: "# ";
    color: #ff0000;
}

/* Heading sizes and spacing (ref: zhouerer.com) */
body.discuzx5 #postlist .t_f h1,
body.discuzx5 #postlist .t_f h2,
body.discuzx5 #postlist .t_f h3,
body.discuzx5 #postlist .t_f h4,
body.discuzx5 #postlist .t_f h5,
body.discuzx5 #postlist .t_f h6 {
    margin: 24px 0;
    line-height: 1.714285714;
    color: #444;
    font-weight: bold;
}
body.discuzx5 #postlist .t_f h1 { font-size: 32px; line-height: 1.5; }
body.discuzx5 #postlist .t_f h2 { font-size: 28px; line-height: 1.6; }
body.discuzx5 #postlist .t_f h3 { font-size: 22px; line-height: 1.846153846; }
body.discuzx5 #postlist .t_f h4 { font-size: 18px; line-height: 1.846153846; }
body.discuzx5 #postlist .t_f h5 { font-size: 16px; line-height: 1.846153846; }
body.discuzx5 #postlist .t_f h6 { font-size: 14px; line-height: 1.846153846; }

/* Paragraphs */
body.discuzx5 #postlist .t_f p {
    margin: 0 0 24px;
    line-height: 1.714285714;
}

/* Links */
body.discuzx5 #postlist .t_f a { color: #1F1F1F; }
body.discuzx5 #postlist .t_f a:hover { color: #0f3647; }
body.discuzx5 #postlist .t_f a:visited { color: #9f9f9f; }

/* Lists */
body.discuzx5 #postlist .t_f ul,
body.discuzx5 #postlist .t_f ol {
    margin: 0 0 24px;
    line-height: 1.714285714;
}
body.discuzx5 #postlist .t_f ul { list-style: disc outside; }
body.discuzx5 #postlist .t_f ol { list-style: decimal outside; }
body.discuzx5 #postlist .t_f li { margin: 0 0 0 36px; }

/* Blockquotes (ref: zhouerer.com) */
body.discuzx5 #postlist .t_f blockquote,
body.discuzx5 #postlist .quote {
    margin: 50px 0;
    padding: 20px 22px !important;
    background: #f5f5f5;
    border: 0;
    font-weight: 400;
    letter-spacing: .01rem;
    color: #444;
}
body.discuzx5 #postlist .t_f blockquote p {
    font-size: 22px;
}
body.discuzx5 #postlist .t_f blockquote p:last-child {
    margin-bottom: 0;
}

/* Code blocks (ref: zhouerer.com) */
body.discuzx5 #postlist .t_f pre,
body.discuzx5 #postlist .t_f .blockcode {
    margin: 50px 0 !important;
    padding: 20px 22px !important;
    background-color: #f8f8f8;
    border: 1px solid #F3F3F3;
    color: #666;
    font-size: 14px !important;
    line-height: 1.714285714;
    overflow: auto;
}
body.discuzx5 #postlist .t_f code {
    font-size: 14px !important;
    line-height: 2;
    white-space: pre-wrap;
    word-wrap: break-word;
}
body.discuzx5 #postlist .t_f .inline-code,
body.discuzx5 #postlist .t_f code.inline-code {
    font-size: 14px !important;
    background: rgba(250, 239, 240, 0.78) !important;
    color: #b44437 !important;
    padding: 3px 4px !important;
    border-radius: 3px !important;
    line-height: 2 !important;
}

/* Tables (ref: zhouerer.com) */
body.discuzx5 #postlist .t_f table {
    border-bottom: 1px solid #E6E6E6;
    color: #757575;
    font-size: 14px;
    line-height: 2;
    width: 100%;
    margin: 0 0 24px;
}
body.discuzx5 #postlist .t_f th,
body.discuzx5 #postlist .t_f td {
    padding: 10px 20px;
    border-right: 1px solid #E6E6E6;
    border-bottom: 1px solid #E6E6E6;
}

/* Images */
body.discuzx5 #postlist .t_f img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

/* Dark mode overrides for content typography */
body.discuzx5[data-theme="dark"] #postlist .t_f,
body.discuzx5[data-theme="dark"] #postlist .t_fsz,
body.discuzx5[data-theme="dark"] #postlist .pcb {
    color: var(--sg-text-primary);
}
body.discuzx5[data-theme="dark"] #postlist .t_f h1,
body.discuzx5[data-theme="dark"] #postlist .t_f h2,
body.discuzx5[data-theme="dark"] #postlist .t_f h3,
body.discuzx5[data-theme="dark"] #postlist .t_f h4,
body.discuzx5[data-theme="dark"] #postlist .t_f h5,
body.discuzx5[data-theme="dark"] #postlist .t_f h6 {
    color: var(--sg-text-primary);
}
body.discuzx5[data-theme="dark"] #postlist .t_f blockquote,
body.discuzx5[data-theme="dark"] #postlist .quote {
    background: var(--sg-quote-bg);
    color: var(--sg-quote-text);
}
body.discuzx5[data-theme="dark"] #postlist .t_f blockquote p {
    color: var(--sg-quote-text);
}
body.discuzx5[data-theme="dark"] #postlist .t_f pre,
body.discuzx5[data-theme="dark"] #postlist .t_f .blockcode {
    background-color: var(--sg-paper-soft);
    border-color: var(--sg-card-border);
    color: var(--sg-text-secondary);
}
body.discuzx5[data-theme="dark"] #postlist .t_f table {
    border-bottom-color: var(--sg-card-border);
    color: var(--sg-text-secondary);
}
body.discuzx5[data-theme="dark"] #postlist .t_f th,
body.discuzx5[data-theme="dark"] #postlist .t_f td {
    border-right-color: var(--sg-card-border);
    border-bottom-color: var(--sg-card-border);
}
body.discuzx5[data-theme="dark"] #postlist .t_f a { color: var(--sg-text-primary); }
body.discuzx5[data-theme="dark"] #postlist .t_f a:hover { color: var(--sg-link-hover); }

/* === Override EditorJS inline styles (ref: zhouerer.com) === */
/* EditorJS embeds <style> blocks in post content that override .t_f typography */
body.discuzx5 #postlist .t_f .ce-block { margin: 0 !important; padding: 0 !important; overflow: visible !important; }
body.discuzx5 #postlist .t_f .ce-block__content,
body.discuzx5 #postlist .t_f .ce-toolbar__content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; overflow: visible !important; }
body.discuzx5 #postlist .t_f .ce-paragraph {
    display: block !important;
    font-size: 20px !important;
    line-height: 1.714285714 !important;
    text-indent: 0 !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
}
body.discuzx5 #postlist .t_f .ce-block:last-child .ce-paragraph { margin-bottom: 0 !important; }

/* EditorJS headings — override .ce-header inline styles, kill blue bar ::before */
body.discuzx5 #postlist .t_f .ce-header {
    margin: 24px 0 !important;
    padding: 0 !important;
    font-weight: bold !important;
    color: #444 !important;
    position: static !important;
}
/* Kill EditorJS blue bar: override .ce-header::before completely
   — set content+color explicitly so the red "# " prefix shows inline,
   neutralize the absolute-positioned blue bar (#3e8fe3) from EditorJS */
body.discuzx5 #postlist .t_f .ce-header::before {
    content: "# " !important;
    color: #ff0000 !important;
    background: none !important;
    width: auto !important;
    height: auto !important;
    position: static !important;
    left: auto !important;
    border-radius: 0 !important;
    display: inline !important;
}
body.discuzx5 #postlist .t_f h2.ce-header { font-size: 28px !important; line-height: 1.6 !important; }
body.discuzx5 #postlist .t_f h3.ce-header { font-size: 22px !important; line-height: 1.846153846 !important; }
body.discuzx5 #postlist .t_f h4.ce-header { font-size: 18px !important; line-height: 1.846153846 !important; }

/* EditorJS blockquote (.cdx-quote) */
body.discuzx5 #postlist .t_f .cdx-quote,
body.discuzx5 #postlist .t_f blockquote.cdx-block {
    background: #f5f5f5 !important;
    padding: 20px 22px !important;
    margin: 50px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    font-weight: 400 !important;
    letter-spacing: .01rem !important;
    color: #444 !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: static !important;
}
body.discuzx5 #postlist .t_f .cdx-quote__text,
body.discuzx5 #postlist .t_f .cdx-quote .ce-paragraph {
    font-size: 22px !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    text-indent: 0 !important;
    line-height: 1.714285714 !important;
    min-height: 0 !important;
    color: #444 !important;
}
body.discuzx5 #postlist .t_f .cdx-quote__text:last-child { margin-bottom: 0 !important; }
body.discuzx5 #postlist .t_f .cdx-quote__caption {
    font-size: 14px !important;
    color: rgba(0,0,0,.44) !important;
    padding: 0 !important;
    margin: 0 !important;
}
/* Hide empty caption divs that add unnecessary spacing */
body.discuzx5 #postlist .t_f .cdx-quote__caption:empty { display: none !important; }
/* Hide decorative SVG icon in quote */
body.discuzx5 #postlist .t_f .cdx-quote .quote-background-icon { display: none !important; }

/* EditorJS lists (.cdx-list) */
body.discuzx5 #postlist .t_f .cdx-list {
    margin: 0 0 24px !important;
    padding: 0 !important;
    line-height: 1.714285714 !important;
}
body.discuzx5 #postlist .t_f .cdx-list__item {
    font-size: 20px !important;
    line-height: 1.714285714 !important;
    margin: 0 0 0 36px !important;
    padding: 0 !important;
}

/* EditorJS code blocks — comprehensive override of codeFlask inline styles
   — EditorJS injects: border:1px solid #dcdfe6, border-radius:5px, bg:#f6f8fa,
     blue accent #409eff for lang badge/copy button, gray #909399 for toggle
   — Target: match zhouerer.com flat style: bg:#f8f8f8, border:1px solid #F3F3F3, no radius */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Wrapper,
body.discuzx5 #postlist .t_f pre,
body.discuzx5 #postlist .t_f .blockcode {
    margin: 50px 0 !important;
    padding: 0 !important;
    background-color: #f8f8f8 !important;
    border: 1px solid #F3F3F3 !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    line-height: 1.714285714 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    position: relative !important;
    transition: none !important;
}
/* Header bar — flat, no separate background */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Header {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    padding: 6px 12px !important;
    background-color: #f0f0f0 !important;
    border-bottom: 1px solid #F3F3F3 !important;
    border-radius: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}
/* Language badge — subtle gray, not blue */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_LangDisplay {
    background-color: #999 !important;
    color: #fff !important;
    border-radius: 2px !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    padding: 2px 8px !important;
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: default !important;
    transition: none !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_LangDisplay:hover {
    background-color: #999 !important;
    box-shadow: none !important;
}
/* Copy button — subtle, not blue */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_CopyButton {
    background-color: transparent !important;
    color: #666 !important;
    border: none !important;
    border-radius: 2px !important;
    padding: 4px 8px !important;
    margin-right: 4px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 28px !important;
    height: 24px !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_CopyButton:hover {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_CopyButton.copied {
    background-color: transparent !important;
    color: #67c23a !important;
}
/* Toggle button (header) — subtle */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Toggle {
    background-color: transparent !important;
    color: #666 !important;
    border: none !important;
    border-radius: 2px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 28px !important;
    height: 24px !important;
    font-weight: normal !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Toggle:hover {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}
/* Content container — no fixed height, auto expand */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_ContentContainer {
    position: relative !important;
    min-height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    transition: none !important;
}
/* Editor container — auto height, no fixed 300px/500px */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor {
    position: relative !important;
    min-height: auto !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    transition: none !important;
}
/* CodeFlask internal — the actual code rendering area */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask {
    position: relative !important;
    background: #f8f8f8 !important;
    border-radius: 0 !important;
    min-height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}
/* Line numbers column */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before,
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__lines {
    width: 40px !important;
    background-color: #f0f0f0 !important;
    border-right: 1px solid #F3F3F3 !important;
    z-index: 0 !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__lines {
    padding: 10px 0 !important;
    font-size: 13px !important;
    line-height: 21px !important;
    color: #999 !important;
    text-align: right !important;
    user-select: none !important;
    overflow: hidden !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__lines__line {
    padding-right: 8px !important;
}
/* Textarea and pre — ensure proper padding and wrapping */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__textarea,
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__pre {
    padding: 10px 10px 10px 50px !important;
    font-size: 14px !important;
    line-height: 21px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    white-space: pre-wrap !important;
    tab-size: 4 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__pre {
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    pointer-events: auto !important;
    z-index: 0 !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__textarea {
    z-index: 1 !important;
    color: transparent !important;
    caret-color: transparent !important;
    resize: none !important;
    outline: none !important;
    border: none !important;
    background: transparent !important;
    pointer-events: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}
/* Code highlight area */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__code {
    display: block !important;
    font-size: 14px !important;
    line-height: 21px !important;
    color: #333 !important;
    white-space: pre-wrap !important;
    tab-size: 4 !important;
    overflow: visible !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Editor .codeflask__code[class*="language-"] {
    background: transparent !important;
}
/* Bottom button container — flat */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_BottomButtonContainer {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 4px !important;
    background-color: #f0f0f0 !important;
    border-top: 1px solid #F3F3F3 !important;
    position: relative !important;
    z-index: 1 !important;
}
/* Bottom toggle button — subtle */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_BottomToggle {
    width: 100% !important;
    background-color: transparent !important;
    color: #666 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    transition: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-align: center !important;
    position: relative !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_BottomToggle:hover {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_BottomToggle:active {
    background-color: #d0d0d0 !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_BottomToggle .toggle-icon {
    font-size: 11px !important;
}
/* Scrollbar — minimal */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Wrapper ::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Wrapper ::-webkit-scrollbar-track {
    background: transparent !important;
}
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Wrapper ::-webkit-scrollbar-thumb {
    background: #ccc !important;
    border-radius: 3px !important;
}
/* Focus state — no blue glow */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Wrapper:focus-within {
    border-color: #F3F3F3 !important;
    box-shadow: none !important;
}
/* Readonly mode */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_Wrapper.readonly .editorjs-codeFlask_Header {
    background-color: #f0f0f0 !important;
}
/* Language popup — if triggered */
body.discuzx5 #postlist .t_f .editorjs-codeFlask_LanguagePopup {
    background-color: #fff !important;
    border: 1px solid #F3F3F3 !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    z-index: 1000 !important;
    overflow: hidden !important;
}

/* EditorJS delimiter */
body.discuzx5 #postlist .t_f .ce-delimiter {
    margin: 24px 0 !important;
    line-height: 1.714285714 !important;
}

/* EditorJS table */
body.discuzx5 #postlist .t_f .tc-wrap,
body.discuzx5 #postlist .t_f .tc-table {
    border-bottom: 1px solid #E6E6E6 !important;
    color: #757575 !important;
    font-size: 14px !important;
    line-height: 2 !important;
    width: 100% !important;
    margin: 0 0 24px !important;
}
body.discuzx5 #postlist .t_f .tc-wrap td,
body.discuzx5 #postlist .t_f .tc-wrap th {
    padding: 10px 20px !important;
    border-right: 1px solid #E6E6E6 !important;
    border-bottom: 1px solid #E6E6E6 !important;
}

/* EditorJS image/video/audio tools */
body.discuzx5 #postlist .t_f .image-tool,
body.discuzx5 #postlist .t_f .video-tool,
body.discuzx5 #postlist .t_f .audio-tool {
    margin: 0 0 24px !important;
}
body.discuzx5 #postlist .t_f .image-tool__image img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 3px !important;
}
body.discuzx5 #postlist .t_f .video-tool__video video {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 3px !important;
}
/* Audio tool: override EditorJS inline card style
   — EditorJS sets width:320px, margin:50px auto, border-radius:12px, box-shadow
   — HTML: .audio-tool__audio > img.audio-cover + audio.audio-tool__audio-picture */
body.discuzx5 #postlist .t_f .audio-tool__audio {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background: #f8f8f8 !important;
    border-radius: 0 !important;
    padding: 20px 22px !important;
    box-shadow: none !important;
    border: 1px solid #F3F3F3 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}
/* Cover image — constrain to reasonable size, centered */
body.discuzx5 #postlist .t_f .audio-tool__audio .audio-cover,
body.discuzx5 #postlist .t_f .audio-tool__audio img {
    display: block !important;
    max-width: 100% !important;
    width: auto !important;
    max-height: 200px !important;
    margin: 0 auto 16px !important;
    border-radius: 3px !important;
    height: auto !important;
    object-fit: contain !important;
}
/* Audio element (confusingly named audio-tool__audio-picture) — full width */
body.discuzx5 #postlist .t_f .audio-tool__audio audio,
body.discuzx5 #postlist .t_f .audio-tool__audio-picture {
    width: 100% !important;
    max-width: 100% !important;
    outline: none !important;
    display: block !important;
}
body.discuzx5 #postlist .t_f .audio-tool__caption {
    text-align: center !important;
    font-size: 14px !important;
    color: #a3a3a3 !important;
    padding: 10px 0 0 0 !important;
    margin: 0 !important;
}
body.discuzx5 #postlist .t_f .audio-tool__caption:empty { display: none !important; }

/* Dark mode overrides for EditorJS */
body.discuzx5[data-theme="dark"] #postlist .t_f .ce-paragraph { color: var(--sg-text-primary) !important; }
body.discuzx5[data-theme="dark"] #postlist .t_f .ce-header { color: var(--sg-text-primary) !important; }
body.discuzx5[data-theme="dark"] #postlist .t_f .cdx-quote,
body.discuzx5[data-theme="dark"] #postlist .t_f blockquote.cdx-block {
    background: var(--sg-quote-bg) !important;
    color: var(--sg-quote-text) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .cdx-quote p,
body.discuzx5[data-theme="dark"] #postlist .t_f .cdx-quote .ce-paragraph {
    color: var(--sg-quote-text) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Wrapper,
body.discuzx5[data-theme="dark"] #postlist .t_f pre,
body.discuzx5[data-theme="dark"] #postlist .t_f .blockcode {
    background-color: var(--sg-paper-soft) !important;
    border-color: var(--sg-card-border) !important;
    color: var(--sg-text-secondary) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Header,
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_BottomButtonContainer {
    background-color: rgba(255,255,255,0.04) !important;
    border-color: var(--sg-card-border) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_LangDisplay {
    background-color: #555 !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_CopyButton,
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Toggle,
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_BottomToggle {
    color: var(--sg-text-secondary) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_CopyButton:hover,
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Toggle:hover,
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_BottomToggle:hover {
    background-color: rgba(255,255,255,0.08) !important;
    color: var(--sg-text-primary) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Editor .codeflask {
    background: var(--sg-paper-soft) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Editor .codeflask__lines,
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before {
    background-color: rgba(255,255,255,0.04) !important;
    border-right-color: var(--sg-card-border) !important;
    color: #777 !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .editorjs-codeFlask_Editor .codeflask__code {
    color: var(--sg-text-primary) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .audio-tool__audio {
    background: var(--sg-paper-soft) !important;
    border-color: var(--sg-card-border) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .tc-wrap,
body.discuzx5[data-theme="dark"] #postlist .t_f .tc-table {
    border-bottom-color: var(--sg-card-border) !important;
    color: var(--sg-text-secondary) !important;
}
body.discuzx5[data-theme="dark"] #postlist .t_f .tc-wrap td,
body.discuzx5[data-theme="dark"] #postlist .t_f .tc-wrap th {
    border-right-color: var(--sg-card-border) !important;
    border-bottom-color: var(--sg-card-border) !important;
}

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: 1fr;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
        width: 100% !important;
        height: 200px;
    }

    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 {
        min-height: 0;
    }

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

    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_box)) {
        padding: 16px;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmtit,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_box)) > .kmtit {
        font-size: 21px;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmtxt,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_box)) > .kmtxt {
        display: block;
    }

    body.discuzx5 .forumportal_listc li.kmlist > .kmfoot,
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_box)) > .kmfoot {
        display: block;
    }

    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: none;
}

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: none;
    border-radius: 7px;
    background: transparent;
    color: var(--sg-text-secondary);
    cursor: pointer;
    transition: color .18s ease;
}

body.discuzx5 .sg-theme-toggle:hover {
    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;
}

/* ============================================================
   Comment section — clean, minimalist reply UI
   Reply posts are rendered directly from viewthread_node.php
   as .sg-comment-item (no JS DOM manipulation).
   ============================================================ */

/* --- Comment section: white box container --- */
body.discuzx5.dz_pg_viewthread .sg-comment-section {
    background: var(--sg-card-bg, #fff);
    border-radius: 9px;
    box-shadow: none;
    margin-top: 20px;
    padding: 24px 0;
}

/* --- Fast reply form inside comment section: remove card styling --- */
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst {
    border: none !important;
    background: transparent !important;
    padding: 0 44px 20px !important;
    margin: 0 !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .pls {
    display: none !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .plc {
    width: 100% !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst table {
    width: 100%;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .ptm {
    margin-top: 12px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .pnpost {
    text-align: right;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .pnpost a.y {
    display: none;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst #fastpostsubmit {
    border-radius: 6px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .tedt {
    margin-top: 0;
    background: var(--sg-input-bg, #f3f4f6);
    border-radius: 6px;
    overflow: hidden;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .tedt .bar {
    padding: 6px 10px;
    background: var(--sg-input-bg, #f3f4f6);
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst .tedt .area {
    padding: 0;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst #fastpostmessage {
    width: 100%;
    border: none;
    border-radius: 0 0 6px 6px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
    background: var(--sg-input-bg, #f3f4f6);
    padding: 6px 8px !important;
}

/* --- Hide smilies sidebar, make editor full width --- */
body.discuzx5.dz_pg_viewthread .sg-comment-section #fastsmiliesdiv {
    display: none !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .hasfsl {
    width: 100% !important;
    margin-right: 0 !important;
    float: none !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .hasfsl #fastposteditor {
    width: 100% !important;
}

/* --- Comment section header: "评论" --- */
body.discuzx5.dz_pg_viewthread .sg-comment-header {
    display: block;
    margin-bottom: 20px;
    padding: 0 44px;
    font-size: 16px;
    font-weight: 600;
    color: var(--sg-text-primary, #1f2937);
}

/* --- Reply wrapper: remove all default styling --- */
body.discuzx5.dz_pg_viewthread .sg-reply-post {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* --- Divider between reply posts --- */
body.discuzx5.dz_pg_viewthread .sg-comment-section .sg-reply-post + .sg-reply-post::before {
    content: '';
    display: block;
    height: 1px;
    background: var(--sg-stripe, #f0f0f0);
    margin: 0 44px;
}

/* --- Comment item: flex row (avatar + body) --- */
body.discuzx5.dz_pg_viewthread .sg-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 44px;
    box-sizing: border-box;
}

/* --- Avatar --- */
body.discuzx5.dz_pg_viewthread .sg-comment-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sg-stripe, #e5e7eb);
}
body.discuzx5.dz_pg_viewthread .sg-comment-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}
body.discuzx5.dz_pg_viewthread .sg-comment-avatar-default {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sg-stripe, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--sg-text-secondary, #6b7280);
}

/* --- Comment body column --- */
body.discuzx5.dz_pg_viewthread .sg-comment-body {
    flex: 1;
    min-width: 0;
}

/* --- Meta row: username + timestamp --- */
body.discuzx5.dz_pg_viewthread .sg-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--sg-text-primary, #1f2937) !important;
    text-decoration: none;
}
body.discuzx5.dz_pg_viewthread .sg-comment-author:hover {
    color: var(--sg-button-primary, #4f46e5) !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-time {
    font-size: 12px;
    color: var(--sg-text-secondary, #9ca3af);
    font-style: normal;
}
body.discuzx5.dz_pg_viewthread .sg-comment-location {
    font-size: 12px;
    color: var(--sg-text-secondary, #9ca3af);
    font-style: normal;
}

/* --- Comment content --- */
body.discuzx5.dz_pg_viewthread .sg-comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--sg-text-primary, #1f2937);
    word-break: break-word;
}
body.discuzx5.dz_pg_viewthread .sg-comment-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-content strong {
    font-weight: 600;
}

/* --- Override main post font sizes for comment content --- */
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_fsz,
body.discuzx5.dz_pg_viewthread .sg-comment-section .pcb {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: var(--sg-text-primary, #1f2937) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f p {
    margin: 0 0 12px;
    line-height: 1.6;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f p:last-child {
    margin-bottom: 0;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f blockquote,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f .quote {
    margin: 12px 0;
    padding: 8px 12px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f blockquote p {
    font-size: 14px !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f pre,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f .blockcode {
    margin: 12px 0 !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f code {
    font-size: 13px !important;
    line-height: 1.5;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f img {
    max-width: 100%;
    height: auto;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f ul,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f ol {
    margin: 0 0 12px;
    line-height: 1.6;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f li {
    margin: 0 0 0 24px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f h1,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f h2,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f h3,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f h4,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f h5,
body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f h6 {
    margin: 12px 0;
    font-size: 15px !important;
    line-height: 1.5;
}

/* --- Comment actions (reply button) --- */
body.discuzx5.dz_pg_viewthread .sg-comment-actions {
    margin-top: 8px;
    display: flex;
    gap: 16px;
}
body.discuzx5.dz_pg_viewthread .sg-comment-actions a,
body.discuzx5.dz_pg_viewthread .sg-comment-action {
    font-size: 12px;
    color: var(--sg-text-secondary, #6b7280);
    text-decoration: none;
}
body.discuzx5.dz_pg_viewthread .sg-comment-actions a:hover,
body.discuzx5.dz_pg_viewthread .sg-comment-action:hover {
    color: var(--sg-button-primary, #4f46e5);
}

/* --- Comment signature --- */
body.discuzx5.dz_pg_viewthread .sg-comment-signature {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 12px;
    color: var(--sg-text-secondary, #9ca3af);
    line-height: 1.5;
    opacity: 0.8;
}

/* --- Comment manage checkbox --- */
body.discuzx5.dz_pg_viewthread .sg-comment-manage {
    font-size: 12px;
    color: var(--sg-text-secondary, #6b7280);
    cursor: pointer;
}
body.discuzx5.dz_pg_viewthread .sg-comment-manage input {
    vertical-align: middle;
    margin-right: 2px;
}

/* --- postlistreply area --- */
body.discuzx5.dz_pg_viewthread .sg-comment-section #postlistreply {
    padding: 0 44px;
}

/* --- Dark mode --- */
body.discuzx5[data-theme="dark"].dz_pg_viewthread .sg-comment-section {
    background: var(--sg-card-bg, #1a1a1e);
}
body.discuzx5[data-theme="dark"].dz_pg_viewthread .sg-comment-content,
body.discuzx5[data-theme="dark"].dz_pg_viewthread .sg-comment-author {
    color: var(--sg-text-primary) !important;
}
body.discuzx5[data-theme="dark"].dz_pg_viewthread .sg-comment-section .sg-reply-post + .sg-reply-post::before {
    background: var(--sg-line, #2a2a30);
}
body.discuzx5[data-theme="dark"].dz_pg_viewthread .sg-comment-section #f_pst .tedt,
body.discuzx5[data-theme="dark"].dz_pg_viewthread .sg-comment-section #f_pst .tedt .bar {
    background: var(--sg-input-bg, #16161a);
}

/* ============================================================
   Mobile responsive — phone screens (≤ 680px)
   Adapts the blog layout: single column, compact nav, readable
   typography, touch-friendly controls, safe-area aware.
   ============================================================ */
@media (max-width: 680px) {
    /* --- Root: override Discuz core body min-width:1200px --- */
    html,
    body.discuzx5,
    body.discuzx5.dz_wide {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    /* --- Layout containers: override extend_common.css fixed widths --- */
    body.discuzx5 .wp,
    body.discuzx5.dz_wide .wp,
    body.discuzx5 .dz_wide .wp,
    body.discuzx5 .dz_btm_layer,
    body.discuzx5 .dz_layer_top,
    body.discuzx5 #dz_btm_layer,
    body.discuzx5 .topbox,
    body.discuzx5 .portal_container,
    body.discuzx5 #ct,
    body.discuzx5 .ct2,
    body.discuzx5.dz_wide .ct2,
    body.discuzx5 .ct2 .mn,
    body.discuzx5.dz_wide .ct2 .mn,
    body.discuzx5 .ct2 .sd,
    body.discuzx5.dz_wide .ct2 .sd,
    body.discuzx5 .ct2_a .mn,
    body.discuzx5.dz_wide .ct2_a .mn,
    body.discuzx5 .ct3_a .mn,
    body.discuzx5.dz_wide .ct3_a .mn,
    body.discuzx5 .ct3_a .sd,
    body.discuzx5.dz_wide .ct3_a .sd {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 5px;
        padding-right: 5px;
        box-sizing: border-box;
    }
    body.discuzx5 .dz_btm_layer,
    body.discuzx5 .dz_layer_top,
    body.discuzx5 #dz_btm_layer {
        padding-left: 14px;
        padding-right: 14px;
    }

    /* --- Header / nav bar: logo centered, nav menu hidden (ref: zhouerer.com) --- */
    body.discuzx5 .dz_btm_layer {
        position: relative;
        height: 56px;
        gap: 0;
        padding: 0 14px;
    }
    /* Center the logo absolutely so it stays centered regardless of login button */
    body.discuzx5 .dz_nav .dz_nav_logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        flex: 0 0 auto;
        height: 56px;
    }
    body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo {
        width: auto;
        max-width: 160px;
        height: 40px;
    }
    body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo::before {
        font-size: 22px;
    }
    body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo::after {
        display: none;
    }
    /* Hide the nav menu + search on phone — keep logo centered + login on right */
    body.discuzx5 .dz_layer_nav {
        display: none !important;
    }
    body.discuzx5 .header-searcher {
        display: none;
    }
    /* Login / user area stays on the right */
    body.discuzx5 .dz_layer_dl {
        margin-left: auto;
        flex: 0 0 auto;
    }
    body.discuzx5 .header-right {
        height: 56px;
    }
    body.discuzx5 .header-user-login .login_btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    body.discuzx5 .header-user-avatar img {
        width: 32px;
        height: 32px;
    }
    body.discuzx5 .sg-theme-toggle {
        width: 34px;
        height: 34px;
        margin-right: 4px;
    }

    /* --- Viewthread mobile: show login button (desktop hides it for 885px blog) --- */
    body.discuzx5.dz_pg_viewthread .dz_layer_dl {
        display: block !important;
    }
    body.discuzx5.dz_pg_viewthread .dz_nav {
        justify-content: flex-start;
    }
    body.discuzx5.dz_pg_viewthread .dz_nav .dz_nav_logo {
        margin: 0;
    }

    /* --- Hide floating right-side nav on mobile --- */
    body.discuzx5 .dz_rnav {
        display: none !important;
    }

    /* --- Portal container: tighter padding --- */
    body.discuzx5 .portal_container {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* --- Breadcrumb --- */
    body.discuzx5 #pt {
        margin: 12px 0;
        font-size: 12px;
    }

    /* --- Portal home: category tabs + article list --- */
    body.discuzx5 .portal_container_wrap {
        display: block;
        margin-top: 20px;
    }
    body.discuzx5 .portal_side {
        width: 100%;
        margin-right: 0;
        margin-top: 24px;
    }
    body.discuzx5 .portal_nav_container {
        padding: 0;
    }
    body.discuzx5 .portal_nav ul {
        gap: 8px;
    }
    body.discuzx5 .portal_nav li a {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Article list cards — single column, compact */
    body.discuzx5 .forumportal_listc li.kmlist {
        min-height: 0;
        padding: 14px;
    }
    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
        width: 100% !important;
        height: auto;
        margin-bottom: 12px;
    }
    /* Images should not fill the container on mobile */
    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box .kmshowimg {
        height: auto;
    }
    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box .kmshowimg img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 160px;
        object-fit: contain;
        min-height: 0;
        margin: 0 auto;
    }
    body.discuzx5 .forumportal_listc li.kmlist > .kmtit {
        font-size: 18px;
    }
    body.discuzx5 .forumportal_listc li.kmlist:not(:has(> .kmimg_box)) > .kmtit {
        font-size: 18px;
    }
    body.discuzx5 .forumportal_listc li.kmlist > .kmtxt {
        font-size: 13px;
        line-height: 1.6;
        -webkit-line-clamp: 3;
    }

    /* --- Forum list (forumdisplay) --- */
    body.discuzx5 #sd_bdl,
    body.discuzx5 .dz_bdl {
        display: none;
    }
    body.discuzx5 .tl th, body.discuzx5 .tl td {
        padding: 12px 0;
    }
    body.discuzx5 .tl th a, body.discuzx5 .tl th.common {
        font-size: 15px;
    }
    body.discuzx5 .dz_waterfall {
        width: 100% !important;
    }
    body.discuzx5 .dz_waterfall li {
        width: calc(50% - 8px) !important;
        margin: 0 8px 12px 0;
    }
    body.discuzx5 .dz_list_top {
        padding: 12px 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* --- Viewthread: relax the 885px lock --- */
    body.discuzx5.dz_pg_viewthread #ct,
    body.discuzx5.dz_pg_viewthread .wp,
    body.discuzx5.dz_pg_viewthread .dz_btm_layer {
        width: 100%;
        max-width: 100%;
    }
    body.discuzx5.dz_pg_viewthread #postlist {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    /* Restore hero full-bleed + body padding */
    body.discuzx5.dz_pg_viewthread #postlist:has(> .posthead.sg-thread-hero) {
        padding: 0;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead.sg-thread-hero {
        height: 260px;
        border-radius: 0;
        margin-bottom: 0;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead.sg-thread-hero .plc {
        height: 260px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead.sg-thread-hero .ts {
        font-size: 22px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist:has(> .posthead.sg-thread-hero) > .sg-first-post,
    body.discuzx5.dz_pg_viewthread #postlist:has(> .posthead.sg-thread-hero) > .pl,
    body.discuzx5.dz_pg_viewthread #postlist:has(> .posthead.sg-thread-hero) > .ad {
        padding-left: 16px;
        padding-right: 16px;
    }
    body.discuzx5.dz_pg_viewthread #postlist:has(> .posthead.sg-thread-hero) > :last-child {
        padding-bottom: 20px;
    }
    /* Post body typography for mobile reading (ref: zhouerer.com scaled down) */
    body.discuzx5.dz_pg_viewthread #postlist .t_f,
    body.discuzx5.dz_pg_viewthread #postlist .t_fsz,
    body.discuzx5.dz_pg_viewthread #postlist .pcb {
        font-size: 16px;
        line-height: 1.714285714;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h1 { font-size: 24px; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h2 { font-size: 22px; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h3 { font-size: 18px; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h4 { font-size: 16px; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f p { margin: 0 0 16px; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f blockquote {
        margin: 24px 0;
        padding: 14px 16px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f blockquote p {
        font-size: 18px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f pre,
    body.discuzx5.dz_pg_viewthread #postlist .t_f .blockcode {
        margin: 24px 0 !important;
        padding: 14px 16px !important;
        font-size: 13px !important;
    }
    /* EditorJS mobile overrides */
    body.discuzx5.dz_pg_viewthread #postlist .t_f .ce-paragraph {
        font-size: 16px !important;
        margin: 0 0 16px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h2.ce-header { font-size: 22px !important; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h3.ce-header { font-size: 18px !important; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f h4.ce-header { font-size: 16px !important; }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .cdx-quote,
    body.discuzx5.dz_pg_viewthread #postlist .t_f blockquote.cdx-block {
        margin: 24px 0 !important;
        padding: 14px 16px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .cdx-quote__text {
        font-size: 18px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .editorjs-codeFlask_Wrapper,
    body.discuzx5.dz_pg_viewthread #postlist .t_f pre {
        margin: 24px 0 !important;
        padding: 0 !important;
        font-size: 13px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .editorjs-codeFlask_Editor .codeflask__textarea,
    body.discuzx5.dz_pg_viewthread #postlist .t_f .editorjs-codeFlask_Editor .codeflask__pre {
        font-size: 13px !important;
        line-height: 19px !important;
        padding: 8px 8px 8px 40px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .editorjs-codeFlask_Editor .codeflask__lines,
    body.discuzx5.dz_pg_viewthread #postlist .t_f .editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before {
        width: 35px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .editorjs-codeFlask_Editor .codeflask__lines {
        font-size: 12px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .audio-tool__audio {
        margin: 0 !important;
        padding: 14px 16px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .t_f .audio-tool__audio .audio-cover,
    body.discuzx5.dz_pg_viewthread #postlist .t_f .audio-tool__audio img {
        max-height: 120px !important;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead .plc {
        padding: 18px 16px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .pi {
        padding: 8px 16px;
    }
    body.discuzx5.dz_pg_viewthread #postlist #p_btn {
        gap: 8px;
        margin: 20px 0 !important;
        padding: 0 16px;
    }
    body.discuzx5.dz_pg_viewthread #postlist #p_btn > a {
        padding: 0 12px;
        min-height: 36px;
        font-size: 13px;
    }
    /* Hide sidebar on mobile */
    body.discuzx5.dz_pg_viewthread .sg-viewthread-sidebar {
        display: none;
    }

    /* --- Comment section mobile overrides --- */
    body.discuzx5.dz_pg_viewthread .sg-comment-section {
        margin-top: 12px;
        padding: 16px 0;
        border-radius: 6px;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-section #f_pst {
        padding: 0 16px 16px !important;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-header {
        padding: 0 16px;
        margin-bottom: 16px;
        font-size: 15px;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-item {
        padding: 12px 16px;
        gap: 10px;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-avatar,
    body.discuzx5.dz_pg_viewthread .sg-comment-avatar img,
    body.discuzx5.dz_pg_viewthread .sg-comment-avatar-default {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-content {
        font-size: 13px !important;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-author {
        font-size: 12px !important;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-section .t_f,
    body.discuzx5.dz_pg_viewthread .sg-comment-section .t_fsz,
    body.discuzx5.dz_pg_viewthread .sg-comment-section .pcb {
        font-size: 13px !important;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-actions {
        gap: 12px;
        flex-wrap: wrap;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-actions a,
    body.discuzx5.dz_pg_viewthread .sg-comment-action {
        font-size: 12px;
        padding: 4px 0;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-signature {
        display: none;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-section .sg-reply-post + .sg-reply-post::before {
        margin: 0 16px;
    }
    body.discuzx5.dz_pg_viewthread .sg-comment-section #postlistreply {
        padding: 0 16px;
    }

    /* Post table layout: convert to block for mobile reading */
    body.discuzx5.dz_pg_viewthread .plhin {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    body.discuzx5.dz_pg_viewthread .plhin > tbody,
    body.discuzx5.dz_pg_viewthread .plhin > tbody > tr {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    body.discuzx5.dz_pg_viewthread .plhin > tbody > tr > .pls {
        display: none !important;
    }
    body.discuzx5.dz_pg_viewthread .plhin > tbody > tr > .plc {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
        padding: 0;
    }

    /* --- Viewthread hero meta: hide avatar + copy link for cleaner layout --- */
    body.discuzx5.dz_pg_viewthread .sg-thread-hero__avatar {
        display: none !important;
    }
    body.discuzx5.dz_pg_viewthread .sg-thread-hero__content > a:not(.sg-thread-hero__tag) {
        display: none;
    }
    body.discuzx5.dz_pg_viewthread .sg-thread-hero__meta {
        flex-wrap: nowrap;
        gap: 6px 12px;
        font-size: 13px;
        line-height: 1.6;
    }

    /* --- sg-first-post: white background instead of transparent --- */
    body.discuzx5.dz_pg_viewthread #postlist .sg-first-post {
        background: var(--sg-card-bg, #fff);
    }

    /* --- Hide all border lines on viewthread --- */
    body.discuzx5.dz_pg_viewthread #postlist .sg-first-post,
    body.discuzx5.dz_pg_viewthread #postlist .viewthread_table,
    body.discuzx5.dz_pg_viewthread #postlist > div[id^="post_"],
    body.discuzx5.dz_pg_viewthread #postlist .sg-first-post .pi {
        border: 0 !important;
    }

    /* --- Pagination --- */
    body.discuzx5 .pgs .pg {
        font-size: 13px;
    }
    body.discuzx5 .pgs a, body.discuzx5 .pgs strong {
        padding: 4px 10px;
    }

    /* --- Footer --- */
    body.discuzx5 .dz_footc {
        margin-top: 28px;
        padding: 0 10px;
    }
    body.discuzx5 .dz_footc_nav {
        display: none;
    }
    body.discuzx5 .dz_footc_copy {
        padding: 12px 0 20px;
        text-align: center;
        font-size: 12px;
        line-height: 1.8;
    }
    body.discuzx5 .dz_footc_copy p {
        margin: 0;
    }
    body.discuzx5 .dz_footc_copy .pipe {
        margin: 0 6px;
    }

    /* --- Floating buttons --- */
    body.discuzx5 #scrolltop {
        right: 14px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    body.discuzx5 #scrolltop span {
        width: 40px;
        height: 40px;
    }
    body.discuzx5 #scrolltop a {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 18px;
    }

    /* --- DIY feature grid --- */
    body.discuzx5 .sg-diy-feature-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 200px 200px;
        height: auto;
    }

    /* --- Side cards --- */
    body.discuzx5 .side-card {
        padding: 16px;
    }
    body.discuzx5 .about-card .profile {
        width: 80px;
        height: 80px;
    }
    body.discuzx5 .about-card h3 {
        font-size: 18px;
    }
    body.discuzx5 .about-card p {
        font-size: 13px;
    }

    /* --- Tables in posts: scroll horizontally --- */
    body.discuzx5 #postlist .t_f table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Post form --- */
    body.discuzx5 .dz_post_input #subject {
        height: 40px;
        line-height: 40px;
        font-size: 16px;
    }
    body.discuzx5 .tfm th {
        width: auto;
        display: block;
        text-align: left;
        padding: 6px 0;
    }
    body.discuzx5 .tfm td {
        display: block;
    }

    /* --- Generic block adjustments --- */
    body.discuzx5 .bm:not(.bw0) {
        border-radius: 7px;
        margin-bottom: 12px;
    }
    body.discuzx5 .bm_h {
        padding: 12px 14px;
    }
    body.discuzx5 .bm_h h2, body.discuzx5 .bm_h h3 {
        font-size: 16px;
    }
    body.discuzx5 .bm_c {
        padding: 12px 14px;
    }
}

/* ============================================================
   Small phone (≤ 380px) — further tightening
   ============================================================ */
@media (max-width: 380px) {
    body.discuzx5 .dz_waterfall li {
        width: 100% !important;
        margin-left: 0;
    }
    body.discuzx5 .forumportal_listc li.kmlist > .kmimg_box {
        height: 150px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead.sg-thread-hero {
        height: 200px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead.sg-thread-hero .plc {
        height: 200px;
    }
    body.discuzx5.dz_pg_viewthread #postlist .posthead.sg-thread-hero .ts {
        font-size: 19px !important;
    }
    body.discuzx5 .dz_nav .dz_nav_logo a.dzlogo::before {
        font-size: 19px;
    }
}

.attach_tips{
    display:  none;
}