:root {
  --ground: #F4F5F2; --card: #FFFFFF; --ink: #18201C; --mute: #56625B; --line: #DDE1DC; --line2: #CBD2CC;
  --green: #24543F; --green-d: #163828; --green-l: #E9F2EC; --amber: #8A4A0F; --amber-l: #FFF4E8; --blue: #1E4F8A; --blue-l: #E4ECF6;
  --bar: #C9772B; --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--green); }
h1 { font-size: 26px; line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 18px; margin: 0 0 8px; } h3 { font-size: 16px; margin: 0 0 6px; }
.mute { color: var(--mute); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.page { max-width: 720px; margin: 0 auto; padding: calc(20px + var(--safe-t)) 16px calc(100px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.hero { background: var(--green); color: #fff; border: none; padding: 20px; }
.card.hero .mute { color: rgba(255,255,255,.82); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat b { display: block; font-size: 28px; line-height: 1.2; } .stat span { font-size: 13px; color: var(--mute); }
.btn { appearance: none; border: none; border-radius: 14px; min-height: 50px; padding: 0 20px; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--green); color: #fff; } .btn.primary:active { background: var(--green-d); }
.btn.white { background: #fff; color: var(--green-d); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line2); font-weight: 500; }
.btn.block { width: 100%; } .btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 14px; border-radius: 10px; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line2); border-radius: 12px; padding: 12px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--mute); }
.err { color: #B42318; font-size: 14px; min-height: 1em; }
.list { display: flex; flex-direction: column; } .list > * + * { border-top: 1px solid var(--line); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; text-decoration: none; color: inherit; }
.item .grow { flex: 1; min-width: 0; } .item .t { font-weight: 600; } .item .s { font-size: 13px; color: var(--mute); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid #9AA59E; } .dot.done { background: var(--green); border-color: var(--green); } .dot.next { border-color: var(--bar); background: var(--bar); }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--green-l); color: var(--green-d); font-weight: 600; white-space: nowrap; }
.tag.amber { background: var(--amber-l); color: var(--amber); }
.wrong { text-decoration: line-through; color: var(--amber); } .right { color: var(--blue); font-weight: 700; }
.bar { position: relative; height: 8px; border-radius: 4px; background: #E3E7E3; } .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--green); }
.tabs { display: flex; gap: 8px; } .tabs button { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
nav.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(6px + var(--safe-b)); z-index: 10; }
nav.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--mute); text-decoration: none; padding: 4px 0; }
nav.tabbar a.on { color: var(--green); font-weight: 700; } nav.tabbar svg { width: 24px; height: 24px; }
@media (min-width: 900px) { nav.tabbar { max-width: 720px; margin: 0 auto; border: 1px solid var(--line); border-bottom: none; border-radius: 16px 16px 0 0; } }
.stars { display: flex; gap: 6px; } .stars button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: #fff; font-size: 18px; cursor: pointer; color: #9AA59E; }
.stars button.on { background: var(--amber-l); border-color: #F0D3B0; color: var(--bar); }
.flash { min-height: 180px; display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: center; font-size: 20px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; max-width: 90vw; }
.center { text-align: center; } .gap { height: 6px; }
.loading { padding: 60px 0; text-align: center; color: var(--mute); }

/* ---------- 欢迎页 ---------- */
.welcome { gap: 16px; max-width: 560px; }
.welcome .brand { font-size: 17px; letter-spacing: .02em; color: var(--green-d); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #E6EAE6; border-radius: 14px; padding: 4px; }
.seg button { appearance: none; border: 0; background: transparent; border-radius: 11px; min-height: 44px; font: inherit; font-size: 16px; font-weight: 600; color: var(--mute); cursor: pointer; }
.seg button.on { background: #fff; color: var(--green-d); box-shadow: 0 1px 2px rgba(24,32,28,.12); }
.seg button:focus-visible, .welcome .btn:focus-visible { outline: 3px solid #8FB8A4; outline-offset: 2px; }
.w-hero { display: flex; flex-direction: column; gap: 10px; }
.w-hello { margin: 6px 0 -4px; font: 800 clamp(52px, 15vw, 76px)/1 "Avenir Next", "Segoe UI", -apple-system, sans-serif; letter-spacing: -.02em; color: var(--green); }
.w-hero h1 { font-size: clamp(22px, 6vw, 28px); line-height: 1.35; }
.w-class { position: relative; margin: 6px 0 0; }
.w-class img { display: block; width: 100%; height: auto; aspect-ratio: 1100 / 820; object-fit: cover; object-position: center 20%; border-radius: 22px; background: #DCD6CE; }
.w-talk { position: relative; margin: -34px 10px 0; display: flex; flex-direction: column; gap: 6px; }
.w-talk .b { margin: 0; max-width: 88%; padding: 8px 12px 9px; border-radius: 14px; font-size: 14px; line-height: 1.45; background: rgba(255,255,255,.94); color: var(--ink); box-shadow: 0 2px 8px rgba(24,32,28,.12); }
.w-talk .b span { display: block; font-size: 11px; font-weight: 700; color: var(--mute); margin-bottom: 1px; }
.w-talk .b.s { align-self: flex-end; background: var(--green); color: #fff; }
.w-talk .b.s span { color: rgba(255,255,255,.75); }
.w-talk mark { background: #FFE08A; color: inherit; padding: 0 3px; border-radius: 4px; font-weight: 700; }
.w-sub { margin: 2px 0 0; }
.w-how h2, .w-what h2 { font-size: 18px; margin: 10px 0 10px; }
.w-how ol { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.w-how li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; }
.w-how li::before { content: counter(s); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--green-l); color: var(--green-d); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.w-how li b { font-size: 16px; } .w-how li span { color: var(--mute); font-size: 14px; }
.w-what ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 720px) { .w-talk { margin: -40px 18px 0; } .w-talk .b { font-size: 15px; } }
