:root {
  --bg: #f4f7f5; --card: #ffffff; --ink: #1d2b24; --muted: #66756d; --line: #dfe6e2;
  --brand: #1d7a4a; --brand-ink: #ffffff; --soft: #e7f3ec; --good: #1d7a4a; --bad: #b3372f; --bad-soft: #fbeceb;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111815; --card: #1a2420; --ink: #e8efeb; --muted: #9aaaa1; --line: #2c3a34; --brand: #37b877; --brand-ink: #0c1512; --soft: #1f3329; --good: #4fcf8d; --bad: #f08a80; --bad-soft: #3a2220; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); min-height: 100vh; }
h1 { font-size: 22px; margin: 4px 0 2px; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; }
.top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.top .title { flex: 1; font-weight: 700; }
.back { border: 0; background: none; color: var(--brand); font: inherit; padding: 10px 8px 10px 0; min-height: 44px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats b { display: block; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); }
button.btn, a.btn { display: block; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-align: center; text-decoration: none; margin: 8px 0; }
button.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.btn:disabled { opacity: .5; }
button.btn.opt { text-align: left; font-weight: 500; }
button.btn.opt.right { border-color: var(--good); background: var(--soft); }
button.btn.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.row { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.row4 { display: grid; gap: 6px; grid-template-columns: repeat(4, 1fr); }
.row4 .btn { padding: 8px 4px; font-size: 14px; }
.word { font-size: 34px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.kk { color: var(--muted); font-size: 17px; }
.say { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 50%; width: 44px; height: 44px; font-size: 18px; }
.gloss { margin: 10px 0; }
.gloss .pos { color: var(--brand); font-weight: 600; margin-right: 6px; }
.ex { border-left: 3px solid var(--line); padding-left: 10px; margin: 10px 0; }
.ex .src { font-size: 12px; }
.ex a, .src a { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--brand); margin-right: 6px; }
.prompt { font-size: 19px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.verdict { font-weight: 700; margin: 10px 0 4px; }
.verdict.ok { color: var(--good); } .verdict.no { color: var(--bad); }
.list button { display: flex; width: 100%; gap: 10px; align-items: baseline; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; padding: 12px 2px; min-height: 48px; }
.list button:last-child { border-bottom: 0; }
.list .w { font-weight: 700; } .list .g { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .list .n { color: var(--bad); font-size: 13px; white-space: nowrap; }
.seg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
input[type=text] { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; padding: 8px 12px; }
.err { color: var(--bad); }
footer { margin-top: 20px; }
footer a { color: var(--muted); }
button.btn.opt.right:disabled, button.btn.opt.wrong:disabled { opacity: 1; }
