/* ============================================================
   跃飞航空 · CAAC 理论题库  全局样式
   ============================================================ */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e9f2;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #e8f0ff;
  --accent: #0ea5e9;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --bad: #e11d48;
  --bad-soft: #fdeaef;
  --nav: #0f1b33;
  --nav-2: #16243f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ------------------------------ 启动 ------------------------------ */
.boot-screen {
  min-height: 100vh; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; color: var(--muted);
}
.boot-logo {
  width: 72px; height: 72px; border-radius: 18px; display: block;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .28);
}
.boot-text { font-size: 13px; letter-spacing: .12em; }

/* ------------------------------ 布局 ------------------------------ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; background: var(--nav); color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 22px 20px 16px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9); color: #fff; font-weight: 800;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .45);
}
.brand-logo { height: 34px; width: auto; display: block; flex: 0 0 auto; filter: drop-shadow(0 6px 14px rgba(37, 99, 235, .35)); }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand-sub { font-size: 11px; color: #7f8ea8; letter-spacing: .08em; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px 20px; }
.nav-group { margin-top: 16px; padding: 0 10px 6px; font-size: 11px; color: #6b7c99; letter-spacing: .12em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #c3cede; cursor: pointer; font-size: 14px; margin-bottom: 2px;
  transition: background .15s, color .15s; border: 0; background: none; width: 100%; text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, .95), rgba(14, 165, 233, .75)); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .35); }
.nav-item .badge-dot { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 20px; }

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; font-size: 13px;
}
.user-chip .u-name { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip .u-role { color: #8fa1bd; font-size: 11px; }
.sidebar-foot .btn-logout {
  margin-top: 12px; width: 100%; background: rgba(255, 255, 255, .07); color: #cbd5e1;
  border: 0; border-radius: 9px; padding: 8px; font-size: 13px; cursor: pointer;
}
.sidebar-foot .btn-logout:hover { background: rgba(255, 255, 255, .13); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 16px; font-weight: 650; }
.topbar .spacer { flex: 1; }
.live-dot {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 30px;
}
.live-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.live-dot.off i { background: #94a3b8; }
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
.site-foot { padding: 14px 22px 22px; text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.site-foot a { color: inherit; text-decoration: underline; }

.mobile-only { display: none; }
.menu-btn {
  display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; align-items: center; justify-content: center;
}

/* ------------------------------ 通用组件 ------------------------------ */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 720; letter-spacing: -.02em; margin-top: 6px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat .ico {
  position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.stat.ok .ico { background: var(--ok-soft); color: var(--ok); }
.stat.bad .ico { background: var(--bad-soft); color: var(--bad); }
.stat.warn .ico { background: var(--warn-soft); color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 550; background: var(--brand); color: #fff; transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover { background: #dbe8ff; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #be123c; }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.link { background: none; color: var(--brand); padding: 4px 6px; }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 550; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar .select, .toolbar .input { width: auto; min-width: 130px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 30px;
  font-size: 12px; font-weight: 550; background: var(--panel-2); color: var(--muted); white-space: nowrap;
}
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--brand-soft); color: var(--brand); }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12.5px; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8fbff; }
td .cell-strong { font-weight: 600; }
td.wrap { white-space: normal; min-width: 260px; }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 13px; }
.empty .empty-ico { font-size: 34px; opacity: .5; margin-bottom: 10px; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* ------------------------------ 登录 ------------------------------ */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--nav);
}
.auth-art {
  position: relative; padding: 56px; color: #fff; overflow: hidden;
  background: radial-gradient(900px 500px at 10% 10%, #1e3a8a 0%, #0f1b33 55%, #0b1426 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art .glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(60px);
  background: radial-gradient(circle, rgba(37, 99, 235, .55), transparent 65%);
  right: -160px; top: -120px;
}
.auth-brand img { height: 56px; width: auto; display: block; }
.auth-brand-sub { color: #7f8ea8; font-size: 11.5px; letter-spacing: .16em; margin-top: 14px; }
.auth-foot { color: #6f83a3; font-size: 12px; line-height: 1.9; }
.auth-foot a, .auth-legal a { color: inherit; text-decoration: underline; }
.auth-legal { display: none; }
.check.consent {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2);
  line-height: 1.6; margin: 0 0 14px; cursor: pointer;
}
.check.consent input { margin-top: 2px; accent-color: var(--brand); }
.check.consent a, .legal-doc a { color: var(--brand); text-decoration: none; }

/* 协议 / 隐私政策 */
.legal-mode { background: var(--bg); }
.legal-page { max-width: 900px; margin: 0 auto; padding: 32px 20px 40px; }
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.legal-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.legal-brand img { height: 36px; width: auto; }
.legal-brand span { font-weight: 650; font-size: 15px; }
.legal-doc { padding: 30px 34px; line-height: 1.85; color: var(--ink-2); }
.legal-doc h1 { font-size: 24px; color: var(--ink); margin-bottom: 6px; }
.legal-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.legal-doc h2 { font-size: 16px; color: var(--ink); margin: 22px 0 8px; }
.legal-doc p { margin: 8px 0; }
.legal-doc ul { margin: 8px 0 8px 20px; }
.legal-doc li { margin: 4px 0; }

.auth-panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }
.auth-box h2 { font-size: 24px; margin-bottom: 6px; }
.auth-box .desc { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.tabs { display: flex; gap: 6px; background: var(--panel-2); padding: 4px; border-radius: 11px; margin-bottom: 22px; }
.tabs button {
  flex: 1; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 550; white-space: nowrap;
}
.tabs button.active { background: #fff; color: var(--brand); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.auth-options { display: flex; align-items: center; gap: 20px; margin: 2px 0 6px; }
.auth-options .check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.auth-options .check input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.auth-options-tip { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.auth-tip { margin-top: 18px; font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 10px 12px; border-radius: 10px; line-height: 1.7; }

/* ------------------------------ 刷题 ------------------------------ */
.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.q-stem { font-size: 17px; line-height: 1.75; font-weight: 550; margin-bottom: 22px; white-space: pre-wrap; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; background: #fff; transition: .14s; user-select: none;
}
.option:hover { border-color: #bcd2ff; background: #f9fbff; }
.option .key {
  width: 26px; height: 26px; border-radius: 8px; background: var(--panel-2); color: var(--ink-2);
  display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: 0 0 26px;
}
.option .text { flex: 1; line-height: 1.6; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); }
.option.selected .key { background: var(--brand); color: #fff; }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.correct .key { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .key { background: var(--bad); color: #fff; }
.option.disabled { cursor: default; }
.option.disabled:hover { border-color: var(--line); background: #fff; }
.option.disabled.correct:hover { border-color: var(--ok); background: var(--ok-soft); }
.option.disabled.wrong:hover { border-color: var(--bad); background: var(--bad-soft); }

.result-banner {
  display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 12px;
  margin-top: 22px; font-weight: 600; animation: pop .25s ease;
}
.result-banner.ok { background: var(--ok-soft); color: #15803d; }
.result-banner.bad { background: var(--bad-soft); color: #be123c; }
.result-banner small { font-weight: 400; opacity: .85; }
.analysis-box {
  margin-top: 14px; padding: 16px 18px; border-radius: 12px; background: var(--panel-2);
  border: 1px dashed #d7dfec; color: var(--ink-2); font-size: 14px; line-height: 1.8; animation: pop .25s ease;
}
.analysis-box .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .06em; }
.analysis-box .answer { color: var(--ok); font-weight: 650; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.q-side { position: sticky; top: 86px; display: grid; gap: 14px; }
.progress-ring { display: grid; place-items: center; padding: 6px 0 2px; }
.side-stat { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.side-stat:last-child { border-bottom: 0; }
.side-stat span { color: var(--muted); }
.side-stat b { font-weight: 650; }

/* ------------------------------ 考试 ------------------------------ */
.exam-shell { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.exam-header {
  position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
}
.exam-title { font-weight: 650; font-size: 15px; }
.timer { margin-left: auto; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.timer .clock {
  font-size: 20px; font-weight: 700; color: var(--brand); letter-spacing: .04em;
  background: var(--brand-soft); padding: 4px 12px; border-radius: 10px;
}
.timer .clock.danger { color: var(--bad); background: var(--bad-soft); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.exam-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 20px; padding: 20px; max-width: 1240px; margin: 0 auto; width: 100%; align-items: start; }
.qnav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qnav-cell {
  aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 13px; cursor: pointer; color: var(--ink-2); transition: .12s;
}
.qnav-cell:hover { border-color: var(--brand); }
.qnav-cell.answered { background: var(--brand-soft); border-color: #b9d0ff; color: var(--brand); font-weight: 600; }
.qnav-cell.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.qnav-cell.correct { background: var(--ok-soft); border-color: #b7e4c7; color: var(--ok); }
.qnav-cell.wrong { background: var(--bad-soft); border-color: #f5c2cf; color: var(--bad); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 4px; }

.score-hero { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.score-ring { position: relative; width: 132px; height: 132px; flex: 0 0 132px; }
.score-ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .val b { font-size: 30px; line-height: 1; }
.score-ring .val span { font-size: 12px; color: var(--muted); }

/* ------------------------------ 图表 ------------------------------ */
.chart { width: 100%; height: 180px; }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .bar { fill: var(--brand); opacity: .85; }
.chart .bar.ok { fill: var(--ok); }
.chart .axis { stroke: var(--line); }

.progress-list { display: grid; gap: 16px; }
.progress-item .row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-item .row b { font-weight: 600; }
.bar-track { height: 8px; border-radius: 8px; background: #eef2f9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .6s ease; }
.bar-fill.ok { background: linear-gradient(90deg, #16a34a, #4ade80); }

/* ------------------------------ 时间线 ------------------------------ */
.feed { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; overflow-x: hidden; }
.feed-item { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item > div { flex: 1; min-width: 0; overflow: hidden; }
.feed-item > div > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; background: var(--ok); }
.feed-item .dot.bad { background: var(--bad); }
.feed-item time { color: var(--muted); font-size: 11.5px; white-space: nowrap; margin-left: auto; }

/* ------------------------------ 模态框 ------------------------------ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .18s ease;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .2s ease;
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-head .close { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------ 提示 ------------------------------ */
.toast-root { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; }
.toast {
  background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .28); animation: slidein .2s ease; max-width: 340px;
  display: flex; gap: 8px; align-items: center;
}
.toast.ok { background: #14532d; }
.toast.bad { background: #881337; }
.toast.warn { background: #78350f; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 移动端 ------------------------------ */
.mobile-nav { display: none; }
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-layout { grid-template-columns: 1fr; }
  .q-side { position: static; }
  .exam-body { grid-template-columns: 1fr; }
  .exam-body .q-side { order: -1; }
  .qnav-grid { grid-template-columns: repeat(10, 1fr); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg); height: 100vh;
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; height: 56px; }
  .content { padding: 16px 14px 84px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 28px 20px; min-height: 100vh; }
  .auth-legal { display: block; margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.9; }
  .legal-page { padding: 18px 12px 28px; }
  .legal-doc { padding: 20px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 14px; }
  .q-card { padding: 18px; }
  .stat .value { font-size: 24px; }
  .exam-header { padding: 10px 14px; flex-wrap: wrap; }
  .exam-body { padding: 14px; }
  .qnav-grid { grid-template-columns: repeat(6, 1fr); }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav button {
    flex: 1; border: 0; background: none; display: grid; justify-items: center; gap: 2px;
    font-size: 10.5px; color: var(--muted); padding: 5px 0; cursor: pointer;
  }
  .mobile-nav button svg { width: 21px; height: 21px; }
  .mobile-nav button.active { color: var(--brand); }
  .toast-root { left: 14px; right: 14px; bottom: 78px; }
  .toast { max-width: none; }
  .toolbar .input, .toolbar .select { flex: 1 1 45%; min-width: 0; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .stat .value { font-size: 21px; }
  .stat .ico { width: 28px; height: 28px; right: 10px; top: 10px; }
  .q-stem { font-size: 15.5px; }
  .score-hero { gap: 16px; }
}

/* 手机刷题紧凑模式：题目、选项、解析尽量一屏；操作栏固定在底部导航上方 */
@media (max-width: 900px) {
  .practice-page { padding-bottom: 56px; }
  .practice-page .toolbar { gap: 8px; margin-bottom: 10px; }
  .practice-page .toolbar .select { height: 34px; padding: 0 9px; font-size: 12.5px; }
  .practice-page .toolbar .btn { padding: 7px 10px; font-size: 12px; }
  .practice-page .toolbar .badge { font-size: 11px; }
  .practice-page .q-card { padding: 12px 12px 14px; border-radius: 14px; }
  .practice-page .q-meta { gap: 6px; margin-bottom: 8px; }
  .practice-page .q-meta .badge { font-size: 10.5px; padding: 2px 7px; }
  .practice-page .q-meta span[style] { font-size: 11px !important; }
  .practice-page .q-stem { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
  .practice-page .options { gap: 6px; }
  .practice-page .option { padding: 8px 10px; gap: 8px; border-radius: 10px; border-width: 1px; }
  .practice-page .option .key { width: 22px; height: 22px; flex-basis: 22px; border-radius: 6px; font-size: 11.5px; }
  .practice-page .option .text { font-size: 13px; line-height: 1.45; }
  .practice-page .result-banner { margin-top: 10px; padding: 8px 10px; border-radius: 10px; gap: 8px; font-size: 12.5px; }
  .practice-page .result-banner small { font-size: 11px; }
  .practice-page .analysis-box { margin-top: 8px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.65; }
  .practice-page .analysis-box .label { font-size: 10.5px; margin-bottom: 4px; }
  .practice-page .q-actions {
    position: fixed; left: 0; right: 0; z-index: 30;
    bottom: calc(60px + env(safe-area-inset-bottom));
    margin: 0 !important; padding: 7px 12px;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    backdrop-filter: blur(10px); gap: 8px !important;
  }
  .practice-page .q-actions .btn { min-height: 36px; padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
  .practice-page .q-actions .btn.ghost.sm { padding: 7px 9px; }
  .toast-root { bottom: 118px; }
}
