/* ============================================================
   理财学习网 site.css
   引入顺序：appica.css → site.css

   内容：
   1. 主题变量覆盖（appica-kit 铁律：换主题只改 CSS 变量）
   2. 补齐 appica.css 缺失的通用工具类
   3. 站点组件（页头 / 页脚 / hero / 书封面 / 章节页 / 列表 / 进度）
   4. 正文排版（prose）
   5. 配图系统（.fig 系列 + 图元：金币/数值卡/流程/比例条/环形/柱状/红绿灯/场景插画）
   ============================================================ */

/* ---------- 1. 主题变量 ---------- */
:root {
  /* 两本书的专属 accent 色（徽章 / 配图 / 封面 / 封面用） */
  --qianqian: oklch(0.60 0.14 65);
  --qianqian-strong: oklch(0.50 0.13 60);
  --qianqian-soft: oklch(0.95 0.05 85);
  --qianqian-muted: oklch(0.85 0.09 80);
  --qianqian-fg: oklch(0.35 0.10 55);

  --indexfund: oklch(0.55 0.11 170);
  --indexfund-strong: oklch(0.42 0.10 168);
  --indexfund-soft: oklch(0.93 0.05 172);
  --indexfund-muted: oklch(0.82 0.08 175);
  --indexfund-fg: oklch(0.30 0.08 168);

  /* 全局“财富金”点缀色 */
  --gold: #f5b93d;
  --gold-deep: #c77f0e;
  --gold-soft: #fdf3d7;
}
.dark {
  --qianqian: oklch(0.72 0.14 75);
  --qianqian-strong: oklch(0.80 0.13 78);
  --qianqian-soft: oklch(0.32 0.07 70);
  --qianqian-muted: oklch(0.45 0.09 75);
  --qianqian-fg: oklch(0.88 0.09 80);

  --indexfund: oklch(0.70 0.11 175);
  --indexfund-strong: oklch(0.80 0.10 178);
  --indexfund-soft: oklch(0.30 0.06 175);
  --indexfund-muted: oklch(0.45 0.08 178);
  --indexfund-fg: oklch(0.85 0.08 178);

  --gold: #f6c453;
  --gold-deep: #e0a52e;
  --gold-soft: oklch(0.32 0.08 75);
}

/* ---------- 2. 通用工具类（补齐缺失） ---------- */
.mx-auto { margin-inline: auto; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }
.size-4 { width: 1rem; height: 1rem; }
.size-5 { width: 1.25rem; height: 1.25rem; }
.size-6 { width: 1.5rem; height: 1.5rem; }
.size-8 { width: 2rem; height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 1.2; }
.text-4xl { font-size: 2.25rem; line-height: 1.15; }

/* ---------- 3. 站点组件 ---------- */

/* 页头导航 */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--background) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-nav {
  max-width: 72rem; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem;
  padding: 0.6rem 1.25rem;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.05rem; color: var(--foreground-intense);
  text-decoration: none;
}
.logo-mark {
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe9a8, var(--gold) 52%, var(--gold-deep));
  color: #7a4a05; font-size: 0.95rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.55), 0 1px 3px rgba(120,70,0,.25);
}
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; }
.nav-links a {
  padding: 0.42rem 0.8rem; border-radius: var(--radius-md);
  color: var(--foreground-muted); font-size: 0.92rem; font-weight: 500;
  text-decoration: none; transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--foreground-intense); background: var(--background-muted); }
.nav-links a[data-active="true"] { color: var(--foreground-intense); background: var(--background-strong); font-weight: 600; }
.theme-btn {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--background); color: var(--foreground-muted);
  cursor: pointer; transition: color .2s, border-color .2s, background-color .2s;
}
.theme-btn:hover { color: var(--foreground-intense); border-color: var(--border-emphasis); background: var(--background-subtle); }
.theme-btn svg { display: none; }
html:not(.dark) .theme-btn .icon-moon { display: block; }
html.dark .theme-btn .icon-sun { display: block; }

/* 滚动阅读进度条 */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 80;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  border-radius: 0 999px 999px 0;
}

/* 页面容器 */
.wrap { max-width: 72rem; margin-inline: auto; padding: 2.25rem 1.25rem 4rem; }
.wrap-narrow { max-width: 46rem; }
@media (min-width: 1080px) {
  .wrap-narrow.chapter-wrap { max-width: 72rem; }
}

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); background: var(--background-subtle); }
.footer-inner { display: grid; gap: 0.5rem; padding-top: 2rem; padding-bottom: 2.5rem; }
.footer-brand { font-weight: 600; color: var(--foreground-strong); font-size: 0.95rem; }
.footer-note { color: var(--foreground-muted); font-size: 0.8rem; line-height: 1.7; max-width: 46rem; }

/* hero（首页 / 书籍页通用） */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-2xl);
  background: linear-gradient(180deg, var(--background-subtle), var(--background));
  padding: 3rem 2rem;
}
.hero-glow { position: absolute; pointer-events: none; border-radius: 50%; filter: blur(48px); }
.hero-glow.g1 { width: 22rem; height: 22rem; right: -6rem; top: -8rem; background: radial-gradient(circle, color-mix(in oklab, var(--gold) 40%, transparent), transparent 65%); }
.hero-glow.g2 { width: 18rem; height: 18rem; left: -5rem; bottom: -7rem; background: radial-gradient(circle, color-mix(in oklab, var(--indexfund) 30%, transparent), transparent 65%); }
.hero-inner { position: relative; max-width: 42rem; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.75rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-deep);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
}
.hero h1 { margin: 1rem 0 0.9rem; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.18; font-weight: 700; letter-spacing: -0.01em; color: var(--foreground-intense); }
.hero p.hero-sub { color: var(--foreground-muted); font-size: 1.05rem; line-height: 1.85; max-width: 36rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.7rem; }

/* 区块标题 */
.sec { margin-top: 3.2rem; }
.sec-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.2rem; }
.sec-head .sec-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px color-mix(in oklab, var(--gold) 25%, transparent); }
.sec-head h2 { font-size: 1.35rem; font-weight: 700; color: var(--foreground-intense); }
.sec-head .sec-sub { color: var(--foreground-muted); font-size: 0.85rem; }

/* 学习路径 */
.path-steps { display: grid; gap: 0.9rem; }
@media (min-width: 720px) { .path-steps { grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; } }
.path-step {
  padding: 1.3rem 1.3rem 1.2rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--background);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.path-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-emphasis); }
.path-step .pn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #fff;
  font-weight: 800; font-size: 0.9rem; margin-bottom: 0.6rem;
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.path-step h3 { font-size: 1rem; font-weight: 700; color: var(--foreground-intense); }
.path-step p { font-size: 0.85rem; color: var(--foreground-muted); line-height: 1.75; margin-top: 0.3rem; }
.path-arrow { display: none; }
@media (min-width: 720px) { .path-arrow { display: flex; align-items: center; justify-content: center; color: var(--border-intense); } }

/* 首页书籍卡 */
.book-card {
  display: grid; grid-template-columns: auto 1fr; gap: 1.5rem;
  padding: 1.6rem; border: 1px solid var(--border); border-radius: var(--radius-2xl);
  background: var(--background); text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.book-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-emphasis); }
.book-card .cover-wrap { width: 7.2rem; flex-shrink: 0; }
.book-card .bc-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.book-card .bc-title { font-size: 1.25rem; font-weight: 700; color: var(--foreground-intense); }
.book-card .bc-route { font-size: 0.78rem; font-weight: 600; color: var(--foreground-muted); }
.book-card .bc-desc { font-size: 0.9rem; line-height: 1.8; color: var(--foreground-strong); margin: 0.6rem 0 1rem; }
.book-card .bc-cta { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; font-weight: 600; color: var(--foreground-intense); }
@media (max-width: 640px) {
  .book-card { grid-template-columns: 1fr; }
  .book-card .cover-wrap { width: 8.5rem; }
}

/* 概念速览 bento */
.bento { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bento-item {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1rem 1.05rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); transition: transform .2s, box-shadow .2s;
}
.bento-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bento-item .bi { font-size: 1.15rem; line-height: 1; }
.bento-item h3 { font-size: 0.9rem; font-weight: 600; color: var(--foreground-intense); }
.bento-item p { font-size: 0.78rem; line-height: 1.65; color: var(--foreground-muted); }

/* 书封面（CSS 绘制的 3:4 封面） */
.book-cover {
  position: relative; aspect-ratio: 3/4; width: 100%;
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  color: #fff; text-align: center; padding: 1.1rem;
}
.book-cover .cover-art { position: absolute; opacity: 0.22; }
.book-cover .cover-title { position: relative; font-size: 1.45rem; font-weight: 800; letter-spacing: 0.1em; line-height: 1.35; }
.book-cover .cover-sub { position: relative; font-size: 0.75rem; opacity: 0.9; letter-spacing: 0.05em; }
.book-cover.qianqian { background: linear-gradient(165deg, #fcd34d 0%, #f59e0b 45%, #b45309 100%); }
.book-cover.qianqian::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 18%, rgba(255,255,255,.32), transparent 45%); }
.book-cover.indexfund { background: linear-gradient(165deg, #5eead4 0%, #14b8a6 45%, #0f766e 100%); }
.book-cover.indexfund::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 18%, rgba(255,255,255,.3), transparent 45%); }
.book-cover.sm { border-radius: var(--radius-lg); }
.book-cover.sm .cover-title { font-size: 1.05rem; }
.book-cover.sm .cover-sub { font-size: 0.62rem; }

/* 书籍页 hero */
.book-hero { display: grid; grid-template-columns: auto 1fr; gap: 2.2rem; align-items: start; }
.book-hero .cover-wrap { width: 12rem; flex-shrink: 0; }
.book-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--border); }
.book-meta span { font-size: 0.82rem; color: var(--foreground-muted); }
.book-meta b { font-weight: 600; color: var(--foreground-strong); }
.book-points { display: grid; gap: 0.5rem; margin-top: 1.2rem; }
.book-points li { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.92rem; color: var(--foreground-strong); line-height: 1.7; }
.book-points li::before { content: "✓"; color: var(--success-strong); font-weight: 800; flex-shrink: 0; }
@media (max-width: 640px) {
  .book-hero { grid-template-columns: 1fr; }
  .book-hero .cover-wrap { width: 9.5rem; }
}

/* 进度条 */
.progress-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background);
}
.progress-track { flex: 1; height: 0.5rem; background: var(--background-strong); border-radius: 999px; overflow: hidden; }
.progress-track > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.progress-label { font-size: 0.82rem; color: var(--foreground-muted); white-space: nowrap; }

/* 章节目录 */
.ch-list { display: grid; gap: 0.7rem; }
.ch-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); text-decoration: none; color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s, background-color .2s;
}
.ch-item:hover { border-color: var(--border-emphasis); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ch-item.ch-done-on { background: var(--success-subtle); }
.ch-num {
  flex-shrink: 0; min-width: 4.3rem; text-align: center;
  padding: 0.32rem 0.5rem; border-radius: var(--radius-md);
  font-size: 0.78rem; font-weight: 700;
}
.ch-item.qianqian .ch-num { background: var(--qianqian-soft); color: var(--qianqian-fg); }
.ch-item.indexfund .ch-num { background: var(--indexfund-soft); color: var(--indexfund-fg); }
.ch-main { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.ch-title { font-weight: 600; color: var(--foreground-intense); font-size: 0.98rem; }
.ch-tag { color: var(--foreground-muted); font-size: 0.85rem; }
.ch-meta { flex-shrink: 0; display: flex; align-items: center; gap: 0.6rem; color: var(--foreground-muted); font-size: 0.8rem; }
.ch-done {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: 0.7rem; transition: all .2s;
}
.ch-done.ch-done-on { background: var(--success-strong); border-color: var(--success-strong); color: #fff; }
@media (max-width: 640px) {
  .ch-item { flex-wrap: wrap; }
  .ch-meta { width: 100%; padding-left: 5.3rem; }
}

/* 方法 / 工具网格（书籍页） */
.method-grid { display: grid; gap: 0.75rem; }
@media (min-width: 720px) { .method-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.method-card {
  padding: 1.05rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); transition: transform .2s, box-shadow .2s;
}
.method-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.method-card .mnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--qianqian-soft); color: var(--qianqian-fg);
  font-weight: 800; font-size: 0.8rem; margin-bottom: 0.55rem;
}
.method-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--foreground-intense); }
.method-card p { font-size: 0.85rem; line-height: 1.7; color: var(--foreground-muted); margin-top: 0.25rem; }

/* 人物表 */
.char-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .char-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.char-card {
  display: flex; gap: 0.8rem; align-items: flex-start;
  padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background);
}
.char-ava {
  flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 0.95rem;
}
.char-card h3 { font-size: 0.92rem; font-weight: 600; color: var(--foreground-intense); }
.char-card .role { font-size: 0.75rem; color: var(--gold-deep); font-weight: 600; }
.char-card p { font-size: 0.8rem; color: var(--foreground-muted); line-height: 1.6; margin-top: 0.2rem; }

/* ---------- 章节页 ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--foreground-muted); margin-bottom: 1.1rem; }
.crumbs a { color: var(--foreground-muted); text-decoration: none; transition: color .2s; }
.crumbs a:hover { color: var(--foreground-intense); }
.crumbs .sep { color: var(--border-intense); }
.crumbs .cur { color: var(--foreground-strong); font-weight: 500; }

/* 章节页：正文 + 侧栏双栏 */
.chapter-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 1080px) {
  .chapter-grid { grid-template-columns: minmax(0, 50rem) 15.5rem; justify-content: center; align-items: start; }
}
.ch-side { display: grid; gap: 0.9rem; }
@media (min-width: 1080px) {
  .ch-side { position: sticky; top: 4.9rem; max-height: calc(100vh - 5.9rem); overflow: auto; }
}
.side-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); padding: 1rem 1.05rem; }
.side-title { font-size: 0.75rem; font-weight: 700; color: var(--foreground-muted); letter-spacing: 0.06em; margin-bottom: 0.6rem; }
.toc-list { display: grid; gap: 0.1rem; }
.toc-list a {
  display: block; padding: 0.32rem 0.6rem; border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--foreground-muted); text-decoration: none; line-height: 1.5;
  transition: background-color .15s, color .15s;
}
.toc-list a:hover { background: var(--background-muted); color: var(--foreground-intense); }
.toc-list a[data-active] { background: var(--gold-soft); color: var(--gold-deep); font-weight: 600; }
.side-next { display: grid; gap: 0.2rem; text-decoration: none; padding: 0.35rem 0.4rem; border-radius: var(--radius-md); transition: background-color .15s; }
.side-next:hover { background: var(--background-subtle); }
.side-next-num { font-size: 0.72rem; font-weight: 700; color: var(--gold-deep); }
.side-next-t { font-size: 0.9rem; font-weight: 600; color: var(--foreground-intense); line-height: 1.45; }
.side-back { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; font-size: 0.88rem; font-weight: 500; color: var(--foreground-muted); transition: color .15s; }
.side-back:hover { color: var(--foreground-intense); }
.side-mini { font-size: 0.8rem; color: var(--foreground-muted); line-height: 1.6; }

.chapter-card { border: 1px solid var(--border); border-radius: var(--radius-2xl); background: var(--background); overflow: hidden; }
.chapter-head { padding: 2rem 1.6rem 1.5rem; border-bottom: 1px dashed var(--border); }
.chapter-body { padding: 1.5rem 1.6rem 2.5rem; }
@media (min-width: 640px) {
  .chapter-head { padding: 2.4rem 2.6rem 1.6rem; }
  .chapter-body { padding: 1.75rem 2.6rem 2.5rem; }
}
.ch-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.chapter-head h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; color: var(--foreground-intense); line-height: 1.3; }
.chapter-head .tagline { margin-top: 0.5rem; color: var(--foreground-muted); font-size: 1rem; }
.chapter-head .lead {
  margin-top: 1.2rem; font-size: 1.05rem; line-height: 2; color: var(--foreground-strong);
  padding: 1rem 1.25rem;
  background: var(--background-subtle);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

/* 章头动作区：字号调节 + 完成按钮 */
.ch-head-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 0.5rem; }
.fs-control { display: inline-flex; gap: 0.3rem; }
.fs-btn {
  width: 2.15rem; height: 2.15rem; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--background);
  color: var(--foreground-strong); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: border-color .15s, color .15s, background-color .15s;
}
.fs-btn:hover { border-color: var(--border-emphasis); color: var(--foreground-intense); background: var(--background-subtle); }

/* 正文排版 */
.prose h2 { display: flex; align-items: center; gap: 0.55rem; font-size: 1.25rem; font-weight: 700; color: var(--foreground-intense); margin: 2.5rem 0 0.9rem; scroll-margin-top: 5rem; }
.prose h2::before { content: ""; width: 0.45rem; height: 1.1rem; border-radius: 2px; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); flex-shrink: 0; }
.prose h3 { font-size: 1.08rem; font-weight: 600; color: var(--foreground-strong); margin: 1.7rem 0 0.65rem; }
.prose p { line-height: 2.05; color: var(--foreground-strong); margin: 0.95rem 0; }
.prose ul, .prose ol { margin: 0.85rem 0 1rem; padding-left: 1.35rem; display: grid; gap: 0.5rem; line-height: 1.95; color: var(--foreground-strong); }
.prose ul li::marker { color: var(--gold-deep); }
.prose ol li::marker { color: var(--gold-deep); font-weight: 600; }
.prose strong { color: var(--foreground-intense); font-weight: 600; }
.prose .callout {
  border: 1px solid var(--border); border-left: 3px solid var(--gold);
  background: var(--gold-soft); border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem; margin: 1.1rem 0;
  font-size: 0.92rem; line-height: 1.8; color: var(--foreground-strong);
}

/* 正文字号调节（data-fs 1/2/3，默认 2，由 A−/A+ 按钮控制） */
.chapter-card[data-fs="1"] .prose, .chapter-card[data-fs="1"] .lead { font-size: 0.97rem; }
.chapter-card[data-fs="2"] .prose, .chapter-card[data-fs="2"] .lead { font-size: 1.07rem; }
.chapter-card[data-fs="3"] .prose, .chapter-card[data-fs="3"] .lead { font-size: 1.2rem; }

/* 块标题（概念 / 金句） */
.block-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; font-weight: 700; color: var(--foreground-intense); margin: 2.4rem 0 0.9rem; }
.block-title::before { content: ""; width: 0.45rem; height: 1.1rem; border-radius: 2px; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); flex-shrink: 0; }

/* 核心概念 */
.concept-grid { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .concept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.concept-card { display: flex; gap: 0.8rem; padding: 0.95rem 1.05rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); }
.concept-dot { flex-shrink: 0; width: 0.6rem; height: 0.6rem; margin-top: 0.45rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px color-mix(in oklab, var(--gold) 22%, transparent); }
.concept-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--foreground-intense); margin-bottom: 0.2rem; }
.concept-card p { font-size: 0.86rem; line-height: 1.7; color: var(--foreground-muted); }

/* 金句 */
.quote-list { display: grid; gap: 0.75rem; }
.quote-item {
  position: relative; padding: 1.05rem 1.2rem 1.05rem 3rem;
  border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: var(--radius-lg); background: var(--background);
  font-size: 1rem; line-height: 1.9; color: var(--foreground-strong);
}
.quote-item::before {
  content: "“"; position: absolute; left: 1rem; top: 0.5rem;
  font-size: 2.2rem; line-height: 1; color: var(--gold);
  font-family: Georgia, "Songti SC", serif;
}

/* 章节导航 */
.chapter-nav { display: grid; gap: 0.75rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--border); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-nav-btn {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.95rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-decoration: none; color: inherit; transition: border-color .2s, background-color .2s, transform .2s;
}
.ch-nav-btn:hover { border-color: var(--border-emphasis); background: var(--background-subtle); transform: translateY(-1px); }
.ch-nav-btn .dir { font-size: 0.75rem; color: var(--foreground-muted); }
.ch-nav-btn .t { font-weight: 600; color: var(--foreground-intense); font-size: 0.95rem; }
.ch-nav-btn.next { text-align: right; }
.ch-nav-btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* FAQ（附录） */
.faq-list { display: grid; gap: 0.6rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); overflow: hidden; }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.95rem 1.15rem; font-weight: 600; color: var(--foreground-intense); font-size: 0.95rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; width: 0.55rem; height: 0.55rem; flex-shrink: 0;
  border-right: 2px solid var(--foreground-muted); border-bottom: 2px solid var(--foreground-muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .25s;
}
.faq-item[open] summary::after { transform: rotate(225deg) translateY(-1px); }
.faq-item .faq-body { padding: 0 1.15rem 1.1rem; color: var(--foreground-muted); font-size: 0.9rem; line-height: 1.85; display: grid; gap: 0.5rem; }

/* ============================================================
   5. 配图系统
   ============================================================ */
.fig { margin: 2.2rem 0; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--background-subtle); overflow: hidden; }
.fig-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 1.5rem; padding: 1.7rem 1.2rem; }
.fig-caption { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.8rem 1.3rem; border-top: 1px dashed var(--border); font-size: 0.82rem; color: var(--foreground-muted); line-height: 1.6; }
.fig-mark {
  flex-shrink: 0; padding: 0.08rem 0.5rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-deep); font-weight: 700; font-size: 0.72rem;
  border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent);
}

/* 图元：金币 */
.coin {
  --c-top: #ffe9a8; --c-mid: var(--gold); --c-edge: var(--gold-deep);
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; color: #7a4a05;
  background: radial-gradient(circle at 32% 28%, var(--c-top), var(--c-mid) 55%, var(--c-edge));
  border: 2px solid rgba(122, 74, 5, 0.35);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.6), 0 2px 4px rgba(120,70,0,.18);
}
.coin.sm { width: 1.9rem; height: 1.9rem; font-size: 0.68rem; }
.coin.lg { width: 3.5rem; height: 3.5rem; font-size: 1.25rem; }
.coin.silver { --c-top: #f2f6fa; --c-mid: #c9d3de; --c-edge: #8fa0b2; color: #4a5a6b; border-color: rgba(74,90,107,.4); }
.coin.green { --c-top: #d9fbe9; --c-mid: #34c47f; --c-edge: #1a8f58; color: #0b5a36; border-color: rgba(11,90,54,.4); }
.coin.red { --c-top: #ffe0dc; --c-mid: #ef6351; --c-edge: #b43a2b; color: #7c2318; border-color: rgba(124,35,24,.4); }
.coin.blue { --c-top: #dbeafe; --c-mid: #60a5fa; --c-edge: #2563eb; color: #1e40af; border-color: rgba(30,64,175,.4); }

/* 图元：数值卡 */
.vcard {
  flex: 1; min-width: 11rem; max-width: 17rem;
  display: grid; gap: 0.3rem; padding: 0.9rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background);
}
.vcard .k { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.4rem; }
.vcard .v { font-size: 1.05rem; font-weight: 800; color: var(--foreground-intense); }
.vcard .d { font-size: 0.8rem; line-height: 1.6; color: var(--foreground-muted); }
.vcard.accent-q { border-top: 3px solid var(--gold); }
.vcard.accent-q .k { color: var(--gold-deep); }
.vcard.accent-i { border-top: 3px solid var(--indexfund); }
.vcard.accent-i .k { color: var(--indexfund-strong); }
.vcard.accent-green { border-top: 3px solid var(--success-strong); }
.vcard.accent-green .k { color: var(--success-intense); }
.vcard.accent-red { border-top: 3px solid var(--error-strong); }
.vcard.accent-red .k { color: var(--error-intense); }
.vcard.accent-blue { border-top: 3px solid var(--info-strong); }
.vcard.accent-blue .k { color: var(--info-intense); }

/* 图元：流程 */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 0.5rem; }
.fnode {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  min-width: 6.2rem; max-width: 9.5rem; padding: 0.7rem 0.8rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background);
  text-align: center;
}
.fnode .fi { font-size: 1.3rem; line-height: 1; }
.fnode .ft { font-size: 0.82rem; font-weight: 600; color: var(--foreground-strong); line-height: 1.45; }
.fnode .fs { font-size: 0.72rem; color: var(--foreground-muted); line-height: 1.5; }
.fnode.hot { border-top: 3px solid var(--gold); }
.fnode.hot .ft { color: var(--gold-deep); }
.farrow { align-self: center; color: var(--foreground-muted); }
.farrow svg { display: block; }

/* 图元：堆叠比例条 */
.pctbar { width: 100%; max-width: 30rem; display: grid; gap: 0.5rem; }
.pctbar .bar { display: flex; height: 2.1rem; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); background: var(--background-strong); }
.pctbar .seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.72rem; font-weight: 700; white-space: nowrap; min-width: 2.6rem; }
.seg.gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #6b4404; }
.seg.teal { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.seg.blue { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.seg.gray { background: var(--foreground-muted); }
.seg.green { background: linear-gradient(180deg, #34d399, #059669); }
.seg.red { background: linear-gradient(180deg, #f87171, #dc2626); }
.pctbar .legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.78rem; color: var(--foreground-muted); }
.legend .lgd { display: inline-flex; align-items: center; gap: 0.35rem; }
.lgd i { width: 0.6rem; height: 0.6rem; border-radius: 2px; display: inline-block; }

/* 图元：环形图 */
.donut { position: relative; width: 9.5rem; height: 9.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.donut::after { content: ""; position: absolute; inset: 26%; background: var(--background-subtle); border-radius: 50%; border: 1px solid var(--border); }
.donut .dc { position: relative; z-index: 1; text-align: center; display: grid; gap: 0.1rem; }
.donut .dc b { display: block; font-size: 1.05rem; color: var(--foreground-intense); }
.donut .dc span { font-size: 0.72rem; color: var(--foreground-muted); }

/* 图元：柱状图 */
.bchart { display: flex; align-items: flex-end; gap: 1.1rem; height: 10rem; padding: 0 0.5rem; }
.bchart .bc { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; height: 100%; justify-content: flex-end; }
.bchart .bcol { width: 2.4rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); transition: height .8s cubic-bezier(.2,.8,.2,1); }
.bchart .bcol.alt { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.bchart .bcol.green { background: linear-gradient(180deg, #34d399, #059669); }
.bchart .bcol.teal { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.bchart .bcol.gray { background: var(--foreground-muted); }
.bchart .blab { font-size: 0.7rem; color: var(--foreground-muted); white-space: nowrap; }
.bchart .bval { font-size: 0.72rem; font-weight: 700; color: var(--foreground-strong); }

/* 图元：红绿灯表 */
.light3 { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.light-tbl { min-width: 13rem; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--background); }
.light-tbl .lrow { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; }
.light-tbl .lrow + .lrow { border-top: 1px solid var(--border); }
.light-dot { width: 0.85rem; height: 0.85rem; border-radius: 50%; flex-shrink: 0; }
.light-dot.g { background: var(--success-strong); box-shadow: 0 0 0 4px var(--success-subtle); }
.light-dot.y { background: var(--warning-strong); box-shadow: 0 0 0 4px var(--warning-subtle); }
.light-dot.r { background: var(--error-strong); box-shadow: 0 0 0 4px var(--error-subtle); }
.light-tbl .lt { font-size: 0.85rem; font-weight: 600; color: var(--foreground-strong); }
.light-tbl .ls { font-size: 0.78rem; color: var(--foreground-muted); }

/* 图元：场景插画（故事章） */
.scene {
  position: relative; width: 100%; max-width: 34rem; aspect-ratio: 16/9;
  border-radius: var(--radius-lg); overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, color-mix(in oklab, var(--gold) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--background-muted), var(--background-subtle));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.scene svg { width: 100%; height: 100%; display: block; }

/* 图元：分组小标签 */
.tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.tag.q { background: var(--qianqian-soft); color: var(--qianqian-fg); }
.tag.i { background: var(--indexfund-soft); color: var(--indexfund-fg); }
.tag.g { background: var(--success-subtle); color: var(--success-intense); }
.tag.y { background: var(--warning-subtle); color: var(--warning-intense); }
.tag.r { background: var(--error-subtle); color: var(--error-intense); }
.tag.gold { background: var(--gold-soft); color: var(--gold-deep); }

/* 图元：小图例（配图内部使用） */
.fig-note { width: 100%; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; justify-content: center; font-size: 0.78rem; color: var(--foreground-muted); }

/* 返回顶部 */
.to-top {
  position: fixed; right: 1.4rem; bottom: 1.6rem; z-index: 70;
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  border: 1px solid var(--border); background: var(--background);
  color: var(--foreground-muted); box-shadow: var(--shadow-md);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(6px);
  transition: opacity .25s, transform .25s, color .2s;
}
.to-top[data-on] { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--foreground-intense); transform: translateY(-2px); }
@media (max-width: 640px) { .to-top { right: 1rem; bottom: 1.1rem; } }
.fig-stack { display: grid; gap: 0.6rem; width: 100%; max-width: 30rem; }
.fig-hint { font-size: 0.75rem; color: var(--foreground-muted); text-align: center; width: 100%; }

/* 图元：场景插画内部排版 */
.sc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.9rem 1.2rem; }
.sc-emoji { font-size: 3rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.08)); }
.sc-emoji.sm { font-size: 2rem; }
.sc-emoji.lg { font-size: 3.6rem; }
.sc-bubble {
  max-width: 17rem; padding: 0.8rem 1.1rem;
  border-radius: 1.1rem 1.1rem 1.1rem 0.4rem;
  background: var(--background); border: 1px solid var(--border);
  font-size: 0.88rem; line-height: 1.7; color: var(--foreground-strong);
  box-shadow: var(--shadow-md);
}
.sc-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; width: 100%; }
.sc-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.8rem; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid color-mix(in oklab, var(--gold) 40%, transparent);
  color: var(--gold-deep); font-size: 0.82rem; font-weight: 600;
}
.sc-chip.teal { background: var(--indexfund-soft); border-color: color-mix(in oklab, var(--indexfund) 40%, transparent); color: var(--indexfund-fg); }
.sc-chip.green { background: var(--success-subtle); border-color: var(--success-strong); color: var(--success-intense); }
.sc-chip.red { background: var(--error-subtle); border-color: var(--error-strong); color: var(--error-intense); }

/* 图元：储蓄罐 */
.jar { position: relative; width: 3.7rem; height: 4.4rem; flex-shrink: 0; }
.jar .lid {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 2.6rem; height: 0.55rem; border-radius: 3px;
  background: linear-gradient(180deg, #e2c288, #b98a3e);
  border: 1px solid rgba(140, 90, 20, .4);
}
.jar .body {
  position: absolute; top: 0.45rem; left: 50%; transform: translateX(-50%);
  width: 3.3rem; height: 3.7rem; border-radius: 0.9rem 0.9rem 1.7rem 1.7rem;
  background:
    linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.05) 55%),
    linear-gradient(160deg, #f7d488, #e0a13e);
  border: 2px solid rgba(160, 105, 20, .5);
  box-shadow: inset -8px -10px 14px rgba(160, 105, 20, .2), inset 4px 6px 8px rgba(255, 255, 255, .35);
}
.jar .slot {
  position: absolute; top: 0.8rem; left: 50%; transform: translateX(-50%);
  width: 1.7rem; height: 0.42rem; border-radius: 3px;
  background: rgba(90, 55, 10, .55); border: 1px solid rgba(90, 55, 10, .4);
}
.jar .coin {
  position: absolute; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe9a8, var(--gold) 55%, var(--gold-deep));
  border: 1.5px solid rgba(122, 74, 5, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 800; color: #7a4a05;
}

/* 图元：时间线 */
.timeline { display: grid; width: 100%; max-width: 27rem; }
.tl-row { display: flex; gap: 0.9rem; align-items: flex-start; position: relative; padding-bottom: 1.05rem; }
.tl-row::before { content: ""; position: absolute; left: 0.55rem; top: 1.25rem; bottom: 0; width: 2px; background: var(--border-strong); }
.tl-row:last-child::before { display: none; }
.tl-dot {
  flex-shrink: 0; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border: 3px solid var(--background-subtle);
  box-shadow: 0 0 0 1px var(--border-strong); z-index: 1; margin-top: 0.15rem;
}
.tl-body { flex: 1; display: grid; gap: 0.1rem; }
.tl-y { font-size: 0.78rem; font-weight: 700; color: var(--gold-deep); }
.tl-t { font-size: 0.9rem; font-weight: 600; color: var(--foreground-intense); }
.tl-d { font-size: 0.8rem; color: var(--foreground-muted); line-height: 1.6; }

/* 图元：公式条 */
.formula {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.8rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); font-family: var(--font-mono);
  font-size: 1rem; color: var(--foreground-intense);
}
.formula .op { color: var(--gold-deep); font-weight: 700; }
.formula .eq { color: var(--foreground-muted); }
