* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
    color: #2c2c2c;
    line-height: 1.8;
    display: flex;
    min-height: 100vh;
    position: relative;
    background: #faf7f2;
    overflow-x: hidden;
    transition: background 0.3s;
}

/* ========== 全局背景 ========== */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -4;
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(240,228,200,0.45) 0%, transparent 55%),
        radial-gradient(ellipse 70% 55% at 85% 100%, rgba(184,134,11,0.05) 0%, transparent 50%),
        linear-gradient(180deg, #fdfbf7 0%, #f8f3e9 100%);
    transition: background 0.3s;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.5) 0%, transparent 30%),
        radial-gradient(circle at 70% 75%, rgba(255,255,255,0.3) 0%, transparent 35%);
}

/* ========== 动态佛教元素水印（6 个） ========== */
.bg-deco {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}
.bg-deco .deco-icon {
    position: absolute;
    color: #b8860b;
    opacity: 0.06;
    font-size: 110px;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    transition: color 0.3s, opacity 0.3s;
}
.bg-deco .deco-icon:nth-child(1) { top: 6%;  left: 4%;  font-size: 100px; animation: float1 32s infinite; }
.bg-deco .deco-icon:nth-child(2) { top: 8%;  left: 76%; font-size: 115px; color: #8B0000; opacity: 0.055; animation: float2 38s infinite; }
.bg-deco .deco-icon:nth-child(3) { top: 38%; left: 20%; font-size: 105px; color: #6b2e1a; opacity: 0.055; animation: float3 40s infinite; }
.bg-deco .deco-icon:nth-child(4) { top: 40%; left: 70%; font-size: 120px; animation: float1 36s infinite reverse; }
.bg-deco .deco-icon:nth-child(5) { top: 72%; left: 8%;  font-size: 110px; color: #8B0000; opacity: 0.055; animation: float2 42s infinite reverse; }
.bg-deco .deco-icon:nth-child(6) { top: 74%; left: 72%; font-size: 100px; color: #6b2e1a; opacity: 0.055; animation: float3 34s infinite; }

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(30px, -40px) rotate(50deg); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(-35px, 30px) rotate(-40deg); }
}
@keyframes float3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    50%      { transform: translate(25px, -30px) rotate(30deg) scale(1.1); }
}

/* ========== 移动端顶部条 + 遮罩（桌面端永久隐藏） ========== */
.mobile-topbar {
    display: none !important;
    position: sticky;
    top: 0;
    z-index: 200;
    background: linear-gradient(180deg, #1f1a15 0%, #14100c 100%);
    color: #e8d9b8;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.mobile-topbar .m-brand {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 4px;
    color: #e8d9b8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.mobile-topbar .m-brand i { color: #b8860b; font-size: 16px; }
.mobile-topbar .m-toggle {
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    color: #e8d9b8;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.mobile-topbar .m-toggle:hover { background: rgba(184,134,11,0.15); }

.mobile-mask {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 300;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s;
}
.mobile-mask.show { display: block !important; opacity: 1; }

/* 抽屉关闭按钮，桌面端永久隐藏 */
.sidebar .m-close { display: none; }

/* ========== 左侧栏 ========== */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1f1a15 0%, #14100c 100%);
    color: #d4d4d4;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    transition: background 0.3s;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #444; }

.sidebar .brand {
    padding: 32px 20px 28px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
}
.sidebar .brand a {
    color: #e8d9b8;
    text-decoration: none;
    font-size: 20px;
    letter-spacing: 5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sidebar .brand i { font-size: 18px; color: #b8860b; }

.sidebar .search-box { padding: 16px 18px; border-bottom: 1px solid #2a2a2a; }
.sidebar .search-box form { position: relative; }
.sidebar .search-box input {
    width: 100%;
    padding: 9px 36px 9px 12px;
    border: 1px solid #333;
    background: #252525;
    color: #e8d9b8;
    font-size: 13px;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    transition: all 0.25s;
}
.sidebar .search-box input::placeholder { color: #666; }
.sidebar .search-box input:focus { border-color: #b8860b; background: #2a2520; }
.sidebar .search-box button {
    position: absolute; right: 4px; top: 50%;
    transform: translateY(-50%);
    background: transparent; border: none;
    color: #b8860b; cursor: pointer;
    padding: 6px 8px; font-size: 13px;
    transition: color 0.2s;
}
.sidebar .search-box button:hover { color: #e8d9b8; }

.sidebar nav { padding: 8px 0; flex: 1; }
.sidebar .nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 22px;
    color: #c8c8c8;
    text-decoration: none;
    font-size: 14.5px;
    transition: all 0.25s;
    position: relative;
}
.sidebar .nav-item::before {
    content: "";
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: #b8860b;
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.25s;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,0.04); color: #e8d9b8; }
.sidebar .nav-item.active { background: rgba(184,134,11,0.1); color: #e8d9b8; font-weight: 600; }
.sidebar .nav-item.active::before { transform: scaleY(1); }
.sidebar .nav-item .arrow { font-size: 10px; color: #555; transition: all 0.25s; }
.sidebar .nav-item:hover .arrow,
.sidebar .nav-item.active .arrow { color: #b8860b; transform: translateX(3px); }

.sidebar .footer-links {
    list-style: none;
    padding: 14px 18px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.sidebar .footer-links li { flex: 1; }
.sidebar .footer-links a {
    color: #aaa;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 12.5px;
    transition: all 0.25s;
    white-space: nowrap;
}
.sidebar .footer-links a:hover {
    color: #e8d9b8;
    background: rgba(184,134,11,0.12);
    border-color: rgba(184,134,11,0.3);
}
.sidebar .footer-links a i { font-size: 11px; color: #b8860b; }

.sidebar .copyright {
    padding: 12px 20px 20px;
    font-size: 11px;
    color: #555;
    line-height: 1.7;
    text-align: center;
}

/* ========== 右侧主区 ========== */
.main-wrapper {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    padding: 80px 60px 100px;
    position: relative;
    background: transparent;
}
.container { max-width: 840px; margin: 0 auto; padding-bottom: 36px; }

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    position: relative;
}
.page-header::after {
    content: "";
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #b8860b, transparent);
}
.page-header h1 {
    font-size: 30px;
    color: #8B0000;
    font-weight: 600;
    letter-spacing: 6px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.page-header h1 i { font-size: 22px; color: #b8860b; opacity: 0.85; }
.page-header .sub { font-size: 13px; color: #999; letter-spacing: 3px; }
.page-header .breadcrumb {
    margin-top: 14px;
    font-size: 12.5px;
    color: #999;
}
.page-header .breadcrumb a { color: #8B0000; text-decoration: none; transition: color 0.2s; }
.page-header .breadcrumb a:hover { color: #b8860b; }
.page-header .breadcrumb .sep { margin: 0 7px; color: #ccc; }
.page-header .breadcrumb .current { color: #666; }

.intro-box {
    background: rgba(255,255,255,0.7);
    border: 1px solid #ecdfc8;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 36px;
    box-shadow: 0 4px 20px rgba(107,46,26,0.04);
    backdrop-filter: blur(6px);
    transition: background 0.3s, border-color 0.3s;
}
.intro-box h2 {
    font-size: 17px;
    color: #8B0000;
    font-weight: 600;
    letter-spacing: 3px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.intro-box h2 i { color: #b8860b; font-size: 16px; }
.intro-box p {
    font-size: 14.5px;
    color: #555;
    line-height: 2;
    text-indent: 2em;
    margin-bottom: 0.8em;
}
.intro-box p:last-child { margin-bottom: 0; }

.intro-quote {
    text-align: center;
    text-indent: 0 !important;
    color: #8B0000;
    font-style: italic;
    margin-top: 16px;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}
.stat-item {
    background: rgba(255,255,255,0.7);
    border: 1px solid #ecdfc8;
    border-radius: 10px;
    padding: 22px 16px;
    text-align: center;
    backdrop-filter: blur(6px);
    transition: all 0.25s;
}
.stat-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(107,46,26,0.08); }
.stat-item i { font-size: 22px; color: #b8860b; margin-bottom: 10px; display: block; }
.stat-item .num {
    font-size: 24px;
    color: #8B0000;
    font-weight: 700;
    font-family: "Georgia", serif;
    margin-bottom: 4px;
}
.stat-item .label { font-size: 12.5px; color: #999; letter-spacing: 1px; }

.section { margin-bottom: 36px; }
.section-title {
    text-align: center;
    font-size: 14px;
    color: #999;
    letter-spacing: 5px;
    margin-bottom: 22px;
}
.section-title i { color: #b8860b; margin-right: 8px; font-size: 13px; }
.section-title::before,
.section-title::after {
    content: "";
    display: inline-block;
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4c5a0, transparent);
    vertical-align: middle;
    margin: 0 14px;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.cat-card {
    padding: 20px 24px;
    text-decoration: none;
    color: #333;
    transition: all 0.25s;
    position: relative;
    background: rgba(255,255,255,0.7);
    border: 1px solid #ecdfc8;
    border-radius: 10px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(107,46,26,0.04);
    overflow: hidden;
}
.cat-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #b8860b, #8B0000);
    transform: scaleY(0);
    transition: transform 0.25s;
    transform-origin: bottom;
}
.cat-card:hover {
    transform: translateY(-2px);
    border-color: #d4c5a0;
    box-shadow: 0 8px 24px rgba(107,46,26,0.1);
    background: rgba(255,255,255,0.92);
}
.cat-card:hover::before { transform: scaleY(1); }
.cat-card .cat-name {
    font-size: 15.5px;
    color: #8B0000;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cat-card .cat-name i { color: #b8860b; font-size: 13px; }
.cat-card .cat-desc { font-size: 12.5px; color: #aaa; line-height: 1.5; }

.page-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.page-grid a {
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    transition: all 0.25s;
    position: relative;
    background: rgba(255,255,255,0.65);
    border: 1px solid #ecdfc8;
    border-radius: 8px;
}
.page-grid a:hover {
    background: rgba(255,255,255,0.92);
    color: #8B0000;
    border-color: #d4c5a0;
    transform: translateX(3px);
    box-shadow: 0 4px 14px rgba(107,46,26,0.08);
}
.page-grid a .num {
    color: #b8860b;
    margin-right: 12px;
    font-size: 12px;
    font-family: "Georgia", serif;
    min-width: 22px;
    opacity: 0.8;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.recommend-item {
    padding: 14px 18px;
    text-decoration: none;
    background: rgba(255,255,255,0.55);
    border: 1px solid #ecdfc8;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s;
}
.recommend-item:hover {
    background: rgba(255,255,255,0.92);
    color: #8B0000;
    border-color: #d4c5a0;
    box-shadow: 0 4px 14px rgba(107,46,26,0.08);
}
.recommend-item i { color: #b8860b; font-size: 14px; flex-shrink: 0; }
.recommend-item .rm-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-tip { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #ecdfc8;
    border-radius: 5px;
    color: #8B0000;
    text-decoration: none;
    font-size: 13px;
    background: rgba(255,255,255,0.65);
    transition: all 0.2s;
}
.pagination a:hover { background: #fff; border-color: #d4c5a0; }
.pagination .current { background: #8B0000; color: #fff; border-color: #8B0000; }

#back-to-top {
    position: fixed;
    right: 28px; bottom: 28px;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #6b2e1a, #8B0000);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 4px 16px rgba(139,0,0,0.3);
    transition: all 0.25s;
    z-index: 999;
}
#back-to-top:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(139,0,0,0.45); }
#back-to-top.show { display: flex; }

.article-title {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 32px;
    position: relative;
}
.article-title::after {
    content: "";
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 2px;
    background: linear-gradient(90deg, transparent, #b8860b, transparent);
}
.article-title h1 {
    font-size: 28px;
    color: #8B0000;
    font-weight: 600;
    letter-spacing: 3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.article-title h1 i { color: #b8860b; font-size: 20px; opacity: 0.85; }

.reading-frame {
    position: relative;
    background: rgba(255,255,255,0.75);
    border: 1px solid #ecdfc8;
    border-radius: 14px;
    padding: 44px 52px;
    backdrop-filter: blur(8px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.8) inset,
        0 8px 32px rgba(107,46,26,0.05),
        0 2px 8px rgba(107,46,26,0.03);
    transition: background 0.3s, border-color 0.3s;
}
.reading-frame::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #b8860b 30%, #8B0000 50%, #b8860b 70%, transparent);
    border-radius: 14px 14px 0 0;
    opacity: 0.45;
}

.content-body {
    font-size: 17px;
    line-height: 2.2;
    color: #333;
    background: transparent;
    padding: 0;
    border: none;
}
.content-body p { margin: 1.1em 0; text-indent: 2em; }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
}
.pager .nav-link {
    color: #8B0000;
    text-decoration: none;
    padding: 10px 18px;
    border: 1px solid #ecdfc8;
    border-radius: 8px;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.65);
    max-width: 46%;
    overflow: hidden;
    font-size: 13.5px;
}
.pager .nav-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .nav-link:hover { background: #fff; border-color: #d4c5a0; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(107,46,26,0.1); }
.pager .nav-link i { font-size: 12px; color: #b8860b; flex-shrink: 0; }
.pager .nav-link.disabled { color: #ccc; border-color: #eee; cursor: not-allowed; background: transparent; box-shadow: none; }
.pager .nav-link.disabled i { color: #ddd; }
.pager .nav-link.disabled:hover { transform: none; }

.back-dir { text-align: center; margin-top: 28px; }
.back-dir a {
    color: #8B0000;
    text-decoration: none;
    font-size: 13.5px;
    padding: 10px 32px;
    border: 1px solid #ecdfc8;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.65);
    transition: all 0.25s;
}
.back-dir a:hover { background: #fff; border-color: #d4c5a0; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(107,46,26,0.1); }
.back-dir a i { color: #b8860b; }

.article-breadcrumb {
    text-align: center;
    font-size: 12.5px;
    color: #999;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #ddd2b8;
}
.article-breadcrumb a { color: #8B0000; text-decoration: none; transition: color 0.2s; }
.article-breadcrumb a:hover { color: #b8860b; }
.article-breadcrumb .sep { margin: 0 7px; color: #ccc; }
.article-breadcrumb .current { color: #666; }
.article-breadcrumb .current i { color: #b8860b; margin-right: 5px; font-size: 12px; }

.read-tools {
    position: fixed;
    right: 28px; bottom: 88px;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.read-tools button {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #6b2e1a, #8B0000);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 4px 16px rgba(139,0,0,0.3);
    transition: all 0.25s;
}
.read-tools button:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(139,0,0,0.45); }
.read-tools button.active { background: linear-gradient(135deg, #b8860b, #8B0000); }

.settings-panel {
    position: fixed;
    right: 88px; bottom: 88px;
    width: 320px;
    background: rgba(253,252,248,0.98);
    border: 1px solid #e0d8c4;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(107,46,26,0.18);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: none;
    animation: slideIn 0.22s ease;
}
.settings-panel.show { display: block; }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.settings-panel h3 {
    font-size: 14px;
    color: #6b2e1a;
    letter-spacing: 2px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eee5d2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.settings-panel h3 i { color: #b8860b; margin-right: 6px; }
.settings-panel .close-btn { cursor: pointer; color: #999; font-size: 14px; transition: color 0.2s; }
.settings-panel .close-btn:hover { color: #8B0000; }

.setting-group { margin-bottom: 18px; }
.setting-group:last-child { margin-bottom: 0; }
.setting-group > label {
    display: block;
    font-size: 12.5px;
    color: #888;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.setting-group > label i { color: #b8860b; margin-right: 4px; }

.setting-group .options { display: flex; gap: 6px; flex-wrap: wrap; }
.setting-group .options button {
    flex: 1;
    min-width: 42px;
    padding: 7px 6px;
    border: 1px solid #e6ddc8;
    background: #fdfcf8;
    color: #666;
    font-size: 12.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.setting-group .options button:hover { border-color: #d4c5a0; color: #8B0000; }
.setting-group .options button.active { background: #8B0000; color: #fff; border-color: #8B0000; }

.bg-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bg-options button {
    position: relative;
    padding: 8px 4px 6px;
    border: 2px solid #e6ddc8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    font-family: inherit;
    transition: all 0.2s;
    background: #fdfcf8;
    text-align: center;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.bg-options button:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(107,46,26,0.1); }
.bg-options button.active {
    border-color: #8B0000;
    box-shadow: 0 0 0 2px rgba(139,0,0,0.15);
    color: #8B0000;
    font-weight: 600;
}
.bg-options button .swatch {
    display: block;
    width: 100%;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
}
.bg-options button[data-bg="default"] .swatch { background: linear-gradient(135deg, #fdfbf7, #f8f3e9); }
.bg-options button[data-bg="white"] .swatch { background: #ffffff; }
.bg-options button[data-bg="sepia"] .swatch { background: #f4ecd8; }
.bg-options button[data-bg="green"] .swatch { background: #e8f0e5; }
.bg-options button[data-bg="dark"] .swatch { background: #2a2622; border-color: #1a1815; }

/* ==================== 主题切换 ==================== */
body.theme-white { background: #f6f6f6; }
body.theme-white::before {
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(245,245,245,0.5) 0%, transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f6f6f6 100%);
}
body.theme-white .intro-box,
body.theme-white .stat-item,
body.theme-white .cat-card,
body.theme-white .page-grid a,
body.theme-white .recommend-item,
body.theme-white .reading-frame { background: rgba(255,255,255,0.95); }

body.theme-sepia { background: #f0e4c8; }
body.theme-sepia::before {
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(230,210,170,0.4) 0%, transparent 55%),
        linear-gradient(180deg, #faf2dd 0%, #f0e4c8 100%);
}
body.theme-sepia .intro-box,
body.theme-sepia .stat-item,
body.theme-sepia .cat-card,
body.theme-sepia .page-grid a,
body.theme-sepia .recommend-item,
body.theme-sepia .reading-frame { background: rgba(244,236,216,0.92); }

body.theme-green { background: #e0ebdc; }
body.theme-green::before {
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(190,215,190,0.35) 0%, transparent 55%),
        linear-gradient(180deg, #eef5ec 0%, #e0ebdc 100%);
}
body.theme-green .intro-box,
body.theme-green .stat-item,
body.theme-green .cat-card,
body.theme-green .page-grid a,
body.theme-green .recommend-item,
body.theme-green .reading-frame { background: rgba(232,240,229,0.92); }

body.theme-dark { background: #15130f; color: #c8c0b0; }
body.theme-dark::before {
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgba(184,134,11,0.06) 0%, transparent 55%),
        linear-gradient(180deg, #1f1c18 0%, #15130f 100%);
}
body.theme-dark::after { opacity: 0.02; }
body.theme-dark .bg-deco .deco-icon { color: #d4a856 !important; opacity: 0.12 !important; }
body.theme-dark .bg-deco .deco-icon:nth-child(even) { color: #c9922f !important; opacity: 0.10 !important; }
body.theme-dark .intro-box,
body.theme-dark .stat-item,
body.theme-dark .cat-card,
body.theme-dark .page-grid a,
body.theme-dark .recommend-item {
    background: rgba(40,36,32,0.75);
    border-color: #3a342a;
    color: #c8c0b0;
}
body.theme-dark .cat-card:hover,
body.theme-dark .page-grid a:hover,
body.theme-dark .recommend-item:hover,
body.theme-dark .stat-item:hover { background: rgba(50,45,38,0.9); }
body.theme-dark .cat-card .cat-name { color: #d4a856; }
body.theme-dark .reading-frame { background: rgba(35,31,26,0.9); border-color: #3a342a; }
body.theme-dark .content-body { color: #c8c0b0; }
body.theme-dark .article-title h1,
body.theme-dark .page-header h1 { color: #d4a856; }
body.theme-dark .article-title::after,
body.theme-dark .page-header::after { background: linear-gradient(90deg, transparent, #d4a856, transparent); }
body.theme-dark .breadcrumb a,
body.theme-dark .page-header .breadcrumb a { color: #d4a856; }
body.theme-dark .breadcrumb .current,
body.theme-dark .page-header .breadcrumb .current { color: #888; }
body.theme-dark .breadcrumb .sep,
body.theme-dark .page-header .breadcrumb .sep { color: #555; }
body.theme-dark .breadcrumb,
body.theme-dark .page-header .breadcrumb { border-bottom-color: #3a342a; }
body.theme-dark .page-header .sub { color: #888; }
body.theme-dark .article-breadcrumb { color: #888; border-bottom-color: #3a342a; }
body.theme-dark .article-breadcrumb a { color: #d4a856; }
body.theme-dark .article-breadcrumb a:hover { color: #e8c068; }
body.theme-dark .article-breadcrumb .sep { color: #555; }
body.theme-dark .article-breadcrumb .current { color: #888; }
body.theme-dark .article-breadcrumb .current i { color: #b8860b; }
body.theme-dark .pager .nav-link { background: rgba(40,36,32,0.7); border-color: #3a342a; color: #d4a856; }
body.theme-dark .pager .nav-link:hover { background: rgba(50,45,38,0.9); border-color: #d4a856; }
body.theme-dark .pager .nav-link i { color: #b8860b; }
body.theme-dark .pager .nav-link.disabled { color: #555; border-color: #2a2622; background: transparent; }
body.theme-dark .pager .nav-link.disabled i { color: #444; }
body.theme-dark .back-dir a { background: rgba(40,36,32,0.7); border-color: #3a342a; color: #d4a856; }
body.theme-dark .back-dir a:hover { background: rgba(50,45,38,0.9); border-color: #d4a856; }
body.theme-dark .back-dir a i { color: #b8860b; }
body.theme-dark .section-title { color: #888; }
body.theme-dark .intro-box h2 { color: #d4a856; }
body.theme-dark .intro-box p { color: #a8a090; }
body.theme-dark .intro-quote { color: #d4a856; }
body.theme-dark .stat-item .num { color: #d4a856; }
body.theme-dark .stat-item .label { color: #888; }
body.theme-dark .sidebar { background: linear-gradient(180deg, #0f0d0a 0%, #050403 100%); }
body.theme-dark .settings-panel { background: rgba(35,31,26,0.98); border-color: #3a342a; }
body.theme-dark .settings-panel h3 { color: #d4a856; border-bottom-color: #3a342a; }
body.theme-dark .setting-group > label { color: #888; }
body.theme-dark .setting-group .options button { background: #2a2622; border-color: #3a342a; color: #c8c0b0; }
body.theme-dark .setting-group .options button.active { background: #d4a856; color: #1a1815; border-color: #d4a856; }
body.theme-dark .bg-options button { background: #2a2622; border-color: #3a342a; color: #aaa; }
body.theme-dark .bg-options button.active { border-color: #d4a856; color: #d4a856; }
body.theme-dark .pagination a,
body.theme-dark .pagination span {
    background: rgba(40,36,32,0.7);
    border-color: #3a342a;
    color: #d4a856;
}
body.theme-dark .pagination .current { background: #d4a856; color: #1a1815; border-color: #d4a856; }

/* ========== 移动端媒体查询（单层，不嵌套） ========== */
@media (max-width: 900px) {
    body { display: block; }
    .bg-deco .deco-icon { opacity: 0.02; }
    body.theme-dark .bg-deco .deco-icon { opacity: 0.06 !important; }

    /* 移动端才显示顶部条 */
    .mobile-topbar { display: flex !important; }

    /* 遮罩仍默认隐藏，只有加 .show 才显示 */
    .mobile-mask { display: none !important; }
    .mobile-mask.show { display: block !important; opacity: 1; }

    /* 侧栏抽屉 */
    .sidebar {
        width: 280px;
        max-width: 82vw;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        height: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
        white-space: normal;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 400;
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }
    .sidebar.show { transform: translateX(0); }

    /* 移动端才显示关闭按钮 */
    .sidebar .m-close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        border-bottom: 1px solid #2a2a2a;
    }
    .sidebar .m-close .m-title {
        font-size: 16px;
        color: #e8d9b8;
        letter-spacing: 4px;
        font-weight: 600;
    }
    .sidebar .m-close button {
        width: 32px; height: 32px;
        background: transparent;
        border: none;
        color: #999;
        font-size: 16px;
        cursor: pointer;
        border-radius: 6px;
        transition: 0.2s;
    }
    .sidebar .m-close button:hover { color: #e8d9b8; background: rgba(184,134,11,0.12); }

    .sidebar .brand { display: none; }
    .sidebar .search-box { display: block; padding: 16px 18px; border-bottom: 1px solid #2a2a2a; }
    .sidebar nav { display: block; padding: 8px 0; flex: 1; }
    .sidebar .nav-item {
        padding: 14px 22px;
        font-size: 14.5px;
        border-bottom: 1px solid #222;
        border-right: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .sidebar .nav-item::before {
        top: 20%; bottom: 20%; left: 0; right: auto;
        width: 3px; height: auto;
        transform: scaleY(0);
    }
    .sidebar .nav-item.active::before { transform: scaleY(1); }
    .sidebar .nav-item .arrow { display: inline-block; color: #555; }
    .sidebar .nav-item:hover { padding-left: 22px; }
    .sidebar .nav-item.active { padding-left: 22px; }

    .sidebar .footer-links {
        display: flex;
        padding: 16px 18px;
        border-top: 1px solid #2a2a2a;
        gap: 8px;
    }
    .sidebar .copyright {
        display: block;
        padding: 0 20px 24px;
        font-size: 11px;
        color: #555;
        line-height: 1.7;
        text-align: center;
    }

    .main-wrapper {
        margin-left: 0;
        padding: 24px 16px 80px;
    }

    .cat-grid, .page-grid, .recommend-grid { grid-template-columns: 1fr; gap: 10px; }
    .page-header h1 { font-size: 22px; letter-spacing: 4px; gap: 10px; }
    .page-header h1 i { font-size: 18px; }
    .intro-box { padding: 20px; }
    .stats { grid-template-columns: 1fr; gap: 10px; }
    .content-body { font-size: 16px; }
    .reading-frame { padding: 22px 18px; border-radius: 10px; }
    .article-title h1 { font-size: 21px; letter-spacing: 2px; gap: 8px; }
    .article-title h1 i { font-size: 17px; }
    .pager { flex-direction: column; }
    .pager .nav-link { max-width: 100%; width: 100%; justify-content: center; }
    #back-to-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
    .settings-panel { right: 16px; left: 16px; width: auto; bottom: 80px; }
    .read-tools { right: 14px; bottom: 70px; }
}