/* ==========================================================================
   CET-4 Crash Handbook — Anthropic Editorial Warm-Paper Design System
   ========================================================================== */

:root {
  /* Warm paper & archival ink palette */
  --bg-page: #FAF9F5;
  --bg-subtle: #F3F1EA;
  --bg-surface: #FFFDF9;
  --bg-ink: #141413;
  --bg-ink-hover: #2A2926;

  --text-primary: #141413;
  --text-secondary: #4E4C46;
  --text-muted: #65625A;
  --text-on-ink: #FAF9F5;

  /* Anthropic terracotta & archival sage */
  --accent: #D97757;
  --accent-hover: #C46142;
  --accent-text: #AE4D2E;       /* >= 4.7:1 contrast on #FAF9F5 */
  --accent-soft: #F7EAE3;
  --accent-border: #E8C5B5;

  --sage-text: #355840;
  --sage-soft: #E9F1EB;
  --sage-border: #C6D9CB;

  --warn-text: #8C471F;
  --warn-soft: #F7EEE3;
  --warn-border: #E6CFB4;

  --border-hairline: #E5E0D5;
  --border-strong: #D3CCC0;

  /* Typography */
  --font-serif: "Newsreader", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: "Inter", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Concentric radii & spacing tokens */
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;

  --shadow-card:
    0 1px 2px rgb(20 20 19 / 0.04),
    0 6px 18px rgb(20 20 19 / 0.04);
  --shadow-elevated:
    0 1px 2px rgb(20 20 19 / 0.05),
    0 12px 32px rgb(20 20 19 / 0.06);

  --header-h: 64px;
  --container-max: 1080px;
}

@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button, input {
  font: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.1em 0.42em;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border-strong);
}

.num,
.metric-value,
.sim-countdown,
.sim-wallclock-value,
.ledger-total-num,
.tl-time,
.tl-dur {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-ink);
  color: var(--text-on-ink);
  text-decoration: none;
  font-size: 14px;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(var(--container-max), calc(100% - 40px));
  margin-inline: auto;
}

/* ==========================================================================
   Sticky Header & Scrollspy Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  background: rgb(250 249 245 / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  width: min(var(--container-max), calc(100% - 40px));
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-ink);
  color: var(--bg-page);
  display: grid;
  place-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Scrollspy native container */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  scroll-target-group: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.primary-nav::-webkit-scrollbar {
  display: none;
}

.primary-nav a {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.primary-nav a:hover {
  color: var(--text-primary);
}

/* Modern Web Guidance: :is() avoids invalidating the entire rule where :target-current is unsupported */
.primary-nav a:is(:target-current, .target-current) {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-ink);
  color: var(--text-on-ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
  transition: background-color 0.16s ease;
}

.header-cta:hover {
  background: var(--bg-ink-hover);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--bg-ink);
  color: var(--text-on-ink);
}

.btn-primary:hover {
  background: var(--bg-ink-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #B9B2A5;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-hairline);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13.5px;
}

/* ==========================================================================
   Hero & Diagnosis
   ========================================================================== */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border-hairline);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.92fr);
  gap: 44px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(2.05rem, 3.8vw, 3.05rem);
  line-height: 1.22;
  margin-bottom: 20px;
}

.hero-lead {
  max-width: 58ch;
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-lead strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Diagnosis Card */
.diagnosis-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}

.diagnosis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.diagnosis-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.diagnosis-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

.diagnosis-title {
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 16px;
}

.diagnosis-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.diagnosis-item {
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

.diagnosis-item dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.diagnosis-item dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Metrics Strip */
.metrics-strip {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border-hairline);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-value {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
}

.metric-value small {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-text);
  margin-left: 3px;
}

.metric-label {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ==========================================================================
   Generic Sections
   ========================================================================== */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-hairline);
}

.section:focus {
  outline: none;
}

.section-tinted {
  background-color: var(--bg-subtle);
}

.section-head {
  max-width: 720px;
  margin-bottom: 34px;
}

.section-head-row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-head-row > div:first-child {
  max-width: 660px;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-text);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  line-height: 1.28;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 15.5px;
  line-height: 1.74;
  color: var(--text-secondary);
}

.section-desc strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Section 01: Responsive Exam Table & Ledger
   ========================================================================== */
.table-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 8px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}

.table-wrapper {
  overflow-x: auto;
  max-inline-size: 100%;
  border-radius: var(--radius-md); /* 18 - 8 = 10px concentric */
  container-type: inline-size;
}

.exam-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  text-align: left;
  --label-2: "题量与时长";
  --label-3: "占比与满分";
  --label-4: "单题分值";
  --label-5: "性价比评级";
  --label-6: "核心策略";
}

.exam-table caption {
  text-align: left;
  padding: 14px 16px 12px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
}

.exam-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.exam-table thead th {
  padding: 11px 14px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

.exam-table tbody th,
.exam-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
  background: var(--bg-surface);
}

.exam-table td.num {
  white-space: nowrap;
}

.exam-table tbody tr:last-child th,
.exam-table tbody tr:last-child td {
  border-bottom: none;
}

.exam-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 156px;
}

.exam-table .row-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.exam-table tbody tr.row-highlight th,
.exam-table tbody tr.row-highlight td {
  background: #FCF6F1;
}

.exam-table tbody tr.row-muted th,
.exam-table tbody tr.row-muted td {
  background: #F7F5EE;
  color: var(--text-secondary);
}

.strong-num {
  color: var(--accent-text);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.tag-sage {
  background: var(--sage-soft);
  color: var(--sage-text);
  border-color: var(--sage-border);
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.tag-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-hairline);
}

/* Container-query stacked table layout for narrow containers */
@container (width < 640px) {
  .exam-table,
  .exam-table thead,
  .exam-table tbody,
  .exam-table tr,
  .exam-table th,
  .exam-table td {
    display: block;
  }

  .exam-table thead {
    display: none;
  }

  .exam-table tbody tr {
    margin: 12px 4px;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .exam-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-hairline);
  }

  .exam-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px dashed var(--border-hairline);
  }

  .exam-table tbody td:last-child {
    border-bottom: none;
  }

  .exam-table td:nth-child(2)::before {
    content: var(--label-2) "：";
    color: var(--text-muted);
    font-weight: 500;
  }

  .exam-table td:nth-child(3)::before {
    content: var(--label-3) "：";
    color: var(--text-muted);
    font-weight: 500;
  }

  .exam-table td:nth-child(4)::before {
    content: var(--label-4) "：";
    color: var(--text-muted);
    font-weight: 500;
  }

  .exam-table td:nth-child(5)::before {
    content: var(--label-5) "：";
    color: var(--text-muted);
    font-weight: 500;
  }

  .exam-table td:nth-child(6)::before {
    content: var(--label-6) "：";
    color: var(--text-muted);
    font-weight: 500;
  }
}

/* Safe Pass Ledger */
.ledger-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  box-shadow: var(--shadow-card);
}

.ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 22px;
}

.ledger-kicker {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sage-text);
  margin-bottom: 4px;
}

.ledger-title {
  font-size: 21px;
  line-height: 1.3;
}

.ledger-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ledger-total-num {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-text);
}

.ledger-total-unit {
  font-size: 13px;
  color: var(--text-muted);
}

.ledger-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin-bottom: 20px;
}

.ledger-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  margin-bottom: 7px;
}

.ledger-name {
  font-weight: 600;
  color: var(--text-primary);
}

.ledger-target {
  color: var(--text-secondary);
}

.ledger-target strong {
  color: var(--text-primary);
}

.bar-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: var(--pct, 60%);
  border-radius: var(--radius-pill);
  background: #5E5B52;
}

.bar-fill.bar-accent {
  background: var(--accent);
}

.ledger-footnote {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
}

/* ==========================================================================
   Section 02: Interactive Exam Timeline & Simulator
   ========================================================================== */
.simulator-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-elevated);
}

.simulator-console {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.sim-clock-panel {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
}

.sim-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sim-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
}

.sim-status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sim-status-pill[data-state="running"] {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.sim-status-pill[data-state="running"]::before {
  background: var(--accent);
}

.sim-status-pill[data-state="done"] {
  background: var(--sage-soft);
  color: var(--sage-text);
  border-color: var(--sage-border);
}

.sim-status-pill[data-state="done"]::before {
  background: var(--sage-text);
}

.sim-wallclock {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.sim-wallclock-label {
  font-size: 12px;
  color: var(--text-muted);
}

.sim-wallclock-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.sim-phase-label {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
}

.sim-countdown {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 10px 0 8px;
}

.sim-subline {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Progress Bar with Exam Checkpoints */
.sim-progress-block {
  margin-bottom: 20px;
}

.sim-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.sim-progress-track {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  overflow: visible;
}

.sim-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: width 0.25s linear;
}

.sim-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--border-strong);
}

.sim-marker-critical {
  width: 3px;
  background: var(--accent-text);
}

.sim-progress-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.tick-critical {
  color: var(--accent-text);
  font-weight: 600;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.sim-options-row {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.speed-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.option-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.seg-btn[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgb(20 20 19 / 0.08);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sound-toggle[aria-pressed="true"] {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Right: Dynamic Directive Panel */
.sim-directive-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.directive-box {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  flex: 1;
}

.directive-box[data-urgency="critical"] {
  background: #FCF3EE;
  border-color: var(--accent-border);
  border-left-color: var(--accent-text);
}

.directive-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.directive-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 0.03em;
}

.directive-card-ref {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
}

.directive-title {
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 12px;
}

.directive-list {
  margin: 0 0 16px;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.directive-alert {
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
}

.preset-block {
  padding-top: 2px;
}

.preset-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.preset-chip:hover {
  background: var(--bg-subtle);
}

.preset-chip.is-active {
  background: var(--bg-ink);
  border-color: var(--bg-ink);
  color: var(--text-on-ink);
}

/* Timeline Horizontal Nodes */
.timeline-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tl-node {
  text-align: left;
  padding: 12px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.tl-node:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.tl-node.tl-critical {
  border-color: var(--accent-border);
}

.tl-node.is-active {
  background: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.tl-node.is-done {
  background: var(--sage-soft);
  border-color: var(--sage-border);
}

.tl-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.tl-node.tl-critical .tl-time {
  color: var(--accent-text);
  font-weight: 600;
}

.tl-title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
}

.tl-dur {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-text);
}

.tl-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: 2px;
}

.pre-exam-note {
  font-size: 13.5px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.pre-exam-note strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Section 03: Accessible Tabs Widget
   ========================================================================== */
.tabs-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.tablist-scroller {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
  --fade-size: 2.5rem;
  --fade-dir: right;
  --fade-start-pos: 0;
  --fade-end-pos: 100%;
  scroll-padding-inline: var(--fade-size);
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-page);
  padding-inline: 16px;
  gap: 6px;
  mask:
    linear-gradient(black, black) no-clip subtract,
    linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
    linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
  animation: reveal-fade-start linear both, hide-fade-end linear both;
  animation-timeline: scroll(self inline);
  animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  transition: --fade-start 0.2s, --fade-end 0.2s;
}

.tablist-scroller::-webkit-scrollbar {
  display: none;
}

.tablist-scroller.more-start {
  --fade-start: var(--fade-size);
}

.tablist-scroller.more-end {
  --fade-end: var(--fade-size);
}

@keyframes reveal-fade-start {
  to {
    --fade-start: var(--fade-size);
  }
}

@keyframes hide-fade-end {
  from {
    --fade-end: var(--fade-size);
  }
}

.tablist-scroller [role="tab"] {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  padding: 16px 18px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease;
}

.tablist-scroller [role="tab"]:hover {
  color: var(--text-primary);
}

/* Modern Web Guidance: style from aria-selected, no dimension change, forced-colors safe border-block-end */
.tablist-scroller [role="tab"][aria-selected="true"] {
  color: var(--accent-text);
}

.tablist-scroller [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 12px 0;
  border-block-end: 2.5px solid var(--accent);
}

/* Modern Web Guidance: place all tabpanels in same grid cell & keep styling on inner wrapper.
   Disable pointer-events on hidden="until-found" panels so later panels in DOM order never occlude active panel controls. */
.tab-panels-stage {
  display: grid;
}

.tab-panels-stage > [role="tabpanel"] {
  grid-area: 1 / 1;
}

.tab-panels-stage > [role="tabpanel"][hidden] {
  pointer-events: none;
  z-index: 0;
}

.tab-panels-stage > [role="tabpanel"]:not([hidden]) {
  position: relative;
  z-index: 1;
}

.tab-panel-inner {
  padding: 28px 30px 32px;
}

.panel-intro {
  max-width: 72ch;
  margin-bottom: 24px;
}

.panel-intro h3 {
  font-size: 22px;
  line-height: 1.32;
  margin-bottom: 8px;
}

.panel-intro p {
  font-size: 15px;
  color: var(--text-secondary);
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.strategy-card {
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.strategy-card.card-caution {
  background: #FCF4EF;
  border-color: var(--accent-border);
}

.card-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-text);
  margin-bottom: 8px;
}

.strategy-card h4 {
  font-size: 17.5px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.strategy-card p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.68;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 14.2px;
  color: var(--text-secondary);
  line-height: 1.62;
}

.compact-list strong {
  color: var(--text-primary);
}

/* Writing Blueprint */
.writing-blueprint {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.blueprint-step {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.bp-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.bp-body h4 {
  font-size: 17px;
  margin-bottom: 6px;
}

.bp-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.copy-snippet {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
}

.copy-snippet code {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

.copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.copy-btn:hover {
  background: var(--bg-subtle);
}

.copy-btn.is-copied {
  background: var(--sage-soft);
  border-color: var(--sage-border);
  color: var(--sage-text);
}

.mini-checklist-row {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 13.8px;
  color: var(--text-secondary);
}

.mini-checklist-row strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Section 04: Vocabulary Bridge
   ========================================================================== */
.vocab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.filter-chip:hover {
  color: var(--text-primary);
  background: var(--bg-page);
}

.filter-chip.is-active {
  background: var(--bg-ink);
  border-color: var(--bg-ink);
  color: var(--text-on-ink);
}

.mask-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent-border);
  background: var(--bg-surface);
  color: var(--accent-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.mask-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-ink);
}

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.vocab-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgb(20 20 19 / 0.03);
}

.vocab-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vocab-cat {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.vocab-daily {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.vocab-daily strong {
  color: var(--text-primary);
  font-weight: 500;
}

.vocab-arrow {
  color: var(--accent);
  font-weight: 600;
  margin-inline: 4px;
}

.vocab-target {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.vocab-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-hairline);
}

/* Self-test mask mode */
.vocab-grid.is-masked .vocab-target {
  position: relative;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: transparent;
  user-select: none;
  cursor: pointer;
  padding: 2px 8px;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.vocab-grid.is-masked .vocab-target::after {
  content: "点击或悬停揭晓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.vocab-grid.is-masked .vocab-card:hover .vocab-target,
.vocab-grid.is-masked .vocab-card.is-revealed .vocab-target {
  background: var(--accent-soft);
  color: var(--text-primary);
}

.vocab-grid.is-masked .vocab-card:hover .vocab-target::after,
.vocab-grid.is-masked .vocab-card.is-revealed .vocab-target::after {
  display: none;
}

/* ==========================================================================
   Section 05: 7-Day Sprint Accordion
   ========================================================================== */
.sprint-meta-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sprint-progress-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.sprint-progress-text strong {
  color: var(--accent-text);
}

[command="--toggle-all"][aria-expanded="true"] .label-expand,
[command="--toggle-all"][aria-expanded="false"] .label-collapse {
  display: none;
}

.accordion {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.accordion > details {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.16s ease;
}

.accordion > details[open] {
  border-color: var(--border-strong);
}

.accordion > details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.accordion > details > summary::-webkit-details-marker {
  display: none;
}

/* Modern Web Guidance: marker right before label text, SVG mask rotated on open */
.accordion > details > summary::before {
  content: "";
  inline-size: 16px;
  block-size: 16px;
  flex-shrink: 0;
  background-color: var(--text-muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.accordion > details[open] > summary::before {
  rotate: 0deg;
  background-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .accordion > details > summary::before {
    transition: rotate 0.2s ease, background-color 0.2s ease;
  }
}

.accordion > details > summary:hover {
  background: var(--bg-page);
}

.day-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  flex-shrink: 0;
}

.day-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.day-time {
  font-size: 12.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Modern Web Guidance: smooth ::details-content reveal */
.accordion > details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.accordion > details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .accordion > details::details-content {
    transition: block-size 0.28s ease-in-out, content-visibility 0.28s ease-in-out, display 0.28s ease-in-out;
    transition-behavior: allow-discrete;
  }
}

.accordion-body {
  padding: 0 20px 18px 46px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--border-hairline);
  display: grid;
  gap: 10px;
}

.task-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.task-list input[type="checkbox"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.task-list input[type="checkbox"]:checked + span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Gear Card */
.gear-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
}

.gear-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.gear-head h3 {
  font-size: 19px;
}

.gear-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gear-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gear-item strong {
  font-size: 14px;
  color: var(--text-primary);
}

.gear-item span {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding: 36px 0 48px;
  background: var(--bg-page);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.footer-note {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-top-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-text);
  text-decoration: none;
}

.footer-top-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Staggered Reveal Animation
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: fade-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--delay, 0ms);
  }

  @keyframes fade-rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 980px) {
  .hero-grid,
  .simulator-console {
    grid-template-columns: 1fr;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-track .tl-node:last-child {
    grid-column: 1 / -1;
  }

  .vocab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gear-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding-block: 10px 4px;
  }

  .brand-sub,
  .header-cta {
    display: none;
  }

  .primary-nav {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
    border-top: 1px solid var(--border-hairline);
    padding-top: 4px;
  }

  .primary-nav a {
    padding: 6px 6px;
    font-size: 12.5px;
  }

  .hero {
    padding: 44px 0 40px;
  }

  .section {
    padding: 52px 0;
  }

  .ledger-bars,
  .strategy-grid,
  .vocab-grid,
  .gear-grid,
  .blueprint-step {
    grid-template-columns: 1fr;
  }

  .tab-panel-inner {
    padding: 20px 18px 24px;
  }

  .simulator-shell {
    padding: 16px;
  }

  .accordion-body {
    padding: 0 16px 16px 20px;
  }
}

@media (max-width: 480px) {
  .primary-nav a {
    padding: 6px 3px;
    font-size: 12px;
  }

  .metrics-strip,
  .timeline-track {
    grid-template-columns: 1fr;
  }
}
