/* =========================================================
   高性价比人生指南 · 设计系统
   视觉概念:「蜜橘炭黑 · 海报式暖调」——暖奶油底、炭黑正文、亮黄荧光标记 + 烧橘动作色

   颜色令牌与使用比例(按页面面积):
   - background  ~68%  页面底色(冷白)
   - surface     ~22%  卡片/面板
   - surface-elevated ~2% 浮起元素(悬浮按钮、抽屉、抽查卡)
   - text-primary ~6%  正文与小标题(炭黑)
   - text-secondary ~2% 说明文字
   - border      细虚结构线,可忽略面积
   - primary     ≤3% 暗朱红实底按钮、勾选、当前页(编辑红)
   - secondary   ≤1% 成功/完成语义(常青绿)
   - accent      ≤0.5% 朱红标记:证据A、高收益、选区;淡粉灰作浅底
   - success/warning/danger 仅语义场景(零成本/需注意/高风险)
   - 分类色(数据可视化):朱红=证据A 高收益;琥珀=B 需注意;青灰蓝=时间;酒红=高风险;灰=C/中性

   反模板纪律:无渐变;朱红为印刷墨红非警示红;无边框堆砌;
   层级 = 字号(18px 基准) + 留白(节间最大 116px) + 色深三级,不靠框线和阴影堆砌。

   协同规则:排版(账目式列表+目录点线思维)、密度(§01 密、导览疏)、
   边框处理(仅 3px 节线与 1px 发丝线)、等宽数字用于一切量值。

   字体系统:Display/Heading 黑体 800 · Body 长文段落宋体族(思源宋→宋体)
   · Label/Caption 黑体 · Data/Numeric 等宽 700——黑体标题 × 宋体正文 × 等宽数据。
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong",
    SimSun, "宋体", serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", "JetBrains Mono",
    "Courier New", monospace;
  --max-w: 1280px;
  --header-h: 64px;
  --radius: 4px;
}

/* 日间:暖奶油与蜜橘(海报式暖调) */
html[data-theme="light"] {
  color-scheme: light;
  /* 表面层:背景 ~68% / 表面 ~22% / 浮起 ~2% */
  --bg: #fbf3e4;            /* background 暖奶油 */
  --surface: #fffbf2;       /* surface 卡片/面板 */
  --surface-2: #f1e6ce;     /* surface-recessed 内嵌区 */
  --surface-elevated: #fffdf8; /* surface-elevated 浮起元素 */

  /* 文字 ~6%:primary 正文 / secondary 次级 / 三级仅短标注 */
  --ink: #1a1210;           /* text-primary 炭黑 */
  --ink-2: #4e4238;         /* text-secondary */
  --ink-3: #75675a;         /* 三级标注(AA 校验) */

  --line: rgba(26, 18, 16, 0.14); /* border 极细结构线 */
  --brand: #a94503;         /* brand 烧橘:大字强调 */
  --brand-soft: rgba(169, 69, 3, 0.08);
  --brand-contrast: #fdfaf2;

  /* 语义动作色 ≤4% */
  --primary: #a94503;       /* 主动作:烧橘实底 + 奶油字(亮橘 #E8590C 用于图形装饰) */
  --primary-fg: #fdfaf2;
  --primary-soft: var(--brand-soft);
  --secondary: #37703f;     /* 常青绿:成功/完成 */
  --secondary-soft: rgba(55, 112, 63, 0.14);
  --accent: #ffd43b;        /* 亮黄荧光:证据A/高收益/选区(配墨字) */
  --accent-fg: #1a1210;
  --accent-soft: rgba(255, 212, 59, 0.35); /* 漫画大面积铺色 */

  --success: var(--secondary);
  --warning: #8f5806;       /* 琥珀:需注意(文字级) */
  --warning-soft: rgba(143, 88, 6, 0.16);
  --danger: #a61919;        /* 正红:高风险 */
  --danger-fg: #fdf4f1;

  --grade-a: var(--accent);       /* 证据 A:亮黄荧光章 */
  --grade-a-fg: var(--accent-fg);
  --grade-b: #8f5806;       /* 证据 B:琥珀 */
  --grade-b-soft: var(--warning-soft);
  --grade-b-fg: #8f5806;
  --ok: #37703f;            /* 零成本:常青绿 */
  --ok-fg: #eff4ec;
  --ok-soft: var(--secondary-soft);
  --info: #4b6a88;          /* 时间:青灰蓝 */
  --info-soft: rgba(75, 106, 136, 0.14);
  --gain: var(--accent);
  --stamp-solid-fg: #1a1210;
  --header-bg: rgba(255, 251, 242, 0.92);
}

/* 夜间:炭黑与亮橘(暗夜海报) */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17120e;            /* 炭黑 */
  --surface: #211a14;
  --surface-2: #2b231b;
  --surface-elevated: #29221a;
  --ink: #f5ede0;
  --ink-2: #b9ab99;
  --ink-3: #8f8374;
  --line: rgba(245, 237, 224, 0.12);
  --brand: #ff9a4d;         /* 亮蜜橘:暗色品牌色 */
  --brand-soft: rgba(255, 154, 77, 0.14);
  --brand-contrast: #17120e;

  --primary: #f5893f;       /* 暗色主动作:亮蜜橘实底 + 深字,AA 7.6 */
  --primary-fg: #17120e;
  --primary-soft: var(--brand-soft);
  --secondary: #86b394;     /* 常青绿 */
  --secondary-soft: rgba(134, 179, 148, 0.18);
  --accent: #ffd43b;        /* 亮黄荧光 */
  --accent-fg: #1a1210;
  --accent-soft: rgba(255, 212, 59, 0.2); /* 漫画大面积铺色 */

  --success: var(--secondary);
  --warning: #e3b55e;       /* 亮琥珀:需注意 */
  --warning-soft: rgba(227, 181, 94, 0.2);
  --danger: #f0755c;        /* 亮珊瑚:高风险 */
  --danger-fg: #1a0f0d;

  --grade-a: var(--accent);
  --grade-a-fg: var(--accent-fg);
  --grade-b: #e3b55e;       /* 证据 B:亮琥珀 */
  --grade-b-soft: var(--warning-soft);
  --grade-b-fg: #e3b55e;
  --ok: #86b394;            /* 零成本:常青绿 */
  --ok-fg: #17120e;
  --ok-soft: var(--secondary-soft);
  --info: #a7b9cf;          /* 时间:青灰蓝 */
  --info-soft: rgba(167, 185, 207, 0.3);
  --gain: var(--accent);
  --stamp-solid-fg: #1a1210;
  --header-bg: rgba(33, 26, 20, 0.92);
}

/* 切换主题的瞬间禁用所有过渡,避免颜色闪现 */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
  animation: none !important;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-fg); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

a { color: inherit; }

.mono { font-family: var(--font-mono); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: var(--brand-contrast);
  padding: 8px 14px;
  z-index: 99;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- 统一顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  flex: none;
}
.brand-mark i {
  display: block;
  height: 2px;
  background: var(--primary);
  width: 14px;
}
.brand-mark i:nth-child(2) { width: 10px; }

.brand-text { line-height: 1.25; }
.brand-text strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-text small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 24px;
}
.site-nav a {
  font-size: 16px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--primary); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  color: var(--ink-2);
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s;
}
.theme-toggle:hover { color: var(--primary); }
.theme-toggle .ic { width: 16px; height: 16px; display: none; }
html[data-theme-mode="auto"] .ic-auto { display: block; }
html[data-theme-mode="light"] .ic-light { display: block; }
html[data-theme-mode="dark"] .ic-dark { display: block; }

.nav-toggle {
  display: none;
  border: none;
  background: none;
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .ic-close { display: none; }
.nav-toggle[aria-expanded="true"] .ic-menu { display: none; }
.nav-toggle[aria-expanded="true"] .ic-close { display: block; }

/* ---------- 报头 ---------- */
.masthead { padding: clamp(36px, 5vw, 68px) 0 8px; }

.masthead-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
}

.mast-meta {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.masthead h1 {
  font-size: clamp(32px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.masthead h1 em {
  font-style: normal;
  color: var(--brand);
}

.mast-sub {
  margin-top: 20px;
  font-size: 19px;
  font-family: var(--font-serif);
  color: var(--ink-2);
  max-width: 42em;
}
.mast-sub strong { color: var(--ink); }

.mast-actions {
  margin-top: 30px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.mast-free {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s, color 0.15s;
}
.btn-solid {
  background: var(--primary);
  color: var(--brand-contrast);
}
.btn-solid:hover { filter: brightness(1.1); }
.btn-ghost {
  padding: 12px 0;
  background: none;
  color: var(--ink-2);
}
.btn-ghost:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.mast-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  margin-top: clamp(32px, 5vw, 52px);
}

/* 每日抽查 */
.pick-card {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pick-label {
  font-size: 13px;
  color: var(--ink-3);
}
.pick-shuffle {
  border: none;
  background: none;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 4px 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.pick-shuffle:hover { color: var(--primary); }

.pick-title {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
}
.pick-desc {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-2);
}
.pick-stamps {
  margin-top: 12px;
  display: flex;
  gap: 0 10px;
  flex-wrap: wrap;
  row-gap: 6px;
}
.pick-src {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* 信息标注:浅底小徽章,证据等级带语义色 */
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  background: var(--surface-2);
  border-radius: 3px;
  color: var(--ink-2);
  white-space: nowrap;
}
/* 按值配色:实底=硬承诺(鲜明对比),浅底=参考值 */
.stamp-a {
  color: var(--accent-fg);
  background: var(--accent);
  font-weight: 700;
}
.stamp-b {
  color: var(--grade-b-fg);
  background: var(--grade-b-soft);
  font-weight: 700;
}
.stamp-c {
  color: var(--ink-2);
  background: var(--surface-2);
}
.stamp-ok {
  color: var(--ok-fg);
  background: var(--ok);
  font-weight: 700;
}
.stamp-warn {
  color: var(--grade-b-fg);
  background: var(--grade-b-soft);
}
.stamp-info {
  color: var(--info);
  background: var(--info-soft);
}
.stamp-gain {
  color: var(--accent-fg);
  background: var(--accent);
  font-weight: 700;
}

/* 书籍许可徽章:可商用=常青绿,非商用=酒红 */
.stamp-lic-ok {
  color: var(--ok-fg);
  background: var(--ok);
  font-weight: 700;
}
.stamp-lic-nc {
  color: var(--danger-fg);
  background: var(--danger);
  font-weight: 700;
}
.stamp-lic-na {
  color: var(--ink-3);
  background: var(--surface-2);
}

/* ---------- 插图占位(后面替换为真实插图) ---------- */
.illus { margin: 0; }
.illus svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}
.illus-slot {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--ink-3);
  text-align: center;
  padding: 16px;
}
.illus-slot .slot-t { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.illus-slot .slot-d { font-size: 12.5px; font-family: var(--font-mono); }
.illus-slot.square { aspect-ratio: 1 / 1; }
.illus-slot.wide { aspect-ratio: 21 / 9; }
.illus figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-3); }

/* ---------- 当前页导航高亮 ---------- */
.site-nav a[aria-current="page"] { color: var(--primary); font-weight: 700; }

/* ---------- 首页:四类导览卡 ---------- */
.cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.cat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.cat-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cat-card-head h3 { font-size: 17px; font-weight: 800; }
.cat-count { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.cat-intro {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-2);
}
.cat-card ul { list-style: none; margin-top: 12px; }
.cat-card li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-2);
  padding: 5px 0;
}
.cat-card li .cat-num {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
  flex: none;
}
.cat-more {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
}
.cat-more:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cat-all {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 4px;
}
.cat-all:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- 子页面通用 ---------- */
.page-head {
  padding-top: clamp(32px, 5vw, 60px);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.crumbs {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 20px;
}
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { margin: 0 9px; }
.page-head h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 800;
  line-height: 1.32;
}
.page-intro {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink-2);
  max-width: 46em;
}

/* ---------- 列表页:检索与筛选工具条 ---------- */
.chapter-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 26px;
}
.chapter-search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  max-width: 460px;
}
.chapter-search-label {
  flex: none;
  font-size: 12.5px;
  color: var(--ink-3);
}
.chapter-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 7px 1px 6px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.chapter-search input::placeholder { color: var(--ink-3); }
.chapter-search input:focus { border-bottom-color: var(--primary); }
.chapter-tools .view-toggle { margin-top: 0; }
.chapter-tools + .chip-tabs { margin-top: 16px; }
.chip-tabs[hidden] { display: none; }
.chapter-result {
  min-height: 1.5em;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.chapter-empty {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-2);
}
.chapter-empty[hidden] { display: none; }
.cat-list li[hidden] { display: none; }

/* ---------- 列表页:类别筛选 ---------- */
.chip-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  margin: 26px 0 4px;
}
.chip-tab {
  border: none;
  background: none;
  padding: 8px 2px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.chip-tab:hover { color: var(--ink); }
.chip-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}
.cat-group[hidden] { display: none; }
.cat-sec { scroll-margin-top: calc(var(--header-h) + 20px); }
.group-intro {
  font-size: 15px;
  color: var(--ink-2);
  margin: 2px 0 12px;
  max-width: 60ch;
}

/* 排序方式切换:按分类 / 按章节顺序 */
.view-toggle {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.vt-label {
  font-size: 12.5px;
  color: var(--ink-3);
}
.vt-btn {
  border: none;
  background: none;
  padding: 4px 2px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.vt-btn:hover { color: var(--ink); }
.vt-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* 顺序视图里每条建议所属的类别标注 */
.cat-list .cat-cat {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  margin-right: 12px;
}
.cat-list a.cat-title {
  color: var(--ink);
  text-decoration: none;
}
.cat-list a.cat-title:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.demo-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-left: 8px;
  white-space: nowrap;
}

/* ---------- 内容页(章节) ---------- */
.entries { margin-top: 8px; }
.entry { padding: 26px 0; }
.entry-num {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-3);
}
.entry-title {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
}
.entry-stamps {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
}
.entry-body {
  margin-top: 12px;
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 18px;
  line-height: 2.1;
}
.entry-meta {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.entry-benefit {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 16px;
  color: var(--ink);
}
.entry-src {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-3);
}
.meta-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 3px;
  color: var(--ink-2);
}
.entries .illus { margin: 10px 0 26px; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 44px;
  flex-wrap: wrap;
}
.pager a {
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
}
.pager a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.pager-note { font-size: 13px; color: var(--ink-3); }

/* ---------- 关于页 ---------- */
.about-sec {
  margin-top: clamp(48px, 7vw, 72px);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.about-sec h2 { font-size: clamp(21px, 2.6vw, 26px); font-weight: 800; }
.prose {
  margin-top: 12px;
  font-family: var(--font-serif);
  color: var(--ink-2);
  font-size: 16.5px;
}
.prose p + p { margin-top: 14px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--primary); text-decoration: none; }
.prose a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.prose ul { margin: 10px 0 0 20px; }
.prose li { margin: 6px 0; }

/* ---------- 小节通用 ---------- */
.section {
  margin-top: clamp(72px, 10vw, 116px);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.sec-kicker {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.sec-head h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 800;
  letter-spacing: 0.01em;
}
.sec-note {
  font-size: 13.5px;
  color: var(--ink-3);
  text-align: right;
  max-width: 26em;
  padding-bottom: 5px;
}

/* ---------- §01 开篇五件事 ---------- */
.ledger { list-style: none; margin-top: 10px; }
.ledger li {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0 6px;
  padding: 24px 0;
}
.ledger-num {
  font-size: 17px;
  color: var(--ink-3);
  padding-top: 3px;
}
.ledger-title-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.ledger-title {
  font-size: 20px;
  font-weight: 700;
  transition: color 0.15s;
}
.ledger li:hover .ledger-title { color: var(--primary); }
.ledger-ref {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.ledger-desc {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink-2);
  max-width: 62ch;
}
.ledger-stamps {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
}

/* ---------- §02 章节目录 ---------- */
.cat-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
  gap: 36px 42px;
  margin-top: 28px;
}
.cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 8px;
}
.cat-head h3 { font-size: 18px; font-weight: 800; }
.cat-count { font-size: 12.5px; color: var(--ink-3); }

.cat-list { list-style: none; }
.cat-list li {
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: 3px;
  font-size: 16px;
  line-height: 1.8;
  transition: background 0.15s;
}
.cat-list li:hover { background: var(--brand-soft); }
.cat-num {
  color: var(--ink-3);
  font-size: 13px;
  flex: none;
}
.cat-title { flex: 1; min-width: 0; }
.cat-n { color: var(--ink-3); font-size: 13px; flex: none; }

/* ---------- §03 方法说明 ---------- */
.method-list { margin-top: 10px; }
.method-row {
  display: grid;
  grid-template-columns: 218px 1fr;
  gap: 10px 28px;
  padding: 21px 0;
}
.method-term {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 17.5px;
  font-weight: 700;
}
.grade {
  font-size: 18px;
  font-weight: 700;
}
.g-a { color: var(--primary); }
.g-b { color: var(--grade-b-fg); }
.g-c { color: var(--ink-2); }
.method-def {
  color: var(--ink-2);
  font-size: 16.5px;
  align-self: center;
}

/* ---------- §04 自查清单 ---------- */
.check-panel {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
  margin-top: 28px;
}
.check-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.check-track {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.check-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

.check-item {
  display: flex;
  gap: 13px;
  padding: 13px 2px;
  cursor: pointer;
  font-size: 17px;
  align-items: flex-start;
}
.check-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cbox {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 2px solid var(--ink-2);
  border-radius: var(--radius);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.check-item input:checked + .cbox {
  background: var(--primary);
  border-color: var(--primary);
}
.check-item input:checked + .cbox::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--primary-fg);
  border-bottom: 2px solid var(--primary-fg);
  transform: rotate(45deg);
}
.check-item input:checked ~ .ctext { color: var(--ink-3); }
.check-item input:focus-visible + .cbox {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.check-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- §05 常见问答 ---------- */
.faq-list { margin-top: 8px; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  list-style: none;
  transition: color 0.15s;
}
.faq summary:hover { color: var(--primary); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-bottom: 3px;
}
.faq[open] summary::after {
  transform: rotate(-135deg);
  margin-bottom: 0;
}
.faq-a {
  padding: 0 2px 18px;
  font-family: var(--font-serif);
  color: var(--ink-2);
  font-size: 16.5px;
}

/* ---------- 统一页脚 ---------- */
.site-footer {
  margin-top: clamp(80px, 11vw, 128px);
  background: var(--surface-elevated);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding: clamp(34px, 5vw, 52px) 0 36px;
}
.foot-h {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.foot-blurb {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 34em;
}
.foot-links { list-style: none; }
.foot-links li { padding: 4px 0; font-size: 15px; }
.foot-links a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s;
}
.foot-links a:hover { color: var(--primary); }
.foot-plain { color: var(--ink-2); }

/* 全站页脚:全部书目 */
.foot-books {
  margin-top: 4px;
  padding: 26px 0 22px;
  border-top: 1px solid var(--line);
}
.foot-books .foot-h { margin-bottom: 12px; }
.foot-book-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 28px;
}
.foot-book-list li { min-width: 0; }
.foot-book-list a {
  display: inline-block;
  padding: 3px 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
  text-decoration: none;
  transition: color 0.15s;
}
.foot-book-list a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .foot-book-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .foot-book-list { grid-template-columns: 1fr; }
}

.foot-bottom {
  padding: 0 0 34px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ---------- 悬浮主题切换 + 返回顶部 ---------- */
.theme-float {
  position: fixed;
  right: 18px;
  bottom: calc(15% + 56px);
  width: 44px;
  height: 44px;
  z-index: 40;
  display: grid;
  place-items: center;
  border: none;
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, background 0.15s, color 0.15s;
}
.theme-float.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.theme-float:hover {
  background: var(--primary);
  color: var(--brand-contrast);
}
.theme-float svg { width: 19px; height: 19px; }
.theme-float .ic { display: none; }
html[data-theme-mode="auto"] .theme-float .ic-auto,
html[data-theme-mode="light"] .theme-float .ic-light,
html[data-theme-mode="dark"] .theme-float .ic-dark { display: block; }

#back-top {
  position: fixed;
  right: 18px;
  bottom: 15%;
  width: 44px;
  height: 44px;
  z-index: 40;
  display: grid;
  place-items: center;
  border: none;
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, background 0.15s, color 0.15s;
}
#back-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
#back-top:hover {
  background: var(--primary);
  color: var(--brand-contrast);
}
#back-top svg { width: 19px; height: 19px; }

/* ---------- 间距工具类(替代内联样式,须置于文件末尾以覆盖同权重规则) ---------- */
.mt-6  { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-28 { margin-top: 28px; }
.mt-32 { margin-top: 32px; }

/* 证据等级字母配色(用于列表编号位) */
.cat-list .cat-num.g-a { color: var(--primary); font-weight: 700; }
.cat-list .cat-num.g-b { color: var(--grade-b-fg); font-weight: 700; }
.cat-list .cat-num.g-c { color: var(--ink-2); }
.cat-list .cat-num.g-d { color: var(--ink-3); }

/* =========================================================
   响应式
   ========================================================= */

@media (max-width: 1100px) {
  /* 预留 */
}

@media (max-width: 940px) {
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    padding: 6px 20px 14px;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 13px 2px;
    font-size: 16px;
  }
  .nav-toggle { display: inline-flex; }

  .mast-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .sec-note { text-align: left; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }

  .masthead-top { flex-direction: column; gap: 6px; }
  .mast-meta { line-height: 1.8; }

  .ledger li { grid-template-columns: 46px 1fr; padding: 20px 0; }
  .ledger-title-row { flex-wrap: wrap; gap: 6px 12px; }
  .ledger-ref { margin-left: 0; flex-basis: 100%; }

  .method-row { grid-template-columns: 1fr; gap: 8px; }

  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .foot-bottom { flex-direction: column; }
}

@media (max-width: 420px) {
  #theme-label { display: none; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 15px; }
  .header-inner { gap: 12px; }
  .site-nav { margin-left: 0; }
  .header-tools { margin-left: auto; }
}

/* =========================================================
   内容增强组件:统计带 / 使用步骤 / 人群直达 / 导览占比条
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 30px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.stat dt {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.stat dd {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 34px;
  margin-top: 26px;
}
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  flex: none;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.1;
  padding-top: 2px;
}
.steps h3 { font-size: 16px; font-weight: 700; }
.steps p {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.crowd-label {
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.crowd {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.crowd a {
  display: inline-block;
  padding: 8px 15px;
  background: var(--surface);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.crowd a:hover { color: var(--primary); background: var(--surface-2); }

.cat-bar {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  margin-top: 16px;
  overflow: hidden;
}
.cat-bar i { display: block; height: 100%; background: var(--brand); opacity: 0.9; }
.w-life { width: 31.8%; }
.w-time { width: 10.6%; }
.w-money { width: 26.6%; }
.w-law { width: 31%; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- 五件小事:行内勾选(与 §05 自查联动) ---------- */
.ledger-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.ledger-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ledger-check .cbox {
  width: 16px;
  height: 16px;
  margin-top: 0;
  border-radius: 3px;
}
.ledger-check input:checked + .cbox {
  background: var(--primary);
  border-color: var(--primary);
}
.ledger-check input:checked + .cbox::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.5px;
  width: 4px;
  height: 8px;
  border-right: 2px solid var(--primary-fg);
  border-bottom: 2px solid var(--primary-fg);
  transform: rotate(45deg);
}
.ledger-check input:checked ~ .check-txt { color: var(--primary); font-weight: 700; }

/* ---------- 系列手册横带 ---------- */
.series {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.series a {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
}
.series a:hover { background: var(--surface-2); }
.series-meta {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.series strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
}

/* =========================================================
   微交互(全部可在 reduced-motion 下关闭)
   ========================================================= */
.btn-solid { transition: filter 0.15s, transform 0.15s, box-shadow 0.15s; }
.btn-solid:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14); }

.series a { transition: background 0.15s, transform 0.2s; }
.series a:hover { transform: translateY(-2px); }
.crowd a { transition: color 0.15s, background 0.15s, transform 0.15s; }
.crowd a:hover { transform: translateY(-1px); }

.site-header { transition: box-shadow 0.25s; }
.site-header.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }

.cat-bar i { transition: width 0.9s cubic-bezier(0.22, 0.61, 0.36, 1); }

.pick-title, .pick-desc, .pick-stamps, .pick-src {
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.pick-card.is-swapping .pick-title,
.pick-card.is-swapping .pick-desc,
.pick-card.is-swapping .pick-stamps,
.pick-card.is-swapping .pick-src {
  opacity: 0;
  transform: translateY(4px);
}

.check-item input:checked + .cbox,
.ledger-check input:checked + .cbox {
  animation: cbox-pop 0.24s ease;
}
@keyframes cbox-pop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-solid:hover, .series a:hover, .crowd a:hover { transform: none; }
  .series a, .crowd a, .site-header, .cat-bar i,
  .pick-title, .pick-desc, .pick-stamps, .pick-src { transition: none; }
  .check-item input:checked + .cbox,
  .ledger-check input:checked + .cbox { animation: none; }
}

/* 条目详情折叠:成本原文与备注 */
.entry-detail {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.85;
}
.entry-detail summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  user-select: none;
}
.entry-detail summary:hover { color: var(--primary); }
.entry-detail p { margin-top: 10px; max-width: 72ch; }
.entry-detail strong { color: var(--ink-2); font-weight: 700; }

/* 散文体章节(人生进阶指南) */
.entry-prose { padding-bottom: 8px; }
.entry-prose .prose {
  margin-top: 0;
  font-size: 17px;
  line-height: 2.1;
  color: var(--ink-2);
}
.entry-prose .prose h2 {
  margin: 34px 0 12px;
  font-family: var(--font-sans);
  font-size: clamp(20px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--ink);
}
.entry-prose .prose h3 {
  margin: 26px 0 10px;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
}
.entry-prose .prose h4 {
  margin: 20px 0 8px;
  font-size: 16px;
  color: var(--ink);
}
.entry-prose .prose p + p { margin-top: 16px; }
.entry-prose .prose ul,
.entry-prose .prose ol { margin: 12px 0 0 22px; }
.entry-prose .prose li { margin: 6px 0; }
.entry-prose .prose blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  color: var(--ink-2);
}
.entry-prose .prose blockquote p + p { margin-top: 8px; }
.entry-prose .prose hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.entry-prose .prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
}
.entry-prose .prose pre {
  margin: 16px 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.entry-prose .prose pre code {
  padding: 0;
  background: none;
  font-size: 13px;
  line-height: 1.7;
}
.md-table-wrap { margin: 18px 0; overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th,
.prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  background: var(--surface-2);
  white-space: nowrap;
}
.entry-body br { content: ""; }

@media (max-width: 640px) {
  .md-table-wrap { -webkit-overflow-scrolling: touch; }
  .entry-prose .prose table,
  .prose table { min-width: 560px; }
}

/* 条目详情页 */
.entry-more {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.entry-more a {
  color: var(--primary);
  text-decoration: none;
}
.entry-more a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.entry-single { padding-bottom: 4px; }
.entry-single .entry-body { font-size: 17px; }

/* 条目详情页:左侧本书目录 */
.entry-layout {
  display: grid;
  grid-template-columns: minmax(210px, 252px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.entry-main { min-width: 0; }
.entry-toc-side {
  position: sticky;
  top: calc(var(--header-h) + 26px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-width: thin;
}
.entry-toc-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.entry-toc-book {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  text-decoration: none;
}
.entry-toc-book:hover { color: var(--primary); }
.entry-toc-nav { margin-top: 16px; }
.entry-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry-toc-list a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  text-decoration: none;
}
.entry-toc-list a:hover { color: var(--primary); }
.entry-toc-num {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.75;
}
.entry-toc-list li.is-current a {
  margin: 0 -7px;
  padding-left: 7px;
  padding-right: 7px;
  color: var(--primary);
  font-weight: 700;
  background: var(--brand-soft);
  border-radius: 3px;
}
.entry-toc-list li.is-current .entry-toc-num { color: var(--primary); }
.entry-toc-mobile { display: none; }

@media (max-width: 1120px) and (min-width: 981px) {
  .entry-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
  }
  .entry-layout .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .entry-layout { display: block; }
  .entry-toc-side { display: none; }
  .entry-toc-mobile {
    display: block;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
  }
  .entry-toc-mobile > summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0 12px;
    cursor: pointer;
    list-style: none;
  }
  .entry-toc-mobile > summary::-webkit-details-marker { display: none; }
  .entry-toc-mobile > summary::after {
    content: "展开";
    flex: none;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-3);
  }
  .entry-toc-mobile[open] > summary::after { content: "收起"; }
  .entry-toc-summary-label {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
  }
  .entry-toc-summary-label strong {
    color: var(--ink);
    font-size: 14px;
  }
  .entry-toc-mobile .entry-toc-nav { margin: 2px 0 14px; }
  .entry-toc-mobile .entry-toc-list a {
    padding: 7px 0;
    font-size: 14px;
  }
}

.entry-detail-panel {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
}
.entry-detail-panel h2 {
  margin-bottom: 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.entry-detail-panel p {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink-2);
}
.entry-detail-panel p:first-of-type { margin-top: 0; }
.entry-detail-panel strong { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) {
  .entry-detail-panel { padding: 14px 15px; }
  .entry-single .entry-body { font-size: 16px; }
}

/* 社会化分享 */
.share-section {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding: 20px 0 8px;
}
.share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
}
.share-kicker {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.share-note {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-3);
}
.share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.share-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.share-btn:active { transform: translateY(0); }
.share-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(15% + 66px);
  z-index: 60;
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.share-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 640px) {
  .share-bar { align-items: flex-start; }
  .share-actions { gap: 7px; }
  .share-btn { padding: 8px 12px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .share-btn, .share-toast { transition: none; }
}

.share-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 14, 10, 0.5);
}
.share-dialog[hidden] { display: none; }
.share-dialog-panel {
  width: min(460px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(20, 14, 10, 0.24);
}
.share-dialog-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.share-dialog-note {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}
.share-dialog-url {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.share-dialog-url:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.share-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* 长 URL 不撑破小屏 */
.entry-body,
.entry-benefit,
.entry-src,
.entry-detail p,
.entry-detail-panel p,
.prose {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   社会化分享:品牌图标 + 悬浮分享入口
   ========================================================= */
.share-section {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 26px 0 14px;
}
.share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
  padding: 20px 22px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
}
.share-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--primary);
}
.share-note {
  margin-top: 5px;
  font-size: 14px;
  color: var(--ink-2);
}
.share-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.share-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.share-btn[hidden] { display: none; }
.share-btn .share-ico {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}
.share-btn .share-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.share-btn[data-share="wechat"] .share-ico { background: #07c160; }
.share-btn[data-share="weibo"] .share-ico { background: #e6162d; }
.share-btn[data-share="qq"] .share-ico { background: #1ebafc; }
.share-btn[data-share="douban"] .share-ico { background: #2e963d; }
.share-btn[data-share="copy"] .share-ico {
  background: var(--primary);
  color: var(--brand-contrast);
}
.share-btn[data-share="native"] .share-ico {
  background: var(--ink-2);
  color: var(--surface);
}
.share-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(20, 14, 10, 0.12);
}
.share-btn:active { transform: translateY(0); }
.share-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 悬浮分享入口 */
.share-dock {
  position: fixed;
  right: 18px;
  bottom: calc(15% + 112px);
  z-index: 55;
}
.share-dock-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: var(--brand-contrast);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(169, 69, 3, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.share-dock-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(169, 69, 3, 0.42);
}
.share-dock-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.share-dock-label {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.share-dock-toggle:hover .share-dock-label,
.share-dock-toggle:focus-visible .share-dock-label {
  opacity: 1;
}
.share-dock-ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.share-dock-panel {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: 318px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 64px rgba(20, 14, 10, 0.24);
}
.share-dock-panel[hidden] { display: none; }
.share-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.share-dock-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--primary);
}
.share-dock-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.share-dock-close:hover {
  background: var(--primary);
  color: var(--brand-contrast);
}
.share-dock-title {
  margin-top: 7px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.share-dock-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}
.share-dock-actions .share-btn-tile {
  flex-direction: column;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}
.share-dock-actions .share-btn-tile .share-ico {
  width: 36px;
  height: 36px;
}
.share-dock-actions .share-btn-tile .share-ico svg {
  width: 21px;
  height: 21px;
}
.share-dock-hint {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

@media (max-width: 1359px) {
  .share-dock {
    right: 14px;
    bottom: calc(15% + 112px);
    left: auto;
    top: auto;
    transform: none;
  }
  .share-dock-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
  }
  .share-dock-label { display: none; }
  .share-dock-panel {
    position: fixed;
    left: auto;
    right: 14px;
    bottom: calc(15% + 176px);
    top: auto;
    transform: none;
    width: 330px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
  }
}
@media (max-width: 640px) {
  .share-section { margin-top: 28px; padding-top: 20px; }
  .share-bar { padding: 16px; align-items: flex-start; }
  .share-actions { width: 100%; gap: 7px; }
  .share-btn { flex: 1 1 auto; justify-content: flex-start; padding-right: 10px; }
  .share-btn .share-ico { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .share-btn, .share-dock-toggle { transition: none; }
}

@media (max-width: 640px) {
  .share-dock-panel {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* 条目详情页:同主题推荐 */
.related-block {
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(20, 14, 10, 0.1);
  text-decoration: none;
}
.related-ev {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--primary);
}
.related-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.58;
}
.related-desc {
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-meta {
  margin-top: auto;
  padding-top: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}
@media (max-width: 900px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .related-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .related-card { transition: none; }
}

/* 标题链接与长文行距 */
.entry-title a,
.ledger-title a {
  color: inherit;
  text-decoration: none;
}
.entry-title a:hover,
.ledger-title a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.entry-title { line-height: 1.5; }
.ledger-title { line-height: 1.5; }
.entry-body { line-height: 2.1; }
.entry-benefit { line-height: 2; }
.entry-src { line-height: 1.95; }
.ledger-desc { line-height: 1.95; }
.page-intro { line-height: 1.95; }
.prose { line-height: 2.1; }
.entry-body,
.prose p,
.page-intro,
.entry-detail-panel p {
  text-wrap: pretty;
}

/* 数字用等宽数位,避免动画时宽度跳动 */
.stat dt,
.cat-n,
.cat-count,
.entry-num,
.ledger-num,
.pager-note {
  font-variant-numeric: tabular-nums;
}

/* 长列表条目做布局隔离,降低整页样式与布局开销 */
.entries > .entry { contain: layout style; }

/* 目录/书目标题:去掉默认下划线 */
.cat-title {
  text-decoration: none;
}
.cat-title:hover {
  color: var(--primary);
}

/* 条目的可选配图 */
.entry-figure {
  margin: 16px 0 4px;
  max-width: 560px;
}
.entry-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.entry-figure-lg { max-width: 760px; }

@media (max-width: 640px) {
  .chapter-tools { align-items: stretch; gap: 12px; }
  .chapter-search { flex-basis: 100%; max-width: none; }
  .chapter-tools .view-toggle { justify-content: flex-start; }
}

/* 书架底部:全部书目索引 */
.book-index {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.book-index li + li { border-top: 1px solid var(--line); }
.book-index-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  color: var(--ink);
  text-decoration: none;
}
.book-index-num {
  font-size: 12px;
  color: var(--ink-3);
}
.book-index-main { min-width: 0; }
.book-index-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
  transition: color 0.15s;
}
.book-index-meta {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-3);
}
.book-index-arrow {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink-3);
  transition: color 0.15s, transform 0.15s;
}
.book-index-link:hover .book-index-title,
.book-index-link:hover .book-index-arrow { color: var(--primary); }
.book-index-link:hover .book-index-arrow { transform: translateX(3px); }

@media (max-width: 640px) {
  .book-index-link {
    grid-template-columns: 26px minmax(0, 1fr) 18px;
    gap: 11px;
    padding: 13px 0;
  }
  .book-index-title { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-index-title, .book-index-arrow { transition: none; }
  .book-index-link:hover .book-index-arrow { transform: none; }
}
