/* ============================================================
   佛光网 · 大藏经
   设计：经卷 — 纸、墨、松绿、金
   ============================================================ */

/* ---------- 设计令牌 ---------- */
html {
    --paper: #f6f1e6;
    --paper-2: #fcf9f2;
    --paper-3: #efe7d5;

    --ink: #1d1a14;
    --ink-2: #57503f;
    --ink-3: #8a8070;

    --line: #e1d7c2;
    --line-2: #d3c6ac;

    --accent: #2f4a3e;
    --accent-2: #9a3b2a;
    --gold: #a98548;
    --on-accent: #fbf7ee;

    --header-bg: rgba(252, 249, 242, 0.94);
    --shadow-1: 0 1px 2px rgba(60, 48, 30, 0.05);
    --shadow-2: 0 14px 40px rgba(60, 48, 30, 0.08);

    --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
    --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

    background: var(--paper);
}

html.theme-white {
    --paper: #f6f6f4;
    --paper-2: #ffffff;
    --paper-3: #eeeee9;
    --ink: #1b1b19;
    --ink-2: #54544e;
    --ink-3: #8a8a82;
    --line: #e4e4de;
    --line-2: #d6d6cf;
    --header-bg: rgba(255, 255, 255, 0.94);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html.theme-sepia {
    --paper: #f1e6cc;
    --paper-2: #f9f1dd;
    --paper-3: #e9dcc0;
    --ink: #2a2418;
    --ink-2: #5f543e;
    --ink-3: #8c7f66;
    --line: #ddcba8;
    --line-2: #cfbb93;
    --header-bg: rgba(249, 241, 221, 0.94);
}

html.theme-green {
    --paper: #e8f0e5;
    --paper-2: #f3f8f1;
    --paper-3: #dde9d9;
    --ink: #1f2a20;
    --ink-2: #4d5c4b;
    --ink-3: #7c8b78;
    --line: #cbd9c5;
    --line-2: #bacbb3;
    --header-bg: rgba(243, 248, 241, 0.94);
}

html.theme-dark {
    --paper: #14130f;
    --paper-2: #1c1a15;
    --paper-3: #24211a;
    --ink: #e8dfce;
    --ink-2: #b3a892;
    --ink-3: #857b6a;
    --line: #2e2a21;
    --line-2: #3b352a;
    --accent: #c9a86a;
    --accent-2: #c46a5a;
    --gold: #c9a86a;
    --on-accent: #17150f;
    --header-bg: rgba(28, 26, 21, 0.94);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- 基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding-top: 76px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.9;
    overflow-x: hidden;
    transition: background 0.25s ease, color 0.25s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(169, 133, 72, 0.07), transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(47, 74, 62, 0.04), transparent 60%);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

/* 装饰法轮 */
.bg-deco {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-deco .deco-icon {
    position: absolute;
    color: var(--gold);
    opacity: 0.05;
    font-size: 120px;
    animation: drift 36s ease-in-out infinite;
}

.bg-deco .deco-icon:nth-child(1) { top: 12%; left: 4%; }
.bg-deco .deco-icon:nth-child(2) { top: 58%; left: 86%; font-size: 150px; animation-duration: 46s; animation-direction: reverse; }
.bg-deco .deco-icon:nth-child(3) { top: 82%; left: 12%; font-size: 90px; animation-duration: 40s; }

@keyframes drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(18px, -24px) rotate(24deg); }
}

/* ---------- 顶部导航（复用 .sidebar 结构） ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 76px;
    padding: 0 28px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    overflow: visible;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    z-index: 100;
}

.sidebar .brand {
    order: 1;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    text-align: left;
}

.sidebar .brand a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--ink);
}

.sidebar .brand i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 15px;
    border-radius: 2px;
}

.sidebar nav {
    order: 2;
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    height: 76px;
    padding: 0;
}

.sidebar .nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 76px;
    padding: 0 15px;
    color: var(--ink-2);
    font-size: 14px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.sidebar .nav-item::before {
    content: "";
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 0;
    top: auto;
    width: auto;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease;
}

.sidebar .nav-item:hover {
    color: var(--ink);
}

.sidebar .nav-item:hover::before,
.sidebar .nav-item.active::before {
    transform: scaleX(1);
}

.sidebar .nav-item.active {
    color: var(--ink);
    font-weight: 600;
}

.sidebar .nav-item .arrow {
    display: none;
}

.sidebar .search-box {
    order: 3;
    flex-shrink: 0;
    width: 214px;
    margin-left: auto;
    padding: 0;
    border: 0;
}

.sidebar .search-box form {
    position: relative;
}

.sidebar .search-box input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper);
    color: var(--ink);
    font-size: 13px;
    outline: none;
    transition: border-color 0.18s ease;
}

.sidebar .search-box input::placeholder {
    color: var(--ink-3);
}

.sidebar .search-box input:focus {
    border-color: var(--gold);
}

.sidebar .search-box button {
    position: absolute;
    right: 0;
    top: 0;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 12px;
}

.sidebar .search-box button:hover {
    color: var(--accent);
}

.sidebar .footer-links {
    order: 4;
    display: flex;
    gap: 12px;
    list-style: none;
    padding: 0;
    border: 0;
    flex-shrink: 0;
}

.sidebar .footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 2px;
    background: none;
    border: 0;
    color: var(--ink-3);
    font-size: 12.5px;
}

.sidebar .footer-links a:hover {
    color: var(--accent);
}

.sidebar .footer-links a i {
    color: var(--gold);
    font-size: 11px;
}

.sidebar .copyright {
    display: none;
}

/* ---------- 主区 ---------- */
.main-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    padding: 46px 24px 0;
    min-height: calc(100vh - 76px);
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.container-home {
    max-width: 1180px;
}

/* ---------- 首页：刊头 ---------- */
.home-hero {
    position: relative;
    padding: 66px 0 48px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.hero-kicker {
    font-size: 11px;
    letter-spacing: 5px;
    color: var(--accent);
}

.hero-title {
    margin: 18px 0 14px;
    font-family: var(--font-serif);
    font-size: clamp(56px, 8.6vw, 104px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 16px;
    padding-left: 16px;
    color: var(--ink);
}

.hero-sub {
    font-size: 12.5px;
    letter-spacing: 3px;
    color: var(--ink-3);
}

.hero-search {
    display: flex;
    width: 100%;
    align-items: center;
    max-width: 620px;
    height: 56px;
    margin: 36px auto 0;
    padding: 5px 5px 5px 20px;
    background: var(--paper-2);
    border: 1px solid var(--line-2);
    border-radius: 2px;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-search:focus-within {
    border-color: var(--gold);
    box-shadow: var(--shadow-2);
}

.hero-search > i {
    flex-shrink: 0;
    margin-right: 12px;
    font-size: 13px;
    color: var(--ink-3);
}

.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 14.5px;
    letter-spacing: 1px;
}

.hero-search input::placeholder {
    color: var(--ink-3);
}

.hero-search button {
    flex-shrink: 0;
    height: 46px;
    padding: 0 28px;
    border: 0;
    border-radius: 0;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    letter-spacing: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hero-search button:hover {
    background: var(--ink);
}

.hero-tags {
    margin-top: 18px;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--ink-3);
}

.hero-tags span {
    margin-right: 10px;
    opacity: 0.7;
}

.hero-tags a {
    margin: 0 8px;
    color: var(--ink-2);
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.hero-tags a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---------- 数据条 ---------- */
.stats-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 46px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-num {
    font-family: "Georgia", "Times New Roman", var(--font-serif);
    font-size: 26px;
    line-height: 1.2;
    color: var(--ink);
}

.stat-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--ink-3);
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--line);
}

/* ---------- 区块标题 ---------- */
.sec {
    margin-top: 58px;
}

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line-2);
    position: relative;
}

.sec-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 52px;
    height: 2px;
    background: var(--accent);
}

.sec-no {
    font-family: "Georgia", "Times New Roman", var(--font-serif);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold);
}

.sec-head h2 {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--ink);
}

.sec-head em {
    margin-left: auto;
    font-style: normal;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--ink-3);
}

.sec-more {
    margin-left: auto;
    font-size: 11.5px;
    letter-spacing: 1px;
    color: var(--ink-3);
}

.sec-more:hover {
    color: var(--accent);
}

.sec-more i {
    margin-left: 3px;
    font-size: 9px;
}

/* ---------- 藏经体系卡片 ---------- */
.canon-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: var(--paper-2);
}

.canon-grid .canon-card {
    border-right: 1px solid var(--line);
}

.canon-grid .canon-card:last-child {
    border-right: 0;
}

.subcat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.canon-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 158px;
    padding: 28px 20px 24px;
    transition: background 0.2s ease;
}

.subcat-grid .canon-card {
    min-height: 0;
    border: 1px solid var(--line);
    background: var(--paper-2);
    border-radius: 2px;
}

.canon-card:hover {
    background: var(--paper);
}

.canon-no {
    font-family: var(--font-kai);
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 1px;
}

.canon-name {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--ink);
}

.canon-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.canon-desc {
    font-size: 12px;
    line-height: 1.75;
    color: var(--ink-3);
}

.canon-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    font-size: 11px;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.canon-card:hover .canon-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- 经卷列表 ---------- */
.text-grid {
    display: grid;
    gap: 0 40px;
}

.text-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.text-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.text-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 11px 2px;
    min-width: 0;
    border-bottom: 1px dashed var(--line);
    transition: padding 0.18s ease;
}

.text-row:hover {
    padding-left: 6px;
}

.tr-no {
    flex-shrink: 0;
    width: 24px;
    font-family: "Georgia", "Times New Roman", var(--font-serif);
    font-size: 10.5px;
    color: var(--gold);
}

.tr-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-serif);
    font-size: 14.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-row:hover .tr-title {
    color: var(--accent);
}

.tr-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.tr-cat {
    font-size: 10.5px;
    color: var(--ink-3);
}

/* ---------- 关于 ---------- */
.about {
    margin-top: 62px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.about-body {
    max-width: 70em;
}

.about-body p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 2.1;
    color: var(--ink-2);
    text-indent: 2em;
}

.about-body blockquote {
    margin: 22px 0 0;
    padding: 6px 0 6px 18px;
    border-left: 2px solid var(--accent);
    font-family: var(--font-kai);
    font-size: 17px;
    letter-spacing: 2px;
    color: var(--accent);
}

/* ---------- 分类页头 ---------- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 2px 0 22px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.breadcrumb a {
    color: var(--ink-2);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .sep {
    opacity: 0.45;
}

.breadcrumb .current {
    color: var(--accent);
}

.page-head {
    padding: 4px 0 26px;
    margin-bottom: 34px;
    border-bottom: 2px solid var(--ink);
}

.page-kicker {
    font-size: 10.5px;
    letter-spacing: 4px;
    color: var(--accent);
}

.page-title {
    margin: 12px 0 10px;
    font-family: var(--font-serif);
    font-size: clamp(34px, 4.8vw, 54px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 4px;
    color: var(--ink);
}

.page-desc {
    font-size: 12.5px;
    letter-spacing: 0.5px;
    color: var(--ink-3);
}

/* ---------- 文章页 ---------- */
.article-container {
    max-width: 880px;
}

.article-breadcrumb {
    padding: 2px 0 20px;
}

.article-head {
    padding: 6px 0 26px;
    margin-bottom: 34px;
    border-bottom: 2px solid var(--ink);
}

.article-kicker {
    font-size: 10.5px;
    letter-spacing: 4px;
    color: var(--accent);
}

.article-head h1 {
    margin: 12px 0 14px;
    font-family: var(--font-serif);
    font-size: clamp(28px, 4.2vw, 44px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 2px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.article-meta .dot {
    color: var(--gold);
}

.reading-frame {
    position: relative;
    padding: 52px 56px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
}

.reading-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold) 25%, var(--accent) 50%, var(--gold) 75%, transparent);
    opacity: 0.5;
}

.content-body {
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 2.2;
    color: var(--ink);
    text-align: justify;
}

.content-body p {
    margin: 0 0 1.05em;
    text-indent: 2em;
}

.content-body p:last-child {
    margin-bottom: 0;
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
    margin: 1.4em 0 0.7em;
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--ink);
    text-indent: 0;
}

.content-body h1 { font-size: 1.5em; }
.content-body h2 { font-size: 1.3em; }
.content-body h3 { font-size: 1.15em; }

.content-body blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 2px solid var(--line-2);
    color: var(--ink-2);
}

.content-body img {
    margin: 1em auto;
}

/* 上一卷 / 下一卷 */
.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 28px;
}

.pager .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    min-width: 0;
    background: var(--paper-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 13.5px;
    transition: all 0.18s ease;
}

.pager .nav-link:hover {
    border-color: var(--gold);
    color: var(--ink);
}

.pager .nav-link i {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--accent);
}

.pager .nav-link span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pager .nav-link em {
    font-style: normal;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ink-3);
}

.pager .nav-link.next {
    justify-content: flex-end;
    text-align: right;
}

.pager .nav-link.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.back-dir {
    margin-top: 26px;
    text-align: center;
}

.back-dir a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 26px;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 12.5px;
    letter-spacing: 1px;
}

.back-dir a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.back-dir i {
    color: var(--gold);
}

/* ---------- 搜索 ---------- */
.search-hero {
    padding: 16px 0 30px;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 6px;
}

.search-hero .hero-search {
    margin: 24px 0 0;
}

.search-meta {
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.search-meta strong {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--accent);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 11px;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 12.5px;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.empty-tip {
    padding: 56px 0;
    text-align: center;
    font-size: 13.5px;
    letter-spacing: 1px;
    color: var(--ink-3);
}

/* ---------- 页脚 ---------- */
.site-footer {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: var(--paper-2);
    padding: 44px 24px 34px;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.footer-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 16px;
    border-radius: 2px;
}

.footer-brand strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 17px;
    letter-spacing: 3px;
    color: var(--ink);
}

.footer-brand p {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--ink-3);
}

.footer-col h3 {
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--ink-3);
}

.footer-col a {
    display: block;
    padding: 3px 0;
    font-size: 12.5px;
    color: var(--ink-2);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-meta p {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--ink-3);
}

/* ---------- 返回顶部 ---------- */
#back-to-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--on-accent);
    border: 0;
    border-radius: 2px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-2);
    z-index: 900;
}

#back-to-top.show {
    display: flex;
}

/* ---------- 阅读设置 ---------- */
.read-tools {
    position: fixed;
    right: 26px;
    bottom: 82px;
    z-index: 901;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.read-tools button {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper-2);
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-1);
}

.read-tools button:hover,
.read-tools button.active {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

.settings-panel {
    position: fixed;
    right: 80px;
    bottom: 82px;
    width: 320px;
    padding: 20px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: var(--shadow-2);
    z-index: 902;
    display: none;
}

.settings-panel.show {
    display: block;
}

.settings-panel h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--ink);
}

.settings-panel h3 i {
    margin-right: 6px;
    color: var(--gold);
}

.settings-panel .close-btn {
    color: var(--ink-3);
    cursor: pointer;
    font-size: 13px;
}

.settings-panel .close-btn:hover {
    color: var(--accent-2);
}

.setting-group {
    margin-bottom: 16px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group > label {
    display: block;
    margin-bottom: 7px;
    font-size: 11.5px;
    letter-spacing: 1px;
    color: var(--ink-3);
}

.setting-group > label i {
    margin-right: 4px;
    color: var(--gold);
}

.setting-group .options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.setting-group .options button {
    flex: 1;
    min-width: 44px;
    padding: 6px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-2);
    font-size: 12px;
    cursor: pointer;
}

.setting-group .options button:hover {
    border-color: var(--gold);
}

.setting-group .options button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.bg-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.bg-options button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 6px 3px 5px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-3);
    font-size: 10px;
    cursor: pointer;
}

.bg-options button.active {
    border-color: var(--accent);
    color: var(--accent);
}

.bg-options .swatch {
    display: block;
    width: 100%;
    height: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.bg-options button[data-bg="default"] .swatch { background: linear-gradient(135deg, #fdfbf7, #f1e9d8); }
.bg-options button[data-bg="white"] .swatch { background: #ffffff; }
.bg-options button[data-bg="sepia"] .swatch { background: #f1e6cc; }
.bg-options button[data-bg="green"] .swatch { background: #e8f0e5; }
.bg-options button[data-bg="dark"] .swatch { background: #1c1a15; }

/* ---------- 移动端 ---------- */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 300;
    height: 58px;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.mobile-topbar .m-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--ink);
}

.mobile-topbar .m-brand i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    border-radius: 2px;
}

.mobile-topbar .m-toggle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 15px;
    cursor: pointer;
}

.mobile-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(20, 16, 10, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-mask.show {
    display: block;
    opacity: 1;
}

.sidebar .m-close {
    display: none;
}

@media (max-width: 1120px) {
    .sidebar {
        padding: 0 20px;
        gap: 16px;
    }

    .sidebar .nav-item {
        padding: 0 11px;
        font-size: 13.5px;
    }

    .sidebar .search-box {
        width: 180px;
    }

    .sidebar .footer-links {
        display: none;
    }
}

@media (max-width: 900px) {
    body {
        padding-top: 0;
    }

    .mobile-topbar {
        display: flex;
    }

    .bg-deco .deco-icon {
        opacity: 0.03;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        bottom: 0;
        width: 286px;
        max-width: 84vw;
        height: 100%;
        padding: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
        background: var(--paper-2);
        border-right: 1px solid var(--line);
        border-bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 400;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar .m-close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        border-bottom: 1px solid var(--line);
    }

    .sidebar .m-close .m-title {
        font-family: var(--font-serif);
        font-size: 16px;
        letter-spacing: 4px;
        color: var(--ink);
    }

    .sidebar .m-close button {
        width: 32px;
        height: 32px;
        border: 1px solid var(--line);
        background: transparent;
        color: var(--ink-2);
        cursor: pointer;
    }

    .sidebar .brand {
        display: block;
        padding: 18px 20px;
        border-bottom: 1px solid var(--line);
    }

    .sidebar .brand a {
        font-size: 17px;
    }

    .sidebar nav {
        flex-direction: column;
        flex: 0 0 auto;
        justify-content: flex-start;
        height: auto;
        padding: 6px 0;
    }

    .sidebar .nav-item {
        height: auto;
        padding: 13px 20px;
        font-size: 14px;
        border-bottom: 1px solid var(--line);
    }

    .sidebar .nav-item::before {
        left: 0;
        right: auto;
        top: 22%;
        bottom: 22%;
        width: 3px;
        height: auto;
        transform: scaleY(0);
    }

    .sidebar .nav-item:hover::before,
    .sidebar .nav-item.active::before {
        transform: scaleY(1);
    }

    .sidebar .nav-item .arrow {
        display: inline-block;
        margin-left: auto;
        font-size: 10px;
        color: var(--ink-3);
    }

    .sidebar .search-box {
        display: block;
        width: auto;
        margin: 0;
        padding: 14px 18px;
        border-bottom: 1px solid var(--line);
    }

    .sidebar .footer-links {
        display: flex;
        padding: 14px 18px;
        border-top: 1px solid var(--line);
        margin-top: auto;
    }

    .sidebar .copyright {
        display: block;
        padding: 0 18px 22px;
        font-size: 11px;
        line-height: 1.8;
        color: var(--ink-3);
        text-align: center;
    }

    .main-wrapper {
        padding: 22px 15px 0;
        min-height: auto;
    }

    .container {
        padding-bottom: 56px;
    }

    .home-hero {
        padding: 36px 0 32px;
    }

    .hero-title {
        font-size: 46px;
        letter-spacing: 8px;
        padding-left: 8px;
    }

    .hero-sub {
        font-size: 11.5px;
        letter-spacing: 2px;
    }

    .hero-search {
        height: 50px;
        margin-top: 26px;
        padding-left: 14px;
    }

    .hero-search button {
        height: 40px;
        padding: 0 18px;
        letter-spacing: 4px;
    }

    .stats-strip {
        gap: 24px;
        padding: 20px 0;
    }

    .stat-num {
        font-size: 21px;
    }

    .canon-grid {
        grid-template-columns: 1fr;
    }

    .canon-grid .canon-card {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        min-height: auto;
        padding: 20px;
    }

    .canon-grid .canon-card:last-child {
        border-bottom: 0;
    }

    .subcat-grid {
        grid-template-columns: 1fr;
    }

    .text-grid.cols-2,
    .text-grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .sec {
        margin-top: 40px;
    }

    .sec-head h2 {
        font-size: 19px;
    }

    .page-title {
        font-size: 30px;
        letter-spacing: 2px;
    }

    .reading-frame {
        padding: 24px 18px;
    }

    .content-body {
        font-size: 16px;
        line-height: 2;
    }

    .article-head h1 {
        font-size: 24px;
    }

    .pager {
        grid-template-columns: 1fr;
    }

    .pager .nav-link.next {
        justify-content: flex-start;
        text-align: left;
    }

    .pager .nav-link.next i {
        order: -1;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .site-footer {
        padding: 32px 16px 26px;
    }

    .settings-panel {
        left: 14px;
        right: 14px;
        bottom: 76px;
        width: auto;
    }

    .read-tools {
        right: 14px;
        bottom: 66px;
    }

    #back-to-top {
        right: 14px;
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 480px) {
    .hero-sub {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .hero-search {
        padding-left: 12px;
    }

    .hero-search button {
        padding: 0 14px;
        letter-spacing: 3px;
    }

    .stats-strip {
        gap: 16px;
    }

    .stat-label {
        letter-spacing: 1.5px;
    }

    .hero-tags a {
        margin: 0 5px;
    }
}