/* ============================================================
   PMP 图像化复习系统 — 设计系统
   ============================================================ */

:root {
  /* 中性色 */
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-sunken: #eceef1;
  --border: #dfe3e8;
  --border-strong: #c6ccd4;
  --text: #1b1f24;
  --text-dim: #57606a;
  --text-faint: #8b949e;

  /* 品牌/语义色 */
  --accent: #2f6df6;
  --accent-soft: #e8f0ff;
  --accent-text: #1a4fd0;
  --ok: #18794e;
  --ok-soft: #e6f6ee;
  --warn: #9a6700;
  --warn-soft: #fff6d9;
  --bad: #cf222e;
  --bad-soft: #ffebe9;
  --purple: #8250df;
  --purple-soft: #f3ecff;
  --teal: #0f7c86;
  --teal-soft: #e2f5f7;

  /* 过程组配色（PMP 五大过程组） */
  --pg-init: #0f7c86;
  --pg-plan: #2f6df6;
  --pg-exec: #18794e;
  --pg-mon: #9a6700;
  --pg-close: #8250df;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(27, 31, 36, .07);
  --shadow: 0 4px 14px rgba(27, 31, 36, .10);
  --shadow-lg: 0 12px 32px rgba(27, 31, 36, .14);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --nav-w: 268px;
  --header-h: 56px;
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-sunken: #010409;
  --border: #30363d;
  --border-strong: #484f58;
  --text: #e6edf3;
  --text-dim: #9198a1;
  --text-faint: #6e7681;

  --accent: #58a6ff;
  --accent-soft: #12243c;
  --accent-text: #79c0ff;
  --ok: #3fb950;
  --ok-soft: #10241a;
  --warn: #d29922;
  --warn-soft: #241c10;
  --bad: #f85149;
  --bad-soft: #2b1213;
  --purple: #bc8cff;
  --purple-soft: #1f1830;
  --teal: #39c5cf;
  --teal-soft: #10262a;

  --pg-init: #39c5cf;
  --pg-plan: #58a6ff;
  --pg-exec: #3fb950;
  --pg-mon: #d29922;
  --pg-close: #bc8cff;

  --shadow-sm: 0 1px 2px rgba(1, 4, 9, .5);
  --shadow: 0 4px 14px rgba(1, 4, 9, .55);
  --shadow-lg: 0 12px 32px rgba(1, 4, 9, .65);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; font-size: inherit; cursor: pointer; }

code, kbd {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1em .4em;
}

::selection { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================================
   布局骨架
   ============================================================ */

.app { display: flex; min-height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 60;
}

.topbar .brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 650; font-size: 15px; letter-spacing: -.01em;
  white-space: nowrap;
}
.topbar .brand .logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
}
.topbar .brand small {
  color: var(--text-faint); font-weight: 500; font-size: 12px;
}

.topbar .spacer { flex: 1; }

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  border-radius: 9px;
  transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-sunken); }
.icon-btn svg { width: 17px; height: 17px; }

.nav-toggle { display: none; }

/* ---------- 侧栏 ---------- */
.sidebar {
  position: fixed; top: var(--header-h); bottom: 0; left: 0;
  width: var(--nav-w);
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 10px 40px;
  z-index: 50;
}

.nav-group { margin-bottom: 18px; }
.nav-group > h4 {
  margin: 0 0 6px; padding: 0 10px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint);
  display: flex; align-items: center; gap: 6px;
}
.nav-group > h4::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; margin-bottom: 1px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.35;
  cursor: pointer;
  transition: .12s;
  position: relative;
}
.nav-item:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent-text); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .ico { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item .txt { flex: 1; min-width: 0; }

/* 进度环 */
.ring { width: 20px; height: 20px; flex-shrink: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: var(--border); }
.ring .fg { stroke: var(--ok); transition: stroke-dashoffset .5s ease; }
.nav-item .done-tick { color: var(--ok); font-size: 13px; }

/* ---------- 主区 ---------- */
.main {
  flex: 1; min-width: 0;
  margin-left: var(--nav-w);
  padding: calc(var(--header-h) + 26px) 0 100px;
}
.container { max-width: 880px; margin: 0 auto; padding: 0 28px; }
.container.wide { max-width: 1140px; }

/* ============================================================
   通用组件
   ============================================================ */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 550; font-size: 13.5px;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-sunken); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--bg-sunken); color: var(--text); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { padding: 11px 22px; font-size: 15px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  background: var(--bg-sunken); color: var(--text-dim);
  border: 1px solid var(--border);
}
.chip.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip.ok     { background: var(--ok-soft);     color: var(--ok);     border-color: transparent; }
.chip.warn   { background: var(--warn-soft);   color: var(--warn);   border-color: transparent; }
.chip.bad    { background: var(--bad-soft);    color: var(--bad);    border-color: transparent; }
.chip.purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.chip.teal   { background: var(--teal-soft);   color: var(--teal);   border-color: transparent; }

/* 标题 */
h1.page-title {
  margin: 0 0 6px;
  font-size: 30px; font-weight: 700; letter-spacing: -.022em;
  line-height: 1.25;
}
.page-sub { margin: 0 0 4px; color: var(--text-dim); font-size: 15px; }
.page-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 30px; }

h2.sec-title {
  margin: 42px 0 14px;
  font-size: 21px; font-weight: 680; letter-spacing: -.015em;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
h2.sec-title .n {
  display: grid; place-items: center;
  width: 25px; height: 25px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
h3.sub-title { margin: 26px 0 10px; font-size: 16.5px; font-weight: 650; }

p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin-bottom: 5px; }
li > strong:first-child { color: var(--text); }

/* 提示框 */
.callout {
  display: flex; gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-faint);
  background: var(--bg-sunken);
  margin: 16px 0;
  font-size: 14px;
}
.callout .ci { font-size: 17px; line-height: 1.3; flex-shrink: 0; }
.callout .cb { min-width: 0; }
.callout .cb > *:last-child { margin-bottom: 0; }
.callout b.ct { display: block; margin-bottom: 3px; font-size: 13px; }
.callout.tip  { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.tip b.ct { color: var(--accent-text); }
.callout.exam { border-left-color: var(--purple); background: var(--purple-soft); }
.callout.exam b.ct { color: var(--purple); }
.callout.trap { border-left-color: var(--bad); background: var(--bad-soft); }
.callout.trap b.ct { color: var(--bad); }
.callout.key  { border-left-color: var(--ok); background: var(--ok-soft); }
.callout.key b.ct { color: var(--ok); }
.callout.note { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.note b.ct { color: var(--warn); }

/* 表格 */
.tbl-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 460px; }
table.tbl th, table.tbl td {
  padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.tbl thead th {
  background: var(--bg-sunken); font-weight: 650; font-size: 12.5px;
  color: var(--text-dim); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .03em;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--bg-sunken); }
table.tbl td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }

/* 公式 */
.formula {
  font-family: var(--mono); font-size: 14.5px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin: 14px 0;
  overflow-x: auto; white-space: nowrap;
}
.formula .hl { color: var(--accent-text); font-weight: 700; }
.formula-grid { display: grid; gap: 9px; margin: 14px 0; }
.formula-row {
  display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: baseline;
  padding: 9px 13px; background: var(--bg-sunken);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.formula-row b { font-size: 13px; color: var(--accent-text); }
.formula-row code { background: transparent; border: none; padding: 0; font-size: 13.5px; }
.formula-row .why { display: block; margin-top: 3px; color: var(--text-dim); font-size: 12.5px; font-family: var(--font); }

/* ============================================================
   可视化 / 动画容器
   ============================================================ */

.viz {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  overflow: hidden;
}
.viz-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}
.viz-head .vt { font-weight: 620; font-size: 13.5px; flex: 1; min-width: 0; }
.viz-head .vc { display: flex; gap: 6px; flex-shrink: 0; }
.viz-body { padding: 18px; overflow-x: auto; }
.viz-body.pad0 { padding: 0; }
.viz-cap {
  padding: 10px 16px; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--text-dim); background: var(--bg-sunken);
}

svg.diagram { display: block; max-width: 100%; height: auto; overflow: visible; }
svg text { font-family: var(--font); fill: var(--text); }
svg .lbl { font-size: 12px; }
svg .lbl-sm { font-size: 10.5px; fill: var(--text-dim); }
svg .lbl-b { font-size: 12px; font-weight: 650; }

/* 控件 */
.ctrl-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--bg-sunken);
  border-top: 1px solid var(--border);
}
.ctrl {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-dim);
}
.ctrl label { font-weight: 600; white-space: nowrap; }
.ctrl output {
  font-family: var(--mono); font-weight: 700; color: var(--accent-text);
  min-width: 46px; text-align: right;
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 4px; border-radius: 3px;
  background: var(--border-strong); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg-elev); box-shadow: var(--shadow-sm);
}

input[type=text], input[type=password], input[type=number], select, textarea {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-elev); color: var(--text);
  font-family: inherit; font-size: 13.5px;
  outline: none; transition: .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
select { cursor: pointer; }

/* 动画基元 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse  { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes dash   { to { stroke-dashoffset: -18; } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes flow   { to { stroke-dashoffset: -1000; } }

.anim-in { animation: fadeUp .4s ease both; }
svg .flow-line { stroke-dasharray: 6 6; animation: dash .7s linear infinite; }
.spinner {
  width: 15px; height: 15px; flex-shrink: 0;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* 分步动画播放器 */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .dots { display: flex; gap: 5px; }
.stepper .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong); transition: .2s; cursor: pointer;
}
.stepper .dot.on { background: var(--accent); transform: scale(1.3); }
.stepper .cnt { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

.step-note {
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--accent-soft); font-size: 13.5px; min-height: 46px;
}
.step-note b { color: var(--accent-text); }

/* ============================================================
   测验
   ============================================================ */

.quiz-wrap { margin: 26px 0; }

.q-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-elev); padding: 20px 22px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .35s ease both;
}
.q-head {
  display: flex; align-items: flex-start; gap: 11px; margin-bottom: 15px;
}
.q-num {
  display: grid; place-items: center; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12.5px; font-weight: 700;
}
.q-stem { flex: 1; min-width: 0; font-size: 15px; line-height: 1.6; font-weight: 500; }
.q-stem .scenario { display: block; color: var(--text-dim); font-size: 14px; margin-bottom: 7px; }

.opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); cursor: pointer;
  transition: .14s; text-align: left; width: 100%;
  font-size: 14px; line-height: 1.55; color: var(--text);
}
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.opt:disabled { cursor: default; }
.opt .k {
  display: grid; place-items: center; flex-shrink: 0;
  width: 21px; height: 21px; border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-size: 11.5px; font-weight: 700; color: var(--text-dim);
  background: var(--bg-sunken);
}
.opt .ot { flex: 1; min-width: 0; }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.picked .k { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt .mk { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.opt.right .mk { color: var(--ok); }
.opt.wrong .mk { color: var(--bad); }

.explain {
  margin-top: 14px; padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  font-size: 13.5px;
  animation: fadeUp .3s ease both;
}
.explain b.et { display: block; margin-bottom: 5px; color: var(--ok); font-size: 12.5px; }
.explain .why-not { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); color: var(--text-dim); }
.explain .why-not div { margin-bottom: 3px; }

.quiz-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 15px 18px; margin: 20px 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
.quiz-bar .spacer { flex: 1; }
.score {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--mono);
}
.score .big { font-size: 25px; font-weight: 700; color: var(--accent-text); }
.score .small { font-size: 13px; color: var(--text-faint); }

.gen-status {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-dim);
}

/* ============================================================
   设置弹窗
   ============================================================ */

.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(1, 4, 9, .55);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .18s ease both;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: fadeUp .22s ease both;
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 650; flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-foot .spacer { flex: 1; }

.field { margin-bottom: 16px; }
.field > label {
  display: block; margin-bottom: 5px;
  font-size: 12.5px; font-weight: 650; color: var(--text);
}
.field .hint { margin-top: 5px; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.field .row { display: flex; gap: 8px; align-items: center; }

.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-dim);
}
.status-dot i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint); flex-shrink: 0;
}
.status-dot.ok i  { background: var(--ok); }
.status-dot.bad i { background: var(--bad); }
.status-dot.busy i { background: var(--warn); animation: pulse 1s infinite; }

/* ============================================================
   仪表盘
   ============================================================ */

.hero {
  padding: 34px 32px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(1000px 300px at 12% -30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
    radial-gradient(760px 260px at 92% -10%, color-mix(in srgb, var(--purple) 14%, transparent), transparent),
    var(--bg-elev);
  border: 1px solid var(--border);
  margin-bottom: 26px;
}
.hero h1 { margin: 0 0 9px; font-size: 29px; font-weight: 720; letter-spacing: -.025em; }
.hero p { color: var(--text-dim); max-width: 62ch; margin-bottom: 0; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.stat-grid {
  display: grid; gap: 12px; margin: 20px 0;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
.stat {
  padding: 15px 17px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border);
}
.stat .sv { font-size: 25px; font-weight: 700; font-family: var(--mono); line-height: 1.15; }
.stat .sl { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.stat .sb { height: 4px; border-radius: 3px; background: var(--bg-sunken); margin-top: 9px; overflow: hidden; }
.stat .sb i { display: block; height: 100%; border-radius: 3px; background: var(--ok); transition: width .6s ease; }

.ch-grid {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  margin: 16px 0 30px;
}
.ch-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 17px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-elev); cursor: pointer;
  transition: .16s; text-decoration: none; color: var(--text);
  position: relative; overflow: hidden;
}
.ch-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: var(--accent); text-decoration: none;
}
.ch-card .ci { font-size: 21px; }
.ch-card .cn { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.ch-card .cd { font-size: 12.5px; color: var(--text-dim); flex: 1; line-height: 1.55; }
.ch-card .cf { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.ch-card .bar { flex: 1; height: 3px; border-radius: 2px; background: var(--bg-sunken); overflow: hidden; }
.ch-card .bar i { display: block; height: 100%; background: var(--ok); transition: width .5s; }

/* ============================================================
   错题本 / 复习
   ============================================================ */
.wrong-item {
  padding: 15px 17px; border: 1px solid var(--border);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius); background: var(--bg-elev);
  margin-bottom: 11px;
}
.wrong-item .wq { font-weight: 550; margin-bottom: 7px; font-size: 14px; }
.wrong-item .wm { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; font-size: 12px; color: var(--text-dim); }

.empty {
  text-align: center; padding: 54px 20px; color: var(--text-faint);
}
.empty .ei { font-size: 38px; margin-bottom: 10px; opacity: .55; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
    width: 280px;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ''; position: fixed; inset: var(--header-h) 0 0 0;
    background: rgba(1,4,9,.4); z-index: 45;
  }
  .main { margin-left: 0; }
  .container { padding: 0 18px; }
  h1.page-title { font-size: 25px; }
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 23px; }
}

@media print {
  .topbar, .sidebar, .viz-head .vc, .ctrl-bar { display: none; }
  .main { margin: 0; padding: 0; }
}
