/* ==========================================================================
   AI学习培训和测评平台 · 设计系统
   浅色主题 / 信息密度优先 / 无第三方依赖
   ========================================================================== */

:root {
  --bg: #f5f7fa;
  --bg-soft: #eef1f6;
  --card: #ffffff;
  --ink: #0e1620;
  --ink2: #3d4a59;
  --ink3: #5f6b7a;
  --line: #e4e8ee;
  --line2: #d5dce6;

  --brand: #2a5bd7;
  --brand-ink: #1c3f9e;
  --brand-soft: #eef3fe;
  --teal: #0f9e8a;
  --ok: #0e9f6e;
  --warn: #b45309;
  --danger: #c0392b;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;

  --sh-1: 0 1px 2px rgba(14, 22, 32, 0.04);
  --sh-2: 0 2px 4px rgba(14, 22, 32, 0.04), 0 12px 28px -16px rgba(14, 22, 32, 0.22);
  --sh-3: 0 20px 48px -20px rgba(14, 22, 32, 0.32);

  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.32;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 880px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 200;
}
.skip-link:focus { left: 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}
/* 品牌区不参与收缩：名称较长时保持完整，靠导航横向滚动吸收空间 */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -0.02em; flex: none; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2a5bd7 0%, #0f9e8a 100%);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(42, 91, 215, 0.5);
  flex: none;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink3);
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.brand b { font-size: 15px; line-height: 1.2; display: block; }

/* min-width:0 + overflow-x:auto：空间不足时导航横向滚动，而不是撑破 topbar */
.nav { display: flex; gap: 2px; margin-left: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink2);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search-btn {
  display: flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  color: var(--ink3);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-btn:hover { border-color: var(--line2); box-shadow: var(--sh-1); color: var(--ink2); }
.search-btn kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink3);
  background: var(--bg);
}

.progress-pill {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink3);
  padding: 0 4px;
}
.progress-pill .ring {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--p, 0) * 1%), var(--bg-soft) 0);
  display: grid; place-items: center;
  flex: none;
}
.progress-pill .ring::after {
  content: "";
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
}

/* ---------- 通用块 ---------- */
.main { padding: 34px 0 72px; min-height: 62vh; }

.section { margin-top: 44px; }
.section:first-child { margin-top: 0; }

.sec-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.sec-head .tagline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--brand);
  text-transform: uppercase;
}
.sec-head h1, .sec-head h2 { font-size: 21px; }
.sec-head p { color: var(--ink3); font-size: 14px; }
.sec-head .spacer { margin-left: auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--ink2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
/* 长文案 chip：允许换行，避免把父级 min-content 撑爆（移动端横向溢出根因） */
.chip.line {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink3);
  white-space: normal;
  height: auto;
  min-height: 22px;
  padding: 2px 8px;
  line-height: 1.55;
  align-items: flex-start;
  overflow-wrap: anywhere;
}
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.ok { background: #e7f7f0; color: #0a7a55; }
.chip.warn { background: #fdf3e7; color: #9a4a06; }
.chip.dim { background: #f1f3f7; color: var(--ink3); font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--ink2);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { background: #fafbfd; border-color: #c8d1de; box-shadow: var(--sh-1); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(42, 91, 215, 0.75);
}
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }

.hr { height: 1px; background: var(--line); border: 0; margin: 30px 0; }

.muted { color: var(--ink3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(900px 300px at 12% -10%, rgba(42, 91, 215, 0.1), transparent 60%),
    radial-gradient(700px 260px at 92% 0%, rgba(15, 158, 138, 0.1), transparent 58%),
    #fff;
  padding: 34px 34px 30px;
  box-shadow: var(--sh-2);
}
.hero h1 {
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.25;
  max-width: 720px;
}
.hero h1 em { font-style: normal; color: var(--brand); }
/* 首页 Hero 副标语：人机协同，共享科技红利 */
.hero .hero-slogan {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: .08em;
  color: var(--brand-ink);
}
.hero .hero-slogan::before {
  content: "";
  flex: none;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--teal));
}
.hero .lede {
  margin-top: 12px;
  max-width: 660px;
  color: var(--ink2);
  font-size: 15px;
}
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.stat { padding-right: 16px; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat b {
  display: block;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 12.5px; color: var(--ink3); }
.hero-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink3);
}

/* ---------- 岗位卡片 ---------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px 18px 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.role-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: hsl(var(--h, 215) 68% 56%);
  opacity: 0.9;
}
.role-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: hsl(var(--h, 215) 40% 84%);
}
.role-card-head { display: flex; align-items: flex-start; gap: 11px; }
.role-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 15px;
  font-weight: 700;
  flex: none;
  background: hsl(var(--h, 215) 72% 96%);
  color: hsl(var(--h, 215) 58% 40%);
  border: 1px solid hsl(var(--h, 215) 55% 90%);
}
.role-card h3 { font-size: 16px; }
.role-card .aud {
  font-size: 12.5px;
  color: var(--ink3);
  line-height: 1.5;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.role-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.role-card .chaps {
  font-size: 12.5px;
  color: var(--ink3);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-top: 2px;
  border-top: 1px dashed var(--line);
}
.role-card .chaps b { color: var(--ink2); font-weight: 500; }
.role-card-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto;
  font-size: 12.5px;
  color: var(--ink3);
}
.role-card-foot .go { margin-left: auto; color: var(--brand); font-weight: 600; }

/* ---------- 岗位页 ---------- */
.role-hero {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 26px 28px;
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
}
.role-hero::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, hsl(var(--h, 215) 70% 58%), hsl(var(--h, 215) 70% 58% / 0.15));
}
.role-hero .kicker {
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  color: hsl(var(--h, 215) 55% 45%);
  text-transform: uppercase;
}
.role-hero h1 { font-size: 27px; margin-top: 6px; }
.role-hero .lede { color: var(--ink2); margin-top: 8px; max-width: 760px; }
.role-hero .metrics { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.role-hero .metric b { font-size: 19px; font-variant-numeric: tabular-nums; }
.role-hero .metric span { font-size: 12px; color: var(--ink3); margin-left: 4px; }

.role-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  margin-top: 26px;
}
.side {
  position: sticky;
  top: 78px;
  min-width: 0;
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.side-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink3);
  text-transform: uppercase;
  padding: 0 10px 8px;
}
.chap-nav a {
  display: flex;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.45;
  border-left: 2px solid transparent;
}
.chap-nav a:hover { background: var(--bg-soft); }
.chap-nav a.on {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-left-color: var(--brand);
  font-weight: 550;
}
.chap-nav .no {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink3);
  padding-top: 2px;
  flex: none;
}
.chap-nav a.on .no { color: var(--brand); }
.chap-nav .cn { margin-left: auto; font-size: 11px; color: var(--ink3); }
.chap-nav .ct { min-width: 0; }
.chap-nav .cnt { flex: none; font-variant-numeric: tabular-nums; }

/* 章节卡片 */
.chap {
  scroll-margin-top: 78px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-1);
}
.chap + .chap { margin-top: 16px; }
.chap-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chap-no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.chap-head h2 { font-size: 18.5px; }
.chap-goal {
  margin-top: 10px;
  color: var(--ink2);
  font-size: 14.5px;
  border-left: 2px solid hsl(var(--h, 215) 60% 82%);
  padding-left: 12px;
}
.pts { margin-top: 16px; display: grid; gap: 8px; }
.pts li {
  display: flex; gap: 10px;
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.65;
}
.pts li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: hsl(var(--h, 215) 60% 62%);
  margin-top: 9px;
  flex: none;
}
.scene-list { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 6px; }
.scene-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px 9px 6px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink2);
  transition: background 0.13s;
}
a.scene-row:hover { background: var(--bg-soft); color: var(--ink); }
.scene-row .sid {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink3);
  width: 34px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.scene-row .st { flex: 1; min-width: 0; }
.scene-row .arrow { color: var(--ink3); font-size: 13px; flex: none; }
a.scene-row:hover .arrow { color: var(--brand); }
.scene-row .chip { flex: none; }

/* ---------- 内容页 ---------- */
.crumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink3);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.crumb a:hover { color: var(--brand); }
.crumb .sep { color: #c3cbd6; }

.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}
.doc-main { min-width: 0; }
.doc-head { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: 24px; letter-spacing: -0.02em; }
.doc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.block { margin-top: 26px; }
.block > h2 {
  font-size: 15px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink);
  margin-bottom: 10px;
}
.block > h2 .ix {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  flex: none;
}
.block p, .block li { color: var(--ink2); font-size: 14.5px; }
.block p + p { margin-top: 8px; }

.plain li {
  position: relative;
  padding-left: 16px;
  margin-top: 6px;
  line-height: 1.7;
}
.plain li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--line2);
}
.plain.check li::before { background: #b9e6d4; }
.plain.bound li::before { background: #f3d4ae; }

.steps { counter-reset: s; display: grid; gap: 12px; margin-top: 4px; }
.steps li {
  position: relative;
  padding-left: 34px;
  counter-increment: s;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 1px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink2);
  font-size: 11.5px;
  font-weight: 600;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.steps b { display: block; font-weight: 600; color: var(--ink); font-size: 14.5px; }
.steps span { color: var(--ink2); font-size: 14px; }

/* 提示词 */
.prompt {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fbfcfe;
  overflow: hidden;
}
.prompt-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  font-size: 12px;
  color: var(--ink3);
}
.prompt-head .dots { display: flex; gap: 4px; }
.prompt-head .dots i { width: 7px; height: 7px; border-radius: 50%; background: #dfe4ec; display: block; }
.prompt pre {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.78;
  color: #1d2733;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow: auto;
}
.copy-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  color: var(--ink2);
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--brand); color: var(--brand); }
.copy-btn.done { border-color: #b9e6d4; color: #0a7a55; background: #f1fbf7; }

/* 侧栏 */
.doc-side { position: sticky; top: 78px; display: grid; gap: 14px; }
.side-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 14px 15px;
}
.side-card h3 {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
  font-weight: 600;
  margin-bottom: 9px;
}
.side-card .kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; }
.side-card .kv span:first-child { color: var(--ink3); }
.side-card .kv span:last-child { color: var(--ink2); text-align: right; }
.side-links a {
  display: block;
  font-size: 13px;
  color: var(--ink2);
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  line-height: 1.5;
}
.side-links a:last-child { border-bottom: 0; }
.side-links a:hover { color: var(--brand); }

/* ---------- 测评 ---------- */
.quiz-shell { max-width: 860px; margin: 0 auto; }
.q-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 20px 22px;
  box-shadow: var(--sh-1);
}
.q-card + .q-card { margin-top: 12px; }
.q-head { display: flex; gap: 10px; align-items: flex-start; }
.q-no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
  padding-top: 3px;
  flex: none;
}
.q-title { font-size: 15px; font-weight: 550; line-height: 1.6; color: var(--ink); }
.opts { margin-top: 14px; display: grid; gap: 8px; }
.opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink2);
  transition: border-color 0.13s, background 0.13s;
  background: #fff;
}
.opt:hover { border-color: var(--line2); background: #fbfcfe; }
.opt input { margin: 5px 0 0; accent-color: var(--brand); flex: none; }
.opt .k {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 19px; height: 19px;
  display: grid; place-items: center;
  flex: none;
  margin-top: 1px;
}
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: #b9e6d4; background: #f1fbf7; }
.opt.wrong { border-color: #f0c6c0; background: #fdf4f3; }
.opt.right .k { border-color: #b9e6d4; color: #0a7a55; }
.opt.wrong .k { border-color: #f0c6c0; color: var(--danger); }
.why {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  background: #f7f9fc;
  border: 1px dashed var(--line2);
  font-size: 13.5px;
  color: var(--ink2);
}
.why b { color: var(--ink); }

.quiz-bar {
  position: sticky;
  bottom: 14px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--sh-2);
}
.quiz-bar .count { font-size: 13px; color: var(--ink3); }
.quiz-bar .count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.quiz-bar .spacer { margin-left: auto; }

.score {
  display: flex; align-items: center; gap: 20px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--sh-2);
}
.score .big {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score .big small { font-size: 15px; font-weight: 500; color: var(--ink3); letter-spacing: 0; }
.score .txt h2 { font-size: 17px; }
.score .txt p { color: var(--ink3); font-size: 13.5px; margin-top: 4px; }
.score.tone-good .big { color: var(--ok); }
.score.tone-mid .big { color: var(--warn); }
.score.tone-low .big { color: var(--danger); }

.role-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.role-pick a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 14px;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.role-pick a:hover { border-color: hsl(var(--h, 215) 55% 82%); box-shadow: var(--sh-1); }
.role-pick .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: hsl(var(--h, 215) 65% 58%);
  flex: none;
}
.role-pick .n { margin-left: auto; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }

/* ---------- 提示词 ---------- */
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  position: sticky;
  top: 68px;
  z-index: 20;
  box-shadow: var(--sh-1);
}
.filter-bar .grow { flex: 1; min-width: 200px; }
.input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(42, 91, 215, 0.12); }
.select {
  height: 36px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 0 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--ink2);
  max-width: 220px;
}
.p-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 18px; }
.p-item { padding: 18px 20px; min-width: 0; }
.p-item-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.p-item-head h3 { font-size: 15.5px; }
.p-item-head .chip { margin-top: 2px; }
.p-item .use { font-size: 13px; color: var(--ink3); margin-top: 3px; }

/* ---------- 搜索浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 22, 32, 0.34);
  backdrop-filter: blur(3px);
  display: none;
  padding: 12vh 16px 16px;
}
.overlay.open { display: block; }
.palette {
  max-width: 660px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sh-3);
  overflow: hidden;
  border: 1px solid var(--line);
}
.palette input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  height: 52px;
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
}
.palette input:focus { outline: none; }
.palette .res { max-height: 54vh; overflow: auto; padding: 8px; }
.palette .res a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 14px;
}
.palette .res a:hover, .palette .res a.on { background: var(--bg-soft); }
.palette .res .ty {
  font-size: 11px;
  color: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  flex: none;
}
.palette .res .hint { margin-left: auto; font-size: 12px; color: var(--ink3); flex: none; }
.palette .foot {
  display: flex; gap: 14px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink3);
  background: #fbfcfe;
}
.palette .foot kbd {
  font-family: var(--mono);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  margin-right: 4px;
  background: #fff;
}
.empty { padding: 26px; text-align: center; color: var(--ink3); font-size: 14px; }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 26px 0 34px;
  color: var(--ink3);
  font-size: 12.5px;
}
.foot-in { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot .chip { white-space: normal; height: auto; min-height: 22px; line-height: 1.55; text-align: center; }
.foot a:hover { color: var(--brand); }
.foot .spacer { margin-left: auto; }

/* ---------- 辅助 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: #0e1620;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.pager { display: flex; gap: 10px; margin-top: 34px; }
.pager a {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13.5px;
  color: var(--ink2);
}
.pager a:hover { border-color: var(--line2); box-shadow: var(--sh-1); }
.pager a small { display: block; color: var(--ink3); font-size: 11.5px; margin-bottom: 2px; }
.pager a.next { text-align: right; }

/* ---------- 响应式 ---------- */
/* 品牌名变长后（如「AI学习培训和测评平台」），中等宽度下收紧导航，
   保证 8 项导航完整可见；≥1161px 保持默认字号与英文副标题。 */
@media (max-width: 1160px) {
  .brand small { display: none; }
  .nav a { padding: 7px 10px; font-size: 13.5px; }
}
/* 更窄的桌面/小平板：再收紧一档，保证 8 项导航完整可见 */
@media (max-width: 1120px) {
  .nav a { padding: 7px 8px; font-size: 13px; }
}
@media (max-width: 1020px) {
  /* minmax(0,1fr)：单列时允许收缩，避免子项 min-content 把整页撑宽 */
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; grid-row: 1; min-width: 0; }
  .role-layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; min-width: 0; }
  .chap-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .chap-nav a { border-left: 0; border: 1px solid var(--line); background: #fff; min-width: 0; }
  .chap-nav a.on { border-color: var(--brand); }
  .chap-nav .cnt { display: none; }
  .chap-nav .ct { margin-left: 0; font-size: 12px; color: var(--ink2); }
  /* 导航文案缩短后覆盖到 1000px：再收一档，避免 1000~1020px 出现滚动条 */
  .nav a { padding: 6px 7px; font-size: 12.5px; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .topbar-in {
    flex-wrap: wrap;
    height: auto;
    /* 注意保留 16px 左右内边距：此前写成 padding: 9px 0 8px 会把 .wrap 的边距覆盖掉，
       导致品牌贴左边缘、搜索按钮贴右边缘 */
    padding: 9px 16px 8px;
    row-gap: 7px;
    column-gap: 10px;
  }
  .brand { order: 1; gap: 7px; }
  .brand small { display: none; }
  .brand b { font-size: 14px; }
  .topbar-right { order: 2; margin-left: auto; gap: 6px; }
  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; padding: 6px 10px; font-size: 13px; border-radius: 7px; }
  .progress-pill { display: none; }
  .sec-head { flex-wrap: wrap; gap: 4px 14px; }
  .sec-head p.spacer { margin-left: 0; flex-basis: 100%; }
  .hero { padding: 24px 20px; border-radius: 16px; }
  .hero h1 { font-size: 23px; }
  .hero .hero-slogan { font-size: 14.5px; margin-top: 12px; }
  .hero .lede { font-size: 14.5px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 14px; padding-top: 16px; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .role-grid { grid-template-columns: 1fr; }
  .role-hero { padding: 20px 18px; }
  .role-hero h1 { font-size: 22px; }
  .chap { padding: 20px 18px; }
  .q-card { padding: 16px; }
  .score { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search-btn span { display: none; }
  .filter-bar { position: static; }
}

@media (max-width: 420px) {
  .brand b { font-size: 13px; }
  .hero h1 { font-size: 20.5px; }
  .hero .hero-slogan { font-size: 14px; letter-spacing: .04em; }
  .stat b { font-size: 20px; }
  .quiz-bar { gap: 8px; padding: 10px 12px; }
}

/* 首页方法列表 */
.rule-list { display: grid; gap: 11px; }
.rule-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.68;
}
.rule-list b {
  flex: none;
  width: 132px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .rule-list li { flex-direction: column; gap: 2px; }
  .rule-list b { width: auto; }
  .stat b { font-size: 21px; }
}

/* 导航项增至 7 个后，窄屏允许横向滑动，避免撑破顶栏 */
@media (max-width: 900px) {
  .nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 9px; font-size: 13px; }
}

@media print {
  .topbar, .doc-side, .quiz-bar, .foot, .search-btn { display: none; }
  body { background: #fff; }
  .chap, .q-card { box-shadow: none; break-inside: avoid; }
  .prompt pre { max-height: none; overflow: visible; }
  .role-layout, .doc { grid-template-columns: 1fr; }
}
