* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --sl: #2e7d32; --hl: #f57c00; --sr: #c62828;
  --primary: #1a237e; --bg: #f4f6fb; --card: #ffffff;
  --text: #263238; --muted: #78909c;
}
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.app { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
.screen { display: none; }
.screen.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 欢迎页 */
.hero { text-align: center; padding: 48px 0 24px; }
.badge { display: inline-block; background: var(--primary); color: #fff; font-size: 13px; padding: 6px 16px; border-radius: 999px; letter-spacing: .5px; }
.hero h1 { font-size: 34px; margin: 18px 0 10px; color: var(--primary); }
.subtitle { color: var(--muted); font-size: 15px; max-width: 520px; margin: 0 auto 28px; line-height: 1.6; }
.level-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.level-card { background: var(--card); border-radius: 14px; padding: 18px 22px; width: 200px; box-shadow: 0 2px 12px rgba(0,0,0,.06); border-top: 4px solid var(--sl); }
.level-card.hl { border-top-color: var(--hl); }
.level-card.sr { border-top-color: var(--sr); }
.level-card h3 { font-size: 18px; margin-bottom: 6px; }
.level-card p { font-size: 13px; color: var(--muted); }
.level-card p.zh { margin-top: 4px; font-weight: 600; color: var(--text); font-size: 14px; }

/* 年级选择 */
.grade-select { margin-bottom: 26px; }
.grade-label { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.grade-options { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.grade-option { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 2px solid #e3e8f0; border-radius: 12px; padding: 10px 18px; cursor: pointer; font-size: 15px; transition: border-color .15s, background .15s; }
.grade-option:hover { border-color: var(--primary); }
.grade-option input { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.grade-option:has(input:checked) { border-color: var(--primary); background: #eef0ff; }
.btn-primary { background: var(--primary); color: #fff; border: none; font-size: 17px; padding: 14px 48px; border-radius: 999px; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: 0 4px 14px rgba(26,35,126,.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,35,126,.35); }
.hint { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* 答题页 */
.quiz-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.progress-wrap { flex: 1; min-width: 200px; }
.progress-track { background: #e3e8f0; height: 10px; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #3f51b5, #7986cb); border-radius: 999px; transition: width .4s ease; }
.progress-text { font-size: 13px; color: var(--muted); }
.level-tag { font-size: 13px; font-weight: 600; color: #fff; padding: 5px 14px; border-radius: 999px; }
.level-tag.sl { background: var(--sl); }
.level-tag.hl { background: var(--hl); }
.level-tag.sr { background: var(--sr); }
.streak-text { font-size: 13px; color: var(--muted); }
.quiz-body { background: var(--card); border-radius: 16px; padding: 28px; box-shadow: 0 2px 16px rgba(0,0,0,.06); }
.q-num { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.q-text { font-size: 17px; line-height: 1.7; margin-bottom: 22px; white-space: pre-line; }
.q-image { display: block; max-width: 100%; max-height: 420px; margin: 0 auto 20px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fff; }
.q-options { display: flex; flex-direction: column; gap: 12px; }
.q-option { display: flex; align-items: flex-start; gap: 12px; border: 2px solid #e3e8f0; border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: all .15s; }
.q-option:hover { border-color: #3f51b5; background: #f5f7ff; }
.q-option.selected { border-color: #3f51b5; background: #eef0ff; }
.q-option .opt-letter { font-weight: 700; color: var(--primary); min-width: 22px; }
.q-option .opt-text { flex: 1; line-height: 1.6; font-size: 15px; }
.q-option.correct { border-color: var(--sl); background: #e8f5e9; }
.q-option.wrong { border-color: var(--sr); background: #ffebee; }
.q-option.disabled { pointer-events: none; }
.explanation { margin-top: 20px; border-top: 1px dashed #e0e6ef; padding-top: 16px; }
.explanation .exp-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.explanation .exp-text { font-size: 14px; line-height: 1.7; color: #455a64; white-space: pre-line; }
.btn-next { margin-top: 20px; background: var(--primary); color: #fff; border: none; font-size: 15px; padding: 12px 36px; border-radius: 999px; cursor: pointer; }
.btn-next:hover { opacity: .9; }

/* 结果页 */
.result-card { background: var(--card); border-radius: 16px; padding: 32px; box-shadow: 0 2px 16px rgba(0,0,0,.06); text-align: center; }
.result-card h2 { color: var(--primary); margin-bottom: 6px; }
.rec-label { color: var(--muted); font-size: 14px; margin-top: 14px; }
.rec-big { font-size: 42px; font-weight: 800; margin: 8px 0 4px; }
.rec-zh { font-size: 18px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.rec-desc { color: var(--muted); font-size: 15px; }
.conf-badge { display: inline-block; margin-top: 10px; background: #eef0ff; color: var(--primary); font-size: 13px; padding: 5px 14px; border-radius: 999px; }
.result-card h3 { margin: 22px 0 10px; font-size: 16px; text-align: left; color: var(--text); }
.reason-list { text-align: left; padding-left: 20px; color: #455a64; font-size: 14px; line-height: 1.8; }
.theta-row { margin: 12px 0; font-size: 15px; font-weight: 600; }
.theta-range { color: var(--muted); font-weight: 400; font-size: 13px; }
.stat-list { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.stat-item { display: flex; align-items: center; gap: 10px; }
.stat-label { width: 90px; font-size: 14px; font-weight: 600; }
.stat-label small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.stat-bar { flex: 1; height: 12px; background: #e8edf5; border-radius: 999px; overflow: hidden; }
.stat-fill { display: block; height: 100%; border-radius: 999px; }
.stat-fill.junior_sl { background: var(--sl); }
.stat-fill.junior_hl { background: var(--hl); }
.stat-fill.senior { background: var(--sr); }
.stat-val { width: 56px; text-align: right; font-size: 13px; color: var(--muted); }
.recap { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.mini-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; }
.mini-dot.ok { background: var(--sl); }
.mini-dot.no { background: var(--sr); }
.explain-text { text-align: left; font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 18px 0; background: #f8faff; padding: 12px 14px; border-radius: 10px; }
.result-card .btn-primary { margin-top: 8px; }
.info-row { font-size: 14px; color: var(--muted); margin: 14px 0 4px; }
.overall-acc { font-size: 16px; color: var(--text); margin: 6px 0 18px; }
.overall-acc strong { color: var(--primary); font-size: 20px; }
.signup-link { display: inline-block; text-decoration: none; margin-top: 14px; }
.disclaimer { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 16px; padding: 12px 14px; background: #f7f8fc; border-radius: 10px; border-left: 3px solid var(--primary); }
.btn-secondary { display: block; margin: 18px auto 0; background: transparent; color: var(--primary); border: 2px solid var(--primary); font-size: 15px; padding: 10px 32px; border-radius: 999px; cursor: pointer; transition: background .15s; }
.btn-secondary:hover { background: #eef0ff; }

@media (max-width: 600px) {
  .quiz-body { padding: 18px; }
  .level-card { width: 100%; }
  .hero h1 { font-size: 26px; }
  .rec-big { font-size: 34px; }
}
