/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,800;1,600&family=Lora:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== Design Tokens (SYSU 中大绿 · Editorial Academic) ===== */
:root {
  /* 中大绿 palette — oklch perceptually uniform */
  --green-900: oklch(22% 0.08 155deg);   /* sidebar base */
  --green-800: oklch(28% 0.10 155deg);   /* sidebar hover */
  --green-700: oklch(34% 0.12 155deg);   /* sidebar active bg */
  --green-600: oklch(40% 0.13 153deg);   /* primary brand #006E3C equiv */
  --green-500: oklch(52% 0.14 152deg);   /* interactive */
  --green-400: oklch(64% 0.13 152deg);   /* links hover */
  --green-200: oklch(88% 0.06 153deg);   /* light accent */
  --green-100: oklch(94% 0.03 155deg);   /* surface tint */
  --green-50:  oklch(97% 0.015 155deg);  /* background tint */

  /* Surfaces */
  --bg:         oklch(98.5% 0.005 90deg);   /* warm cream, not pure white */
  --surface:    oklch(100% 0 0);
  --surface2:   oklch(96% 0.008 155deg);    /* subtle green tint */
  --border:     oklch(88% 0.015 155deg);
  --border-mid: oklch(80% 0.025 155deg);

  /* Sidebar */
  --sidebar-bg:      var(--green-900);
  --sidebar-border:  var(--green-800);
  --sidebar-text:    oklch(82% 0.05 155deg);
  --sidebar-muted:   oklch(62% 0.06 155deg);
  --sidebar-active:  oklch(98% 0.02 155deg);
  --sidebar-hover:   oklch(36% 0.10 155deg);

  /* Text */
  --text:       oklch(16% 0.025 155deg);   /* almost black, green tint */
  --text-mid:   oklch(38% 0.04 155deg);
  --text-muted: oklch(52% 0.04 155deg);
  --text-dim:   oklch(68% 0.03 155deg);

  /* Accent */
  --accent:     var(--green-600);
  --accent-mid: var(--green-500);
  --accent-lt:  var(--green-400);

  /* State colors */
  --red:    oklch(52% 0.18 25deg);
  --yellow: oklch(68% 0.16 80deg);
  --blue:   oklch(52% 0.14 240deg);

  /* Layout */
  --sidebar-w: 256px;
  --content-max: 780px;
  --radius: 6px;
  --radius-sm: 3px;

  /* Type */
  --font-display: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --font-body:    'Lora', 'Noto Serif SC', Georgia, serif;
  --font-ui:      'DM Sans', 'PingFang SC', system-ui, sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-mid:  250ms;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--green-700); }

.sidebar-header {
  padding: 28px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-book-title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin-bottom: 8px;
}
.sidebar-ch-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-active);
  line-height: 1.4;
}

.toc-list { padding: 16px 0; list-style: none; }
.toc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 20px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background var(--t-fast), color var(--t-fast);
  line-height: 1.4;
}
.toc-link:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.toc-link.active {
  color: var(--sidebar-active);
  border-left-color: var(--green-200);
  background: color-mix(in oklch, var(--green-200) 12%, transparent);
  font-weight: 500;
}
.toc-link.section {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-active);
  padding-top: 10px;
  padding-bottom: 10px;
}
.toc-link.sub { padding-left: 32px; }
.toc-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--sidebar-muted);
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.toc-link.active .toc-dot { background: var(--green-200); }

.sidebar-progress {
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--sidebar-border);
}
.progress-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin-bottom: 8px;
}
.progress-bar-bg {
  height: 2px;
  background: var(--green-800);
  border-radius: 1px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green-200);
  border-radius: 1px;
  width: 0%;
  transition: width 0.4s var(--ease-out);
}
.progress-pct {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-top: 6px;
}

/* ===== Main Content ===== */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 64px 72px 120px;
  max-width: calc(var(--sidebar-w) + var(--content-max));
}

/* ===== Chapter Header ===== */
.chapter-header {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 2px solid var(--border-mid);
}
.chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-bottom: 20px;
}
.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--green-600);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.chapter-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.chapter-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
}
.meta-icon { font-size: 14px; }

/* ===== Roadmap Card ===== */
.roadmap-card {
  background: var(--green-100);
  border: 1px solid var(--green-200);
  border-left: 3px solid var(--green-500);
  border-radius: var(--radius);
  margin-bottom: 56px;
  overflow: hidden;
}
.roadmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
}
.roadmap-header:hover { background: color-mix(in oklch, var(--green-200) 30%, transparent); }
.roadmap-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--green-600);
}
.roadmap-icon { font-size: 16px; }
.roadmap-toggle {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-dim);
  transition: transform var(--t-fast);
}
.roadmap-card.open .roadmap-toggle { transform: rotate(180deg); }
.roadmap-body {
  border-top: 1px solid var(--green-200);
  padding: 20px;
  display: none;
}
.roadmap-card.open .roadmap-body { display: block; }
.roadmap-questions {
  list-style: none;
  counter-reset: rq;
  margin-bottom: 20px;
}
.roadmap-questions li {
  padding: 5px 0 5px 24px;
  position: relative;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-mid);
  counter-increment: rq;
}
.roadmap-questions li::before {
  content: counter(rq);
  position: absolute;
  left: 0;
  color: var(--green-500);
  font-weight: 700;
  font-size: 12px;
  top: 7px;
  background: var(--green-100);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.roadmap-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.roadmap-tag {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 10px;
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  background: var(--surface);
}
.roadmap-tag strong { color: var(--green-600); font-weight: 600; }

/* ===== Section Headers ===== */
.section { margin-bottom: 64px; scroll-margin-top: 24px; }
.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
}
.section-num {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-mid);
  text-transform: uppercase;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-desc {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.65;
  max-width: 64ch;
}

.subsection { margin-bottom: 44px; scroll-margin-top: 24px; }
.subsection-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

/* ===== Task Cards Grid ===== */
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}
.task-card {
  background: var(--surface);
  transition: background var(--t-fast);
}
.task-card.expanded { background: var(--green-50); }

.task-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
}
.task-header:hover { background: var(--surface2); }
.task-card.expanded .task-header { background: var(--green-100); }
.task-emoji { font-size: 22px; flex-shrink: 0; }
.task-names { flex: 1; min-width: 0; }
.task-name-zh {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.task-name-en {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.task-expand-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-mid);
  background: none;
  border: 1px solid var(--green-200);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--t-fast);
}
.task-expand-btn:hover,
.task-card.expanded .task-expand-btn {
  background: var(--green-600);
  border-color: var(--green-600);
  color: white;
}
.task-expand-icon { transition: transform var(--t-fast); }
.task-card.expanded .task-expand-icon { transform: rotate(180deg); }

.task-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--green-200);
}
.task-card.expanded .task-body { display: block; }

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: var(--surface2);
  padding: 9px 14px;
  text-align: left;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
  color: var(--text-muted);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
td:first-child { color: var(--text); font-weight: 500; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  font-family: var(--font-ui);
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.b-strong { background: color-mix(in oklch, var(--green-500) 18%, white); color: var(--green-600); }
.b-medium { background: oklch(94% 0.08 80deg); color: oklch(45% 0.15 80deg); }
.b-weak   { background: oklch(95% 0.06 25deg); color: oklch(45% 0.18 25deg); }
.b-yes    { background: color-mix(in oklch, var(--green-500) 15%, white); color: var(--green-600); }
.b-no     { background: var(--surface2); color: var(--text-dim); }
.b-partial{ background: oklch(94% 0.08 80deg); color: oklch(45% 0.15 80deg); }

/* ===== Tags ===== */
.task-tag {
  display: inline-block;
  font-family: var(--font-ui);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 12px;
}
.tag-stat     { background: var(--surface2); color: var(--green-600); border: 1px solid var(--green-200); }
.tag-ml       { background: oklch(94% 0.07 80deg); color: oklch(45% 0.15 80deg); }
.tag-dl       { background: oklch(95% 0.05 240deg); color: oklch(45% 0.14 240deg); }
.tag-fm       { background: var(--green-100); color: var(--green-600); }
.tag-industry { background: oklch(95% 0.06 32deg); color: oklch(45% 0.16 32deg); }

/* ===== Formal Definition Box ===== */
.formal-def {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0 12px;
}
.formal-def h5 {
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-500);
  margin-bottom: 8px;
  font-weight: 700;
}
.formal-def p {
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ===== Key Takeaways ===== */
.key-takeaway {
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--green-500);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  background: var(--surface);
}
.kt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  user-select: none;
}
.kt-header:hover { background: var(--surface2); }
.kt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--green-600);
}
.kt-icon { font-size: 14px; }
.kt-toggle {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  transition: transform var(--t-fast);
}
.key-takeaway.open .kt-toggle { transform: rotate(180deg); }
.kt-body {
  display: none;
  padding: 0 16px 14px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}
.key-takeaway.open .kt-body { display: block; }
.kt-body p { padding-top: 12px; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}
.filter-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.filter-btn {
  font-family: var(--font-ui);
  padding: 5px 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--t-fast);
}
.filter-btn:hover { border-color: var(--green-400); color: var(--green-600); }
.filter-btn.active {
  background: var(--green-600);
  border-color: var(--green-600);
  color: white;
  font-weight: 600;
}

/* ===== Era Timeline ===== */
.era-timeline { margin: 32px 0; }
.era-track {
  display: flex;
  align-items: flex-start;
  position: relative;
  gap: 0;
  padding-bottom: 4px;
}
.era-track::before {
  content: '';
  position: absolute;
  top: 19px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: var(--border-mid);
}
.era-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0 8px;
  position: relative;
  transition: var(--t-fast);
}
.era-node {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-mid);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 1;
  margin-bottom: 10px;
  transition: var(--t-fast);
}
.era-item:hover .era-node,
.era-item.active .era-node {
  border-color: var(--green-500);
  background: var(--green-100);
  transform: scale(1.08);
}
.era-period {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 3px;
  text-align: center;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.era-name {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}
.era-item.active .era-name { color: var(--green-600); }

.era-details { margin-top: 24px; }
.era-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--green-500);
  border-radius: var(--radius);
  padding: 24px;
  animation: slideDown 0.2s var(--ease-out);
}
.era-panel.active { display: block; }
.era-panel h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.era-panel p {
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.7;
}
.era-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.era-method-tag {
  font-family: var(--font-ui);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.era-method-tag.highlight {
  background: var(--green-100);
  border-color: var(--green-200);
  color: var(--green-600);
  font-weight: 600;
}

/* ===== Benchmark Cards ===== */
.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.benchmark-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.benchmark-card:hover {
  border-color: var(--green-400);
  transform: translateY(-1px);
}
.benchmark-card.hidden { display: none; }
.benchmark-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.benchmark-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.benchmark-task-tag {
  flex-shrink: 0;
  font-family: var(--font-ui);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.benchmark-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.benchmark-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.b-stat {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-dim);
}
.b-stat strong { color: var(--green-600); font-weight: 600; }

/* ===== Info / Warning Boxes ===== */
.info-box {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-left: 3px solid var(--green-400);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-mid);
  line-height: 1.7;
}
.info-box strong { color: var(--green-600); }

.controversy-box {
  background: oklch(97% 0.04 32deg);
  border: 1px solid oklch(88% 0.08 32deg);
  border-left: 3px solid oklch(55% 0.16 32deg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
}
.controversy-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: oklch(45% 0.16 32deg);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.controversy-box p {
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ===== Foundation Model Table ===== */
.fm-coverage-table td { text-align: center; }
.fm-coverage-table td:first-child { text-align: left; }
.fm-dot { font-size: 15px; }
.fm-full    { color: var(--green-500); }
.fm-partial { color: oklch(60% 0.15 80deg); }
.fm-none    { color: var(--text-dim); }

/* ===== Pitfalls ===== */
.pitfall-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.pitfall-item {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  align-items: flex-start;
}
.pitfall-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.pitfall-name {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: oklch(40% 0.18 25deg);
  margin-bottom: 4px;
}
.pitfall-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
}
.pitfall-fix {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--green-600);
  font-weight: 500;
  margin-top: 5px;
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* ===== Symbol Tooltip ===== */
.sym {
  color: var(--green-600);
  border-bottom: 1px dashed var(--green-300, var(--green-400));
  cursor: help;
  position: relative;
}
.sym::after {
  content: attr(data-def);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-900);
  color: var(--sidebar-active);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1000;
}
.sym:hover::after { opacity: 1; }

/* ===== Chapter Summary ===== */
.summary-card {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 40px;
}
.summary-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.summary-card p {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 14px;
}
.reader-tips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.reader-tip {
  background: var(--surface);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.reader-tip-role {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: var(--green-600);
  margin-bottom: 6px;
}
.reader-tip-text {
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ===== Animations ===== */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }

/* ===== MathJax ===== */
mjx-container { overflow-x: auto; max-width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding: 28px 24px 80px; }
  .task-grid { grid-template-columns: 1fr; }
  .benchmark-grid { grid-template-columns: 1fr; }
  .reader-tips { grid-template-columns: 1fr; }
  .era-period { display: none; }
  .chapter-title { font-size: 28px; }
}
