:root {
  --primary: #2f54eb;
  --primary-deep: #1d39c4;
  --primary-grad: linear-gradient(135deg, #2f54eb 0%, #597ef7 100%);
  --green: #22c55e;
  --green-bg: #ecfdf3;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --cyan: #0ea5e9;
  --cyan-bg: #ecfeff;
  --gold: #f59e0b;
  --gold-bg: #fffbeb;
  --blue-bg: #eef2ff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --line: #eef0f4;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(47, 84, 235, 0.08);
  --tabbar-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overscroll-behavior: none;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0,0,0,0.06);
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  max-width: 520px;
  margin: 0 auto;
  height: 56px;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(244, 246, 251, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar .tb-title { font-size: 17px; font-weight: 700; flex: 1; text-align: center; }
.topbar .tb-back { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer; font-size: 18px; color: var(--text); border: none; }
.topbar .tb-side { width: 36px; }
.topbar.grad { background: var(--primary-grad); }
.topbar.grad .tb-title { color: #fff; }

#view { padding: 72px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); min-height: 100vh; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 520px;
  margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 60;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  transition: color .15s;
}
.tab-item svg { width: 24px; height: 24px; }
.tab-item.active { color: var(--primary); font-weight: 600; }

/* ---------- Home ---------- */
.home-hero {
  background: var(--primary-grad);
  border-radius: 20px;
  padding: 22px 20px 26px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(47, 84, 235, 0.25);
}
.home-hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.home-hero .hh-greet { font-size: 14px; opacity: 0.9; }
.home-hero .hh-title { font-size: 22px; font-weight: 800; margin: 4px 0 16px; letter-spacing: 1px; }
.hh-stats { display: flex; gap: 12px; position: relative; z-index: 2; }
.hh-stat {
  flex: 1;
  background: rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(4px);
}
.hh-stat .hs-num { font-size: 22px; font-weight: 800; }
.hh-stat .hs-label { font-size: 12px; opacity: 0.88; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 12px; }
.section-title h3 { font-size: 16px; font-weight: 700; }
.section-title .st-link { font-size: 13px; color: var(--primary); cursor: pointer; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .12s;
  border: 1px solid transparent;
}
.mode-card:active { transform: scale(0.97); }
.mc-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mc-icon svg { width: 24px; height: 24px; color: #fff; }
.mc-body .mc-title { font-size: 15px; font-weight: 700; }
.mc-body .mc-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.mc-icon.blue { background: linear-gradient(135deg,#3b82f6,#60a5fa); }
.mc-icon.green { background: linear-gradient(135deg,#22c55e,#4ade80); }
.mc-icon.orange { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.mc-icon.red { background: linear-gradient(135deg,#ef4444,#f87171); }
.mc-icon.purple { background: linear-gradient(135deg,#8b5cf6,#a78bfa); }
.mc-icon.cyan { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.panel-head { padding: 14px 16px 0; }
.panel-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.wrong-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.wrong-item:first-of-type { border-top: none; }
.wrong-item .wi-tag { font-size: 11px; color: var(--primary); background: var(--blue-bg); border-radius: 6px; padding: 2px 7px; flex-shrink: 0; }
.wrong-item .wi-text { flex: 1; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wrong-item .wi-arrow { color: var(--text-3); font-size: 14px; }
.wrong-item .wi-state { font-size: 12px; font-weight: 700; }
.wrong-item .wi-state.wrong { color: var(--red); }
.wrong-item .wi-state.ok { color: var(--green); }

/* ---------- Year grid (exam setup) ---------- */
.year-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.year-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .12s;
}
.year-card:active { transform: scale(0.97); }
.yc-year { font-size: 20px; font-weight: 800; color: var(--primary); }
.yc-info { flex: 1; font-size: 12px; color: var(--text-2); }
.yc-info .yc-num { font-size: 13px; color: var(--text); font-weight: 600; }
.yc-best { font-size: 12px; color: var(--gold); font-weight: 600; }

/* ---------- Practice ---------- */
.pg-progress { display: flex; align-items: center; gap: 10px; padding: 4px 2px 12px; }
.pg-progress .pg-bar { flex: 1; height: 6px; background: #e5e9f5; border-radius: 3px; overflow: hidden; }
.pg-progress .pg-fill { height: 100%; background: var(--primary-grad); border-radius: 3px; transition: width .3s; }
.pg-progress .pg-txt { font-size: 13px; color: var(--text-2); white-space: nowrap; }

.q-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 16px; }
.q-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.q-meta .q-year { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--blue-bg); border-radius: 6px; padding: 2px 8px; }
.q-meta .q-no { font-size: 12px; color: var(--text-3); }
.q-stem { font-size: 16px; font-weight: 600; line-height: 1.75; white-space: pre-wrap; word-break: break-all; }

.opts { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fafbfe;
  cursor: pointer;
  transition: all .15s;
  font-size: 14.5px;
  line-height: 1.6;
}
.opt .opt-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #e8ecf8;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .15s;
}
.opt:active { transform: scale(0.985); }
.opt .opt-text { flex: 1; word-break: break-all; white-space: pre-wrap; }
.opt.selected { border-color: var(--primary); background: var(--blue-bg); }
.opt.selected .opt-letter { background: var(--primary); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--green-bg); }
.opt.correct .opt-letter { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-bg); animation: shake .4s; }
.opt.wrong .opt-letter { background: var(--red); color: #fff; }
.opt.disabled { pointer-events: none; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.feedback { margin-top: 16px; border-radius: 12px; padding: 14px; animation: fadeIn .3s; }
.feedback.correct { background: var(--green-bg); border: 1px solid #bbe7cb; }
.feedback.wrong { background: var(--red-bg); border: 1px solid #f6c3c3; }
.feedback .fb-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.feedback.correct .fb-title { color: var(--green); }
.feedback.wrong .fb-title { color: var(--red); }
.feedback .fb-kaoqing { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.feedback .fb-streak { font-size: 12.5px; color: var(--primary); font-weight: 700; margin-top: 8px; }
.sub-judge .fb-streak { margin: 0 0 10px; text-align: left; }
.feedback .fb-jiedu { font-size: 13.5px; color: var(--text); margin-top: 6px; line-height: 1.8; white-space: pre-wrap; }
.feedback .fb-empty { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pg-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1;
  height: 46px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: all .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 16px rgba(47,84,235,.3); }
.btn-primary:disabled { opacity: .5; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--text-2); border: 1.5px solid var(--line); }
.btn-ghost.active { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }
.btn-small { flex: 0 0 auto; width: 46px; height: 46px; font-size: 20px; padding: 0; }
.btn-sheet { background: var(--blue-bg); color: var(--primary); }

/* ---------- Answer sheet ---------- */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 90; }
.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 100;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .25s;
  max-height: 70vh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head span { font-size: 16px; font-weight: 700; }
.sheet-close { cursor: pointer; color: var(--text-3); font-size: 18px; padding: 4px; }
.sheet-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sheet-num {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  background: #f1f3fa;
  color: var(--text-2);
  cursor: pointer;
  border: 1.5px solid transparent;
}
.sheet-num.cur { border-color: var(--primary); color: var(--primary); background: var(--blue-bg); font-weight: 800; }
.sheet-num.right { background: var(--green-bg); color: var(--green); border-color: #bbe7cb; }
.sheet-num.wrong { background: var(--red-bg); color: var(--red); border-color: #f6c3c3; }
.sheet-legend { display: flex; gap: 16px; justify-content: center; margin-top: 16px; font-size: 12px; color: var(--text-2); }
.sheet-legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.dot-cur { background: var(--blue-bg); border: 1.5px solid var(--primary); }
.dot-right { background: var(--green); }
.dot-wrong { background: var(--red); }
.dot-blank { background: #f1f3fa; }

/* ---------- List (wrong/fav) ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.list-item:first-of-type { border-top: none; }
.li-main { flex: 1; min-width: 0; }
.li-tags { display: flex; gap: 6px; margin-bottom: 4px; }
.li-tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.li-tag.year { background: var(--blue-bg); color: var(--primary); }
.li-tag.wrong-c { background: var(--red-bg); color: var(--red); }
.li-tag.ok-c { background: var(--green-bg); color: var(--green); }
.li-text { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li-del { color: var(--text-3); font-size: 18px; padding: 6px; cursor: pointer; }

.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty p { font-size: 14px; }

/* ---------- Exam ---------- */
.exam-timer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.exam-timer .timer-box {
  background: #0f172a;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 6px 20px;
  border-radius: 12px;
  letter-spacing: 2px;
  font-family: "DIN Alternate", "SF Mono", Consolas, monospace;
}
.exam-timer .timer-warn .timer-box { background: #dc2626; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }
.exam-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-submit { background: linear-gradient(135deg,#f97316,#f59e0b); color: #fff; box-shadow: 0 6px 16px rgba(249,115,22,.3); }

/* ---------- Result ---------- */
.result-hero { text-align: center; padding: 26px 20px; }
.result-score { font-size: 52px; font-weight: 900; color: var(--primary); line-height: 1.1; }
.result-score small { font-size: 16px; color: var(--text-3); font-weight: 500; }
.result-sub { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.result-bar { height: 10px; background: #e5e9f5; border-radius: 5px; margin: 16px 0 4px; overflow: hidden; }
.result-bar .rb-fill { height: 100%; border-radius: 5px; transition: width .6s; }
.result-stats { display: flex; margin-top: 18px; }
.result-stats .rs-item { flex: 1; text-align: center; }
.result-stats .rs-num { font-size: 22px; font-weight: 800; }
.result-stats .rs-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.result-stats .rs-item.ok .rs-num { color: var(--green); }
.result-stats .rs-item.bad .rs-num { color: var(--red); }
.result-stats .rs-item.time .rs-num { color: var(--gold); }
.result-wrong-list { margin-top: 10px; }
.result-wrong-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.result-wrong-item:first-of-type { border-top: none; }
.rwi-no { font-size: 13px; color: var(--text-3); width: 28px; flex-shrink: 0; }
.rwi-text { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rwi-mine { font-size: 12px; color: var(--red); flex-shrink: 0; }
.rwi-ans { font-size: 12px; color: var(--green); flex-shrink: 0; }

/* ---------- Profile ---------- */
.profile-head { text-align: center; padding: 26px 20px; }
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 8px 20px rgba(47,84,235,.3);
}
.profile-name { font-size: 18px; font-weight: 800; }
.profile-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.profile-stats { display: flex; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 0; margin-bottom: 14px; }
.profile-stats .ps-item { flex: 1; text-align: center; }
.profile-stats .ps-num { font-size: 22px; font-weight: 800; color: var(--primary); }
.profile-stats .ps-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.menu-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.menu-item:first-of-type { border-top: none; }
.menu-item .mi-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.menu-item .mi-text { flex: 1; font-size: 14.5px; }
.menu-item .mi-badge { font-size: 12px; color: var(--red); font-weight: 700; }
.menu-item .mi-arrow { color: var(--text-3); }

.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: none; }
.setting-row .sr-text { font-size: 14.5px; }
.setting-row .sr-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.switch { width: 48px; height: 28px; border-radius: 14px; background: #d9dee8; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch.on { background: var(--primary); }
.switch.on::after { left: 23px; }

.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 10px 16px; }
.chart-bars .cb-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bars .cb-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--primary-grad); opacity: .85; min-height: 3px; }
.chart-bars .cb-bar.today { opacity: 1; }
.chart-bars .cb-label { font-size: 10px; color: var(--text-3); }

/* ---------- Confirm modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 110; display: flex; align-items: center; justify-content: center; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 340px; padding: 22px 20px 16px; animation: fadeIn .2s; }
.modal-title { font-size: 17px; font-weight: 800; text-align: center; }
.modal-desc { font-size: 14px; color: var(--text-2); text-align: center; margin-top: 8px; line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

.hidden { display: none !important; }

/* ---------- 主观题（简答/论述） ---------- */
.sub-filter { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; }
.sub-filter::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; font-size: 12.5px; color: var(--text-2); background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 15px; cursor: pointer; transition: all .15s; }
.chip:active { transform: scale(0.96); }
.chip.on { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-bg); font-weight: 600; }
.q-type { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; flex-shrink: 0; }
.q-type.type-sa { color: #0891b2; background: #cffafe; }
.q-type.type-ls { color: #7c3aed; background: #ede9fe; }
.sub-hint { margin-top: 16px; font-size: 13px; color: var(--text-2); background: var(--blue-bg); border: 1.5px dashed var(--primary); border-radius: 12px; padding: 16px 14px; text-align: center; line-height: 1.8; }
.sub-answer { margin-top: 16px; border-radius: 12px; background: var(--cyan-bg); border: 1px solid #bae6fd; padding: 14px; animation: fadeIn .3s; }
.sa-title { font-size: 12.5px; font-weight: 700; color: #0284c7; margin-bottom: 8px; }
.sa-text { font-size: 15px; line-height: 1.9; color: var(--text); white-space: pre-wrap; word-break: break-all; }
.sub-judge { display: flex; gap: 10px; margin-top: 14px; }
.sub-judge .btn { flex: 1; }
.sub-no { color: var(--red) !important; border-color: var(--red) !important; background: #fff !important; }

/* 主观题：答题与评分 */
.sub-input-area { margin-top: 16px; }
.sub-input {
  width: 100%; min-height: 104px; resize: vertical; box-sizing: border-box;
  font: inherit; font-size: 14px; line-height: 1.75;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s;
}
.sub-input:focus { border-color: var(--cyan); background: #f8fdff; }
.sub-myanswer {
  font-size: 14px; line-height: 1.85; color: var(--text);
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; white-space: pre-wrap; word-break: break-all;
}
.sub-score-card {
  margin-top: 14px; border-radius: 14px; padding: 14px 16px;
  text-align: center; border: 1px solid; animation: fadeIn .3s;
}
.sub-score-card.lv-ex { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-color: #a7f3d0; }
.sub-score-card.lv-good { background: linear-gradient(135deg, #eff6ff, #dbeafe); border-color: #bfdbfe; }
.sub-score-card.lv-pass { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fde68a; }
.sub-score-card.lv-weak { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fecaca; }
.ssc-num { font-size: 32px; font-weight: 800; line-height: 1.1; }
.ssc-num small { font-size: 13px; font-weight: 600; color: var(--text-2); }
.lv-ex .ssc-num { color: #059669; }
.lv-good .ssc-num { color: #2563eb; }
.lv-pass .ssc-num { color: #d97706; }
.lv-weak .ssc-num { color: #dc2626; }
.ssc-meta { font-size: 12.5px; color: var(--text-2); margin-top: 5px; }
.ssc-level {
  display: inline-block; margin-top: 9px; font-size: 12.5px; font-weight: 700;
  padding: 3px 14px; border-radius: 999px; background: #fff;
}
.lv-ex .ssc-level { color: #059669; }
.lv-good .ssc-level { color: #2563eb; }
.lv-pass .ssc-level { color: #d97706; }
.lv-weak .ssc-level { color: #dc2626; }
.sub-points { margin-top: 12px; }
.sp-title { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.sp-item {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.7; padding: 8px 10px;
  border-radius: 10px; margin-bottom: 6px;
}
.sp-item.hit { background: #ecfdf5; color: #047857; }
.sp-item.miss { background: #fef2f2; color: #b91c1c; }
.sp-mark { flex-shrink: 0; font-weight: 800; }

/* ---------- 轻提示 Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(17, 24, 39, .9); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 999px; z-index: 200; animation: fadeIn .2s;
  white-space: nowrap; max-width: 86vw; text-align: center;
}

/* ================= 登录页 ================= */
.login-page {
  position: fixed; inset: 0;
  max-width: 520px; margin: 0 auto;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: calc(28px + env(safe-area-inset-top)) 26px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(1100px 520px at 18% -8%, rgba(89, 127, 247, 0.22), transparent 62%),
    radial-gradient(900px 460px at 115% 112%, rgba(14, 165, 233, 0.16), transparent 58%),
    var(--bg);
}
.login-card { width: 100%; max-width: 340px; }
.login-logo {
  width: 74px; height: 74px; margin: 0 auto 18px;
  border-radius: 20px;
  background: var(--primary-grad);
  color: #fff; font-size: 30px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 26px rgba(47, 84, 235, 0.32);
}
.login-title { font-size: 21px; font-weight: 800; text-align: center; letter-spacing: 1px; }
.login-sub { text-align: center; font-size: 12.5px; color: var(--text-3); margin: 6px 0 26px; }
.login-field { margin-bottom: 14px; }
.login-input {
  width: 100%; box-sizing: border-box; height: 50px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; font: inherit; font-size: 15px; letter-spacing: 3px; text-align: center;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.12); }
.btn-block { width: 100%; flex: none; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-tip { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-3); line-height: 1.9; }
.login-tip b { color: var(--primary); font-weight: 700; }

/* 游客模式提示条（首页顶部） */
.guest-bar {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #7c2d12; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px;
  font-size: 12.5px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.22);
}
.guest-bar .gb-title { font-weight: 800; flex-shrink: 0; }
.guest-bar .gb-tip { flex: 1; opacity: .9; }
.guest-bar .gb-arrow { font-size: 16px; font-weight: 700; }

/* ================= 独立运行（添加到主屏幕 / 全屏）适配 =================
   · 独立窗口没有地址栏，用 dvh 消除 100vh 误差
   · 底部安全区（iPhone 小白条）已在 .tabbar / #view / .toast / .modal-mask / .login-page 预留
   · 顶部状态栏由 apple-mobile-web-app-status-bar-style=default 单独占位，无需额外处理 */
@supports (height: 100dvh) {
  #app, #view { min-height: 100dvh; }
}

/* 去掉长按弹窗（复制/搜索/放大镜），更接近原生 App 手感 */
.tabbar, .topbar, .btn, .chip, .mode-card, .menu-item, .sheet-num, .tab-item {
  -webkit-touch-callout: none;
}
