:root {
  --bg: #f4f0e6;
  --ink: #2c2416;
  --ink2: #6d5e4c;
  --ink3: #9a8874;
  --line: #eadfce;
  --card: #fffdf8;
  --orange: #e86a17;
  --orange-soft: #fff1e4;
  --green: #1f8a5b;
  --green-soft: #e7f6ee;
  --blue: #2a74d6;
  --blue-soft: #e7f1ff;
  --red: #c4473a;
  --red-soft: #ffecea;
  --yellow: #f4b942;
  --shadow: 0 8px 24px rgba(80, 50, 20, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { overscroll-behavior-x: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  padding: max(12px, env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}
body.has-dock { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
button, input { font-family: inherit; }
a { color: inherit; }
.wrap { max-width: 640px; margin: 0 auto; }
.top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.back, .ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 12px; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  text-decoration: none; font-weight: 800; font-size: 0.92rem;
}
h1 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.02em; }
.sub { color: var(--ink2); margin: 6px 0 12px; font-size: 0.95rem; }
.note {
  background: #fff; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 12px 14px; margin: 10px 0 14px; color: var(--ink2); font-size: 0.9rem;
}
.note b { color: var(--ink); }
.note summary { font-weight: 800; color: var(--ink); cursor: pointer; }
.note p + p { margin-top: 8px; }
.home-label { margin: 16px 0 8px; font-size: 0.82rem; font-weight: 800; color: var(--ink3); }
.who-card { padding: 10px 12px; }
.who-line { display: flex; gap: 8px; align-items: center; }
.who-line + .who-line,
.who-card .row,
.who-card .field { margin-top: 8px; }
.who-line .field { margin-top: 0; flex: 1; min-width: 0; width: auto; min-height: 44px; }
.who-line .btn { flex: none; min-width: 72px; min-height: 44px; }
.who-now { flex: 1; min-width: 0; font-size: 1rem; }
.who-now b { font-size: 1.15rem; }
.who-link {
  appearance: none; border: none; background: transparent; color: var(--blue);
  font-weight: 800; font-size: 0.92rem; padding: 6px 0; min-height: 36px;
}
.lesson {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.lesson:active { transform: scale(0.99); }
.badge {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-weight: 900; font-size: 1.2rem; flex-shrink: 0;
}
.lt { flex: 1; min-width: 0; }
.lt b { display: block; font-size: 1.05rem; }
.lt span { display: block; color: var(--ink2); font-size: 0.84rem; margin-top: 2px; }
.dots { display: flex; gap: 4px; margin-top: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: #e6dccb; display: block; }
.dots i.on { background: var(--green); }
.go { color: var(--ink3); font-weight: 900; }

.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.step {
  flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; color: var(--ink2);
  border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size: 0.86rem;
}
.step.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.step.done { border-color: #b7e2cb; background: var(--green-soft); color: var(--green); }
.card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.kicker { font-size: 0.78rem; font-weight: 800; color: var(--orange); letter-spacing: 0.04em; }
.en { font-size: 1.35rem; font-weight: 850; line-height: 1.35; margin: 6px 0; }
.zh { color: var(--ink2); font-size: 0.95rem; }
.who { font-size: 0.78rem; font-weight: 800; color: var(--blue); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn {
  appearance: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  min-height: 48px; padding: 10px 14px; border-radius: 14px; font-weight: 800;
  font-size: 1rem; flex: 1; min-width: 120px;
}
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--blue-soft); border-color: #c5dcff; color: #1d5eaf; }
.btn:disabled { opacity: 0.45; }
.btn.block { width: 100%; flex: none; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 8px 10px; text-align: left; flex: 1 1 30%; max-width: calc(33.33% - 6px);
}
.word b { display: block; font-size: 1.02rem; }
.word small { color: var(--ink2); }
.word.on { border-color: var(--orange); background: var(--orange-soft); }
.word.pass { border-color: #b7e2cb; background: var(--green-soft); }
.gloss {
  margin-top: 10px; background: var(--orange-soft); border-radius: 12px; padding: 10px 12px;
}
.progress { height: 8px; background: #efe6d8; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--green)); width: 0; }
.score-box {
  background: #fff; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 10px 12px 12px; margin-top: 8px;
}
.score { font-size: 2.4rem; font-weight: 900; text-align: center; color: var(--orange); line-height: 1.1; }
.mark-ok, .mark-bad { text-align: center; font-weight: 850; margin-top: 2px; }
.mark-ok { color: var(--green); }
.mark-bad { color: var(--red); }
.ok { color: var(--green); font-weight: 800; }
.bad { color: var(--red); font-weight: 800; display: block; width: auto; height: auto; }
.opt, .chip, .slot {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 12px; font-weight: 800; text-align: left; width: 100%; margin-top: 8px;
}
.opt.on, .chip.on { border-color: var(--blue); background: var(--blue-soft); color: #1d5eaf; }
.opt.good, .slot.good { border-color: var(--green); background: var(--green-soft); }
.opt.bad, .slot.bad { border-color: var(--red); background: var(--red-soft); }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { width: auto; margin-top: 0; }
.slot { display: inline-flex; min-width: 72px; width: auto; margin: 2px 4px; justify-content: center; vertical-align: middle; }
.sent { font-size: 1.12rem; font-weight: 750; line-height: 1.9; }
.field {
  width: 100%; min-height: 52px; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px; font-size: 1.15rem; font-weight: 750; margin-top: 8px; background: #fff;
}
textarea.field { font-family: inherit; line-height: 1.45; resize: vertical; }
.tray { min-height: 52px; border: 1.5px dashed #e0d3c0; border-radius: 14px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mini { font-size: 0.8rem; color: var(--ink3); margin-top: 8px; }
.pass-line { font-size: 0.92rem; }
.habitats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hab { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; min-height: 120px; }
.hab.on { border-color: var(--orange); background: var(--orange-soft); }
.hab h3 { font-size: 0.92rem; margin-bottom: 6px; }
.tag {
  display: inline-flex; margin: 3px; padding: 4px 8px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 0.82rem; font-weight: 800;
}
.emoji { font-size: 4.2rem; text-align: center; line-height: 1.1; margin: 6px 0; }
.pic { width: 100%; height: 200px; object-fit: cover; border-radius: 16px; display: block; background: #f3eadc; margin: 4px 0 10px; }
.pic.read-pic { height: 140px; }
.read-card .en { font-size: 1.45rem; }
.read-card.live, .card.live { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 106, 23, 0.28); }
.thumb { width: 100%; height: 88px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 4px; background: #f3eadc; }
.spell-pic { width: 72px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; background: #f3eadc; }
.mini-pic { width: 22px; height: 22px; object-fit: cover; border-radius: 6px; vertical-align: -5px; margin-right: 4px; }
.bar-row { display: grid; grid-template-columns: 2.6em 1fr 2em; gap: 8px; align-items: center; font-size: 0.82rem; font-weight: 800; margin-top: 6px; }
.bar { height: 8px; background: #f3eadc; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #f4b942, #1f8a5b); }
.phones { margin-top: 8px; text-align: center; line-height: 1.8; }
.phones span {
  display: inline-block; margin: 2px; padding: 2px 7px; border-radius: 8px;
  background: #f3eadc; font-weight: 800;
}
.phones span.low { background: var(--red-soft); color: var(--red); }
.shield {
  position: fixed; inset: 0; z-index: 80; background: rgba(44, 36, 22, 0.72);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.shield.on { display: flex; }
.shield .box {
  width: min(420px, 100%); background: #fff; border-radius: 20px; padding: 22px 16px; text-align: center;
}
.shield .btn { width: 100%; flex: none; min-width: 0; }
.shield p { font-size: 1.15rem; font-weight: 850; margin-bottom: 12px; }
.verse-title { font-weight: 850; margin: 4px 0 2px; }
.verse-gap { height: 10px; }
.song-verse { margin-top: 12px; }
.song-verse h3 { font-size: 0.82rem; color: var(--ink3); font-weight: 800; margin: 0 0 4px; }
.lyric-line { padding: 8px 10px; border-radius: 12px; margin-top: 4px; cursor: pointer; }
.line-btn {
  display: block; width: 100%; border: none; background: transparent; cursor: pointer;
  text-align: center; color: inherit;
}
.dock {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  width: min(640px, 100%); bottom: 0;
  background: rgba(255, 253, 248, 0.97); border-top: 1.5px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(80, 50, 20, 0.06);
}
.dock-msg { font-size: 0.8rem; font-weight: 750; color: var(--ink3); min-height: 1.2em; }
.dock .row { flex-wrap: nowrap; margin-top: 8px; }
.dock .btn { min-height: 44px; min-width: 0; padding: 8px 6px; font-size: 0.95rem; line-height: 1.2; white-space: normal; }
.dock .score-box { max-height: 38vh; overflow: auto; margin-top: 0; margin-bottom: 4px; }
.dock .stop { display: none; }
.dock.busy .stop { display: block; }
.dock.busy .dock-act { display: none; }
.lyric-line.on { background: var(--orange-soft); }
.lyric-line.pass { box-shadow: inset 3px 0 0 var(--green); }
.lyric { padding: 7px 0; border-top: 1px solid #f3eadc; }
.lyric-en { font-size: 1.08rem; font-weight: 700; line-height: 1.7; }
.linkword {
  border: none; background: transparent; border-bottom: 1.5px dashed #e7b089;
  color: inherit; font: inherit; font-weight: 800; padding: 0 1px; border-radius: 4px;
}
.linkword.marked { background: #ffe1c4; border-bottom-color: var(--orange); }
.line-gloss { margin: 6px 0 0; }
.talk { background: #fff8e8; border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 4px; }
.pager { color: var(--ink3); font-size: 0.82rem; font-weight: 800; }
