/* ===== 学生端公共样式（移动优先） ===== */
:root {
  --p: #3b6cf6; --p2: #6a8dff; --pd: #2a4fd0;
  --g: #18b36b; --o: #ff8a1f; --r: #ef4d5e; --y: #ffc53d;
  --bg: #f3f6fc; --card: #ffffff; --t: #1c2333; --t2: #5c6577; --t3: #98a0b3; --line: #e6eaf3;
  --radius: 18px; --shadow: 0 8px 28px rgba(40, 60, 120, .10);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--t); font-size: 16px; line-height: 1.5; min-height: 100vh; }
a { color: var(--p); text-decoration: none; }
button, input, select { font: inherit; }
img { max-width: 100%; }
.wrap { width: min(100%, 720px); margin: 0 auto; padding: 16px 16px 40px; }
.narrow { width: min(100%, 520px); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 720px; margin: 0 auto; }
.topbar .brand { font-weight: 800; font-size: 18px; color: var(--p); letter-spacing: .5px; }
.topbar .back { color: var(--t2); font-size: 15px; cursor: pointer; background: none; border: 0; padding: 6px 8px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h1, .card h2, .card h3 { margin: 0 0 12px; }
.card h1 { font-size: 24px; line-height: 1.3; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 17px; }
.muted { color: var(--t2); } .small { font-size: 13px; } .xs { font-size: 12px; }
.t3 { color: var(--t3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 14px 20px; font-weight: 700; font-size: 17px; cursor: pointer; background: var(--p); color: #fff; width: 100%; transition: transform .05s, opacity .15s, background .15s; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--p); border: 1.5px solid var(--p); }
.btn.soft { background: #eaf0ff; color: var(--p); }
.btn.green { background: var(--g); } .btn.orange { background: var(--o); } .btn.red { background: var(--r); } .btn.gray { background: #eef1f6; color: var(--t2); }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; width: auto; }
.btn.xs { padding: 5px 10px; font-size: 13px; border-radius: 8px; width: auto; font-weight: 600; }
.btn + .btn { margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; } .row .btn + .btn { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
label.fld { display: block; font-size: 14px; color: var(--t2); margin: 14px 0 6px; font-weight: 600; }
.input, select.input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 17px; background: #fff; color: var(--t); outline: none; }
.input:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(59,108,246,.15); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 6px; font-weight: 700; font-size: 16px; color: var(--t2); cursor: pointer; }
.seg button.on { border-color: var(--p); background: #eaf0ff; color: var(--p); }
.seg button span { display: block; font-size: 12px; font-weight: 400; color: var(--t3); margin-top: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--t2); margin: 16px 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--p); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eaf0ff; color: var(--p); }
.tag.green { background: #e3f7ee; color: var(--g); } .tag.orange { background: #fff0e0; color: #c96a00; } .tag.gray { background: #eef1f6; color: var(--t2); } .tag.red { background: #fde8ea; color: var(--r); }
.stat { background: #f7f9fd; border-radius: 14px; padding: 14px; text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--p); line-height: 1.2; } .stat span { font-size: 12px; color: var(--t2); }
.big { font-size: 56px; font-weight: 800; color: var(--p); line-height: 1; letter-spacing: -1px; }
.hero { background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; border-radius: 22px; padding: 28px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 6px; font-size: 24px; } .hero p { margin: 0; opacity: .92; }
.entry { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; color: var(--t); position: relative; overflow: hidden; }
.entry:active { transform: scale(.99); }
.entry .ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex: none; }
.entry .ico.blue { background: #eaf0ff; } .entry .ico.green { background: #e3f7ee; } .entry .ico.orange { background: #fff0e0; } .entry .ico.purple { background: #efe8ff; }
.entry .ttl { font-weight: 800; font-size: 18px; } .entry .sub { font-size: 13px; color: var(--t2); margin-top: 2px; }
.entry .go { margin-left: auto; color: var(--t3); font-size: 22px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 16px; padding: 16px 16px; font-size: 18px; margin-bottom: 12px; cursor: pointer; color: var(--t); transition: all .12s; }
.opt .lab { width: 36px; height: 36px; border-radius: 10px; background: #f0f3fa; color: var(--t2); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.opt:active { background: #eef3ff; }
.opt.right { border-color: var(--g); background: #e9f8f0; } .opt.right .lab { background: var(--g); color: #fff; }
.opt.wrong { border-color: var(--r); background: #fdecEE; } .opt.wrong .lab { background: var(--r); color: #fff; }
.opt.dim { opacity: .55; }
.opt:disabled { cursor: default; }
.stem { text-align: center; padding: 18px 0 6px; }
.stem .w { font-size: 40px; font-weight: 800; letter-spacing: -.5px; }
.stem .ph { color: var(--t2); font-size: 18px; margin-top: 4px; font-family: "Charis SIL", "Doulos SIL", "Lucida Sans Unicode", Arial, sans-serif; }
.stem .cn { font-size: 26px; font-weight: 700; }
.progress { height: 8px; background: #e9edf6; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--p), var(--p2)); border-radius: 99px; transition: width .25s; }
.timerbar { height: 6px; background: #e9edf6; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.timerbar i { display: block; height: 100%; background: var(--g); border-radius: 99px; }
.timerbar i.warn { background: var(--o); } .timerbar i.danger { background: var(--r); }
.qhead { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--t2); margin-bottom: 8px; }
.qhead b { color: var(--p); font-size: 18px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #eaf0ff; color: var(--p); font-weight: 700; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(28,35,51,.92); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 999; max-width: 86vw; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }
.mask { position: fixed; inset: 0; background: rgba(20,26,40,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.mask.on { display: flex; }
.modal { background: #fff; border-radius: 20px; padding: 22px; width: min(100%, 440px); max-height: 90vh; overflow: auto; }
.modal h3 { margin-top: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list li:last-child { border-bottom: 0; }
.rank { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: #eef1f6; color: var(--t2); flex: none; }
.rank.r1 { background: #fff2c8; color: #b78300; } .rank.r2 { background: #e9edf6; color: #5c6577; } .rank.r3 { background: #fde6d8; color: #b55a1a; }
.list li.me { background: #f3f6ff; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--t3); } .kv dd { margin: 0; color: var(--t); font-weight: 600; }
.copy { cursor: pointer; color: var(--p); }
.empty { text-align: center; color: var(--t3); padding: 40px 0; font-size: 14px; }
.bar { height: 10px; background: #e9edf6; border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 99px; background: var(--p); }
.bar i.g { background: var(--g); } .bar i.o { background: var(--o); } .bar i.r { background: var(--r); } .bar i.y { background: var(--y); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.tc { text-align: center; } .bold { font-weight: 700; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.code { font-family: "SFMono-Regular", Consolas, Menlo, monospace; letter-spacing: 4px; font-size: 34px; font-weight: 800; color: var(--p); text-align: center; padding: 6px 0; }
.qr { width: 180px; height: 180px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 14px; border: 1px solid var(--line); }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; display: block; }
.hide { display: none !important; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.vs .side b { display: block; font-size: 30px; font-weight: 800; }
.vs .side span { font-size: 13px; color: var(--t2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs .mid { font-weight: 800; color: var(--t3); font-size: 18px; }
.spinner { width: 34px; height: 34px; border: 3px solid #e3e9f7; border-top-color: var(--p); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.pop { animation: pop .35s ease-out both; }
.flash { animation: flash .5s ease-out; } @keyframes flash { 0% { background: #fff2c8; } 100% { background: transparent; } }
.result-ico { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 46px; margin: 6px auto 14px; background: #fff2c8; }
.result-ico.lose { background: #eef1f6; } .result-ico.draw { background: #eaf0ff; } .result-ico.win { background: #fff2c8; }
details summary { cursor: pointer; font-weight: 700; color: var(--t2); font-size: 14px; padding: 8px 0; }
.word { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.word:last-child { border-bottom: 0; }
.word b { color: var(--t); } .word span { color: var(--t2); text-align: right; }
.sound { background: #eaf0ff; color: var(--p); border: 0; border-radius: 999px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
@media (max-width: 420px) { .stem .w { font-size: 34px; } .big { font-size: 48px; } }
@media print { .topbar, .noprint, .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; } }
