:root {
  --ink: #16203a;
  --ink-2: #2c3a5c;
  --muted: #68748f;
  --line: #e4e9f4;
  --bg: #f4f6fb;
  --card: #ffffff;
  --brand: #1f4fd8;
  --brand-2: #2f6bff;
  --brand-soft: #eaf0ff;
  --gold: #c79a4b;
  --gold-soft: #fbf4e6;
  --green: #17936b;
  --green-soft: #e7f6f0;
  --red: #d64545;
  --red-soft: #fdecec;
  --amber: #d98324;
  --amber-soft: #fff4e4;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(22, 32, 58, .07);
  --shadow-sm: 0 4px 14px rgba(22, 32, 58, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 26px;
  height: 62px; padding: 0 28px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .5px; cursor: pointer; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #5b8cff);
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 900;
  box-shadow: 0 4px 10px rgba(31,79,216,.3);
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 2px; }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav button {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.nav button:hover { background: #f0f3fa; }
.nav button.active { color: var(--brand); background: var(--brand-soft); }
.top-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 22px 70px; }
.wrap.narrow { max-width: 980px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card.pad { padding: 24px; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: .3px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .nav { overflow-x: auto; }
  .brand small { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 38px 40px;
  background:
    radial-gradient(900px 300px at 90% -20%, rgba(199,154,75,.22), transparent 60%),
    radial-gradient(700px 320px at 5% 120%, rgba(47,107,255,.25), transparent 60%),
    linear-gradient(120deg, #12224a 0%, #1b3b7a 55%, #1f4fd8 100%);
  color: #fff; box-shadow: 0 18px 44px rgba(18,34,74,.28);
}
.hero::after {
  content: "行测"; position: absolute; right: 24px; bottom: -26px;
  font-size: 150px; font-weight: 900; color: rgba(255,255,255,.05); letter-spacing: 8px;
}
.hero .kicker { font-size: 12px; letter-spacing: 4px; color: #cfe0ff; font-weight: 700; }
.hero h1 { margin: 10px 0 8px; font-size: 32px; line-height: 1.3; letter-spacing: .5px; }
.hero .lead { color: #d7e2f7; max-width: 720px; margin: 0 0 22px; font-size: 14.5px; }
.hero .meta-row { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 24px; }
.hero .meta-row div b { display: block; font-size: 24px; font-weight: 800; }
.hero .meta-row div span { font-size: 12px; color: #bfd0ee; letter-spacing: 1px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 2; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; padding: 11px 20px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: .18s; text-decoration: none;
  background: #fff; color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(31,79,216,.25); }
.btn.primary:hover { background: #1a45bd; }
.btn.gold { background: var(--gold); color: #2a1e08; box-shadow: 0 8px 18px rgba(199,154,75,.3); }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.line { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.line:hover { border-color: var(--brand); color: var(--brand); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: #f3c9c9; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- stat cards ---------- */
.stat { padding: 18px 20px; }
.stat .label { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.stat .value { font-size: 28px; font-weight: 800; margin: 4px 0 2px; }
.stat .sub { font-size: 12px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: #f0f3fa; color: var(--ink-2); white-space: nowrap;
}
.chip.blue { background: var(--brand-soft); color: var(--brand); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.gold { background: var(--gold-soft); color: #8f6a1f; }
.chip.gray { background: #f0f3fa; color: var(--muted); }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 700; background: #fafbfe; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- bars ---------- */
.bar { height: 7px; background: #edf1f9; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #5b8cff); }
.bar.gold > i { background: linear-gradient(90deg, #d7a94f, #ecc878); }
.bar.green > i { background: linear-gradient(90deg, #17936b, #43c79a); }
.bar.red > i { background: linear-gradient(90deg, #d64545, #f07b7b); }
.freq-row { display: grid; grid-template-columns: 290px 1fr 52px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.freq-row:last-child { border-bottom: 0; }
.freq-row .name { font-weight: 600; font-size: 13.5px; }
.freq-row .years { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- home ---------- */
.quick-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; margin-top: -30px; position: relative; z-index: 3; }
@media (max-width: 900px) { .quick-grid { grid-template-columns: 1fr; margin-top: 16px; } }
.quick-card { padding: 22px; }
.quick-card h3 { margin: 0 0 4px; font-size: 15px; }
.quick-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.mini-structure { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mini-structure span { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: #f4f6fb; color: var(--ink-2); }
.mini-structure b { color: var(--brand); }

.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (max-width: 900px) { .rule-grid { grid-template-columns: 1fr; } }
.rule { padding: 18px 20px; border-left: 3px solid var(--brand); }
.rule h4 { margin: 0 0 6px; font-size: 14.5px; }
.rule p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.predict { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.predict:last-child { border-bottom: 0; }
.predict .prob { min-width: 58px; text-align: center; }
.predict .prob b { display: block; font-size: 18px; color: var(--brand); }
.predict .prob span { font-size: 10.5px; color: var(--muted); }
.predict .txt { flex: 1; }
.predict .txt h5 { margin: 0 0 2px; font-size: 13.5px; }
.predict .txt p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------- exam ---------- */
.exam-shell { display: grid; grid-template-columns: 1fr 310px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .exam-shell { grid-template-columns: 1fr; } .exam-side { display: none; } }
.exam-top {
  position: sticky; top: 62px; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: 1px; }
.timer.warn { color: var(--amber); }
.timer.danger { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.exam-progress { flex: 1; min-width: 80px; }
.exam-progress .bar { height: 6px; }
.exam-progress small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 5px; }
.q-card { padding: 28px 32px 24px; }
@media (max-width: 700px) { .q-card { padding: 20px 18px; } }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.q-no { font-size: 13px; font-weight: 800; color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 4px 10px; }
.q-stem { font-size: 16px; line-height: 1.95; white-space: pre-wrap; }
.q-stem .blank { display: inline-block; min-width: 64px; border-bottom: 1px solid var(--ink); }
.q-figure { margin: 18px auto 8px; max-width: 640px; }
.q-figure svg { display: block; width: 100%; height: auto; }
.q-figure.wide { max-width: 100%; }
.options { display: grid; gap: 10px; margin-top: 22px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1.5px solid var(--line); background: #fff; border-radius: 13px;
  padding: 13px 16px; cursor: pointer; transition: .15s; text-align: left; width: 100%;
  font-size: 14.5px; line-height: 1.7; color: var(--ink);
}
.opt:hover { border-color: #b9c8ee; background: #fbfcff; }
.opt .letter {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: #f0f3fa; color: var(--ink-2); font-weight: 800; font-size: 12.5px; margin-top: 1px;
}
.opt.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(31,79,216,.08); }
.opt.sel .letter { background: var(--brand); color: #fff; }
.opt-fig { max-width: 120px; width: 100%; }
.opt-fig svg { display: block; width: 100%; height: auto; }
.opt.fig { align-items: center; }
.opt.fig .opt-fig { margin-left: auto; }
.q-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.q-actions .spacer { flex: 1; }

.material { background: #fbfcff; border: 1px solid var(--line); border-radius: 13px; padding: 18px 20px; margin-bottom: 20px; font-size: 13.8px; line-height: 1.9; }
.material h4 { margin: 0 0 8px; font-size: 13px; color: var(--brand); letter-spacing: 1px; }
.material table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.material th, .material td { border: 1px solid var(--line); padding: 7px 10px; text-align: center; }
.material th { background: #f1f5ff; }
.material p { margin: 6px 0; }

.palette { padding: 16px; position: sticky; top: 148px; max-height: calc(100vh - 170px); overflow: auto; }
.palette h4 { margin: 0 0 10px; font-size: 13px; display: flex; justify-content: space-between; }
.palette .group { margin-bottom: 12px; }
.palette .group .g-title { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.nums button {
  height: 30px; border-radius: 7px; border: 1px solid var(--line); background: #fff;
  font-size: 12px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
.nums button.done { background: var(--brand-soft); border-color: #c9d7ff; color: var(--brand); font-weight: 700; }
.nums button.flag { box-shadow: inset 0 -3px 0 var(--gold); }
.nums button.cur { outline: 2px solid var(--brand); outline-offset: 1px; font-weight: 800; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- result ---------- */
.result-hero { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; padding: 28px 32px; }
@media (max-width: 760px) { .result-hero { grid-template-columns: 1fr; } }
.score-ring { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .inner { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.score-ring .inner b { font-size: 48px; line-height: 1; letter-spacing: -1px; }
.score-ring .inner span { font-size: 12px; color: var(--muted); letter-spacing: 2px; margin-top: 6px; }
.big-score-note { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
.level-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 12.5px; }

.mod-row { display: grid; grid-template-columns: 90px 1fr 82px 66px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.mod-row:last-child { border-bottom: 0; }
.mod-row .m-name { font-weight: 700; font-size: 13px; }
.mod-row .m-num { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mod-row .m-score { font-weight: 800; font-variant-numeric: tabular-nums; }

.radar-wrap { display: grid; place-items: center; padding: 6px; }
.radar-wrap svg { width: 100%; max-width: 320px; height: auto; }

.diag-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.diag-item:last-child { border-bottom: 0; }
.diag-item .idx { flex: 0 0 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--red-soft); color: var(--red); }
.diag-item h4 { margin: 0 0 4px; font-size: 14.5px; }
.diag-item p { margin: 0; font-size: 13.2px; color: var(--ink-2); }
.diag-item .fix { margin-top: 6px; font-size: 12.8px; color: var(--green); background: var(--green-soft); border-radius: 8px; padding: 7px 11px; display: inline-block; }

.plan-table td:first-child { white-space: nowrap; font-weight: 700; color: var(--brand); }
.plan-table td { font-size: 13px; vertical-align: top; }

.review-item { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; background: #fff; }
.review-item.correct { border-color: #d6eee4; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review-head .r-no { font-weight: 800; color: var(--brand); }
.review-stem { font-size: 14.2px; line-height: 1.85; white-space: pre-wrap; }
.review-opts { display: grid; gap: 6px; margin: 12px 0; }
.review-opt { font-size: 13.2px; padding: 8px 12px; border-radius: 9px; background: #f8f9fc; border: 1px solid transparent; }
.review-opt.ok { background: var(--green-soft); border-color: #bfe6d7; }
.review-opt.bad { background: var(--red-soft); border-color: #f4cccc; }
.explain { background: #fbfcff; border: 1px dashed var(--line); border-radius: 11px; padding: 12px 14px; font-size: 13.2px; line-height: 1.8; }
.explain b { color: var(--brand); }
.tip-line { margin-top: 8px; color: #8f6a1f; background: var(--gold-soft); border-radius: 8px; padding: 7px 11px; font-size: 12.8px; }
.tag-select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; color: var(--ink-2); background: #fff; }

/* ---------- misc ---------- */
.note { font-size: 12.5px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { text-align: right; max-width: 64%; overflow-wrap: anywhere; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; margin-bottom: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #16203a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-mask { position: fixed; inset: 0; background: rgba(12,20,40,.45); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 18px; max-width: 520px; width: 100%; padding: 26px; box-shadow: 0 30px 70px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); font-size: 13.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 0 10px; }

@media print {
  .topbar, .nav, .btn, .exam-top, .palette, .q-actions { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
  .wrap { max-width: 100%; padding: 0; }
}

.options.fig-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.options.fig-grid .opt.fig { flex-direction: column; align-items: center; gap: 8px; padding: 12px 10px 10px; min-height: 130px; }
.options.fig-grid .opt.fig .letter { align-self: flex-start; margin: 0; }
.options.fig-grid .opt-fig { margin: 0 auto; max-width: 100%; width: 100%; }
.options.fig-grid .opt-fig svg { max-height: 110px; }
@media (max-width: 700px) { .options.fig-grid { grid-template-columns: repeat(2, 1fr); } }
.review-opt svg { max-width: 90px; max-height: 90px; vertical-align: middle; }

@media (max-width: 700px) {
  .freq-row { grid-template-columns: 1fr 46px; }
  .freq-row .bar { grid-column: 1 / -1; }
  .freq-row > div:first-child { grid-column: 1 / 2; }
}

html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 6px; row-gap: 8px; }
  .brand { flex: 1 1 auto; font-size: 15px; }
  .brand .mark { width: 26px; height: 26px; border-radius: 8px; }
  .nav { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; gap: 2px; -webkit-overflow-scrolling: touch; }
  .nav button { flex: 0 0 auto; white-space: nowrap; padding: 6px 11px; font-size: 13px; }
  .top-actions { flex: 0 0 auto; }
  .top-actions .btn { padding: 6px 10px; font-size: 12px; }
  .wrap { padding: 18px 12px 50px; }
  .hero { padding: 26px 22px; border-radius: 18px; }
  .hero h1 { font-size: 26px; }
  .hero .meta-row { gap: 16px; }
  .hero .meta-row div b { font-size: 20px; }
  .hero::after { font-size: 110px; right: 10px; }
  .q-stem { font-size: 15.2px; }
  .result-hero { padding: 22px 18px; }
  .card.pad { padding: 18px 16px; }
  .mod-row { grid-template-columns: 74px 1fr 62px; }
  .mod-row .m-score { grid-column: 3; }
}

/* ---------- auth / landing ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-side { display: none; } }
.auth-side { background: radial-gradient(900px 400px at 80% 0%, rgba(199,154,75,.25), transparent 60%), linear-gradient(140deg,#12224a,#1b3b7a 60%,#1f4fd8); color:#fff; padding:56px 54px; display:flex; flex-direction:column; justify-content:center; position:relative; overflow:hidden; }
.auth-side::after { content:"行测"; position:absolute; right:-10px; bottom:-50px; font-size:220px; font-weight:900; color:rgba(255,255,255,.05); letter-spacing:10px; }
.auth-side .kicker { font-size:11px; letter-spacing:4px; color:#cfe0ff; font-weight:700; }
.auth-side h1 { font-size:38px; line-height:1.35; margin:14px 0 14px; }
.auth-side p { color:#d7e2f7; font-size:14.5px; line-height:1.9; max-width:520px; }
.auth-side .points { display:grid; gap:10px; margin-top:20px; }
.auth-side .points div { font-size:13.5px; color:#e7eefc; display:flex; gap:8px; align-items:flex-start; }
.auth-side .points b { color:#ffd98a; }
.auth-main { display:grid; place-items:center; padding:36px 24px; background:#f4f6fb; }
.auth-card { width:100%; max-width:430px; background:#fff; border:1px solid var(--line); border-radius:20px; box-shadow:var(--shadow); padding:32px; }
.auth-card h2 { margin:0 0 6px; font-size:23px; }
.auth-card .sub { color:var(--muted); font-size:13px; margin-bottom:20px; }
.tabs { display:flex; background:#f1f4fa; border-radius:11px; padding:4px; margin-bottom:18px; }
.tabs button { flex:1; border:0; background:transparent; padding:9px; border-radius:8px; font-weight:700; color:var(--muted); cursor:pointer; font-size:13.5px; }
.tabs button.on { background:#fff; color:var(--brand); box-shadow:0 2px 8px rgba(22,32,58,.08); }
.field { margin-bottom:13px; }
.field label { display:block; font-size:12px; color:var(--muted); margin-bottom:5px; font-weight:700; }
.input, select.input, textarea.input { width:100%; border:1.5px solid var(--line); border-radius:10px; padding:11px 12px; font-size:14px; background:#fff; color:var(--ink); outline:none; font-family:inherit; }
.input:focus { border-color:var(--brand); box-shadow:0 0 0 3px rgba(31,79,216,.08); }
.btn.block { width:100%; }
.msg { font-size:12.5px; padding:8px 10px; border-radius:8px; margin-bottom:10px; display:none; }
.msg.show { display:block; }
.msg.err { background:var(--red-soft); color:var(--red); }
.msg.ok { background:var(--green-soft); color:var(--green); }
.auth-foot { text-align:center; font-size:12px; color:var(--muted); margin-top:16px; }

/* ---------- app shell ---------- */
.app-top { position:sticky; top:0; z-index:40; background:rgba(255,255,255,.94); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.app-top-in { max-width:1180px; margin:0 auto; padding:0 20px; height:60px; display:flex; align-items:center; gap:18px; }
.app-nav { display:flex; gap:2px; flex:1; overflow-x:auto; }
.app-nav a { color:var(--ink-2); text-decoration:none; font-size:13.5px; font-weight:600; padding:8px 12px; border-radius:9px; white-space:nowrap; }
.app-nav a:hover { background:#f1f4fa; }
.app-nav a.on { background:var(--brand-soft); color:var(--brand); }
.user-chip { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-2); white-space:nowrap; }
.avatar { width:30px; height:30px; border-radius:9px; background:linear-gradient(135deg,var(--brand),#5b8cff); color:#fff; display:grid; place-items:center; font-weight:800; font-size:13px; }
.page { max-width:1180px; margin:0 auto; padding:26px 20px 70px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.page-head h1 { margin:0; font-size:24px; }
.page-head p { margin:3px 0 0; color:var(--muted); font-size:13px; }
.dash-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
@media (max-width:900px) { .dash-grid { grid-template-columns:repeat(2,1fr); } }
.metric { padding:16px 18px; }
.metric .label { font-size:11.5px; color:var(--muted); letter-spacing:.5px; }
.metric .value { font-size:26px; font-weight:800; line-height:1.2; margin:3px 0 2px; }
.metric .sub { font-size:11.5px; color:var(--muted); }
.actions-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
@media (max-width:900px) { .actions-grid { grid-template-columns:repeat(2,1fr); } }
.action-card { padding:18px; cursor:pointer; border:1px solid var(--line); border-radius:14px; background:#fff; transition:.16s; text-align:left; }
.action-card:hover { border-color:#b9c8ee; transform:translateY(-2px); box-shadow:var(--shadow-sm); }
.action-card .ico { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:var(--brand-soft); color:var(--brand); font-weight:800; margin-bottom:10px; font-size:15px; }
.action-card h4 { margin:0 0 3px; font-size:14px; }
.action-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.mastery-row { display:grid; grid-template-columns:1fr 90px 52px; gap:10px; align-items:center; padding:8px 0; border-bottom:1px dashed var(--line); font-size:13px; }
.mastery-row:last-child { border-bottom:0; }
.history-item { display:flex; align-items:center; gap:14px; padding:13px 0; border-bottom:1px dashed var(--line); }
.history-item:last-child { border-bottom:0; }
.history-item .score { font-size:20px; font-weight:800; min-width:70px; }
.history-item .meta { flex:1; font-size:12.5px; color:var(--muted); }
.badge { display:inline-flex; padding:3px 9px; border-radius:999px; background:#f1f4fa; font-size:11px; font-weight:700; color:var(--ink-2); }
.badge.green { background:var(--green-soft); color:var(--green); }
.badge.red { background:var(--red-soft); color:var(--red); }
.badge.gold { background:var(--gold-soft); color:#8f6a1f; }

/* ---------- exam ---------- */
.exam-wrap { max-width:1180px; margin:0 auto; padding:18px 20px 60px; }
.exam-bar { position:sticky; top:60px; z-index:35; display:flex; gap:12px; align-items:center; background:#fff; border:1px solid var(--line); border-radius:13px; padding:10px 16px; box-shadow:var(--shadow-sm); margin-bottom:14px; }
.exam-bar .timer { font-size:19px; }
.exam-grid { display:grid; grid-template-columns:1fr 300px; gap:18px; align-items:start; }
@media (max-width:1000px) { .exam-grid { grid-template-columns:1fr; } .exam-side { display:none; } }
.q-card { padding:24px 28px; }
@media (max-width:700px) { .q-card { padding:18px 16px; } }
.q-top { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.q-body { font-size:15.5px; line-height:1.95; white-space:pre-wrap; }
.q-body .blank { display:inline-block; min-width:60px; border-bottom:1px solid var(--ink); }
.opt { font-size:14.2px; }
.palette { padding:14px; position:sticky; top:132px; max-height:calc(100vh - 150px); overflow:auto; }
.nums { grid-template-columns:repeat(5,1fr); }
.nums button.done { background:var(--brand-soft); }
.nums button.flag { box-shadow:inset 0 -3px 0 var(--gold); }
.q-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.q-actions .spacer { flex:1; }

/* ---------- result / practice ---------- */
.result-top { display:grid; grid-template-columns:220px 1fr; gap:24px; align-items:center; padding:24px 28px; }
@media (max-width:760px) { .result-top { grid-template-columns:1fr; } }
.ring { position:relative; width:190px; height:190px; margin:0 auto; }
.ring svg { transform:rotate(-90deg); }
.ring .inner { position:absolute; inset:0; display:grid; place-content:center; text-align:center; }
.ring .inner b { font-size:44px; line-height:1; }
.ring .inner span { font-size:11px; color:var(--muted); letter-spacing:1px; margin-top:5px; }
.review-item { border:1px solid var(--line); border-radius:14px; padding:16px 18px; margin-bottom:12px; background:#fff; }
.review-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.review-stem { font-size:14px; line-height:1.8; white-space:pre-wrap; }
.review-opts { display:grid; gap:6px; margin:10px 0; }
.review-opt { font-size:13px; padding:8px 11px; border-radius:8px; background:#f8f9fc; border:1px solid transparent; }
.review-opt.ok { background:var(--green-soft); border-color:#bfe6d7; }
.review-opt.bad { background:var(--red-soft); border-color:#f4cccc; }
.explain { background:#fbfcff; border:1px dashed var(--line); border-radius:10px; padding:11px 13px; font-size:13px; line-height:1.8; }
.tip-line { margin-top:8px; color:#8f6a1f; background:var(--gold-soft); border-radius:8px; padding:7px 10px; font-size:12.5px; }
.ai-card { border:1px solid #d7e2ff; background:linear-gradient(180deg,#f7f9ff,#fff); border-radius:16px; padding:22px; }
.ai-card h3 { margin:0 0 4px; }
.ai-problems { display:grid; gap:10px; margin-top:12px; }
.ai-problem { background:#fff; border:1px solid var(--line); border-radius:11px; padding:12px 14px; }
.ai-problem h4 { margin:0 0 4px; font-size:13.5px; }
.ai-problem p { margin:0; font-size:12.8px; color:var(--ink-2); line-height:1.7; }
.ai-problem .fix { color:var(--green); margin-top:5px; }
.plan-table { width:100%; border-collapse:collapse; font-size:12.8px; }
.plan-table th, .plan-table td { border-bottom:1px solid var(--line); padding:9px 10px; text-align:left; vertical-align:top; }
.plan-table th { color:var(--muted); font-size:11.5px; }
.practice-card { padding:26px 30px; }
.feedback-box { border-radius:12px; padding:14px 16px; margin-top:14px; font-size:13.5px; line-height:1.8; }
.feedback-box.ok { background:var(--green-soft); color:#0f6b4e; }
.feedback-box.bad { background:var(--red-soft); color:#9b2c2c; }
.progress-line { height:7px; background:#edf1f9; border-radius:99px; overflow:hidden; }
.progress-line i { display:block; height:100%; background:linear-gradient(90deg,var(--brand),#5b8cff); }
.stars { display:flex; gap:6px; }
.stars button { border:0; background:transparent; font-size:24px; cursor:pointer; color:#d7ddea; padding:0; line-height:1; }
.stars button.on { color:var(--gold); }
.tag-pill { display:inline-flex; padding:5px 10px; border-radius:999px; border:1px solid var(--line); background:#fff; font-size:12px; cursor:pointer; color:var(--ink-2); }
.tag-pill.on { background:var(--brand-soft); border-color:#c9d7ff; color:var(--brand); font-weight:700; }

/* ---------- admin ---------- */
.admin-shell { max-width:1240px; margin:0 auto; padding:24px 20px 70px; }
.admin-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.admin-table { width:100%; border-collapse:collapse; font-size:12.8px; }
.admin-table th, .admin-table td { border-bottom:1px solid var(--line); padding:9px 10px; text-align:left; }
.admin-table th { background:#fafbfe; color:var(--muted); font-size:11.5px; position:sticky; top:0; }
.admin-table tr:hover td { background:#fbfcff; }
.chart { display:flex; align-items:flex-end; gap:6px; height:120px; padding:8px 0; }
.chart .bar { flex:1; display:flex; flex-direction:column; justify-content:flex-end; gap:3px; height:100%; }
.chart .bar i { display:block; background:linear-gradient(180deg,#5b8cff,var(--brand)); border-radius:4px 4px 0 0; min-height:2px; }
.chart .bar span { font-size:9px; color:var(--muted); text-align:center; white-space:nowrap; transform:rotate(-45deg); transform-origin:center; }
.modal-mask { position:fixed; inset:0; background:rgba(12,20,40,.5); z-index:100; display:grid; place-items:center; padding:16px; }
.modal { background:#fff; border-radius:16px; width:min(780px,100%); max-height:88vh; overflow:auto; padding:24px; box-shadow:0 30px 80px rgba(0,0,0,.3); }
.modal h3 { margin:0 0 10px; }
@media (max-width:700px) {
  .app-top-in { height:auto; flex-wrap:wrap; padding:8px 12px; gap:6px; }
  .app-nav { order:3; flex:0 0 100%; }
  .user-chip { margin-left:auto; }
  .page { padding:18px 12px 60px; }
  .exam-wrap { padding:12px 12px 50px; }
  .exam-bar { top:0; }
}
.chart .bar { background: transparent; border-radius: 0; height: 100%; }
.chart .bar i { width: 100%; min-height: 2px; background: linear-gradient(180deg,#5b8cff,var(--brand)); border-radius: 3px 3px 0 0; }
.chart .bar span { transform: none; font-size: 9px; margin-top: 2px; color: var(--muted); }

.opt.ok { border-color: var(--green); background: var(--green-soft); }
.opt.ok .letter { background: var(--green); color:#fff; }
.auth-links { display:flex; justify-content:space-between; gap:12px; margin-top:12px; font-size:12.5px; }
.auth-links a { color:var(--brand); cursor:pointer; text-decoration:none; }
.auth-links a:hover { text-decoration:underline; }
.code-row { display:flex; gap:8px; }
.code-row .input { flex:1; min-width:0; }
.code-row .btn { flex:0 0 auto; white-space:nowrap; }
/* ---------- knowledge library ---------- */
.library-grid { display:grid; grid-template-columns:250px minmax(0,1fr); gap:16px; align-items:start; }
.lib-side { position:sticky; top:76px; }
.lib-mod { width:100%; display:flex; flex-direction:column; gap:2px; text-align:left; border:1px solid transparent; background:transparent; padding:10px 11px; border-radius:10px; cursor:pointer; color:var(--ink-2); font-family:inherit; }
.lib-mod:hover { background:#f6f8fd; }
.lib-mod.on { background:var(--brand-soft); border-color:#d7e2ff; color:var(--brand); }
.lib-mod span { font-weight:700; font-size:13.5px; }
.lib-mod small { font-size:10.5px; color:var(--muted); }
.lib-mod.on small { color:#5b78b8; }
.know-sec { margin-bottom:14px; padding:20px 22px; }
.know-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.know-head h3 { margin:7px 0 0; font-size:17px; }
.know-summary { margin:8px 0 10px; color:var(--ink-2); font-size:13px; line-height:1.8; }
.know-points { display:grid; gap:7px; margin:10px 0; }
.know-point { display:grid; grid-template-columns:64px 1fr; gap:9px; background:#f8faff; border:1px solid #e9eef9; border-radius:9px; padding:9px 11px; font-size:12.8px; line-height:1.7; }
.know-point b { color:var(--brand); font-size:11.5px; }
.formula-table, .rule-table { display:grid; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:10px; overflow:hidden; margin:10px 0; }
.formula-row { display:grid; grid-template-columns:1.1fr 1fr; gap:10px; background:#fff; padding:9px 12px; font-size:12.6px; line-height:1.6; }
.formula-row b { color:var(--brand); }
.formula-row span { color:var(--muted); }
.rule-row { display:grid; grid-template-columns:78px 1.6fr 1fr; gap:10px; background:#fff; padding:9px 12px; font-size:12.4px; line-height:1.6; }
.rule-row b { color:var(--brand); }
.rule-row span { color:var(--ink-2); }
.rule-row em { color:#8f6a1f; font-style:normal; }
.mother-list { display:grid; gap:10px; margin-top:12px; }
.mother { border:1px dashed #d5deef; border-radius:11px; padding:14px 15px; background:#fdfdff; }
.mother-top { display:flex; justify-content:space-between; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.mother-stem { font-size:13.5px; line-height:1.85; white-space:pre-wrap; }
.mother-material { margin:6px 0; }
.mother-answer[hidden] { display:none; }
.review-opt.ok { background:var(--green-soft); border-color:#bfe6d7; }
.review-opt.fig-opt { display:flex; align-items:center; gap:8px; }
.review-opt.fig-opt svg { max-height:70px; width:auto; }
@media (max-width:900px) {
  .library-grid { grid-template-columns:1fr; }
  .lib-side { position:static; }
  #libModules { display:flex; overflow-x:auto; gap:6px; }
  .lib-mod { flex:0 0 auto; width:auto; border:1px solid var(--line); }
  .lib-mod small { display:none; }
  .formula-row, .rule-row { grid-template-columns:1fr; gap:3px; }
}
.review-opts.fig-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.review-opt.fig-opt { display:flex; align-items:center; gap:8px; min-height:90px; }
.review-opt.fig-opt b { flex:0 0 14px; }
.fig-opt-svg { display:block; width:76px; height:76px; flex:0 0 76px; overflow:hidden; }
.fig-opt-svg svg { width:76px !important; height:76px !important; max-width:76px; max-height:76px; display:block; }
@media (max-width:600px) { .review-opts.fig-options { grid-template-columns:1fr; } }
.qr-admin-card { display:flex; gap:18px; align-items:center; }
.qr-admin-card img { border:1px solid var(--line); border-radius:10px; width:150px; height:auto; }
@media (max-width:600px) { .qr-admin-card { flex-direction:column; align-items:flex-start; } }
/* ---------- learning pages ---------- */
.filter-bar { display:flex; gap:7px; flex-wrap:wrap; align-items:center; margin:14px 0; }
.filter-bar .input { max-width:260px; }
.filter-bar .tag-pill b { color:var(--brand); margin-left:2px; }
.mistake-card { padding:16px 18px; margin-bottom:11px; }
.mistake-head { display:flex; justify-content:space-between; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.mistake-answer[hidden] { display:none; }
.mistake-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; padding-top:11px; border-top:1px dashed var(--line); }
.weak-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.weak-item { display:flex; gap:10px; align-items:center; background:#fbfcff; border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.weak-rank { width:24px; height:24px; border-radius:7px; background:var(--brand-soft); color:var(--brand); display:grid; place-items:center; font-weight:800; font-size:12px; flex:0 0 24px; }
.weak-pct { font-weight:800; color:var(--red); font-size:13px; }
.topic-list { display:grid; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:10px; overflow:hidden; margin-top:10px; }
.topic-row { display:grid; grid-template-columns:1.2fr 1fr 52px; gap:12px; align-items:center; background:#fff; padding:9px 12px; font-size:12.8px; }
.topic-pct { text-align:right; font-weight:800; }
.report-card { padding:18px 20px; margin-bottom:12px; }
.report-head { display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; }
.report-problems { display:grid; gap:6px; margin-top:8px; }
.report-problem { display:grid; grid-template-columns:minmax(150px,.9fr) 1.4fr; gap:12px; background:#fbfcff; border:1px solid var(--line); border-radius:9px; padding:8px 11px; font-size:12.5px; line-height:1.65; }
.report-problem b { color:var(--ink); }
.report-problem span { color:var(--ink-2); }
.report-plan { margin-top:10px; }
.report-plan summary { cursor:pointer; color:var(--brand); font-size:12.5px; font-weight:700; }
@media (max-width:760px) {
  .weak-grid { grid-template-columns:1fr; }
  .topic-row { grid-template-columns:1fr 80px 44px; }
  .report-problem { grid-template-columns:1fr; gap:3px; }
}
/* wider, more comfortable knowledge sidebar */
.library-grid { grid-template-columns:300px minmax(0,1fr); }
.lib-side { padding:20px 18px; }
.lib-mod { padding:12px 13px; border-radius:11px; }
.lib-mod span { font-size:14px; }
.lib-mod small { font-size:11px; margin-top:2px; }
#libModules { display:grid; gap:4px; }
.app-nav a { padding:8px 10px; }
@media (max-width:1100px) {
  .library-grid { grid-template-columns:265px minmax(0,1fr); }
  .app-nav a { padding:8px 7px; font-size:12.8px; }
}
@media (max-width:900px) {
  .library-grid { grid-template-columns:1fr; }
  #libModules { display:flex; }
}
.tools-grid { grid-template-columns:repeat(3,1fr); }
@media (max-width:900px) { .tools-grid { grid-template-columns:1fr; } }
/* ---------- mobile app navigation ---------- */
.mobile-tabs { display:none; }
.mobile-only { display:none; }

@media (max-width:900px) {
  .app-top-in { height:56px; flex-wrap:nowrap; padding:0 14px; gap:8px; }
  .app-nav { display:none; }
  .app-top-in > a:first-child span:last-child { font-size:14px; }
  .user-chip { margin-left:auto; gap:6px; }
  .user-chip #userName { max-width:76px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .user-chip .btn { padding:6px 9px; }
  .page { padding:18px 13px 92px; }
  .exam-wrap { padding:12px 12px 92px; }
  .exam-bar { top:0; }
  .mobile-only { display:inline-flex; }
  .mobile-tabs {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:80;
    height:calc(62px + env(safe-area-inset-bottom)); padding:0 6px env(safe-area-inset-bottom);
    background:rgba(255,255,255,.98); backdrop-filter:blur(12px);
    border-top:1px solid var(--line); box-shadow:0 -8px 24px rgba(18,34,74,.07);
    align-items:stretch; justify-content:space-around;
  }
  .mobile-tabs a, .mobile-tabs button {
    flex:1; border:0; background:transparent; color:var(--muted); text-decoration:none;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    font-size:10.5px; font-family:inherit; padding:6px 2px; position:relative; cursor:pointer;
  }
  .mobile-tabs a.on, .mobile-tabs button.on { color:var(--brand); font-weight:700; }
  .mt-ico { font-size:17px; line-height:1.2; font-weight:700; }
  .mobile-tabs .mt-start { flex:1.15; color:var(--brand); }
  .mobile-tabs .mt-start .mt-plus {
    width:46px; height:46px; margin-top:-20px; border-radius:50%;
    background:linear-gradient(135deg,#1f4fd8,#5b8cff); color:#fff;
    display:grid; place-items:center; font-size:25px; line-height:1;
    box-shadow:0 8px 18px rgba(31,79,216,.35); border:4px solid #fff;
  }
  .mobile-tabs .mt-start span:last-child { margin-top:-1px; font-size:10.5px; font-weight:700; }
  .mobile-tabs em { position:absolute; top:5px; right:calc(50% - 22px); background:var(--red); color:#fff; font-style:normal; font-size:9px; min-width:15px; height:15px; border-radius:99px; display:grid; place-items:center; padding:0 3px; }
}
@media (min-width:901px) {
  .mobile-tabs { display:none !important; }
}
/* bottom sheets */
.sheet-mask { position:fixed; inset:0; background:rgba(12,20,40,.5); z-index:110; display:grid; place-items:center; padding:16px; }
.sheet { width:min(520px,100%); max-height:82vh; overflow:auto; background:#fff; border-radius:20px; padding:20px; box-shadow:0 30px 80px rgba(0,0,0,.3); }
.sheet-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.sheet-head h3 { margin:0; font-size:18px; }
.sheet-close { border:0; background:#f1f4fa; width:30px; height:30px; border-radius:9px; cursor:pointer; font-size:16px; color:var(--ink-2); }
.sheet-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.sheet-item { display:flex; gap:10px; align-items:flex-start; text-decoration:none; color:inherit; border:1px solid var(--line); background:#fff; border-radius:13px; padding:13px; cursor:pointer; text-align:left; font-family:inherit; }
.sheet-item:hover { border-color:#b9c8ee; background:#fbfcff; }
.sheet-item .si { width:32px; height:32px; border-radius:9px; background:var(--brand-soft); color:var(--brand); display:grid; place-items:center; font-weight:800; flex:0 0 32px; }
.sheet-item b { display:block; font-size:13.5px; margin-bottom:2px; }
.sheet-item small { color:var(--muted); font-size:11px; line-height:1.45; }
.sheet-section { margin-top:15px; padding-top:13px; border-top:1px solid var(--line); }
.sheet-section h4 { margin:0 0 8px; font-size:11px; color:var(--muted); letter-spacing:1px; }
.sheet-logout { width:100%; margin-top:14px; border:1px solid #f0d2d2; color:var(--red); background:#fff7f7; border-radius:11px; padding:11px; font-family:inherit; font-weight:700; cursor:pointer; }
@media (max-width:600px) {
  .sheet-mask { place-items:end center; padding:0; }
  .sheet { border-radius:20px 20px 0 0; max-height:86vh; padding:20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .sheet-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.nums-mobile { margin-top:4px; }
.nums-mobile button { height:32px; }
@media (max-width:900px) {
  .exam-bar { gap:7px; padding:9px 11px; }
  .exam-bar .timer { font-size:16px; }
  .exam-progress small { font-size:10px; }
  .q-actions .btn { flex:1; }
  .q-actions .spacer { display:none; }
  .actions-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .action-card { padding:14px; }
  .action-card .ico { width:30px; height:30px; margin-bottom:7px; }
  .action-card h4 { font-size:13px; }
  .action-card p { font-size:11px; }
  .dash-grid { gap:9px; }
  .metric { padding:13px; }
  .metric .value { font-size:22px; }
  .page-head h1 { font-size:22px; }
  .page-head p { font-size:12px; }
}
html, body { max-width:100%; overflow-x:hidden; }
.dash-grid, .actions-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.metric, .action-card, .card { min-width:0; }
.action-card p, .metric .sub, .metric .label { overflow-wrap:anywhere; }
@media (max-width:900px) {
  .user-chip { display:none; }
  .app-top-in { justify-content:flex-start; }
  .mobile-tabs { width:100vw; max-width:100vw; overflow:hidden; }
  .mobile-tabs a, .mobile-tabs button { min-width:0; }
  .mobile-tabs a span:last-child, .mobile-tabs button span:last-child { white-space:nowrap; }
}
body.exam-mode .mobile-tabs { display:none !important; }
body.exam-mode .exam-wrap { padding-bottom:30px; }
@media (max-width:900px) {
  #libModules { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; overflow:visible; }
  .lib-mod { width:100%; border:1px solid var(--line); }
  .lib-mod small { display:block; font-size:10px; }
}
@media (max-width:900px) {
  .exam-progress { min-width:0; overflow:hidden; }
  .exam-progress small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .mobile-tabs a, .mobile-tabs button { font-size:10px; }
}
/* keep the raised center action fully visible */
.mobile-tabs { overflow:visible !important; }
.mobile-tabs .mt-start { overflow:visible; }
.mobile-tabs .mt-start .mt-plus {
  line-height:1;
  padding-bottom:1px;
  flex:0 0 46px;
  isolation:isolate;
}
@media (max-width:900px) {
  .mobile-tabs .mt-start { justify-content:center; padding:2px 2px 7px; }
  .mobile-tabs .mt-start .mt-plus {
    margin-top:0 !important;
    width:42px; height:42px; flex:0 0 42px;
    border-width:3px; font-size:24px;
    box-shadow:0 5px 13px rgba(31,79,216,.28);
  }
  .mobile-tabs .mt-start span:last-child { margin-top:0; line-height:1.2; }
}
.login-note { text-align:center; color:var(--muted); font-size:11.5px; margin-top:9px; }
.login-note::before { content:"🔒 "; font-size:10px; }
@media (max-width:900px) {
  .mobile-tabs { height:calc(64px + env(safe-area-inset-bottom)); }
  .mobile-tabs .mt-start { padding:2px 2px 5px; }
}
