:root {
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --red: #dc2626;   /* 涨/正确 红 */
  --green: #16a34a; /* 跌/错误 绿 */
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  padding: 16px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.container { max-width: 860px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 14px 0 8px; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 80px; resize: vertical; }
label { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: var(--primary-d); }
.btn.ghost { background: #eef2ff; color: var(--primary-d); }
.btn.ghost:hover { background: #e0e7ff; }
.btn.danger { background: #fee2e2; color: var(--red); }
.btn.danger:hover { background: #fecaca; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.grid { display: grid; gap: 12px; }
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary-d);
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 20px; max-width: 360px; width: 100%; text-align: center;
}
.modal img { width: 240px; height: 240px; margin: 10px auto; }
.qr-url { font-size: 12px; color: var(--muted); word-break: break-all; background: #f8fafc; padding: 8px; border-radius: 8px; }
/* exam */
.q { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.q .stem { font-weight: 600; margin-bottom: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; cursor: pointer;
}
.opt:hover { background: #f8fafc; }
.opt input { margin-top: 4px; }
.opt.ok { background: #ecfdf5; border-color: var(--green); }
.opt.ok span { color: var(--green); }
.opt.no { background: #fef2f2; border-color: var(--red); }
.opt.no span { color: var(--red); }
.exp { margin-top: 10px; padding: 10px; border-radius: 8px; background: #f8fafc; font-size: 13px; }
.exp .ok { color: var(--green); font-weight: 600; }
.exp .no { color: var(--red); font-weight: 600; }
.q-actions { margin-top: 6px; }
.q-exp { margin-top: 8px; }
.exp-box { padding: 10px; border-radius: 8px; background: #f8fafc; font-size: 13px; line-height: 1.6; border-left: 3px solid var(--primary); }
.exp-box .ok { color: var(--green); font-weight: 600; }
.exp-box .no { color: var(--red); font-weight: 600; }
.score-big { font-size: 48px; font-weight: 800; color: var(--primary); text-align: center; margin: 10px 0; }
.hidden { display: none !important; }
.banner { display:block; margin:12px 0; padding:10px 14px; border-radius:10px; color:#fff; background:#2563eb; font-size:13px; line-height:1.5; }
.banner.static { background:#16a34a; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  z-index: 100; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: .95; }
