:root {
  --ink: #243826;
  --muted: #515e4c;
  --paper: #fff9ec;
  --cream: #fffcf4;
  --green: #245c43;
  --lime: #e4efd3;
  --line: #dddccc;
  --gold: #ffcd62;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; }
button { font: inherit; color: inherit; cursor: pointer; min-height: 44px; touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #9d4d11; outline-offset: 4px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5.4vw, 3.5rem); line-height: 1.14; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
p { line-height: 1.65; }
.frame { width: min(1100px, 100% - 48px); margin-inline: auto; }
.header { border-bottom: 1px solid var(--line); background: var(--cream); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, nav button, .link, .back { border: 0; background: transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; font-weight: 850; font-size: 1.22rem; white-space: nowrap; }
.brand span { background: #285842; color: #fff8e7; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 1.4rem; }
nav { display: flex; gap: 7px; }
nav button { border-radius: 12px; padding: 7px 15px; font-weight: 720; white-space: nowrap; }
nav button[aria-current="page"] { background: var(--lime); }
.count { padding: 2px 6px; border-radius: 99px; margin-left: 5px; background: var(--gold); font-size: .875rem; }
main { min-height: 64vh; padding-block: 32px; }
.hero { position: relative; display: grid; grid-template-columns: 1.12fr 1fr; gap: 12px; min-height: 315px; background: #23523c; color: #fffaf0; border-radius: 28px; overflow: hidden; }
.hero-copy { padding: 42px 0 42px 42px; align-self: center; z-index: 1; }
.hero-copy p { margin: 14px 0 22px; color: #e7efd7; }
.eyebrow { font-size: .9rem; font-weight: 750; letter-spacing: .08em; margin-bottom: 10px; }
.hero-art { position: relative; isolation: isolate; overflow: hidden; min-height: 220px; }
.hero-art::before, .hero-art::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.hero-art::before { left: -4%; right: -12%; height: 90%; bottom: -52%; background: #376c4d; transform: rotate(-11deg); }
.hero-art::after { width: 80%; height: 86%; right: -10%; bottom: -58%; background: #568260; transform: rotate(12deg); }
.letter { position: absolute; display: grid; place-items: center; width: clamp(68px, 11vw, 123px); aspect-ratio: 1; border-radius: 22%; font-weight: 850; font-size: clamp(2.4rem, 6vw, 4.6rem); color: #263d2b; box-shadow: 0 8px 0 #12372460; }
.letter.sun { top: 13%; left: 53%; transform: rotate(13deg); background: #ffcc67; }
.letter.tree { top: 37%; left: 25%; transform: rotate(-12deg); background: #e4f0b9; }
.letter.water { top: 52%; left: 61%; transform: rotate(6deg); background: #b9e8ee; }
.spark { position: absolute; font-size: 1.8rem; color: #ffe5a3; }
.spark.one { left: 30%; top: 14%; }
.spark.two { left: 85%; top: 28%; }
.spark.three { left: 14%; top: 67%; font-size: 1rem; }
.primary, .secondary { border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 780; min-height: 50px; }
.primary { color: white; background: var(--green); box-shadow: 0 3px 0 #183f2e; }
.primary.gold { color: #352b18; background: var(--gold); box-shadow: 0 3px 0 #b58025; }
.primary:hover { filter: brightness(1.09); }
.secondary { background: var(--lime); border: 1px solid #bfd0b0; }
.secondary:hover, .lesson-btn:hover, .char-btn:hover { background: #dcebcf; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 7px 18px; margin: 32px 0 14px; }
.muted { color: var(--muted); }
.unit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.unit-tile { text-align: left; padding: 18px; border: 1px solid #cecfc0; border-radius: 20px; min-height: 148px; display: grid; align-content: start; gap: 8px; box-shadow: 0 3px 0 #27372718; background: #f3efde; }
.unit-tile:nth-child(4n + 1) { background: #e8efda; }
.unit-tile:nth-child(4n + 2) { background: #fcf0d1; }
.unit-tile:nth-child(4n + 3) { background: #e3eff1; }
.unit-tile:nth-child(4n + 4) { background: #f7e7dd; }
.unit-tile:hover { border-color: var(--green); }
.unit-tile .emoji { font-size: 1.65rem; }
.unit-tile strong { font-size: 1.14rem; }
.unit-tile small { font-size: .875rem; }
.bar { height: 8px; border-radius: 20px; background: #20341424; overflow: hidden; }
.bar span { display: block; background: var(--green); border-radius: 20px; height: 100%; }
.panel { margin-top: 20px; background: var(--cream); border: 1px solid var(--line); border-radius: 23px; padding: clamp(16px, 3vw, 32px); }
.subhead { display: grid; gap: 10px; }
.back { justify-self: start; padding: 0 11px; border-radius: 12px; background: var(--lime); font-weight: 700; }
.lesson-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesson-btn { text-align: left; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 16px; background: #f3f5e6; padding: 15px; font-weight: 720; }
.lesson-btn small { color: var(--muted); font-weight: 520; font-size: .9rem; }
.char-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.char-btn { min-width: 57px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 12px; background: #f7f2e5; font-size: 1.65rem; }
.char-btn small { display: block; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.space { margin-top: 16px; }
.study-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.study { text-align: center; max-width: 800px; margin-inline: auto; }
.study-card { min-height: 192px; display: grid; justify-items: center; align-content: center; gap: 8px; }
.glyph { font-size: clamp(3.8rem, 13vw, 7rem); font-weight: 650; line-height: 1.06; }
.prompt { font-size: clamp(2.1rem, 8vw, 4rem); font-weight: 750; }
.pin { font-size: 1.45rem; }
.options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin: 12px 0; }
.choice { background: #f5f2e3; border: 2px solid #e0ddcb; border-radius: 16px; min-height: 74px; font-size: clamp(1.35rem, 5vw, 2.6rem); font-weight: 720; }
.choice:hover:not(:disabled) { border-color: var(--green); }
.choice.correct { border-color: #3a714a; background: #e4f3d9; }
.choice.wrong { border-color: #ab593e; background: #fbe4da; }
.feedback { min-height: 2rem; margin-block: 11px; font-weight: 750; }
.center { justify-content: center; }
.score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { border-radius: 16px; background: #eef2df; padding: 12px; }
.stat strong { display: block; font-size: 1.8rem; }
.stat span { color: var(--muted); }
.practice-square { position: relative; width: min(100%, 325px); aspect-ratio: 1; margin: 12px auto; background: #fffaf0; border: 2px solid #b06552; }
.practice-square::before, .practice-square::after { content: ""; position: absolute; pointer-events: none; }
.practice-square::before { border-top: 1px dashed #b06552; left: 0; right: 0; top: 50%; }
.practice-square::after { border-left: 1px dashed #b06552; top: 0; bottom: 0; left: 50%; }
.guide { position: absolute; inset: 0; display: grid; place-items: center; color: #a75543; opacity: .19; font: 9rem "Kaiti SC", KaiTi, STKaiti, serif; pointer-events: none; }
canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; touch-action: none; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-block: 12px max(12px, env(safe-area-inset-bottom)); font-size: .9rem; color: var(--muted); }
.link { text-decoration: underline; padding-inline: 6px; }
dialog { width: min(540px, 100% - 40px); border: 1px solid var(--line); border-radius: 23px; padding: 24px; background: var(--cream); color: var(--ink); }
dialog::backdrop { background: #14261899; }
dialog li { margin-bottom: 7px; }
dialog form { margin-top: 18px; }
@media (max-width: 800px) {
  .unit-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-copy { padding-left: 25px; }
}
@media (max-width: 510px) {
  .frame { width: calc(100% - 24px); }
  .topbar { min-height: 64px; }
  .brand { font-size: 1.04rem; gap: 5px; }
  .brand span { width: 32px; height: 32px; font-size: 1.12rem; }
  nav { gap: 1px; }
  nav button { padding-inline: 5px; font-size: .92rem; }
  main { padding-block: 16px; }
  .hero { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { padding: 23px 20px 0; }
  .hero-art { min-height: 165px; }
  .letter { width: 65px; }
  .letter.sun { top: 10%; }
  .options, .score, .lesson-grid { grid-template-columns: 1fr 1fr; }
}
