/* ============================================================
   拆问题 · 学科地图 — 共享设计系统
   8 本书拆解复杂问题 · 中文图文教学网站
   ============================================================ */

/* ---------- 1. 变量与重置 ---------- */
:root {
  --bg: #F6F3EC;
  --bg-deep: #EFEAE0;
  --surface: #FFFFFF;
  --ink: #23201B;
  --ink-soft: #55504A;
  --muted: #8A8378;
  --line: #E6E0D4;
  --line-strong: #D8D0C0;

  --accent: #0F766E;
  --accent-soft: #CCFBF1;
  --accent-ink: #134E4A;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(35, 32, 27, .05), 0 8px 24px rgba(35, 32, 27, .07);
  --shadow-lg: 0 2px 4px rgba(35, 32, 27, .06), 0 18px 48px rgba(35, 32, 27, .12);
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); }

/* ---------- 2. 每本书的主题色 ---------- */
.accent-teal   { --accent: #0F766E; --accent-soft: #CCFBF1; --accent-ink: #134E4A; }
.accent-blue   { --accent: #1D4ED8; --accent-soft: #DBEAFE; --accent-ink: #1E3A8A; }
.accent-rose   { --accent: #BE123C; --accent-soft: #FFE4E6; --accent-ink: #881337; }
.accent-amber  { --accent: #B45309; --accent-soft: #FEF3C7; --accent-ink: #78350F; }
.accent-violet { --accent: #6D28D9; --accent-soft: #EDE9FE; --accent-ink: #4C1D95; }
.accent-orange { --accent: #C2410C; --accent-soft: #FFEDD5; --accent-ink: #7C2D12; }
.accent-green  { --accent: #15803D; --accent-soft: #DCFCE7; --accent-ink: #14532D; }
.accent-indigo { --accent: #4338CA; --accent-soft: #E0E7FF; --accent-ink: #312E81; }

/* ---------- 3. 顶部导航 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 243, 236, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; gap: 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-weight: 700; font-size: 17px;
  color: var(--ink); white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-brand svg { flex: none; }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-links > a, .drop-btn {
  display: inline-block; padding: 7px 13px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-soft); border: none; background: none;
  font-family: inherit; cursor: pointer; white-space: nowrap;
}
.nav-links > a:hover, .drop-btn:hover { background: var(--bg-deep); color: var(--ink); text-decoration: none; }
.nav-drop { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 200;
}
.nav-drop.open .drop-menu { display: block; }
.drop-menu a {
  display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px;
  color: var(--ink-soft);
}
.drop-menu a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
.drop-menu .drop-tag { font-size: 11px; color: var(--muted); margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 12px; font-size: 18px; cursor: pointer; color: var(--ink); }

/* 阅读进度条 */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 200; transition: width .1s linear;
}

/* ---------- 4. 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 380px at -10% 20%, #FDEBD3, transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 72px 20px 56px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--accent-ink); background: var(--accent-soft);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; letter-spacing: .5px;
}
.hero h1 {
  font-family: var(--font-serif); font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.25; margin: 22px 0 14px; letter-spacing: 1px;
}
.hero h1 .hl { color: var(--accent); position: relative; }
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--ink-soft); max-width: 720px; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-size: 15.5px; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .stat b { font-family: var(--font-serif); font-size: 30px; color: var(--ink); display: block; line-height: 1.2; }
.hero-stats .stat span { font-size: 13.5px; color: var(--muted); }

/* ---------- 5. 章节与容器 ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 56px 20px; }
.section-narrow { max-width: 880px; }
.section-head { margin-bottom: 28px; }
.section-head .kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--accent);
  text-transform: uppercase; display: block; margin-bottom: 8px;
}
.section-head h2 { font-family: var(--font-serif); font-size: clamp(26px, 3.4vw, 36px); line-height: 1.3; }
.section-head p.lead { color: var(--ink-soft); margin-top: 10px; max-width: 760px; }

.divider { border: none; border-top: 1px dashed var(--line-strong); max-width: var(--maxw); margin: 0 auto; }

/* ---------- 6. 书籍卡片 ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 18px; }
.book-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); text-decoration: none; }
.book-card .bc-num {
  font-family: var(--font-serif); font-size: 13px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 999px; padding: 2px 10px; width: fit-content;
}
.book-card .bc-title { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--ink); }
.book-card .bc-author { font-size: 13px; color: var(--muted); }
.book-card .bc-desc { font-size: 14px; color: var(--ink-soft); flex: 1; }
.book-card .bc-field { font-size: 12.5px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; width: fit-content; font-weight: 600; }
.book-card .bc-arrow { font-size: 14px; color: var(--accent); font-weight: 700; }

/* ---------- 7. 图解 figure ---------- */
.diagram {
  background: linear-gradient(180deg, #FFFFFF, #FAF8F3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 20px 18px;
  margin: 26px 0;
  box-shadow: var(--shadow);
}
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption {
  text-align: center; font-size: 13px; color: var(--muted);
  margin-top: 14px; line-height: 1.6;
}
.diagram figcaption b { color: var(--accent); }
/* 图解内的通用 SVG 样式 */
.diagram svg text { font-family: var(--font-sans); }
.d-title { font-size: 16.5px; font-weight: 700; fill: #23201B; }
.d-sub { font-size: 12.5px; fill: #8A8378; }
.d-note { font-size: 12.5px; fill: #6B6459; }
.d-arrow { stroke: #94A3B8; stroke-width: 2; fill: none; }
.d-arrow-head { fill: #94A3B8; }
.d-arrow-accent { stroke: var(--accent); stroke-width: 2.2; fill: none; }

/* 8 色盒子（用于多色图，如首页地图） */
.bx { stroke-width: 2; rx: 10; }
.bx-teal   { fill: #CCFBF1; stroke: #0F766E; }
.bx-blue   { fill: #DBEAFE; stroke: #1D4ED8; }
.bx-rose   { fill: #FFE4E6; stroke: #BE123C; }
.bx-amber  { fill: #FEF3C7; stroke: #B45309; }
.bx-violet { fill: #EDE9FE; stroke: #6D28D9; }
.bx-orange { fill: #FFEDD5; stroke: #C2410C; }
.bx-green  { fill: #DCFCE7; stroke: #15803D; }
.bx-indigo { fill: #E0E7FF; stroke: #4338CA; }
.bx-gray   { fill: #F1EFEA; stroke: #B7B0A4; }

/* 单色盒子（每本书页内，随主题色） */
.accent-teal   .d-box { fill: #E6FFFA; stroke: #0F766E; stroke-width: 2; }
.accent-blue   .d-box { fill: #EFF6FF; stroke: #1D4ED8; stroke-width: 2; }
.accent-rose   .d-box { fill: #FFF1F2; stroke: #BE123C; stroke-width: 2; }
.accent-amber  .d-box { fill: #FFFBEB; stroke: #B45309; stroke-width: 2; }
.accent-violet .d-box { fill: #F5F3FF; stroke: #6D28D9; stroke-width: 2; }
.accent-orange .d-box { fill: #FFF7ED; stroke: #C2410C; stroke-width: 2; }
.accent-green  .d-box { fill: #F0FDF4; stroke: #15803D; stroke-width: 2; }
.accent-indigo .d-box { fill: #EEF2FF; stroke: #4338CA; stroke-width: 2; }
.d-box { rx: 12; }
.d-box-strong { fill: var(--accent); stroke: var(--accent); stroke-width: 2; rx: 12; }
.d-box-strong text { fill: #fff; }
.d-line { stroke: var(--accent); stroke-width: 2; fill: none; }
.d-line-soft { stroke: #C9C2B4; stroke-width: 2; fill: none; }

/* ---------- 8. 正文章节（书页） ---------- */
.book-page .site-nav { background: rgba(255,255,255,.92); }
.book-hero {
  background:
    radial-gradient(700px 320px at 90% -20%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, #FFFFFF, var(--bg));
  border-bottom: 1px solid var(--line);
}
.book-hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 52px 20px 44px;
  display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: center;
}
.book-cover-svg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-lg); }
.book-kicker { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--accent); }
.book-meta h1 { font-family: var(--font-serif); font-size: clamp(30px, 4vw, 42px); margin: 8px 0 4px; }
.book-meta .book-author { font-size: 15px; color: var(--ink-soft); }
.book-one-liner {
  margin-top: 14px; font-size: 16.5px; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; line-height: 1.7;
}
.book-tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.book-tags span {
  font-size: 12.5px; color: var(--ink-soft); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 3px 12px; background: var(--surface);
}

.book-main { max-width: 880px; margin: 0 auto; padding: 20px 20px 70px; }
.chapter { margin-top: 54px; }
.chapter > h2 {
  font-family: var(--font-serif); font-size: clamp(23px, 3vw, 30px);
  padding-bottom: 10px; margin-bottom: 18px;
  border-bottom: 3px solid var(--accent-soft); display: flex; align-items: center; gap: 12px;
}
.chapter > h2 .cn { color: var(--accent); font-size: .7em; }
.chapter h3 { font-size: 19px; margin: 26px 0 10px; font-family: var(--font-serif); }
.chapter p { margin: 12px 0; color: var(--ink-soft); }
.chapter p strong, .chapter li strong { color: var(--ink); }
.chapter ul, .chapter ol { margin: 12px 0 12px 24px; color: var(--ink-soft); }
.chapter li { margin: 7px 0; }
.chapter blockquote {
  border-left: 4px solid var(--accent); background: var(--surface);
  padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 18px 0; color: var(--ink-soft);
}

/* 重点卡片 */
.key-point {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 14px; padding: 18px 20px; margin: 22px 0;
}
.key-point .kp-title { font-weight: 700; color: var(--accent-ink); margin-bottom: 6px; font-size: 15px; }
.key-point p, .key-point li { color: var(--accent-ink); }
.key-point ul { margin-left: 20px; }

/* 生活例子 / 行动清单 / 练习 */
.callout {
  border-radius: 14px; padding: 18px 20px; margin: 22px 0;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.callout .co-title { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.callout.life .co-title { color: #0E7490; }
.callout.life { border-left: 5px solid #06B6D4; }
.callout.tip .co-title { color: #B45309; }
.callout.tip { border-left: 5px solid #F59E0B; }
.callout.practice .co-title { color: #15803D; }
.callout.practice { border-left: 5px solid #22C55E; }
.callout p, .callout li { color: var(--ink-soft); }
.callout ul, .callout ol { margin-left: 20px; }

/* 一页速记 */
.cheatsheet { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.cs-card {
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
}
.cs-card b { display: block; color: var(--ink); margin-bottom: 6px; font-size: 15px; }
.cs-card span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }

/* ---------- 9. 视频 ---------- */
.video-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); background: #000;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------- 10. 时间线（12周路径） ---------- */
.week-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-top: 20px;
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
}
.week-card .wc-phase {
  font-family: var(--font-serif); font-weight: 700; font-size: 15px; color: #fff;
  background: var(--accent); border-radius: 12px; padding: 10px 14px; align-self: start; text-align: center;
}
.week-card h3 { font-family: var(--font-serif); font-size: 19px; }
.week-card .wc-weeks { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.week-card p, .week-card li { color: var(--ink-soft); }
.week-card ul { margin-left: 20px; }

/* ---------- 11. 表格（资源页） ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
table.res { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 620px; }
table.res th {
  text-align: left; font-size: 13.5px; color: var(--accent-ink); background: var(--accent-soft);
  padding: 12px 16px; white-space: nowrap;
}
table.res td { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14.5px; vertical-align: top; }
table.res tr:hover td { background: #FBF9F4; }
table.res .badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; margin-right: 6px; white-space: nowrap; }
.badge.ok { background: #DCFCE7; color: #15803D; }
.badge.warn { background: #FEF3C7; color: #B45309; }
.badge.free { background: #DBEAFE; color: #1D4ED8; }

/* ---------- 12. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 40px 20px 48px; margin-top: 30px;
}
.site-footer .f-inner { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .f-brand { font-family: var(--font-serif); font-weight: 700; font-size: 17px; }
.site-footer .f-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.site-footer .f-note { font-size: 12.5px; color: var(--muted); margin-top: 14px; max-width: var(--maxw); margin-left: auto; margin-right: auto; }

/* 书页底部翻页 */
.book-footer-nav {
  max-width: 880px; margin: 0 auto; padding: 10px 20px 60px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.book-footer-nav a {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; font-size: 14px; color: var(--ink-soft); box-shadow: var(--shadow);
}
.book-footer-nav a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--accent); font-size: 20px; cursor: pointer;
  box-shadow: var(--shadow-lg); display: none; align-items: center; justify-content: center;
}
.to-top.show { display: flex; }

/* ---------- 13. 动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .book-card:hover { transform: none; }
}

/* ---------- 14. 响应式 ---------- */
@media (max-width: 860px) {
  .book-hero-inner { grid-template-columns: 150px 1fr; gap: 24px; }
  .week-card { grid-template-columns: 1fr; }
  .week-card .wc-phase { width: fit-content; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .drop-menu { position: static; box-shadow: none; border: none; padding: 0 0 0 12px; }
  .book-hero-inner { grid-template-columns: 1fr; }
  .book-cover-svg { max-width: 200px; }
  .hero-stats { gap: 20px; }
  .hero-stats .stat b { font-size: 24px; }
  .section { padding: 44px 16px; }
}
