:root {
  --primary: #4f6ef7;
  --primary-dark: #3b55d9;
  --bg: #f0f2f8;
  --card: #ffffff;
  --text: #2b2f3a;
  --muted: #7a8095;
  --ok: #2fa96e;
  --bad: #e05656;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
#app { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 4px 18px rgba(30,40,90,.08);
  margin-top: 16px;
}

h1 { font-size: 26px; margin-bottom: 8px; }
h2 { font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; }

/* 登录 */
.login-box { max-width: 380px; margin: 60px auto 0; }
.login-box h1 { text-align: center; }
.form-row { margin-top: 18px; }
.form-row label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.form-row input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid #d8dcea; border-radius: 10px; outline: none;
  transition: border-color .15s;
}
.form-row input:focus { border-color: var(--primary); }
.btn {
  display: inline-block; border: none; cursor: pointer; font-size: 16px;
  padding: 12px 26px; border-radius: 10px; background: var(--primary); color: #fff;
  transition: background .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn.full { width: 100%; margin-top: 24px; }
.btn.ghost { background: #eef1fb; color: var(--primary); }
.btn.ghost:hover { background: #e2e7fa; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; min-height: 20px; }

/* 顶栏 */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.timer {
  font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--primary);
}
.timer.warn { color: #e08a1e; }
.timer.danger { color: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.user-tag { font-size: 13px; color: var(--muted); }
.user-tag a { color: var(--muted); margin-left: 10px; cursor: pointer; }

/* 题目 */
.q-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.q-num { font-size: 18px; font-weight: 700; }
.q-score { font-size: 13px; color: var(--muted); }
.stem-en { font-size: 17px; line-height: 1.65; }
.stem-zh { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.q-image { max-width: 100%; margin-top: 14px; border-radius: 10px; border: 1px solid #e3e6f0; }

.opts { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid #dfe3f0; border-radius: 12px; cursor: pointer;
  transition: all .12s; font-size: 16px;
}
.opt:hover { border-color: var(--primary); }
.opt.sel { border-color: var(--primary); background: #f0f3ff; }
.opt.correct { border-color: var(--ok); background: #edfaf2; }
.opt.wrong { border-color: var(--bad); background: #fdf0f0; }
.opt .key {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: #eef1fb; color: var(--primary); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.opt.sel .key { background: var(--primary); color: #fff; }
.opt.correct .key { background: var(--ok); color: #fff; }
.opt.wrong .key { background: var(--bad); color: #fff; }
.opt img { max-width: 260px; max-height: 140px; border-radius: 8px; }

/* 导航 */
.nav { display: flex; justify-content: space-between; margin-top: 26px; gap: 12px; }
.progress { margin-top: 20px; }
.progress-track { height: 8px; background: #e6e9f4; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width .3s; }
.progress-text { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: right; }

/* 解析 */
.analysis {
  margin-top: 18px; padding: 16px 18px; border-radius: 12px;
  background: #f6f8ff; border-left: 4px solid var(--primary);
  font-size: 15px; line-height: 1.7; white-space: pre-wrap;
}
.verdict { font-weight: 700; margin-top: 16px; font-size: 15px; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

/* 结果页 */
.score-hero { text-align: center; padding: 40px 20px; }
.score-hero .big {
  font-size: 64px; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.score-hero .big small { font-size: 24px; color: var(--muted); font-weight: 400; }
.result-item { border-top: 1px solid #eef0f7; padding-top: 20px; margin-top: 20px; }
.center { text-align: center; }
