/* ============================================================
   Tobpage · 普客网自研主题
   骨架：Butterfly × AnZhiYu（双栏卡片流 / 侧栏 / TOC / 页脚信息区）
   皮肤：暗黑西游（墨黑打底 · 鎏金主色 · 朱砂点缀 · 宣纸文字）
   换皮入口：只改下面两组 CSS 变量即可换主色与整体色调
   ============================================================ */

/* ---------- 变量：暗色（默认气质） ---------- */
:root {
  --gold: #c9a24b;
  --gold-bright: #e8c268;
  --gold-dim: rgba(201, 162, 75, .55);
  --red: #c8402a;
  --red-bright: #e2543a;
  --bg: #0c0b09;
  --bg-soft: #14110c;
  --card: #1a1712;
  --card-2: #211c14;
  --text: #e8e0cd;
  --text-strong: #f4ecd9;
  --text-dim: #a79c86;
  --border: rgba(201, 162, 75, .20);
  --border-soft: rgba(201, 162, 75, .12);
  --shadow: 0 10px 34px rgba(0, 0, 0, .48);
  --shadow-hover: 0 18px 44px rgba(0, 0, 0, .62);
  --quote-bg: rgba(201, 162, 75, .06);
  --code-bg: #100e0a;
  --header-bg: rgba(12, 11, 9, .82);
  --radius: 16px;
  --radius-sm: 12px;
  --font-title: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-poem: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", var(--font-title);
  --font-li: "LiSu", "STLiti", "STLibian", "Baoli SC", "Baoli TC", "隶书", var(--font-kai); /* 主旨语隶书：Win 隶书/华文隶体、苹果报隶，缺失时回退楷体 */
  --motto: var(--red-bright); /* 主旨语专用朱砂：暗底走提亮赤，浅色随 --red-bright 变深保证纸面可读 */
}

/* ---------- 变量：浅色（深灰纸面，沉稳版） ---------- */
[data-theme="light"] {
  --gold: #9a7a2e;
  --gold-bright: #b8912f;
  --gold-dim: rgba(154, 122, 46, .5);
  --red: #b23a24;
  --red-bright: #c0452c;
  --bg: #e9e2d0;
  --bg-soft: #efe8d8;
  --card: #f6f1e3;
  --card-2: #efe7d3;
  --text: #29241a;
  --text-strong: #171307;
  --text-dim: #6f6450;
  --border: rgba(122, 94, 32, .28);
  --border-soft: rgba(122, 94, 32, .16);
  --shadow: 0 10px 30px rgba(64, 48, 12, .14);
  --shadow-hover: 0 18px 40px rgba(64, 48, 12, .22);
  --quote-bg: rgba(154, 122, 46, .08);
  --code-bg: #e3dac2;
  --header-bg: rgba(233, 226, 208, .85);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 85% -80px, rgba(201, 162, 75, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 240px, rgba(200, 64, 42, .045), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
a { color: var(--gold); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-bright); }
img { max-width: 100%; }
::selection { background: var(--gold); color: #14100a; }
h1, h2, h3, h4 { font-family: var(--font-title); color: var(--text-strong); line-height: 1.4; }

#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright) 55%, var(--red-bright));
  z-index: 1200;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  height: 62px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-strong); }
.brand:hover { color: var(--text-strong); }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 75, .15); object-fit: cover; }
.brand-name { font-family: var(--font-title); font-size: 21px; font-weight: 700; letter-spacing: .12em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: 7px 14px; border-radius: 999px; color: var(--text);
  font-size: 15px; transition: background .2s ease, color .2s ease;
}
.site-nav ul a:hover { background: rgba(201, 162, 75, .13); color: var(--gold-bright); }
.site-nav ul a.active { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); color: #171204; font-weight: 600; }
.nav-actions { display: flex; gap: 6px; margin-left: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-soft);
  background: transparent; color: var(--text); cursor: pointer;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-bright); transform: translateY(-1px); }
#nav-toggle { display: none; margin-left: auto; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 460px; max-height: 560px; height: 62vh;
  display: flex; align-items: center; justify-content: center;
  background: #060504;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: var(--hero-img);
  background-size: cover; background-position: center 30%;
}
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(6, 5, 4, .42) 0%, rgba(6, 5, 4, .18) 38%, rgba(12, 11, 9, .88) 88%, var(--bg) 100%),
    radial-gradient(680px 320px at 50% 46%, rgba(6, 5, 4, .38), transparent 70%),
    radial-gradient(720px 320px at 50% 42%, rgba(201, 162, 75, .13), transparent 65%);
}
.hero-content { text-align: center; padding: 56px 20px 84px; max-width: 860px; }
.hero-title {
  margin: 0 0 12px; font-size: clamp(46px, 8vw, 84px); font-weight: 900; letter-spacing: .14em;
  background: linear-gradient(100deg, #8a6a24 0%, var(--gold-bright) 38%, #f7e3a1 52%, var(--gold) 78%, #7c5f1e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 42px rgba(201, 162, 75, .0);
}
/* 站名整图（params.tobpage.titleImage）：书法大字与印章合成一图，构图在图内定死，
   不受访客设备字体与排版差异影响；Hero 与开场动画共用，动画处等比缩小 */
.hero-title-imgwrap { margin: 0 0 10px; line-height: 0; }
.hero-title-img { width: min(430px, 84vw); height: auto; }
/* 主旨语：隶书加粗 + 朱砂 + 两侧黯金细线，与鎏金大标题拉开古朴差别（Hero 与开场动画同一套；2026-11-09 放大、改隶书定版） */
.hero-motto {
  display: flex; align-items: center; justify-content: center; gap: .85em;
  font-family: var(--font-li); font-weight: 700; color: var(--motto);
  letter-spacing: .32em; margin: 0 0 14px; font-size: 29px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
  white-space: nowrap; /* 主旨语全宽度单行、保持居中 */
}
.hero-motto::before, .hero-motto::after { content: ""; flex: 0 0 34px; height: 1px; }
.hero-motto::before { background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.hero-motto::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.hero-sub { color: #ddd3ba; font-size: 15px; margin: 0 auto 18px; max-width: 620px; text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.hero-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.hero-stats span {
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px; color: #e9dfc4;
  border: 1px solid rgba(232, 194, 104, .45); background: rgba(10, 8, 5, .45); backdrop-filter: blur(4px);
}
.hero-btn {
  display: inline-block; padding: 11px 34px; border-radius: 999px; font-weight: 700; letter-spacing: .2em; text-indent: .2em;
  color: #171204; background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 10px 28px rgba(201, 162, 75, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-btn:hover { color: #171204; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(201, 162, 75, .45); }
.hero-clouds, .footer-clouds, .nf-clouds {
  height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60' preserveAspectRatio='none'%3E%3Cpath d='M12 52c-7 0-12-4-12-10 0-5 4-9 9-10C11 24 18 18 26 18c3-7 10-11 18-11 9 0 16 5 19 13 9-2 19 2 23 9 7 1 12 6 12 12 0 7-6 11-13 11z' fill='%23c9a24b' fill-opacity='0.20'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: auto 100%;
}
.hero-clouds { position: absolute; left: 0; right: 0; bottom: 0; opacity: .5; }

/* ---------- 布局 ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 34px 20px 10px; }
.container-narrow { max-width: 860px; }
.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.content-col { min-width: 0; display: flex; flex-direction: column; gap: 22px; }

/* ---------- 文章卡片（蝴蝶骨架 + Heo 卡片风） ---------- */
.post-card {
  display: flex; gap: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border); }
.post-card-cover { flex: 0 0 37%; max-width: 340px; overflow: hidden; display: block; }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.post-card:hover .post-card-cover img { transform: scale(1.06); }
.post-card-body { padding: 22px 24px; display: flex; flex-direction: column; min-width: 0; }
.post-card-title { margin: 0 0 8px; font-size: 21px; }
.post-card-title a { color: var(--text-strong); }
.post-card-title a:hover { color: var(--gold-bright); }
.post-card-summary { margin: 0 0 auto; color: var(--text-dim); font-size: 14.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-meta { margin-top: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--text-dim); font-size: 13px; }
.meta-sep { margin: 0 5px; opacity: .6; }
.meta-cat { color: var(--gold); border: 1px solid var(--border); border-radius: 999px; padding: 0 10px; font-size: 12.5px; line-height: 1.8; }
.meta-cat:hover { background: rgba(201, 162, 75, .12); }

/* ---------- 侧栏（粘性组件群） ---------- */
.sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.widget {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.widget-title {
  font-family: var(--font-title); font-size: 17px; font-weight: 700; color: var(--text-strong);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
}
.widget-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--gold); flex: 0 0 auto; }
.author-card { text-align: center; }
.author-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; margin-top: 4px;
  border: 2px solid var(--gold); box-shadow: 0 0 0 5px rgba(201, 162, 75, .14), 0 10px 24px rgba(0,0,0,.35);
}
.author-name { font-family: var(--font-title); font-size: 20px; font-weight: 700; color: var(--text-strong); margin-top: 12px; letter-spacing: .1em; }
.author-desc { color: var(--text-dim); font-size: 13.5px; margin: 6px 0 16px; line-height: 1.7; }
.author-stats { display: flex; justify-content: center; gap: 30px; margin-bottom: 16px; }
.author-stats div { display: flex; flex-direction: column; }
.author-stats strong { font-size: 19px; color: var(--gold-bright); font-family: var(--font-title); }
.author-stats span { font-size: 12px; color: var(--text-dim); }
.social-icons { display: flex; gap: 10px; justify-content: center; }
.author-card .social-icons { margin-top: 2px; }
.social-icons a {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--border); color: var(--text-dim);
  transition: all .2s ease;
}
.social-icons a:hover { color: #171204; background: linear-gradient(120deg, var(--gold), var(--gold-bright)); border-color: transparent; transform: translateY(-2px); }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 14.5px;
}
.cat-list li a:hover { background: rgba(201, 162, 75, .1); color: var(--gold-bright); }
.cat-count { background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--gold); border-radius: 999px; padding: 0 9px; font-size: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 3px 12px; border-radius: 999px; font-size: 13px; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--border-soft);
}
.tag-cloud a sup { color: var(--gold); margin-left: 3px; }
.tag-cloud a:hover { border-color: var(--gold); color: var(--gold-bright); }
.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.recent-list a { color: var(--text); font-size: 14.5px; line-height: 1.55; display: block; }
.recent-list a:hover { color: var(--gold-bright); }
.recent-list time { color: var(--text-dim); font-size: 12px; }

/* ---------- TOC ---------- */
.toc-widget { padding-bottom: 12px; }
.toc-body nav ul { list-style: none; margin: 0; padding: 0; }
.toc-body nav ul ul { padding-left: 15px; }
.toc-body a {
  display: block; padding: 5px 8px; border-radius: 8px; color: var(--text-dim); font-size: 13.5px; line-height: 1.55;
  border-left: 2px solid transparent;
}
.toc-body a:hover { color: var(--gold-bright); background: rgba(201, 162, 75, .08); }
.toc-body a.toc-active { color: var(--gold-bright); border-left-color: var(--gold); background: rgba(201, 162, 75, .1); font-weight: 600; }

/* ---------- 文章页 ---------- */
.post {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 40px 40px;
}
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: 13px; color: var(--text-dim); }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--gold-bright); }
.crumb-current { color: var(--gold); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-title { font-size: clamp(27px, 4vw, 37px); margin: 16px 0 12px; letter-spacing: .02em; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--text-dim); font-size: 13.5px; padding-bottom: 20px; border-bottom: 1px solid var(--border-soft); }
.post-cover { margin: 24px 0 8px; }
.post-cover img { width: 100%; border-radius: 14px; border: 1px solid var(--border-soft); box-shadow: var(--shadow); display: block; }
.post-content { font-size: 16.5px; line-height: 1.9; overflow-wrap: break-word; }
.post-content p { margin: 1.1em 0; }
.post-content h2 {
  font-size: 24px; margin: 1.7em 0 .7em; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.post-content h2::before { content: "☁"; color: var(--gold); font-size: 15px; margin-right: 9px; vertical-align: 3px; }
.post-content h3 { font-size: 19.5px; margin: 1.5em 0 .6em; }
.post-content h3::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--gold); margin-right: 9px; vertical-align: 2px; }
.post-content img { border-radius: 14px; border: 1px solid var(--border-soft); box-shadow: var(--shadow); cursor: zoom-in; }
.post-content a { border-bottom: 1px dashed var(--gold-dim); }
.post-content a:hover { border-bottom-style: solid; }
.post-content ul, .post-content ol { padding-left: 1.5em; }
.post-content li { margin: .35em 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2.2em auto; width: 62%; }
.post-content table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 14.5px; }
.post-content th, .post-content td { border: 1px solid var(--border-soft); padding: 8px 12px; }
.post-content th { background: var(--bg-soft); font-family: var(--font-title); }
.post-content code { background: var(--code-bg); border: 1px solid var(--border-soft); border-radius: 6px; padding: 1px 6px; font-size: .88em; }
.post-content pre { background: var(--code-bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; }
.post-content pre code { background: none; border: none; padding: 0; }

/* 诗词引文（诗歌排版 · 深色可读性专项） */
.post-content blockquote {
  font-family: var(--font-poem);
  font-size: 1.14em; line-height: 2.0; letter-spacing: .02em;
  color: var(--text-strong);
  background: var(--quote-bg);
  border: none; border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.4em 0; padding: 18px 26px;
}
.post-content blockquote p { margin: .2em 0; }

.post-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.post-tags a {
  padding: 4px 14px; border-radius: 999px; font-size: 13.5px; color: var(--gold);
  border: 1px solid var(--border); background: rgba(201, 162, 75, .06);
}
.post-tags a:hover { background: rgba(201, 162, 75, .15); }
.post-nav { display: flex; gap: 16px; margin-top: 30px; }
.post-nav-link {
  flex: 1; display: flex; flex-direction: column; gap: 5px;
  padding: 15px 18px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); min-width: 0;
}
.post-nav-link span { font-size: 12.5px; color: var(--text-dim); }
.post-nav-link strong { font-family: var(--font-title); font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-nav-link.next { text-align: right; }
.post-nav-link:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- 列表头 / 分类标签页 ---------- */
.list-header { padding: 6px 2px 2px; }
.list-header h1 { font-size: 30px; margin: 0 0 6px; }
.list-header p { color: var(--text-dim); margin: 0; }
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.term-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.term-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--shadow-hover); color: var(--text); }
.term-name { font-family: var(--font-title); font-size: 20px; font-weight: 700; color: var(--text-strong); }
.term-count { color: var(--gold); font-size: 13px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 8px 0 18px; flex-wrap: wrap; }
.page-btn {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border-soft);
  background: var(--card); color: var(--text); font-size: 14px;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.page-btn.current { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); color: #171204; border-color: transparent; font-weight: 700; }

/* ---------- 归档时间线 ---------- */
.timeline { max-width: 860px; }
.timeline-year { margin-bottom: 34px; }
.timeline-year-title { font-size: 25px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; }
.timeline-count { font-size: 13px; color: var(--gold); font-family: var(--font-body); font-weight: 400; }
.timeline-month { margin: 18px 0 0 6px; padding-left: 22px; border-left: 2px solid var(--border-soft); position: relative; }
.timeline-month::before {
  content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--gold);
}
.timeline-month-title { font-size: 18px; margin: 0 0 10px; display: flex; gap: 9px; align-items: baseline; }
.timeline-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.timeline-list li { display: flex; gap: 14px; align-items: baseline; }
.timeline-list time { color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.timeline-list a { color: var(--text); }
.timeline-list a:hover { color: var(--gold-bright); }

/* ---------- 搜索 ---------- */
.search-box {
  display: flex; align-items: center; gap: 12px; padding: 6px 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow); color: var(--text-dim);
}
.search-box input {
  flex: 1; border: none; outline: none; background: transparent; color: var(--text);
  font-size: 17px; padding: 12px 0; font-family: var(--font-body);
}
.search-hint { color: var(--text-dim); font-size: 13.5px; margin: 16px 4px 20px; }
.search-results { display: flex; flex-direction: column; gap: 16px; padding-bottom: 30px; }
.search-result {
  display: block; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); color: var(--text);
}
.search-result:hover { border-color: var(--gold); color: var(--text); }
.search-result h3 { margin: 0 0 6px; font-size: 18.5px; }
.search-result p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.search-result time { color: var(--gold); font-size: 12.5px; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-top: 70px; padding-bottom: 80px; }
.nf-clouds { margin: 0 auto 8px; max-width: 420px; opacity: .8; }
.nf-code {
  font-family: var(--font-title); font-size: clamp(84px, 16vw, 140px); font-weight: 900; line-height: 1;
  background: linear-gradient(100deg, #8a6a24, var(--gold-bright) 50%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.not-found h1 { font-size: 30px; margin: 14px 0 8px; }
.not-found p { color: var(--text-dim); margin: 0 0 30px; }
.nf-actions { display: flex; gap: 18px; justify-content: center; align-items: center; }
.nf-link { color: var(--text-dim); border-bottom: 1px dashed var(--gold-dim); }

/* ---------- 页脚（信息区） ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--border-soft); background: var(--bg-soft); }
.footer-clouds { transform: scaleY(-1); opacity: .35; margin-top: -1px; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 36px 20px 8px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px;
}
.footer-brand { font-family: var(--font-title); font-size: 23px; font-weight: 700; letter-spacing: .12em; color: var(--text-strong); }
.footer-text { color: var(--text-dim); font-size: 14px; margin: 9px 0 16px; }
.footer-about .social-icons { justify-content: flex-start; }
.footer-title { font-family: var(--font-title); font-weight: 700; color: var(--text-strong); margin-bottom: 13px; font-size: 16px; }
.footer-links, .footer-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--text-dim); font-size: 14px; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--gold-bright); }
.footer-bottom {
  max-width: 1240px; margin: 0 auto; padding: 18px 20px 26px;
  border-top: 1px solid var(--border-soft); margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 7px; justify-content: center;
  color: var(--text-dim); font-size: 13.5px; text-align: center;
}
.footer-bottom a { color: var(--text-dim); border-bottom: 1px dashed var(--gold-dim); }
.footer-bottom a:hover { color: var(--gold-bright); }
.footer-bottom .dot { opacity: .55; }

/* ---------- 回到顶部 ---------- */
#back-to-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 1100;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--gold); background: var(--card); color: var(--gold);
  cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
#back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
#back-to-top:hover { background: linear-gradient(120deg, var(--gold), var(--gold-bright)); color: #171204; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .layout-2col { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  #nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px 16px;
    background: var(--header-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-soft);
    background: var(--bg); /* 移动抽屉用近实底，避免 backdrop-filter 不生效时透出正文显得乱 */
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: 10px 14px; }
  .nav-actions { margin: 10px 0 0; padding-left: 6px; }
  .hero { height: auto; min-height: 400px; }
  .post-card { flex-direction: column; }
  .post-card-cover { flex: none; max-width: none; height: 190px; }
  .post { padding: 24px 20px 30px; }
  .post-nav { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; }
  .container { padding-top: 24px; }
}

/* ---------- 图标（内联 SVG sprite 引用） ---------- */
.ic { display: inline-block; vertical-align: -0.14em; flex: 0 0 auto; }

/* ---------- 页眉栏目导航（下拉） ---------- */
.site-nav .nav-list { align-items: center; }
.nav-item { position: relative; }
.site-nav .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; color: var(--text); font-size: 15px; white-space: nowrap;
}
.site-nav .nav-link.active { background: linear-gradient(90deg, var(--gold), var(--gold-bright)); color: #171204; font-weight: 600; }
.site-nav .nav-link.active .ic { color: #171204 !important; }
.nav-caret { opacity: .75; transition: transform .2s ease; }
.has-drop:hover .nav-caret, .has-drop:focus-within .nav-caret, .has-drop.open .nav-caret { transform: rotate(180deg); }
.site-nav .nav-drop {
  position: absolute; top: 100%; left: 50%; z-index: 1001;
  min-width: 198px; margin: 8px 0 0; padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-hover);
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.site-nav .nav-drop::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.has-drop:hover .nav-drop, .has-drop:focus-within .nav-drop {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
.site-nav .nav-drop a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 10px; color: var(--text); font-size: 14.5px;
}
.site-nav .nav-drop a:hover { background: rgba(201, 162, 75, .10); color: var(--gold-bright); }
.nav-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- 分类胶囊（卡片/文章页，颜色走 --cat 变量） ---------- */
.meta-cat.cat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text);
  border-color: color-mix(in srgb, var(--cat) 55%, transparent);
  background: color-mix(in srgb, var(--cat) 13%, transparent);
}
.meta-cat.cat-chip .ic { color: var(--cat); }
.meta-cat.cat-chip:hover {
  color: var(--text-strong);
  background: color-mix(in srgb, var(--cat) 24%, transparent);
  border-color: var(--cat);
}
.post-meta .cat-chip + .cat-chip { margin-left: 6px; }

/* ---------- 分类页：大图标徽章 + 分组索引 ---------- */
.term-header { display: flex; align-items: center; gap: 18px; }
.term-badge {
  flex: 0 0 auto; width: 76px; height: 76px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid color-mix(in srgb, var(--cat) 55%, transparent);
  background: color-mix(in srgb, var(--cat) 13%, transparent);
  box-shadow: var(--shadow);
}
.term-heading h1 { margin: 0 0 4px; }
.term-heading p { margin: 0; }
.cat-group { margin-top: 36px; scroll-margin-top: 84px; }
.cat-group-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 22px; margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.term-card.cat-card { align-items: flex-start; gap: 9px; border-top: 3px solid var(--cat); }
.term-card.cat-card:hover { border-color: var(--border-soft); border-top-color: var(--cat); }
.cat-card-icon {
  width: 58px; height: 58px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cat) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat) 40%, transparent);
}
.term-card.is-empty { opacity: .55; box-shadow: none; }
.term-card.is-empty:hover { transform: none; }

/* ---------- 侧栏分类列表（图标 + 计数右置） ---------- */
.cat-list li a { justify-content: flex-start; gap: 8px; }
.cat-list .cat-count { margin-left: auto; }

/* ---------- 栏目导航 · 移动端（手风琴） ---------- */
@media (max-width: 720px) {
  .site-nav .nav-list { align-items: stretch; }
  .site-nav .nav-link { display: flex; width: 100%; }
  .site-nav .nav-drop {
    position: static; min-width: 0; margin: 0; padding: 2px 0 6px 16px;
    display: none; opacity: 1; visibility: visible; transform: none;
    background: transparent; border: none; box-shadow: none; transition: none;
  }
  .site-nav .nav-drop::before { display: none; }
  /* 桌面 hover/focus 规则特异性 0,3,0，其 transform 会漏进移动端把展开的子菜单推出屏外，
     必须在同等特异性上把 transform 一并重置（见 DESIGN.md「移动端菜单 bug 根因」）。 */
  .has-drop:hover .nav-drop, .has-drop:focus-within .nav-drop { display: none; transform: none; }
  .has-drop.open .nav-drop { display: flex; transform: none; opacity: 1; visibility: visible; }
  .term-header { gap: 13px; }
  .term-badge { width: 60px; height: 60px; border-radius: 16px; }
}

/* ---------- 开场动画（大圣驾筋斗云 · preloader · 两段式） ----------
   仅当 <html> 带 .show-preloader（head 引导脚本判定：首页 + 非减动效）时显示；
   第一段 v11「在飞」（加载中）→ load 触发（或最迟 1.9s）crossfade 到第二段 v12「指南天门」收尾，
   收尾图停留约 500ms 后整体淡出；3 秒硬上限必退场（baseof 内联兜底 + tobpage.js 双保险）。 */
#preloader {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: #0c0b09;
  align-items: center; justify-content: center;
}
html.show-preloader #preloader { display: flex; }
#preloader.pl-done { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .55s ease, visibility .55s; }
.pl-inner { position: relative; display: flex; flex-direction: column; align-items: center; padding: 20px; transition: transform .45s ease; }
#preloader.pl-arrive .pl-inner { transform: scale(.97); } /* 抵达时轻微收束，像落定 */
.pl-swirl {
  position: absolute; top: 50%; left: 50%; width: 300px; height: 300px;
  transform: translate(-50%, -58%);
  color: var(--gold); opacity: .35;
  animation: pl-spin 26s linear infinite;
}
.pl-fly { position: relative; animation: pl-in .85s cubic-bezier(.22, .8, .3, 1) both; }
.pl-wukong {
  /* 两段图均为 660×778 纯黑底定版，不用径向遮罩裁边；
     纯黑底靠 mix-blend-mode: screen 与 overlay 融合（黑像素在 screen 下即透明）。 */
  width: min(74vw, 320px); height: auto; display: block;
  mix-blend-mode: screen;
  transition: opacity .3s ease;
  animation: pl-bob 2.3s ease-in-out .85s infinite alternate;
}
.pl-img-b { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
#preloader.pl-arrive .pl-img-a { opacity: 0; }
#preloader.pl-arrive .pl-img-b { opacity: 1; }
.pl-name {
  margin-top: 6px; line-height: 1.25;
  font-family: var(--font-title); font-size: 27px; font-weight: 600;
  color: var(--gold-bright); letter-spacing: .5em; text-indent: .5em;
  animation: pl-fade .8s ease .35s both;
}
/* 动画站名钤印：与 Hero 同规，印章定位于站名右下角 */
/* 动画站名整图：与 Hero 同图等比缩小 */
.pl-title-imgwrap { margin-top: 10px; line-height: 0; animation: pl-fade .8s ease .35s both; }
.pl-title-img { width: 176px; height: auto; }
.pl-motto {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: .85em;
  font-family: var(--font-li); font-weight: 700; font-size: 23px;
  color: var(--motto); letter-spacing: .32em;
  white-space: nowrap; /* 与 Hero 主旨行同口径：全宽度单行 */
  animation: pl-fade .8s ease .65s both;
}
.pl-motto::before, .pl-motto::after { content: ""; flex: 0 0 26px; height: 1px; }
.pl-motto::before { background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.pl-motto::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.pl-bar {
  margin-top: 18px; width: 168px; height: 2px; border-radius: 2px;
  background: rgba(201, 162, 75, .16); overflow: hidden;
  animation: pl-fade .8s ease .5s both;
}
.pl-bar span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transform-origin: left;
  animation: pl-scan 1.15s ease-in-out infinite;
}
@keyframes pl-in {
  from { opacity: 0; transform: translateX(-64px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pl-bob {
  from { transform: translateY(-7px); }
  to { transform: translateY(7px); }
}
@keyframes pl-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pl-scan {
  0% { transform: scaleX(0); transform-origin: left; }
  55% { transform: scaleX(1); transform-origin: left; }
  56% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}
@keyframes pl-spin {
  from { transform: translate(-50%, -58%) rotate(0deg); }
  to { transform: translate(-50%, -58%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  #preloader { display: none !important; }
}
/* 窄屏主旨行逐档收紧：字距收紧、字号与印章略降，保证整句一行、印章紧跟句号（2026-11-08 折行修复口径，2026-11-09 放大后沿用） */
@media (max-width: 720px) {
  .hero-motto { font-size: 24px; letter-spacing: .26em; }
  .pl-name { line-height: 1.2; }
  .pl-motto { font-size: 20px; letter-spacing: .26em; }
}
@media (max-width: 480px) {
  .hero-motto { letter-spacing: .18em; font-size: 20px; gap: .5em; }
  .hero-motto::before, .hero-motto::after { flex-basis: 12px; }
  .hero-sub { font-size: 14px; }
  .pl-motto { letter-spacing: .18em; font-size: 18px; gap: .5em; }
  .pl-motto::before, .pl-motto::after { flex-basis: 12px; }
  .pl-title-img { width: 138px; }
}
