/* ===== 考试题库 · 精美圆角风格 ===== */
:root {
  --bg1: #eef3fb;
  --bg2: #e6ecf8;
  --card: #ffffff;
  --ink: #1f2d3d;
  --ink2: #6b7a90;
  --line: #e8edf5;
  --brand: #4f6ef7;
  --brand2: #7b5cf0;
  --grad: linear-gradient(135deg, #4f6ef7, #7b5cf0);
  --ok: #10b981;
  --ok-bg: #e7f9f1;
  --bad: #f0483e;
  --bad-bg: #fdeceb;
  --gold: #f5a623;
  --radius: 22px;
  --shadow: 0 8px 30px rgba(79, 110, 247, .10);
  --shadow-lg: 0 14px 44px rgba(79, 110, 247, .16);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #dbe6ff55, transparent),
              radial-gradient(900px 500px at 110% 10%, #e8dcff55, transparent),
              linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height: 100vh;
  background-attachment: fixed;
}
#app { max-width: 560px; margin: 0 auto; padding: 18px 14px 48px; }

/* ===== 通用组件 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid #ffffffcc;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; user-select: none;
  border-radius: 999px; font-size: 1rem; font-weight: 600;
  padding: 13px 28px; transition: .18s;
  font-family: inherit;
}
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(99, 102, 241, .35); }
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(99, 102, 241, .45); }
.btn-grad:active { transform: translateY(0); }
.btn-ghost { background: #f1f4fb; color: var(--ink); }
.btn-ghost:hover { background: #e6ebf7; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: #fbd9d6; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 8px 16px; font-size: .88rem; }

.tag {
  display: inline-flex; align-items: center;
  background: #eef1fd; color: var(--brand);
  border-radius: 999px; padding: 4px 12px; font-size: .78rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-bad { background: var(--bad-bg); color: var(--bad); }
.tag-gold { background: #fdf3e0; color: #d9820b; }

input.field {
  width: 100%; padding: 14px 18px; border-radius: 16px;
  border: 2px solid var(--line); background: #f8faff;
  font-size: 1rem; font-family: inherit; color: var(--ink);
  transition: .18s; outline: none;
}
input.field:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(79, 110, 247, .12); }

/* ===== 顶栏 ===== */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar h1 { font-size: 1.3rem; flex: 1; }
.avatar {
  width: 44px; height: 44px; border-radius: 16px; background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}

/* ===== 登录页 ===== */
.login-wrap { min-height: 92vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 400px; text-align: center;
  background: #ffffffee; backdrop-filter: blur(8px);
  border-radius: 30px; padding: 40px 30px; box-shadow: var(--shadow-lg);
  border: 1px solid #fff;
}
.login-logo {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 28px;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  font-size: 40px; box-shadow: 0 12px 30px rgba(99, 102, 241, .4);
}
.login-card h1 { font-size: 1.45rem; margin-bottom: 6px; }
.login-card .sub { color: var(--ink2); font-size: .9rem; margin-bottom: 26px; }
.login-card input { margin-bottom: 14px; text-align: left; }
.login-err { color: var(--bad); font-size: .88rem; min-height: 20px; margin-bottom: 6px; }

/* ===== 首页 ===== */
.stat-row { display: flex; gap: 10px; margin-bottom: 16px; }
.stat {
  flex: 1; background: var(--card); border-radius: 18px; padding: 14px 10px;
  text-align: center; box-shadow: var(--shadow); border: 1px solid #ffffffcc;
}
.stat .num { font-size: 1.35rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { font-size: .75rem; color: var(--ink2); margin-top: 3px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.entry {
  background: var(--card); border-radius: var(--radius); padding: 22px 18px;
  box-shadow: var(--shadow); border: 1px solid #ffffffcc; cursor: pointer;
  transition: .18s; display: flex; flex-direction: column; gap: 8px;
}
.entry:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.entry .ico {
  width: 52px; height: 52px; border-radius: 18px; display: flex; align-items: center;
  justify-content: center; font-size: 26px;
}
.entry h3 { font-size: 1.02rem; }
.entry p { font-size: .78rem; color: var(--ink2); line-height: 1.4; }
.i-blue { background: #e8edff; } .i-purple { background: #f0e9ff; }
.i-green { background: #e2f7ee; } .i-red { background: #fdeaea; } .i-gold { background: #fdf3dd; }

/* ===== 练习目录 ===== */
.group {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border-radius: 20px; padding: 16px 18px; margin-bottom: 12px;
  box-shadow: var(--shadow); border: 1px solid #ffffffcc;
  cursor: pointer; transition: .18s;
}
.group:hover { transform: translateX(4px); }
.group .gname { font-weight: 700; font-size: .98rem; width: 128px; flex-shrink: 0; }
.group .gname small { display: block; color: var(--ink2); font-weight: 400; font-size: .74rem; margin-top: 2px; }
.bar { flex: 1; height: 9px; background: #edf1f9; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }
.gstats { text-align: right; font-size: .76rem; color: var(--ink2); width: 118px; flex-shrink: 0; line-height: 1.5; }
.gstats b { color: var(--ink); }
.gstats .w { color: var(--bad); font-weight: 700; }
.section-t { font-size: 1.05rem; font-weight: 800; margin: 22px 4px 12px; display: flex; align-items: center; gap: 8px; }
.section-t::before { content: ""; width: 6px; height: 20px; border-radius: 99px; background: var(--grad); }

/* ===== 答题页 ===== */
.quiz-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; white-space: nowrap; }
.quiz-top .tag { font-size: .76rem; padding: 5px 11px; }
.quiz-top .cnt { font-weight: 800; font-size: .95rem; flex-shrink: 0; }
.quiz-top .cnt small { color: var(--ink2); font-weight: 400; font-size: .78rem; }
.quit { margin-left: auto; background: none; border: none; color: var(--ink2); font-size: 1.3rem; cursor: pointer; padding: 4px 8px; border-radius: 12px; flex-shrink: 0; }
.quit:hover { background: #f1f4fb; }
.qbar { height: 10px; background: #e3e9f4; border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.qbar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .25s; }
.qcard { background: var(--card); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow-lg); border: 1px solid #ffffffcc; }
.qcard .cat { margin-bottom: 10px; }
.qcard .stem { font-size: 1.08rem; line-height: 1.75; margin-bottom: 20px; font-weight: 600; }
.opts { display: flex; flex-direction: column; gap: 11px; }
.opt {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  background: #f7f9fd; border: 2px solid transparent; border-radius: 16px;
  cursor: pointer; transition: .15s; font-size: .98rem; line-height: 1.5;
}
.opt:hover { background: #eef2fc; transform: translateX(3px); }
.opt .abc {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 11px;
  background: #e8edff; color: var(--brand); font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.opt.sel { background: #eef2ff; border-color: var(--brand); }
.opt.sel .abc { background: var(--brand); color: #fff; }
.opt.right { background: var(--ok-bg); border-color: var(--ok); }
.opt.right .abc { background: var(--ok); color: #fff; }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); }
.opt.wrong .abc { background: var(--bad); color: #fff; }
.opt.locked { cursor: default; }
.opt.locked:hover { transform: none; }

.feedback {
  margin-top: 18px; padding: 15px 18px; border-radius: 16px; font-size: .95rem;
  display: flex; align-items: center; gap: 10px; line-height: 1.6;
  animation: pop .25s;
}
.feedback.ok { background: var(--ok-bg); color: #0a7d5c; }
.feedback.bad { background: var(--bad-bg); color: #b83229; }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.quiz-next { margin-top: 18px; display: flex; gap: 10px; }

/* ===== 结果页 / 复盘 ===== */
.score-ring {
  width: 150px; height: 150px; margin: 10px auto 14px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), #e9eef8 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.score-ring .sv { position: relative; font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-ring .sl { position: relative; font-size: .75rem; color: var(--ink2); }
.result-grid { display: flex; gap: 10px; justify-content: center; margin-bottom: 6px; flex-wrap: wrap; }
.rq { border-radius: 18px; background: var(--card); box-shadow: var(--shadow); padding: 20px; margin-bottom: 14px; border: 1px solid #ffffffcc; }
.rq .stem { font-size: .98rem; font-weight: 600; line-height: 1.65; margin: 8px 0 12px; }
.rq .opt-line { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 12px; font-size: .9rem; margin-bottom: 7px; line-height: 1.45; }
.rq .opt-line .abc { width: 26px; height: 26px; flex-shrink: 0; border-radius: 9px; background: #eef1f9; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; color: var(--ink2); }
.rq .opt-line.right { background: var(--ok-bg); color: #0a7d5c; }
.rq .opt-line.right .abc { background: var(--ok); color: #fff; }
.rq .opt-line.chosen { background: var(--bad-bg); color: #b83229; }
.rq .opt-line.chosen .abc { background: var(--bad); color: #fff; }
.verdict { font-size: .8rem; font-weight: 700; }

/* ===== 历史记录 ===== */
.hitem {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: 18px; padding: 15px 17px; margin-bottom: 11px;
  box-shadow: var(--shadow); border: 1px solid #ffffffcc; cursor: pointer; transition: .15s;
}
.hitem:hover { transform: translateX(4px); }
.hitem .hi { width: 44px; height: 44px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.hitem .hb { flex: 1; min-width: 0; }
.hitem .hb b { font-size: .95rem; }
.hitem .hb small { display: block; color: var(--ink2); font-size: .76rem; margin-top: 3px; }
.hitem .hs { text-align: right; font-size: .8rem; color: var(--ink2); line-height: 1.5; }
.hitem .hs b { font-size: 1.05rem; color: var(--ink); }

/* ===== 用户管理 ===== */
.u-row {
  display: flex; align-items: center; gap: 12px; padding: 15px 17px;
  background: var(--card); border-radius: 18px; margin-bottom: 11px;
  box-shadow: var(--shadow); border: 1px solid #ffffffcc;
}
.u-row .un { flex: 1; font-weight: 700; }
.u-row .un small { display: block; font-weight: 400; color: var(--ink2); font-size: .74rem; margin-top: 2px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: .84rem; color: var(--ink2); margin-bottom: 6px; font-weight: 600; }
.empty { text-align: center; color: var(--ink2); padding: 42px 0; font-size: .92rem; }
.empty .e-ico { font-size: 44px; margin-bottom: 10px; }

/* ===== 弹窗 ===== */
.mask { position: fixed; inset: 0; background: rgba(30, 41, 66, .35); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 26px; padding: 26px; width: 100%; max-width: 360px; box-shadow: var(--shadow-lg); animation: pop .2s; }
.modal h3 { margin-bottom: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #26314a; color: #fff; border-radius: 999px; padding: 11px 24px;
  font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 99;
  animation: pop .2s; max-width: 86vw; text-align: center;
}
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); font-size: .9rem; cursor: pointer; margin-bottom: 14px; padding: 8px 14px; background: #ffffffaa; border-radius: 999px; }
.back-link:hover { color: var(--ink); background: #fff; }

@media (max-width: 480px) {
  html { font-size: 15px; }
  #app { padding: 14px 12px 40px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .group .gname { width: 96px; font-size: .9rem; }
  .gstats { width: 86px; }
  .qcard { padding: 20px 16px; }
  .opt { padding: 14px 15px; }
  .entry { padding: 20px 16px; }
}
