:root {
  --bg: #0f1420;
  --bg2: #161d2e;
  --card: #1c2536;
  --card2: #232f44;
  --line: #2c3850;
  --text: #e8edf6;
  --muted: #93a1bd;
  --accent: #4f9dff;
  --accent2: #7c5cff;
  --good: #36d399;
  --bad: #f87272;
  --warn: #fbbd23;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1b2740 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(15,20,32,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 30px; }
.brand-title { font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.userbox { display: flex; align-items: center; gap: 10px; }
.uid-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 20px; }

input, textarea, select {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }

.tabs { display: flex; gap: 8px; padding: 14px 22px 0; flex-wrap: wrap; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.tab:hover { color: var(--text); background: var(--bg2); }
.tab.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; }

.app { flex: 1; padding: 22px; max-width: 980px; width: 100%; margin: 0 auto; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.grid { display: grid; gap: 14px; }
.grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .grid.cols3, .grid.cols2 { grid-template-columns: 1fr; } }

.stat { background: var(--card2); border-radius: 12px; padding: 16px; }
.stat .num { font-size: 30px; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat .num.good { color: var(--good); }
.stat .num.bad { color: var(--bad); }
.stat .num.warn { color: var(--warn); }

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .08s ease, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
.tagpill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); margin: 2px; }

.bar { background: var(--bg2); border-radius: 20px; height: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 20px; }
.bar.good > i { background: var(--good); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

.q { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: var(--card2); }
.q .qmeta { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.q .qtext { font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
.q .instr { color: var(--accent); font-size: 12px; margin-bottom: 8px; }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: var(--accent); }
.opt input { accent-color: var(--accent); }
textarea { width: 100%; min-height: 90px; resize: vertical; font-family: inherit; line-height: 1.6; }

.badge { font-size: 12px; padding: 3px 9px; border-radius: 20px; font-weight: 700; }
.badge.ok { background: rgba(54,211,153,.15); color: var(--good); }
.badge.no { background: rgba(248,114,114,.15); color: var(--bad); }

.result-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.solution { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

.cwd { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 12px 0; }
.cwd .c { background: var(--card2); border-radius: 10px; padding: 12px; text-align: center; }
.cwd .c .v { font-size: 24px; font-weight: 800; }
.cwd .c .k { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 720px){ .cwd { grid-template-columns: repeat(2,1fr); } }

.rec { border-left: 3px solid var(--accent); padding: 10px 14px; background: var(--card2); border-radius: 0 10px 10px 0; margin-bottom: 10px; }
.rec .meta { color: var(--muted); font-size: 12px; }
.feedback { background: rgba(79,157,255,.08); border: 1px solid rgba(79,157,255,.25); border-radius: 10px; padding: 12px; line-height: 1.7; }

.passage { background: var(--bg2); border-left: 3px solid var(--accent2); padding: 14px; border-radius: 0 10px 10px 0; line-height: 1.8; margin-bottom: 16px; font-size: 14px; }

.recording { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(248,114,114,.5);} 70%{box-shadow:0 0 0 12px rgba(248,114,114,0);} 100%{box-shadow:0 0 0 0 rgba(248,114,114,0);} }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50; opacity: 0; transition: opacity .25s; }
.toast.show { opacity: 1; }

.footer { padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--bg2); color: var(--muted); border: none; padding: 9px 14px; cursor: pointer; font-size: 13px; }
.seg button.active { background: var(--accent); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ===== P0 限时考试内核 ===== */
.exam-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.exam-bar .eb-item { display: flex; flex-direction: column; line-height: 1.3; }
.exam-bar .eb-item .muted { font-size: 11px; }
.exam-bar .eb-item b { font-size: 16px; }
.exam-bar .btn { margin-left: auto; }
#countdown { font-variant-numeric: tabular-nums; color: var(--good, #36d399); }
#countdown.danger { color: #f87272; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { opacity: .55; } }

.sheet { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.snum {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
  font-size: 13px; font-weight: 600; position: relative;
}
.snum:hover { border-color: var(--accent); color: var(--text); }
.snum.done { background: rgba(54,211,153,.14); border-color: rgba(54,211,153,.45); color: #36d399; }
.snum.flagged::after {
  content: '⚑'; position: absolute; top: -6px; right: -4px;
  font-size: 10px; color: #fbbf24;
}
.q.flagged { border-left: 3px solid #fbbf24; padding-left: 12px; }

/* ===== P1 图形推理（向性测试） ===== */
svg.fig { width: 100%; height: auto; max-width: 320px; display: block; margin: 0 auto; background: #fff; border-radius: 8px; }
.q svg.fig { max-width: 260px; margin-bottom: 10px; }
.options.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.figopt { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; }
.figopt:hover { border-color: var(--accent); }
.figopt input { margin: 0; }
.figopt svg.fig { max-width: 100%; }
.solution svg.fig { max-width: 90px; display: inline-block; vertical-align: middle; margin-left: 6px; }
@media (max-width: 720px) { .options.figures { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .exam-bar { gap: 14px; } .exam-bar .btn { margin-left: 0; } }

/* ===== P2 英语客观题 · 25选15 选词填空 ===== */
.wb-bank {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.5;
}
.wb-word { white-space: nowrap; }
.wb-word > b { color: var(--accent); margin-right: 2px; }
.wb-passage { line-height: 2.2; font-size: 15px; }
.wb-sel { display: inline-block; width: auto; min-width: 84px; padding: 2px 8px; margin: 0 4px; font-size: 13px; vertical-align: middle; }
.wb-review { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wb-cell { font-size: 12px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); }
.wb-cell.wbok { background: rgba(54,211,153,.14); border-color: rgba(54,211,153,.45); color: #36d399; }
.wb-cell.wbno { background: rgba(248,114,114,.14); border-color: rgba(248,114,114,.45); color: #f87272; }

/* ===== P2 阶段3 计时写作 ===== */
textarea.essay { min-height: 320px; font-size: 15px; line-height: 1.8; }
.essay-meta { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: right; }
.essay-meta .good { color: var(--good); }
.essay-meta .warn { color: var(--warn); }
.cwd5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 10px 0; }
.cwd5 .c { background: var(--card2); border-radius: 10px; padding: 10px; text-align: center; }
.cwd5 .c .v { font-size: 22px; font-weight: 800; }
.cwd5 .c .k { font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (max-width: 720px) { .cwd5 { grid-template-columns: repeat(3, 1fr); } }

