:root {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #49301e;
  background: #dff6fa;
  font-synthesis: none;
  --orange: #ffb657;
  --orange-dark: #df7f21;
  --green: #48ad68;
  --cream: #fff9e8;
  --line: #ead9bb;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:focus-visible { outline: 4px solid #247aa2; outline-offset: 3px; }
button:disabled { opacity: .48; cursor: not-allowed; }
.primary { min-height: 64px; padding: 0 42px; border-radius: 28px; background: var(--orange); border: 4px solid #fff; box-shadow: 0 6px 0 var(--orange-dark), 0 10px 24px #3c2b1a26; font-size: 22px; font-weight: 900; }
.primary:hover { transform: translateY(-2px); }
.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--orange-dark); }
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 24px auto; background: var(--cream); border: 8px solid #fff; border-radius: 32px; box-shadow: 0 22px 60px #4776812b; overflow: hidden; }
header { height: 98px; padding: 12px 22px; display: flex; align-items: center; gap: 24px; border-bottom: 2px solid #f0e3cb; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; background: transparent; font-size: 25px; font-weight: 1000; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
nav { display: flex; flex: 1; justify-content: center; gap: 10px; }
.theme { display: flex; align-items: center; gap: 7px; min-height: 56px; padding: 6px 14px; background: #fffaf0; border: 2px solid #ebd9b9; border-radius: 15px; font-weight: 800; }
.theme img { width: 38px; height: 38px; object-fit: contain; }
.theme.active { border: 4px solid #2f9560; background: #f8fff6; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.stars { display: flex; align-items: center; gap: 5px; padding: 10px 14px; background: #fff; border: 2px solid var(--line); border-radius: 16px; font-size: 20px; font-weight: 900; }
.stars img { width: 28px; height: 28px; }
.parent-link { padding: 14px 16px; background: #fffaf1; border: 2px solid var(--line); border-radius: 15px; font-weight: 800; }
.learning-stage { display: grid; grid-template-columns: 1.18fr .92fr; gap: 18px; padding: 18px; min-height: 690px; }
.adventure { position: relative; overflow: hidden; border-radius: 28px; display: flex; align-items: center; flex-direction: column; padding-top: 55px; text-align: center; background: url("/images/backgrounds/home-forest.png") center/cover; }
.adventure::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, #57ba6d66); pointer-events: none; }
.bear-main { width: 210px; height: 210px; object-fit: contain; z-index: 1; filter: drop-shadow(0 10px 4px #40301f25); }
.adventure h1 { z-index: 1; margin: 6px 0 18px; font-size: clamp(27px, 3vw, 40px); text-shadow: 0 3px #fff; }
.adventure .primary { z-index: 1; min-width: 280px; }
.path-preview { z-index: 1; position: absolute; bottom: 55px; display: flex; align-items: center; gap: 55px; }
.path-preview::before { content: ""; position: absolute; height: 8px; left: 25px; right: 25px; background: #f8e0ad; border: 3px solid #fff; }
.path-dot { z-index: 1; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: #aab0b2; color: white; border: 6px solid white; box-shadow: 0 5px 0 #7c8182; font-weight: 900; font-size: 22px; }
.path-dot.active { background: #4db366; box-shadow: 0 5px 0 #208b48; }
.lesson-panel { border-radius: 28px; border: 2px solid #f0dfc1; padding: 22px; background: #fff9eb; box-shadow: inset 0 -4px #eadcc2; }
.lesson-title { display: flex; justify-content: space-between; align-items: center; }
.lesson-title h2 { margin: 0; font-size: 28px; }
.lesson-title b { background: #fff; border: 2px solid var(--line); border-radius: 13px; padding: 8px 13px; font-size: 18px; }
.progress { height: 16px; border-radius: 20px; border: 3px solid #f1e6d2; background: #fff; padding: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; min-width: 8px; border-radius: inherit; background: #65bc6c; transition: width .3s; }
.lesson-panel > .progress { margin: 14px 0; }
.lesson-standalone > .progress { margin: 18px 0; }
.prompt-card { display: flex; flex-direction: column; align-items: center; background: white; border: 2px solid #f1e3ca; border-radius: 24px; padding: 15px; box-shadow: 0 5px 0 #e5d2af; }
.prompt-card h2 { margin: 0 0 5px; font-size: 30px; }
.prompt-card h2 span { font-family: ui-rounded, sans-serif; }
.prompt-card > img { width: 190px; height: 190px; object-fit: contain; }
.sound { width: 58px; height: 58px; border-radius: 50%; background: var(--orange); font-size: 25px; box-shadow: 0 4px 0 #dc832d; }
.sound img { width: 28px; height: 28px; object-fit: contain; }
.prompt-card small { margin-top: 7px; font-size: 14px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; }
.choices button { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 22px; background: white; border: 4px solid transparent; box-shadow: 0 5px 0 #e6d5b9; transition: transform .15s; }
.choices button:hover { transform: translateY(-2px); border-color: #a9db91; }
.choices button.correct { border-color: #45b866; background: #effdec; animation: pop .45s; }
.choices button.wrong { border-color: #ef6b68; animation: shake .35s; }
.choices img { width: 95px; height: 95px; object-fit: contain; }
.choices b { font-size: 25px; }
.mobile-themes,.mobile-parent { display: none; }
.center-screen { width: min(560px, calc(100% - 28px)); min-height: calc(100vh - 40px); margin: 20px auto; padding: 28px; background: var(--cream); border: 7px solid #fff; border-radius: 34px; box-shadow: 0 20px 50px #47768132; text-align: center; }
.onboarding { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.onboarding > img { width: 220px; height: 220px; object-fit: contain; }
.onboarding h1 { font-size: 34px; margin: 2px 0 28px; }
.onboarding h2 { margin: 0 0 18px; }
.age-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; }
.age-grid button,.setting-row button { min-height: 60px; background: #fff; border: 3px solid #eadbbb; border-radius: 18px; font-weight: 900; }
.age-grid button.selected,.setting-row button.selected { background: #eaf9e4; border-color: #49ac68; }
.onboarding p { color: #7b6d5e; }
.onboarding .primary { width: 100%; margin-top: 18px; }
.screen-top,.map-top { display: flex; align-items: center; justify-content: space-between; }
.screen-top button,.map-top button { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.trace-screen { width: min(600px, calc(100% - 28px)); }
.trace-screen .progress { margin: 18px 0; }
.trace-screen h1 { margin: 12px 0 5px; }
.trace-screen p { color: #60776c; }
.trace-board { width: min(420px, 100%); aspect-ratio: 1; margin: 18px auto; position: relative; overflow: hidden; border: 4px solid #efad4e; border-radius: 28px; background: #fffdf6; box-shadow: 0 8px 18px #76552c24; touch-action: none; }
.grid-lines { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 49.7%, #efdfc7 50%, transparent 50.3%), linear-gradient(transparent 49.7%, #efdfc7 50%, transparent 50.3%); }
.grid-lines::after,.grid-lines::before { content:""; position:absolute; inset:0; background: linear-gradient(45deg, transparent 49.7%, #f2e7d6 50%, transparent 50.3%); }
.grid-lines::before { transform: rotate(90deg); }
.guide-char { position: absolute; inset: 0; display: grid; place-items: center; font: 270px/1 serif; color: #d8ebd2; }
.start-dot { position: absolute; width: 23px; height: 23px; top: 14%; left: 37%; border-radius: 50%; background: #ffb34d; border: 5px solid white; box-shadow: 0 0 0 5px #ffdcaa; z-index: 2; }
.trace-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; }
.trace-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.trace-actions > button:not(.primary),.reward > button:not(.primary) { min-height: 60px; border: 2px solid var(--line); background: white; border-radius: 22px; font-weight: 800; }
.reward { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.reward > img { width: 250px; height: 250px; object-fit: contain; }
.big-stars { display: flex; justify-content: center; gap: 12px; animation: pop .5s; }
.big-stars img { width: 58px; height: 58px; object-fit: contain; }
.reward h1 { font-size: 38px; }
.reward p { color: #775f43; }
.reward > button { width: 100%; margin-top: 14px; }
.map-screen { min-height: 100vh; padding: 20px 6vw 110px; background-position: center; background-size: cover; }
.map-top { max-width: 1100px; margin: auto; }
.map-top h1 { background: #fff9; padding: 8px 22px; border-radius: 20px; }
.map-path { width: min(900px, 90vw); margin: 30px auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 35px 55px; align-items: center; }
.node { position: relative; aspect-ratio: 1; border-radius: 50%; background: #fff; border: 7px solid #59b86c; box-shadow: 0 8px 0 #2f8b51; }
.node:nth-child(even) { transform: translateY(55px); }
.node:disabled { filter: grayscale(1); border-color: #aaa; box-shadow: 0 8px 0 #777; }
.node.current { animation: pulse 1.4s infinite; }
.node img { width: 80%; height: 80%; object-fit: contain; }
.node span { position: absolute; bottom: -15px; right: -8px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #ffb655; border: 4px solid white; font-weight: 900; }
.node i { position: absolute; top: -8px; right: -6px; width: 30px; height: 30px; border-radius: 50%; background: #33a757; color: white; }
.map-start { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); }
.parent-page { min-height: 100vh; padding: 25px; background: #dff6fa; }
.parent-inner { width: min(860px, 100%); margin: auto; }
.parent-inner .screen-top h1 { margin-right: auto; margin-left: 20px; }
.parent-inner section { margin: 18px 0; padding: 22px; background: #fffdf4; border: 3px solid #fff; border-radius: 25px; box-shadow: 0 5px 15px #47646b1a; }
.parent-inner section h2 { margin-top: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats-grid div { display: flex; flex-direction: column; align-items: center; padding: 18px 8px; background: #f2fbea; border-radius: 18px; }
.stats-grid b { font-size: 28px; color: #278d50; }
.stats-grid span { font-size: 14px; }
.setting-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.danger { padding: 14px 20px; border-radius: 14px; background: #fff0ef; color: #b43131; border: 2px solid #e97575; font-weight: 800; }
.confirm-reset { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.confirm-reset span { flex: 1; }
.confirm-reset button { padding: 12px 18px; border-radius: 12px; }
@keyframes pop { 50% { transform: scale(1.12); } }
@keyframes shake { 33% { transform: translateX(-8px); } 66% { transform: translateX(8px); } }
@keyframes pulse { 50% { transform: scale(1.07); } }
@media (max-width: 820px) {
  body { background: #70c873; }
  .app-shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; background: #70c873; box-shadow: none; overflow-y: auto; }
  header { height: 70px; position: relative; z-index: 4; border: 0; padding: 9px 16px; color: white; }
  .brand { font-size: 23px; text-shadow: 0 2px #477154; }
  .brand img { display: none; }
  nav,.parent-link { display: none; }
  .header-actions { margin-left: auto; }
  .stars { color: #49301e; padding: 8px 11px; border: 0; }
  .learning-stage { display: block; padding: 0; min-height: 510px; }
  .adventure { min-height: 510px; border-radius: 0; padding: 30px 15px 0; background-size: cover; overflow: visible; }
  .bear-main { width: 190px; height: 190px; }
  .adventure h1 { font-size: 30px; margin: 0 0 15px; }
  .adventure .primary { width: calc(100% - 22px); min-width: 0; }
  .path-preview { display: none; }
  .lesson-panel { display: none; }
  .mobile-themes { position: relative; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 0 14px; margin-top: -8px; }
  .mobile-themes button { min-height: 114px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: white; border: 4px solid white; border-radius: 18px; font-weight: 800; }
  .mobile-themes button.active { border-color: #21a85c; box-shadow: 0 0 0 3px white; }
  .mobile-themes img { width: 68px; height: 68px; object-fit: contain; }
  .mobile-parent { display: block; margin: 22px auto; padding: 11px 24px; background: white; border-radius: 22px; font-weight: 800; }
  .center-screen { min-height: 100vh; width: 100%; margin: 0; border: 0; border-radius: 0; }
  .map-path { grid-template-columns: repeat(2, 1fr); gap: 35px 70px; }
  .node:nth-child(even) { transform: translateY(35px); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 470px) {
  .center-screen { padding: 20px 15px; }
  .onboarding > img { width: 180px; height: 180px; }
  .onboarding h1 { font-size: 28px; }
  .age-grid { grid-template-columns: 1fr 1fr; }
  .trace-board { border-radius: 20px; }
  .guide-char { font-size: 62vw; }
  .trace-actions { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr 1fr; }
  .map-screen { padding-inline: 16px; }
  .map-path { gap: 35px 40px; }
}
