/* 数字后端面试题库：离线、多页面、无外部依赖 */
:root {
  color-scheme: light;
  --page: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f8;
  --ink: #17212b;
  --ink-2: #46586a;
  --muted: #718096;
  --navy: #173a59;
  --navy-2: #0f2c46;
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: #e9f2fd;
  --gold: #b58936;
  --gold-soft: #fbf5e8;
  --line: #dfe6ed;
  --line-strong: #c6d2de;
  --good: #14775f;
  --good-soft: #e9f6f1;
  --warning: #95610a;
  --warning-soft: #fff5df;
  --critical: #b13b3b;
  --critical-soft: #fff0ef;
  --shadow: 0 10px 28px rgba(24, 49, 72, .06);
  --shadow-hover: 0 14px 34px rgba(24, 49, 72, .11);
  --radius: 14px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #10161c;
  --surface: #182128;
  --surface-2: #1c2730;
  --surface-3: #24323e;
  --ink: #edf2f6;
  --ink-2: #c2cdd6;
  --muted: #95a4b1;
  --navy: #8bb9e8;
  --navy-2: #d3e8fa;
  --accent: #69a8ef;
  --accent-strong: #94c2f5;
  --accent-soft: #203b54;
  --gold: #d2ae68;
  --gold-soft: #3a3223;
  --line: #31404c;
  --line-strong: #465866;
  --good: #6fd2b2;
  --good-soft: #1d3b34;
  --warning: #e7b75d;
  --warning-soft: #3d3423;
  --critical: #ed9292;
  --critical-soft: #422a2c;
  --shadow: 0 12px 30px rgba(0, 0, 0, .18);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button { color: inherit; }
img, svg { max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 1000;
  padding: 10px 16px; border-radius: 8px; background: var(--surface); color: var(--ink);
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner {
  max-width: 1480px; min-height: 68px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; background: var(--navy-2); color: var(--surface);
  font-size: 13px; font-weight: 800; letter-spacing: .04em;
}
:root[data-theme="dark"] .brand-mark { background: #2a78d6; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .01em; }
.brand-text small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.global-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.global-nav a {
  position: relative; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.global-nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.global-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .menu-button {
  min-width: 38px; min-height: 38px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; font-size: 13px; font-weight: 650;
}
.icon-button:hover, .menu-button:hover { background: var(--surface-3); border-color: var(--line-strong); }
.menu-button { display: none; }
.key-hint {
  padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px;
  color: var(--muted); font: 11px var(--mono);
}

.page-shell {
  max-width: 1480px; margin: 0 auto; padding: 30px 28px 64px;
  display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 34px;
}
.page-shell.no-sidebar { display: block; max-width: 1240px; }
.sidebar { min-width: 0; }
.sidebar-inner { position: sticky; top: 94px; max-height: calc(100vh - 116px); overflow-y: auto; padding-right: 5px; }
.sidebar-title {
  margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 750;
  letter-spacing: .12em; text-transform: uppercase;
}
.chapter-nav { display: grid; gap: 4px; }
.chapter-nav a {
  display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start;
  padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13px; line-height: 1.45;
}
.chapter-nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.chapter-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.chapter-nav .nav-no { color: var(--muted); font: 11px/1.8 var(--mono); }
.chapter-nav a[aria-current="page"] .nav-no { color: var(--accent-strong); }
.sidebar-divider { height: 1px; margin: 16px 4px; background: var(--line); }
.sidebar-note { padding: 12px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; line-height: 1.65; }
.sidebar-note strong { display: block; margin-bottom: 3px; color: var(--ink); }
.main-content { min-width: 0; }
.narrow-content { max-width: 900px; }

.hero {
  position: relative; overflow: hidden;
  padding: 40px 44px; border-radius: 18px; background: #153a59; color: #f5f9fc;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; width: 340px; height: 340px; right: -130px; top: -180px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #b9d7ef; }
.hero h1 { max-width: 800px; margin: 8px 0 12px; font-size: clamp(28px, 4vw, 42px); line-height: 1.25; letter-spacing: -.02em; }
.hero p { max-width: 760px; margin: 0; color: #d5e4ef; font-size: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero .button-primary { background: #fff; color: #173a59; border-color: #fff; }
.hero .button-primary:hover { background: #eaf3fb; }
.hero .button-secondary { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); }
.hero .button-secondary:hover { background: rgba(255,255,255,.12); }
.hero.compact { padding: 30px 34px; }
.hero.compact h1 { font-size: clamp(25px, 3vw, 34px); }
.hero.compact p { font-size: 14.5px; }
.eyebrow {
  color: var(--accent-strong); font-size: 11px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}
.page-heading { margin-bottom: 26px; }
.page-heading h1 { margin: 7px 0 8px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.3; letter-spacing: -.02em; }
.page-heading p { max-width: 820px; margin: 0; color: var(--ink-2); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--muted); }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.button, .button-primary, .button-secondary, .button-ghost, .button-danger {
  min-height: 40px; padding: 8px 15px; border: 1px solid transparent; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; line-height: 1.4; cursor: pointer;
}
.button:hover, .button-primary:hover, .button-secondary:hover, .button-ghost:hover, .button-danger:hover { text-decoration: none; }
.button-primary { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.button-primary:hover { filter: brightness(1.08); }
.button-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.button-secondary:hover { background: var(--surface-3); color: var(--ink); }
.button-ghost { background: transparent; color: var(--accent-strong); border-color: transparent; }
.button-ghost:hover { background: var(--accent-soft); }
.button-danger { background: var(--surface); color: var(--critical); border-color: var(--critical); }
.button-danger:hover { background: var(--critical-soft); }
.button-small { min-height: 34px; padding: 6px 11px; font-size: 12.5px; }
button:disabled, .button-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 32px; }
.stat-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12.5px; font-weight: 650; }
.stat-value { margin-top: 3px; font-size: 34px; font-weight: 760; line-height: 1.3; letter-spacing: -.03em; }
.stat-note { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); flex: 0 0 auto; }
.status-dot.good { background: #0ca30c; }
.status-dot.warning { background: #d89517; }
.status-dot.neutral { background: var(--muted); }

.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 21px; line-height: 1.4; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-heading .section-link { flex: 0 0 auto; font-size: 13px; font-weight: 700; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-flat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card-padded { padding: 24px; }
.notice { padding: 15px 18px; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); color: var(--ink-2); font-size: 13.5px; }
.notice strong { color: var(--ink); }
.notice.warning { border-left-color: #d89517; background: var(--warning-soft); }
.notice.good { border-left-color: #0ca30c; background: var(--good-soft); }
.notice.critical { border-left-color: #d03b3b; background: var(--critical-soft); }

.track-group { margin-top: 26px; }
.track-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; }
.track-title span { color: var(--muted); font-size: 12px; font-weight: 500; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.chapter-card {
  position: relative; min-height: 208px; padding: 21px;
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.chapter-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-hover); text-decoration: none; }
.chapter-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chapter-number { color: var(--accent-strong); font: 700 12px var(--mono); letter-spacing: .05em; }
.chapter-card h3 { margin: 14px 0 8px; font-size: 17px; line-height: 1.45; }
.chapter-card p { margin: 0; color: var(--muted); font-size: 12px; }
.chapter-card-bottom { margin-top: auto; padding-top: 18px; }
.chapter-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--ink-2); font-size: 11.5px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.progress-fill { height: 100%; border-radius: 0 4px 4px 0; background: #2a78d6; transition: width .25s ease; }
:root[data-theme="dark"] .progress-fill { background: #3987e5; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-3);
  color: var(--ink-2); font-size: 10.5px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}
.badge.new { border-color: #d6b66f; background: var(--gold-soft); color: var(--warning); }
.badge.good { border-color: color-mix(in srgb, var(--good) 30%, var(--line)); background: var(--good-soft); color: var(--good); }
.badge.review { border-color: color-mix(in srgb, var(--warning) 30%, var(--line)); background: var(--warning-soft); color: var(--warning); }
.badge.mastered { border-color: color-mix(in srgb, var(--good) 30%, var(--line)); background: var(--good-soft); color: var(--good); }

.feature-panel { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 0; overflow: hidden; }
.feature-main { padding: 28px 30px; }
.feature-main h2 { margin: 6px 0 10px; font-size: 23px; }
.feature-main p { color: var(--ink-2); }
.feature-side { padding: 28px; border-left: 1px solid var(--line); background: var(--surface-2); }
.feature-side h3 { margin: 0 0 10px; font-size: 14px; }
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 21px; color: var(--ink-2); font-size: 13px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }

.chapter-header { margin-bottom: 20px; }
.chapter-header h1 { margin: 8px 0 10px; font-size: clamp(25px, 3.4vw, 35px); line-height: 1.35; letter-spacing: -.02em; }
.chapter-intro { max-width: 920px; color: var(--ink-2); font-size: 14px; }
.chapter-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.chapter-summary strong { color: var(--ink); }
.chapter-progress { margin-top: 15px; max-width: 500px; }
.chapter-progress .chapter-meta { margin-bottom: 5px; }
.section-jump { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0; }
.section-jump a { padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-2); font-size: 11.5px; }
.section-jump a:hover { background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }
.toolbar {
  position: sticky; top: 79px; z-index: 20;
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(130px, .45fr) auto; gap: 9px;
  margin: 18px 0 24px; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.toolbar-actions { display: flex; gap: 5px; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
  font-size: 13px; line-height: 1.5;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.textarea { min-height: 90px; resize: vertical; }
.field { display: grid; gap: 6px; }
.field label, .field-label { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.field-help { color: var(--muted); font-size: 11.5px; }
.filter-count { margin: -12px 0 18px; color: var(--muted); font-size: 12px; }

.question-section { margin: 0 0 34px; }
.question-section-header {
  display: flex; align-items: center; gap: 12px; margin: 0 0 13px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.question-section-header h2 { margin: 0; font-size: 19px; line-height: 1.45; }
.section-count { color: var(--muted); font: 11px var(--mono); }
.question-card {
  scroll-margin-top: 160px; margin-bottom: 13px; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.question-card:hover { border-color: var(--line-strong); }
.question-card.is-mastered { border-left: 3px solid #0ca30c; }
.question-card.is-review { border-left: 3px solid #d89517; }
.question-card:target, .question-card.focused { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); border-color: var(--accent); }
.question-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.question-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.question-id { color: var(--accent-strong); font: 750 12px var(--mono); }
.question-point { color: var(--muted); font-size: 11px; }
.bookmark-button {
  width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1;
}
.bookmark-button:hover { background: var(--gold-soft); color: var(--gold); }
.bookmark-button[aria-pressed="true"] { color: var(--gold); background: var(--gold-soft); }
.question-title { margin: 10px 0 14px; font-size: 16.5px; font-weight: 720; line-height: 1.65; }
.question-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.status-button { min-height: 33px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 11.5px; font-weight: 700; }
.status-button:hover { background: var(--surface-3); }
.status-button[data-status="review"][aria-pressed="true"] { border-color: #d89517; background: var(--warning-soft); color: var(--warning); }
.status-button[data-status="mastered"][aria-pressed="true"] { border-color: #0ca30c; background: var(--good-soft); color: var(--good); }
.answer-details { margin-top: 13px; border-top: 1px solid var(--line); }
.answer-details > summary {
  position: relative; padding: 13px 28px 0 0; color: var(--accent-strong); cursor: pointer;
  font-size: 12.5px; font-weight: 750; list-style: none;
}
.answer-details > summary::-webkit-details-marker { display: none; }
.answer-details > summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 20px; font-weight: 500; }
.answer-details[open] > summary::after { content: "−"; }
.answer-details > summary .summary-hint { margin-left: 8px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.answer-body { padding-top: 5px; }
.answer-label { margin: 8px 0 7px; color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.answer-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.answer-list li { position: relative; padding-left: 16px; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.answer-list li::before { content: ""; position: absolute; left: 1px; top: .77em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.followup-details { margin: 16px 0 4px; padding: 10px 13px; border-radius: 9px; background: var(--gold-soft); }
.followup-details summary { color: var(--warning); cursor: pointer; font-size: 12px; font-weight: 750; }
.followup-list { margin: 10px 0 2px; padding-left: 21px; color: var(--ink-2); }
.followup-list li { margin: 7px 0; padding-left: 3px; font-size: 13px; }
.note-block { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.note-block label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.note-status { color: var(--muted); font-size: 10px; font-weight: 500; }
.note-block .textarea { min-height: 76px; background: var(--surface-2); font-size: 12.5px; }
.chapter-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.empty-state { padding: 42px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty-state .empty-icon { font-size: 32px; color: var(--muted); }
.empty-state h2, .empty-state h3 { margin: 8px 0; font-size: 19px; }
.empty-state p { max-width: 560px; margin: 0 auto 18px; color: var(--muted); font-size: 13px; }

/* 首页学习路径与项目图示 */
.learning-loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.loop-step { position: relative; padding: 18px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.loop-no { color: var(--accent-strong); font: 700 11px var(--mono); }
.loop-step h3 { margin: 7px 0 5px; font-size: 14px; }
.loop-step p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.process-flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.process-step { position: relative; padding: 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: center; }
.process-step:not(:last-child)::after { content: "→"; position: absolute; right: -9px; top: 35%; z-index: 2; color: var(--accent); font-weight: 800; }
.process-step .process-no { color: var(--accent-strong); font: 700 10px var(--mono); }
.process-step strong { display: block; margin: 4px 0; font-size: 12.5px; }
.process-step small { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; }
.loop-back { padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ink-2); background: var(--surface-2); text-align: center; font-size: 12px; }

/* 搜索、复习、模拟面试 */
.search-panel { padding: 22px; margin-bottom: 20px; }
.search-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.search-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.search-results { display: grid; gap: 12px; }
.search-result { padding: 20px 22px; }
.search-result h2 { margin: 8px 0; font-size: 16px; line-height: 1.6; }
.search-result h2 a { color: var(--ink); }
.search-result h2 a:hover { color: var(--accent-strong); }
.search-result p { margin: 6px 0 0; color: var(--ink-2); font-size: 12.5px; }
.search-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; }
mark { padding: 0 2px; border-radius: 2px; background: var(--warning-soft); color: var(--ink); }
.trainer-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; }
.trainer-config { position: sticky; top: 94px; padding: 21px; }
.trainer-config h2 { margin: 0 0 16px; font-size: 17px; }
.trainer-config .field { margin-bottom: 14px; }
.trainer-config .button-primary { width: 100%; margin-top: 4px; }
.trainer-main { min-width: 0; }
.trainer-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.trainer-navigation { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.mock-timer { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font: 700 14px var(--mono); }
.mock-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.mock-history { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mock-history th, .mock-history td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.mock-history th { color: var(--muted); font-size: 11px; }
.mock-history td:last-child { white-space: nowrap; }

/* 项目拆解与说明 */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.project-card { padding: 22px; }
.project-card h3 { margin: 7px 0 8px; font-size: 17px; }
.project-card p { margin: 0; color: var(--ink-2); font-size: 13px; }
.project-card .card-index { color: var(--accent-strong); font: 750 12px var(--mono); }
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.compare-table { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 12.5px; }
.compare-table th, .compare-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table th { background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; }
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table td:first-child { font-weight: 750; }
.details-card { margin-bottom: 10px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.details-card summary { padding: 14px 0; cursor: pointer; font-weight: 700; }
.details-card > div { padding: 0 0 16px; color: var(--ink-2); font-size: 13px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.guide-card { padding: 22px; }
.guide-card h3 { margin: 0 0 8px; font-size: 16px; }
.guide-card p { margin: 0; color: var(--ink-2); font-size: 13px; }
.code-inline { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); font: .92em var(--mono); }
.diagram { margin: 14px 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.diagram h3 { margin: 0 0 12px; font-size: 14px; }
.diagram-row { display: flex; gap: 5px; margin: 5px 0; }
.diagram-cell { flex: 1; padding: 9px; border-radius: 6px; background: var(--surface-3); text-align: center; font-size: 11px; }
.diagram-note { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; }

.site-footer { max-width: 1480px; margin: 0 auto; padding: 24px 28px 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--muted); }
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 500; max-width: min(400px, calc(100vw - 40px));
  padding: 12px 17px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-hover); font-size: 13px;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .header-inner { gap: 14px; padding: 0 20px; }
  .global-nav a { padding: 8px 9px; font-size: 13px; }
  .page-shell { grid-template-columns: 210px minmax(0, 1fr); gap: 24px; padding-left: 20px; padding-right: 20px; }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-flow { grid-template-columns: repeat(3, 1fr); }
  .process-step:nth-child(3)::after { display: none; }
  .learning-loop { grid-template-columns: repeat(3, 1fr); }
  .key-hint { display: none; }
}

@media (max-width: 860px) {
  .header-inner { min-height: 62px; flex-wrap: wrap; padding: 10px 16px; }
  .brand-text small { display: none; }
  .global-nav {
    order: 3; width: 100%; display: none; overflow-x: auto; padding: 5px 0 7px;
  }
  .site-header.nav-open .global-nav { display: flex; }
  .header-actions { margin-left: auto; }
  .menu-button { display: inline-flex; }
  .page-shell, .page-shell.no-sidebar { display: block; padding: 22px 16px 50px; }
  .sidebar { display: none; }
  .hero { padding: 30px 26px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-panel { grid-template-columns: 1fr; }
  .feature-side { border-left: 0; border-top: 1px solid var(--line); }
  .toolbar { top: 72px; grid-template-columns: 1fr 140px; }
  .toolbar-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .trainer-layout { grid-template-columns: 1fr; }
  .trainer-config { position: static; }
  .site-footer { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .brand-text strong { font-size: 13px; }
  .header-actions .search-shortcut span:nth-child(2) { display: none; }
  .hero { padding: 25px 21px; border-radius: 14px; }
  .hero h1 { font-size: 27px; }
  .hero p { font-size: 14px; }
  .chapter-grid, .project-grid, .guide-grid { grid-template-columns: 1fr; }
  .chapter-card { min-height: 185px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 29px; }
  .learning-loop, .process-flow { grid-template-columns: 1fr 1fr; }
  .process-step:nth-child(3)::after { display: block; }
  .process-step:nth-child(2n)::after { display: none; }
  .toolbar { position: static; grid-template-columns: 1fr; }
  .toolbar-actions { grid-column: auto; }
  .question-card { padding: 17px; }
  .question-title { font-size: 15.5px; }
  .summary-hint { display: none; }
  .search-filters { grid-template-columns: 1fr; }
  .search-main { grid-template-columns: 1fr; }
  .mock-summary-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; }
  .chapter-footer, .site-footer { flex-direction: column; }
}

@media print {
  :root, :root[data-theme="dark"] {
    --page: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f2f2f2;
    --ink: #111; --ink-2: #333; --muted: #666; --line: #ccc; --line-strong: #aaa;
    --accent-strong: #173a59; --accent: #173a59; --gold-soft: #fff; --warning: #333;
  }
  body { background: #fff; font-size: 10.5pt; }
  .site-header, .sidebar, .site-footer, .toolbar, .hero-actions, .question-actions, .bookmark-button,
  .note-block, .chapter-footer, .button, .button-primary, .button-secondary, .toast { display: none !important; }
  .page-shell, .page-shell.no-sidebar { display: block; max-width: none; padding: 0; }
  .hero { padding: 0 0 15px; background: #fff; color: #111; box-shadow: none; }
  .hero::after { display: none; }
  .hero p, .hero .eyebrow { color: #333; }
  .hero h1 { font-size: 23pt; }
  .question-card { break-inside: avoid; box-shadow: none; }
  .answer-details > * { display: block !important; }
  .answer-details > summary { display: none !important; }
  .followup-details > * { display: block !important; }
  .followup-details > summary { display: none !important; }
  .answer-list li { color: #222; }
  .section-block { break-inside: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
