/* ============================================================
   智元机器人生态布局图谱 · Blueprint Dark 设计系统
   单一来源 CSS，所有章节共享
   ============================================================ */

:root {
  --bg-base: #0a0e14;
  --bg-paper: #0d131c;
  --bg-surface: #131a24;
  --bg-elevated: #1a2330;
  --bg-card: #131a24;

  --grid-line: rgba(58, 193, 201, 0.05);
  --grid-line-bold: rgba(58, 193, 201, 0.1);
  --border: #243447;
  --border-strong: rgba(58, 193, 201, 0.35);

  --cyan: #3ac1c9;
  --cyan-deep: #268a90;
  --amber: #e8a33d;
  --amber-deep: #b87a1f;
  --red: #c85c5c;
  --green: #5fb98a;
  --violet: #9d8de0;

  --text-primary: #e6edf3;
  --text-secondary: #a3b1c2;
  --text-muted: #6d7d90;
  --text-dim: #4a5666;

  --font-display: 'Smiley Sans', 'Alibaba PuHuiTi 2.0', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 18.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-bold) 1px, transparent 1px),
    radial-gradient(ellipse at 15% 0%, rgba(58, 193, 201, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 100%, rgba(232, 163, 61, 0.05) 0%, transparent 50%);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px, 100% 100%, 100% 100%;
  min-height: 100vh;
}

.app { display: grid; grid-template-columns: 260px 1fr; max-width: 1680px; margin: 0 auto; min-height: 100vh; }

/* ---------- Sidebar ---------- */
#sidebar-mount { position: relative; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13,19,28,.95) 0%, rgba(10,14,20,.9) 100%);
  backdrop-filter: blur(10px);
  padding: 28px 20px; overflow-y: auto; z-index: 50;
  display: flex; flex-direction: column;
}
.sidebar-brand { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px dashed var(--border); }
.sidebar-brand .codename { font-family: var(--font-mono); font-size: 14px; letter-spacing: .18em; color: var(--cyan); text-transform: uppercase; margin-bottom: 8px; }
.sidebar-brand h1 { font-family: var(--font-display); font-weight: 700; font-size: 22.5px; line-height: 1.25; }
.sidebar-brand h1 a { color: var(--text-primary); text-decoration: none; }
.sidebar-brand .subtitle { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); margin-top: 6px; letter-spacing: .04em; }
.nav-list { list-style: none; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-list a { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; color: var(--text-secondary); text-decoration: none; font-size: 16.5px; border-radius: 3px; border-left: 2px solid transparent; transition: all .15s; line-height: 1.4; }
.nav-list a:hover { background: rgba(58,193,201,.07); color: var(--text-primary); }
.nav-list a.active { background: rgba(58,193,201,.12); color: var(--cyan); border-left-color: var(--cyan); }
.nav-list a .num { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); min-width: 22px; }
.nav-list a.active .num { color: var(--amber); }
.sidebar-footer { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); font-family: var(--font-mono); font-size: 13.5px; color: var(--text-dim); line-height: 1.7; }
.sidebar-footer .meta-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.sidebar-footer .meta-row span:last-child { color: var(--text-secondary); }

.main { min-width: 0; }

/* ---------- Chapter frame ---------- */
section.chapter, .hero-section { padding: 64px 56px 88px; border-bottom: 1px solid var(--border); position: relative; }
.chapter-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px dashed var(--border); gap: 28px; }
.chapter-header .left { flex: 1; min-width: 0; }
.chapter-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 14.5px; letter-spacing: .18em; color: var(--cyan); text-transform: uppercase; margin-bottom: 12px; }
.chapter-tag::before { content: ''; width: 22px; height: 1px; background: var(--cyan); }
.chapter-title { font-family: var(--font-display); font-weight: 700; font-size: 39.5px; line-height: 1.1; letter-spacing: -.01em; margin-bottom: 14px; }
.chapter-title .accent { color: var(--amber); }
.chapter-subtitle { font-size: 18px; color: var(--text-secondary); max-width: 720px; line-height: 1.75; }
.chapter-meta { font-family: var(--font-mono); font-size: 14.5px; color: var(--text-muted); text-align: right; line-height: 1.7; white-space: nowrap; }
.chapter-meta .num { font-family: var(--font-display); font-size: 45.5px; font-weight: 300; color: var(--text-dim); line-height: .85; display: block; }

.chap-nav { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 20px; border-top: 1px dashed var(--border); font-family: var(--font-mono); font-size: 16px; }
.chap-nav a { color: var(--text-secondary); text-decoration: none; padding: 8px 14px; border: 1px solid var(--border); border-radius: 3px; transition: all .15s; }
.chap-nav a:hover { color: var(--cyan); border-color: var(--cyan); }
.chap-nav .idx { color: var(--text-muted); }

.divider-dash { display: flex; align-items: center; gap: 12px; margin: 36px 0; font-family: var(--font-mono); font-size: 14px; letter-spacing: .18em; color: var(--text-dim); text-transform: uppercase; }
.divider-dash::before, .divider-dash::after { content: ''; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 14px); }

/* ---------- Hero ---------- */
.hero-section { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hero-section::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 80% 20%, rgba(58,193,201,.12), transparent 50%), radial-gradient(circle at 15% 85%, rgba(232,163,61,.08), transparent 50%); pointer-events: none; }
.hero-meta-row { display: flex; justify-content: space-between; margin-bottom: 48px; position: relative; z-index: 1; font-family: var(--font-mono); font-size: 14.5px; color: var(--text-muted); letter-spacing: .12em; }
.hero-meta-row .key { color: var(--cyan); }
.hero-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(38px, 5.6vw, 64px); line-height: 1.18; letter-spacing: -.02em; margin-bottom: 24px; position: relative; z-index: 1; }
.hero-title .accent { color: var(--amber); }
.hero-lede { max-width: 760px; margin: 20px 0 44px; font-size: 20px; line-height: 1.85; color: var(--text-secondary); position: relative; z-index: 1; }
.hero-lede strong { color: var(--cyan); font-weight: 600; }
.hero-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; margin: 32px 0; position: relative; z-index: 1; }
.hero-stat { padding: 20px 20px 22px; background: linear-gradient(180deg, rgba(26,35,48,.6) 0%, rgba(26,35,48,.2) 100%); border: 1px solid var(--border); border-top: 1px solid var(--border-strong); border-radius: 3px; }
.hero-stat .lbl { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.hero-stat .val { font-family: var(--font-display); font-weight: 700; font-size: 31.5px; line-height: 1.1; color: var(--cyan); letter-spacing: -.01em; margin-bottom: 6px; }
.hero-stat .val .unit { font-family: var(--font-body); font-size: 16.5px; color: var(--text-muted); font-weight: 400; margin-left: 3px; }
.hero-stat .note { font-size: 15.5px; color: var(--text-muted); line-height: 1.5; }
.hero-stat:nth-child(2) .val { color: var(--amber); }
.hero-stat:nth-child(3) .val { color: var(--green); }
.hero-stat:nth-child(4) .val { color: var(--violet); }
.hero-jump { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; background: rgba(58,193,201,.06); border: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; font-family: var(--font-mono); font-size: 15.5px; border-radius: 3px; transition: all .2s; }
.hero-jump a:hover { background: rgba(58,193,201,.14); border-color: var(--cyan); color: var(--cyan); transform: translateY(-1px); }
.hero-jump a .arrow { color: var(--amber); }

/* index chapter cards */
.chapter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 16px; position: relative; z-index: 1; }
.chapter-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 20px 22px; text-decoration: none; display: block; transition: all .18s; position: relative; }
.chapter-card:hover { border-color: var(--cyan); background: var(--bg-elevated); transform: translateY(-2px); }
.chapter-card .cc-num { font-family: var(--font-mono); font-size: 14.5px; color: var(--amber); letter-spacing: .12em; margin-bottom: 8px; }
.chapter-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 20.5px; color: var(--text-primary); margin-bottom: 6px; line-height: 1.3; }
.chapter-card p { font-size: 16.5px; color: var(--text-muted); line-height: 1.55; }

/* ---------- Tree diagram (upstream/downstream atlas) ---------- */
.tree-wrap { background: var(--bg-paper); border: 1px solid var(--border); border-radius: 4px; padding: 26px 28px; margin: 24px 0; position: relative; overflow-x: auto; }
.tree-wrap::before { content: attr(data-tag); position: absolute; top: 10px; right: 16px; font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); letter-spacing: .14em; }
.tree-root { font-family: var(--font-mono); font-size: 17px; color: var(--text-primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); font-weight: 600; }
.tree-module { margin: 18px 0; padding-left: 4px; }
.tree-module-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tree-module-head .icon { font-family: var(--font-mono); color: var(--cyan); font-size: 17px; }
.tree-module-head h4 { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--text-primary); }
.tree-module-head .role { font-size: 16px; color: var(--text-muted); }
.tree-branch { margin-left: 26px; padding-left: 18px; border-left: 1px dashed var(--border-strong); margin-bottom: 8px; }
.tree-branch .part { font-size: 17px; color: var(--amber); font-weight: 600; margin-bottom: 4px; }
.tree-branch .link { font-size: 16.5px; color: var(--text-secondary); line-height: 1.65; }
.tree-branch .link .co { color: var(--text-primary); font-weight: 600; }
.tree-branch .link .src { color: var(--text-muted); font-size: 15.5px; }
.tree-branch.absent .part { color: var(--text-dim); }
.tree-branch.absent .link { color: var(--text-dim); font-style: italic; }

/* ---------- Deep-dive case cards ---------- */
.case-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--cyan); border-radius: 3px; padding: 22px 24px; margin-bottom: 20px; }
.case-card.amber { border-left-color: var(--amber); }
.case-card.violet { border-left-color: var(--violet); }
.case-card .case-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.case-card h4 { font-family: var(--font-display); font-weight: 700; font-size: 22.5px; color: var(--text-primary); }
.case-card .case-head-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.case-card .case-tag { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); letter-spacing: .1em; white-space: nowrap; }
.case-card p { font-size: 17.5px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 8px; }
.case-card .quote { border-left: 2px solid var(--border-strong); padding-left: 14px; margin: 12px 0; font-size: 17px; color: var(--text-muted); font-style: italic; line-height: 1.7; }
.case-card .src-line { font-family: var(--font-mono); font-size: 15px; color: var(--text-dim); margin-top: 10px; }

/* ---------- JV badge (equity joint-venture marker) ---------- */
.jv-badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .09em; color: var(--violet); background: rgba(157,141,224,.13); border: 1px solid rgba(157,141,224,.5); padding: 3px 10px 4px; border-radius: 20px; text-transform: uppercase; white-space: nowrap; }
.jv-badge.sub { background: rgba(157,141,224,.07); color: #b6aae8; }
table.data-tbl .jv-badge { font-size: 12px; padding: 2px 8px 3px; }

/* ---------- Timeline (funding rounds / policy) ---------- */
.timeline { position: relative; padding-left: 36px; margin: 24px 0; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 1px; background: linear-gradient(180deg, var(--cyan), var(--amber)); }
.tl-item { position: relative; margin-bottom: 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 16px 20px 18px; }
.tl-item::before { content: ''; position: absolute; left: -30px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-base); border: 2px solid var(--cyan); }
.tl-item .tl-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.tl-item .tl-date { font-family: var(--font-mono); font-size: 15px; color: var(--amber); letter-spacing: .06em; }
.tl-item h5 { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--text-primary); }
.tl-item p { font-size: 16.5px; color: var(--text-secondary); line-height: 1.65; }
.tl-item .tl-amt { font-family: var(--font-mono); color: var(--cyan); font-weight: 600; }

/* ---------- Tables ---------- */
.tbl-wrap { background: var(--bg-paper); border: 1px solid var(--border); border-radius: 4px; padding: 22px; overflow-x: auto; margin: 20px 0; }
table.data-tbl { width: 100%; border-collapse: collapse; font-size: 17px; }
table.data-tbl th, table.data-tbl td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data-tbl thead th { font-family: var(--font-mono); font-size: 14.5px; letter-spacing: .08em; color: var(--cyan); text-transform: uppercase; border-bottom: 2px solid var(--border-strong); }
table.data-tbl tbody tr:hover { background: rgba(58,193,201,.03); }
table.data-tbl td.num { font-family: var(--font-mono); color: var(--amber); }

/* ---------- JV overview table: fixed column budget for 8 dense cols ---------- */
.tbl-wrap.jv-wide { padding: 18px 16px; }
table.data-tbl.jv-tbl {
  table-layout: fixed;
  width: 100%;
  min-width: 1320px;
  font-size: 14.5px;
  line-height: 1.55;
  border-spacing: 0;
}
table.data-tbl.jv-tbl th,
table.data-tbl.jv-tbl td {
  padding: 12px 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}
table.data-tbl.jv-tbl thead th {
  font-size: 12.5px;
  letter-spacing: .06em;
  line-height: 1.35;
  padding: 12px 10px;
  white-space: normal;
}
table.data-tbl.jv-tbl col.c-name { width: 15%; }
table.data-tbl.jv-tbl col.c-partner { width: 13%; }
table.data-tbl.jv-tbl col.c-pshare { width: 8%; }
table.data-tbl.jv-tbl col.c-ashare { width: 7%; }
table.data-tbl.jv-tbl col.c-capital { width: 7%; }
table.data-tbl.jv-tbl col.c-date { width: 7%; }
table.data-tbl.jv-tbl col.c-scope { width: 14%; }
table.data-tbl.jv-tbl col.c-status { width: 29%; }
table.data-tbl.jv-tbl td.num,
table.data-tbl.jv-tbl td:nth-child(5),
table.data-tbl.jv-tbl td:nth-child(6) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
table.data-tbl.jv-tbl td.num span,
table.data-tbl.jv-tbl td.c-tight span {
  white-space: normal;
  display: block;
  margin-top: 4px;
  line-height: 1.4;
}
table.data-tbl.jv-tbl td:nth-child(1) { font-weight: 600; color: var(--text-primary); }
table.data-tbl.jv-tbl td:nth-child(7),
table.data-tbl.jv-tbl td:nth-child(8) {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}
table.data-tbl.jv-tbl td:nth-child(8) strong { color: var(--text-primary); font-weight: 600; }

/* Natural-person JV side table (6 cols) */
table.data-tbl.jv-tbl-np {
  table-layout: fixed;
  min-width: 1100px;
  font-size: 14.5px;
  line-height: 1.55;
}
table.data-tbl.jv-tbl-np th,
table.data-tbl.jv-tbl-np td { padding: 12px 12px; word-break: break-word; }
table.data-tbl.jv-tbl-np col.c-np-name { width: 14%; }
table.data-tbl.jv-tbl-np col.c-np-share { width: 10%; }
table.data-tbl.jv-tbl-np col.c-np-people { width: 20%; }
table.data-tbl.jv-tbl-np col.c-np-verify { width: 28%; }
table.data-tbl.jv-tbl-np col.c-np-meta { width: 12%; }
table.data-tbl.jv-tbl-np col.c-np-biz { width: 16%; }
table.data-tbl.jv-tbl-np td.num { white-space: nowrap; }
table.data-tbl.jv-tbl-np td.num span { white-space: normal; display: block; margin-top: 4px; }

/* ---------- Player / card grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 20px 0; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.player-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 20px 20px 22px; position: relative; }
.player-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--cyan); }
.player-card.self::before { background: linear-gradient(90deg, var(--amber), var(--cyan)); }
.player-card h4 { font-family: var(--font-display); font-weight: 700; font-size: 20.5px; margin-bottom: 4px; }
.player-card .p-sub { font-family: var(--font-mono); font-size: 14.5px; color: var(--text-muted); margin-bottom: 12px; }
.player-card .p-row { font-size: 16.5px; color: var(--text-secondary); margin: 5px 0; line-height: 1.6; }
.player-card .p-row .k { color: var(--text-muted); font-family: var(--font-mono); font-size: 14.5px; margin-right: 6px; }

/* ---------- Callouts ---------- */
.callout { background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--cyan); padding: 18px 22px; border-radius: 3px; margin: 20px 0; }
.callout.warn { border-left-color: var(--amber); }
.callout.dim { border-left-color: var(--text-dim); }
.callout.violet { border-left-color: var(--violet); }
.callout h5 { font-family: var(--font-display); font-weight: 700; font-size: 18.5px; margin-bottom: 8px; color: var(--text-primary); }
.callout p { font-size: 17px; color: var(--text-secondary); line-height: 1.7; }

/* ---------- Glossary ---------- */
.glossary-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; background: var(--bg-paper); border: 1px solid var(--border); border-radius: 3px; padding: 12px 16px; position: sticky; top: 10px; z-index: 20; backdrop-filter: blur(8px); flex-wrap: wrap; }
.gloss-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 2px; padding: 9px 12px; }
.gloss-search input { flex: 1; background: none; border: none; outline: none; color: var(--text-primary); font-family: var(--font-mono); font-size: 16.5px; }
.gloss-search input::placeholder { color: var(--text-dim); }
.gloss-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.gloss-filter { font-family: var(--font-mono); font-size: 14px; letter-spacing: .06em; padding: 5px 10px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 2px; cursor: pointer; user-select: none; transition: all .15s; }
.gloss-filter:hover { color: var(--text-primary); border-color: var(--border-strong); }
.gloss-filter.active { background: var(--cyan); color: var(--bg-base); border-color: var(--cyan); font-weight: 600; }
.gloss-count { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.gloss-groups { display: grid; gap: 24px; }
.gloss-group { background: var(--bg-paper); border: 1px solid var(--border); border-radius: 4px; padding: 20px 24px; }
.gloss-group h4 { font-family: var(--font-display); font-weight: 700; font-size: 19.5px; margin-bottom: 4px; }
.gloss-group .gdesc { font-size: 15.5px; color: var(--text-muted); margin-bottom: 14px; }
.gloss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.gloss-term { background: var(--bg-card); border: 1px solid var(--border); border-left: 2px solid var(--cyan); padding: 10px 12px 12px; border-radius: 2px; }
.gloss-term .tk { font-family: var(--font-mono); font-size: 16.5px; font-weight: 700; color: var(--text-primary); }
.gloss-term .tdef { font-size: 15.5px; color: var(--text-secondary); line-height: 1.6; margin-top: 4px; }
.gloss-term.hidden { display: none; }
.gloss-group.cat-mech .gloss-term { border-left-color: var(--cyan); }
.gloss-group.cat-ai .gloss-term { border-left-color: var(--violet); }
.gloss-group.cat-capital .gloss-term { border-left-color: var(--amber); }
.gloss-group.cat-market .gloss-term { border-left-color: var(--green); }

/* ---------- Footer ---------- */
.doc-footer { padding: 40px 56px 56px; border-top: 2px solid var(--border); background: var(--bg-paper); font-family: var(--font-mono); font-size: 14.5px; color: var(--text-muted); line-height: 1.8; }
.doc-footer .frow { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 6px; flex-wrap: wrap; }
.doc-footer .frow strong { color: var(--cyan); font-weight: 500; letter-spacing: .08em; }
.doc-footer .signoff { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); font-family: var(--font-display); font-size: 17px; color: var(--text-secondary); }

/* ---------- Tooltip ---------- */
abbr.term { text-decoration: none; border-bottom: 1px dotted var(--cyan); cursor: help; color: inherit; }
.tooltip { position: fixed; z-index: 1000; max-width: 280px; background: var(--bg-elevated); border: 1px solid var(--cyan); border-radius: 3px; padding: 10px 13px; font-size: 16px; line-height: 1.55; color: var(--text-primary); box-shadow: 0 10px 28px rgba(0,0,0,.5); pointer-events: none; opacity: 0; transition: opacity .15s; }
.tooltip.show { opacity: 1; }
.tooltip .tt-name { font-family: var(--font-mono); font-weight: 700; color: var(--cyan); margin-bottom: 3px; font-size: 15px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.shown { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .app { grid-template-columns: 210px 1fr; }
  section.chapter, .hero-section { padding: 48px 32px 64px; }
  .hero-stats { grid-template-columns: repeat(2,1fr); }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .chapter-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .card-grid, .card-grid.cols-2 { grid-template-columns: 1fr; }
  .hero-title { font-size: 34.5px; }
  .tree-branch { margin-left: 12px; padding-left: 12px; }
}
@media print {
  body { background: white; color: black; }
  .sidebar, .chap-nav, .hero-jump { display: none; }
  .app { grid-template-columns: 1fr; }
  section.chapter { page-break-inside: avoid; }
}
