/* 美股技术分析与期权课程 — 全站样式
   主题变量：浅色在 :root，深色在 [data-theme="dark"]。
   美股配色：--up 绿色 = 上涨，--down 红色 = 下跌。 */

:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --surface-3: #e9e8e2;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #85837d;
  --border: #e1e0d9;
  --border-strong: #c3c2b7;
  --grid: #ebeae4;
  --axis: #c3c2b7;
  --accent: #2a78d6;
  --accent-text: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --up: #0ca30c;
  --up-text: #006300;
  --up-soft: rgba(12, 163, 12, 0.12);
  --down: #d03b3b;
  --down-text: #b42828;
  --down-soft: rgba(208, 59, 59, 0.12);
  --flat: #898781;
  --warn: #9a6400;
  --warn-fill: #fab219;
  --warn-soft: rgba(250, 178, 25, 0.16);
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #6250d6;
  --s8: #e34948;
  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --content-w: 840px;

  /* 原聊天交互图使用的变量名（别名） */
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  --text-success: var(--up-text);
  --text-danger: var(--down-text);
  --text-accent: var(--accent-text);
  --text-warning: var(--warn);
  --bg-neutral: var(--surface-2);
  --bg-accent: var(--accent-soft);
  --bg-success: var(--up-soft);
  --bg-danger: var(--down-soft);
  --bg-warning: var(--warn-soft);
  --border-accent: var(--accent);
  --border-warning: var(--warn-fill);
  --border-stronger: var(--text-3);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110;
  --surface: #1a1a19;
  --surface-2: #242422;
  --surface-3: #2e2e2b;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #8f8d86;
  --border: #2e2e2b;
  --border-strong: #4a4944;
  --grid: #272725;
  --axis: #4a4944;
  --accent: #3987e5;
  --accent-text: #86b6ef;
  --accent-soft: rgba(57, 135, 229, 0.18);
  --up: #0ca30c;
  --up-text: #4fcf4f;
  --up-soft: rgba(12, 163, 12, 0.20);
  --down: #e66767;
  --down-text: #f08a8a;
  --down-soft: rgba(230, 103, 103, 0.18);
  --flat: #8f8d86;
  --warn: #fab219;
  --warn-fill: #fab219;
  --warn-soft: rgba(250, 178, 25, 0.14);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #0ca30c;
  --s7: #9085e9;
  --s8: #e66767;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 600; margin: 1.6em 0 0.6em; }
h1 { font-size: 1.75rem; margin-top: 0.4em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0.6em 0; }
ul, ol { padding-left: 1.4em; margin: 0.5em 0; }
li { margin: 0.25em 0; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
b, strong { font-weight: 600; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.small { font-size: 0.875rem; }
.up { color: var(--up-text); }
.down { color: var(--down-text); }
.warn-text { color: var(--warn); }
.accent { color: var(--accent-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 0.55rem 1rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand { font-weight: 650; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { display: inline-flex; gap: 2px; margin-right: 6px; vertical-align: -1px; }
.brand .mark i { display: inline-block; width: 5px; border-radius: 1px; }
.nav { display: flex; gap: 0.15rem; flex-wrap: wrap; flex: 1; }
.nav a {
  color: var(--text-2); padding: 0.3rem 0.65rem; border-radius: var(--radius-sm);
  font-size: 0.95rem; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.on { color: var(--text); background: var(--surface-2); font-weight: 600; }
.nav .count { font-size: 0.75rem; background: var(--accent); color: #fff; border-radius: 9px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.top-actions { display: flex; gap: 0.4rem; align-items: center; }

/* ---------- 主体 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1rem 3rem; min-height: 70vh; }
.page { max-width: var(--content-w); margin: 0 auto; }
.page.wide { max-width: 1040px; }
.footer {
  border-top: 1px solid var(--border); color: var(--text-3); font-size: 0.85rem;
  padding: 1.25rem 1rem 2rem; text-align: center;
}
.footer a { color: var(--text-2); }

/* ---------- 按钮和表单 ---------- */
button, .btn {
  font: inherit; font-size: 0.92rem; line-height: 1.4;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 0.38rem 0.8rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.35rem; justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary, button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { font-size: 0.82rem; padding: 0.22rem 0.6rem; }
button.on, .btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
button.up-btn { border-color: color-mix(in srgb, var(--up) 55%, var(--border-strong)); }
button.down-btn { border-color: color-mix(in srgb, var(--down) 55%, var(--border-strong)); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0.4rem 0; }

input[type="text"], input[type="number"], input[type="search"], select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.38rem 0.55rem;
  max-width: 100%;
}
textarea { width: 100%; resize: vertical; line-height: 1.6; }
input[type="number"] { width: 8.5rem; font-family: var(--font-mono); }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; }
label { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.92rem; }
.field > span:first-child { color: var(--text-2); }
.field input[type="number"] { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.75rem; }
.form-error { color: var(--down-text); font-size: 0.9rem; min-height: 1.4em; }

.slider-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 5.5rem; gap: 0.7rem; align-items: center; font-size: 0.92rem; margin: 0.3rem 0; }
.slider-row > span:first-child { color: var(--text-2); }
.slider-row output { font-family: var(--font-mono); text-align: right; font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--text-2); padding: 0.2rem 0.55rem 0.2rem 0.35rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.toggle:has(input:checked) { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

/* ---------- 卡片、标签 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 0.9rem; }
.dash .card + .card, .wgrid .card + .card { margin-top: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; line-height: 1.5;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 0.05rem 0.6rem; white-space: nowrap;
}
a.chip:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.chip.done { background: var(--up-soft); border-color: transparent; color: var(--up-text); }
.chip.todo { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.lock { background: var(--surface-2); color: var(--text-3); }
.chip.acc { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.badge-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; display: inline-block; background: var(--border-strong); }
.badge-dot.done { background: var(--up); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 0.5rem; margin: 0.6rem 0; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; min-width: 0; }
.stat .l { font-size: 0.78rem; color: var(--text-2); line-height: 1.4; }
.stat .v { font-size: 1.12rem; font-weight: 600; font-family: var(--font-mono); line-height: 1.35; overflow-wrap: anywhere; }
.stat .v.up { color: var(--up-text); }
.stat .v.down { color: var(--down-text); }
.stat .v.warn { color: var(--warn); }
.stat .s { font-size: 0.75rem; color: var(--text-3); line-height: 1.35; }

/* ---------- 提示框 ---------- */
.callout { border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; margin: 0.9rem 0; background: var(--surface-2); border-left: 3px solid var(--border-strong); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout.warn { background: var(--warn-soft); border-left-color: var(--warn-fill); }
.callout.note { background: var(--accent-soft); border-left-color: var(--accent); }
.callout.tendency { background: var(--surface-2); border-left-color: var(--s7); }
.callout.tendency::before { content: "倾向，不是规则 · "; font-weight: 600; color: var(--text-2); }
.callout.tip { background: var(--up-soft); border-left-color: var(--up); }
.callout.danger { background: var(--down-soft); border-left-color: var(--down); }
.callout.country { background: var(--surface-2); border-left-color: var(--s3); }
.callout.country::before { content: attr(data-label); display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.15rem; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; margin: 0.8rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 0.92rem; background: var(--surface); }
.tbl th, .tbl td { padding: 0.45rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { background: var(--surface-2); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); }
.tbl tr.hl td { background: var(--accent-soft); }

/* ---------- 课程页 ---------- */
.crumbs { font-size: 0.85rem; color: var(--text-3); margin-bottom: 0.4rem; }
.crumbs a { color: var(--text-2); }
.lesson-no { font-size: 0.9rem; color: var(--accent-text); font-weight: 600; }
.lesson-head h1 { margin: 0.1em 0 0.35em; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.9rem; color: var(--text-2); margin: 0.3rem 0; }
.toc { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 1rem 0 0.5rem; padding: 0.7rem 0.9rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 0.88rem; }
.toc b { color: var(--text-2); font-weight: 600; margin-right: 0.3rem; }
.toc a { color: var(--text-2); }
.concept { margin: 2.2rem 0 0; }
.concept > h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; margin-top: 0; }
.part { margin: 0.9rem 0; position: relative; }
.part > .part-label {
  display: inline-block; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.02em;
  border-radius: 4px; padding: 0.05rem 0.5rem; margin-bottom: 0.25rem;
}
.part.what > .part-label { background: var(--accent-soft); color: var(--accent-text); }
.part.sowhat > .part-label { background: color-mix(in srgb, var(--s7) 16%, transparent); color: var(--s7); }
[data-theme="dark"] .part.sowhat > .part-label { color: #b3abf2; }
.part.how > .part-label { background: var(--up-soft); color: var(--up-text); }
.part.mistakes > .part-label { background: var(--down-soft); color: var(--down-text); }
.part.mistakes ul { margin-top: 0.2rem; }
.formula { font-family: var(--font); font-variant-numeric: tabular-nums; font-weight: 500; background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.55rem 0.9rem; margin: 0.7rem 0; font-size: 0.95rem; overflow-x: auto; }
.steps-list { counter-reset: st; list-style: none; padding-left: 0; }
.steps-list > li { counter-increment: st; padding-left: 2rem; position: relative; margin: 0.4rem 0; }
.steps-list > li::before { content: counter(st); position: absolute; left: 0; top: 0.15rem; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 0.8rem; font-weight: 650; display: flex; align-items: center; justify-content: center; }
kbd { font-family: var(--font-mono); font-size: 0.85em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3rem; background: var(--surface); }
.ui-word { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 0.3rem; white-space: nowrap; }

.lesson-summary h2, .lesson-terms h2, .lesson-practice h2 { margin-top: 2.6rem; }
.finish-box { margin: 2.5rem 0 1rem; padding: 1.1rem 1.2rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.finish-box.done { border-style: solid; border-color: color-mix(in srgb, var(--up) 45%, var(--border)); background: var(--up-soft); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1.5rem 0; }
.pager a { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; background: var(--surface); color: var(--text); }
.pager a:hover { border-color: var(--border-strong); text-decoration: none; }
.pager a small { display: block; color: var(--text-3); }
.pager .next { text-align: right; }

/* ---------- 交互图卡片 ---------- */
.widget { margin: 1.3rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.widget-head { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.55rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.widget-head .wid { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-text); background: var(--accent-soft); border-radius: 4px; padding: 0 0.4rem; }
.widget-head .wt { font-weight: 600; font-size: 0.98rem; }
.widget-head .wh { font-size: 0.84rem; color: var(--text-3); flex-basis: 100%; line-height: 1.5; }
.widget-body { padding: 0.9rem 1rem 1rem; font-size: 0.94rem; }
.widget-body svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.widget-body svg text { font-family: var(--font); }
.widget-error { color: var(--down-text); font-size: 0.9rem; }
.readout { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.82rem; color: var(--text-2); min-height: 1.4em; white-space: nowrap; overflow-x: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.8rem; color: var(--text-2); margin: 0.3rem 0; }
.legend .sw { display: inline-block; width: 16px; height: 0; border-top: 2px solid currentColor; vertical-align: middle; margin-right: 5px; }
.legend .sw.dash { border-top-style: dashed; }
.legend .sw.box { height: 10px; border: 0; border-radius: 2px; }
.wgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.wgrid.side { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.wgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; font-size: 0.92rem; line-height: 1.7; }
.panel h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.log { font-size: 0.86rem; line-height: 1.55; max-height: 13rem; overflow-y: auto; }
.log > div { border-bottom: 1px solid var(--border); padding: 0.3rem 0; }
.log > div:first-child { font-weight: 500; }
.result { border-radius: var(--radius-sm); padding: 0.55rem 0.8rem; margin: 0.5rem 0; font-size: 0.93rem; }
.result.ok { background: var(--up-soft); }
.result.bad { background: var(--down-soft); }
.result.mid { background: var(--warn-soft); }
.result.info { background: var(--surface-2); }

/* 订单簿表格（多个交互图共用） */
table.book { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.book td { padding: 0.22rem 0.45rem; text-align: right; font-family: var(--font-mono); border-bottom: 1px solid var(--border); }
table.book td:first-child { text-align: left; font-family: var(--font); color: var(--text-2); }
table.book tr.best td { background: var(--surface-2); font-weight: 600; }
table.book tr.gone td { color: var(--text-3); text-decoration: line-through; }
table.book tr.new td { background: var(--warn-soft); }
table.book .ask { color: var(--down-text); }
table.book .bid { color: var(--up-text); }
.book-label { font-size: 0.8rem; margin: 0.4rem 0 0.15rem; }

/* ---------- 首页 ---------- */
.hero { padding: 1.2rem 0 0.4rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.4rem; }
.hero p { color: var(--text-2); max-width: 46rem; }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--up); border-radius: 99px; transition: width 0.3s; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.9rem; margin: 1.2rem 0; }
.dash .card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.dash .big { font-size: 1.6rem; font-weight: 650; font-family: var(--font-mono); }
.part-block { margin: 2rem 0 0; }
.part-block > h2 { margin: 0 0 0.2rem; }
.part-block > p { margin: 0 0 0.8rem; color: var(--text-2); }
.lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.7rem; }
.lesson-card { display: flex; flex-direction: column; gap: 0.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 0.95rem; color: var(--text); position: relative; }
.lesson-card:hover { border-color: var(--border-strong); text-decoration: none; box-shadow: var(--shadow); }
.lesson-card .no { font-size: 0.82rem; color: var(--accent-text); font-weight: 600; }
.lesson-card .tt { font-weight: 600; font-size: 1.02rem; }
.lesson-card .cv { font-size: 0.84rem; color: var(--text-2); line-height: 1.55; }
.lesson-card .pr { font-size: 0.78rem; color: var(--text-3); }
.lesson-card .st { position: absolute; top: 0.7rem; right: 0.8rem; }
.lesson-card.done { border-color: color-mix(in srgb, var(--up) 40%, var(--border)); }

/* ---------- 问答 ---------- */
.q-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.8rem 0 1rem; }
.q-group { margin: 1.8rem 0 0; }
.q-group > h2 { font-size: 1.1rem; margin: 0 0 0.6rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.05rem; margin: 0.7rem 0; }
.q-card.done { border-color: color-mix(in srgb, var(--up) 45%, var(--border)); }
.q-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.3rem; }
.q-head .qid { font-family: var(--font-mono); font-weight: 650; color: var(--text-2); }
.q-prompt { font-size: 1rem; }
.q-prompt p:first-child { margin-top: 0; }
.q-figure { margin: 0.6rem 0; }
.q-options { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.6rem 0; }
.q-opt { display: flex; gap: 0.55rem; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.45rem 0.7rem; background: var(--surface); cursor: pointer; font-size: 0.95rem; line-height: 1.6; }
.q-opt:hover { border-color: var(--border-strong); }
.q-opt input { margin-top: 0.3rem; flex: none; }
.q-opt.right { border-color: var(--up); background: var(--up-soft); }
.q-opt.wrong { border-color: var(--down); background: var(--down-soft); }
.q-opt .why { display: block; font-size: 0.86rem; color: var(--text-2); margin-top: 0.15rem; }
.q-fields { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin: 0.6rem 0; }
.q-fields label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; }
.q-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.5rem; }
.q-feedback { margin-top: 0.6rem; }
.q-box { border-radius: var(--radius-sm); padding: 0.6rem 0.85rem; margin-top: 0.55rem; font-size: 0.94rem; }
.q-box.hint { background: var(--warn-soft); }
.q-box.explain { background: var(--surface-2); border-left: 3px solid var(--accent); }
.q-box.ref { background: var(--accent-soft); }
.q-box > :first-child { margin-top: 0; }
.q-box > :last-child { margin-bottom: 0; }
.locked-group { color: var(--text-3); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0.6rem 0; font-size: 0.92rem; }

/* ---------- 我的问题 ---------- */
.notes-box { margin: 2.5rem 0 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0.9rem 1.05rem; }
.notes-box h2 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.notes-box .intro { font-size: 0.86rem; color: var(--text-3); margin: 0 0 0.6rem; }
.note-item { display: flex; gap: 0.6rem; align-items: flex-start; border-top: 1px solid var(--border); padding: 0.5rem 0; font-size: 0.94rem; }
.note-item .tx { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item.resolved .tx { color: var(--text-3); text-decoration: line-through; }
.note-item .tm { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; }

/* ---------- 弹窗和提示 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--surface); color: var(--text); border-radius: var(--radius); max-width: 560px; width: 100%; padding: 1.3rem 1.4rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); max-height: 92vh; overflow-y: auto; }
.modal h2 { margin: 0 0 0.5rem; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 0.5rem 1rem; border-radius: 99px; font-size: 0.9rem; z-index: 60; box-shadow: var(--shadow); }
.storage-warn { background: var(--warn-soft); color: var(--text); font-size: 0.88rem; text-align: center; padding: 0.35rem 1rem; }

/* ---------- 术语表 ---------- */
.gl-tools { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.8rem 0; }
.gl-tools input[type="search"] { flex: 1; min-width: 14rem; }

/* ---------- 应用题 ---------- */
.app-list .card h3 { margin: 0 0 0.3rem; }
.plan-form { margin-top: 1rem; }
.check-list { list-style: none; padding: 0; margin: 0.6rem 0; }
.check-list li { padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); margin: 0.35rem 0; font-size: 0.93rem; }
.check-list li.ok { background: var(--up-soft); }
.check-list li.ok::before { content: "✓ "; color: var(--up-text); font-weight: 700; }
.check-list li.warn { background: var(--warn-soft); }
.check-list li.warn::before { content: "! "; color: var(--warn); font-weight: 700; }
.check-list li.bad { background: var(--down-soft); }
.check-list li.bad::before { content: "✗ "; color: var(--down-text); font-weight: 700; }
.check-list li.info { background: var(--surface-2); }
.check-list li.info::before { content: "· "; color: var(--text-3); font-weight: 700; }
.step-btns { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.2rem 0 0.6rem; }
.explain-box { font-size: 0.95rem; line-height: 1.75; margin-top: 0.6rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .topbar-in { gap: 0.3rem 0.6rem; padding: 0.45rem 0.7rem; }
  .nav { flex-wrap: nowrap; overflow-x: auto; flex-basis: 100%; order: 3; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0.25rem 0.55rem; font-size: 0.9rem; }
  .top-actions { margin-left: auto; }
  .wgrid, .wgrid.side, .wgrid.three { grid-template-columns: minmax(0, 1fr); }
  .slider-row { grid-template-columns: 5.8rem minmax(0, 1fr) 4.6rem; gap: 0.5rem; }
  .pager { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .widget-body { padding: 0.7rem 0.7rem 0.8rem; }
}

@media print {
  .topbar, .notes-box, .finish-box, .pager, .footer { display: none; }
  .widget { break-inside: avoid; box-shadow: none; }
}
