/* 全站样式：大字号、圆角、马卡龙低多边形氛围，适合 7-8 岁孩子。 */
:root {
  --ink: #24304a;
  --muted: #69738a;
  --panel: rgba(255,255,255,.88);
  --primary: #ff6f91;
  --blue: #5dc9ff;
  --green: #5be7a9;
  --yellow: #ffd166;
  --shadow: 0 18px 50px rgba(20, 40, 80, .18);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; overflow: hidden; font-family: "站酷快乐体", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: #bfeaff; }
body.eye-care-mode { background: #d8f4df; }
body.eye-care-mode #gameCanvas { filter: sepia(.18) saturate(.78) brightness(.94) contrast(.92); }
body.eye-care-mode .topbar, body.eye-care-mode .hud div, body.eye-care-mode .panel, body.eye-care-mode .dock-btn { background: rgba(255, 253, 232, .9); }
body.eye-care-mode .level-up-text, body.eye-care-mode .combo-text { filter: saturate(.78) brightness(.96); }
button, input, select { font: inherit; }
button { border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 900; cursor: pointer; background: #fff; color: var(--ink); box-shadow: 0 8px 18px rgba(0,0,0,.10); min-height: 46px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: linear-gradient(135deg, var(--primary), #ff9671); color: white; }
#gameCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; touch-action: none; }
.topbar, .hud, .panel, .touch-controls, .utility-dock { position: fixed; z-index: 5; }
.topbar { top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.topbar strong { display: block; font-size: 22px; }
.topbar span { color: var(--muted); }
.icon-btn { background: #25304a; color: white; }
.hud { top: 98px; left: 16px; display: grid; grid-template-columns: repeat(2, minmax(160px, auto)); gap: 10px; }
.hud div { background: rgba(255,255,255,.9); border-radius: 18px; padding: 10px 14px; box-shadow: 0 8px 20px rgba(0,0,0,.09); }
.challenge-hud { display: inline-block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #168fd3; }
.eye-care-hud { color: #0b8f63; }
.eye-care-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at center, rgba(255,255,255,.96), rgba(207,242,220,.94)); backdrop-filter: blur(12px); }
.eye-care-card { width: min(620px, 100%); text-align: center; background: #fffdf0; border: 4px solid rgba(91,231,169,.45); border-radius: 36px; padding: 30px; box-shadow: 0 28px 90px rgba(18,62,55,.22); }
.eye-care-icon { font-size: 56px; display: block; }
.eye-care-card h2 { font-size: clamp(30px, 6vw, 48px); margin: 8px 0; color: #0b8f63; }
.eye-care-card p { font-size: 22px; line-height: 1.7; }
.eye-care-card strong { display: block; margin: 12px auto; font-size: clamp(38px, 8vw, 70px); color: #ef476f; }
.eye-care-card small { display: block; color: var(--muted); margin-bottom: 14px; }
.panel { background: var(--panel); box-shadow: var(--shadow); border-radius: 28px; padding: 24px; backdrop-filter: blur(10px); }
.landing-panel { left: 50%; top: 52%; transform: translate(-50%, -50%); width: min(920px, calc(100vw - 28px)); max-height: 78vh; overflow: auto; }
.play-panel { right: 18px; bottom: 18px; width: min(420px, calc(100vw - 36px)); }
.mission-panel ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.interaction-prompt { position: fixed; left: 50%; bottom: 132px; transform: translateX(-50%); z-index: 9; background: rgba(37,48,74,.9); color: #fff; border-radius: 999px; padding: 12px 18px; font-weight: 900; box-shadow: var(--shadow); pointer-events: none; }
.combo-text { position: fixed; left: 50%; top: 24%; transform: translateX(-50%); z-index: 12; background: linear-gradient(135deg, #ffd166, #ff6f91); color: white; border-radius: 28px; padding: 18px 26px; font-size: 28px; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.15); box-shadow: var(--shadow); pointer-events: none; }
.combo-text.pop { animation: popCombo 1.6s ease both; }
.level-up-text { position: fixed; left: 50%; top: 34%; transform: translateX(-50%); z-index: 13; min-width: min(560px, calc(100vw - 28px)); text-align: center; background: linear-gradient(135deg, #5dc9ff, #5be7a9 55%, #ffd166); color: white; border: 4px solid rgba(255,255,255,.92); border-radius: 34px; padding: 20px 28px; font-size: clamp(24px, 5vw, 42px); font-weight: 900; text-shadow: 0 3px 10px rgba(0,0,0,.18); box-shadow: 0 24px 70px rgba(20,40,80,.28); pointer-events: none; }
.level-up-text.burst { animation: levelUpBurst 2.2s cubic-bezier(.16,1,.3,1) both; }
@keyframes levelUpBurst { 0% { opacity: 0; transform: translateX(-50%) translateY(34px) scale(.52) rotate(-3deg); filter: saturate(.6); } 16% { opacity: 1; transform: translateX(-50%) translateY(-12px) scale(1.12) rotate(2deg); filter: saturate(1.35); } 42% { transform: translateX(-50%) translateY(0) scale(1); } 78% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.02); } 100% { opacity: 0; transform: translateX(-50%) translateY(-46px) scale(.88); } }
.scene-hovering { cursor: pointer; }
.scene-theme-changing #gameCanvas { animation: sceneThemeFlash .75s ease both; }
.zone-scene-banner { position: fixed; left: 50%; top: 118px; transform: translateX(-50%) translateY(-18px) scale(.96); z-index: 14; width: min(620px, calc(100vw - 32px)); padding: 16px 20px; border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(238,248,255,.9)); border: 3px solid rgba(255,255,255,.82); box-shadow: 0 24px 70px rgba(20,40,80,.24); opacity: 0; pointer-events: none; backdrop-filter: blur(12px); }
.zone-scene-banner.show { animation: zoneBannerIn 3.1s cubic-bezier(.16,1,.3,1) both; }
.zone-scene-banner .theme-pill { display: inline-block; margin-bottom: 6px; padding: 5px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--blue), var(--green)); color: white; font-weight: 900; }
.zone-scene-banner strong { display: block; font-size: clamp(22px, 4vw, 34px); color: var(--ink); }
.zone-scene-banner p { margin: 6px 0; font-weight: 900; line-height: 1.5; color: #3f4a63; }
.zone-scene-banner small { color: #ef476f; font-weight: 900; }
@keyframes zoneBannerIn { 0% { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(.9); filter: saturate(.7); } 14% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.03); filter: saturate(1.25); } 72% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-22px) scale(.96); } }
@keyframes sceneThemeFlash { 0% { filter: saturate(.75) brightness(.96); } 45% { filter: saturate(1.28) brightness(1.08); } 100% { filter: none; } }
@keyframes popCombo { 0% { transform: translateX(-50%) scale(.65); opacity: 0; } 18% { transform: translateX(-50%) scale(1.12); opacity: 1; } 72% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) translateY(-28px) scale(.92); opacity: 0; } }
.utility-dock { right: 18px; top: 190px; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 12px; pointer-events: none; z-index: 7; }
.dock-rail { display: grid; gap: 10px; pointer-events: auto; }
.dock-btn { width: 76px; min-height: 70px; padding: 10px 8px; border-radius: 22px; display: grid; place-items: center; gap: 2px; background: rgba(255,255,255,.9); border: 1px solid rgba(93,201,255,.35); }
.dock-btn span { display: block; font-size: 13px; }
.dock-btn[aria-expanded="true"] { background: linear-gradient(135deg, var(--blue), var(--green)); color: white; }
.drawer-panel { position: relative; width: min(360px, calc(100vw - 128px)); max-height: min(68vh, 520px); overflow: auto; padding: 18px; pointer-events: auto; transform: translateX(18px) scale(.98); opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility .18s ease; }
.drawer-panel.open { transform: translateX(0) scale(1); opacity: 1; visibility: visible; }
.drawer-panel:not(.open) { pointer-events: none; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.drawer-header h2 { margin: 0; }
.drawer-close { min-height: 38px; width: 38px; padding: 0; border-radius: 14px; background: #eef8ff; }
.ai-panel-content label { display: block; margin: 10px 0; font-weight: 900; }
.ai-panel-content select { width: 100%; border: 2px solid #dde8f7; border-radius: 14px; padding: 10px; margin-top: 6px; background: #fff; }
.ai-panel-content p, .drawer-panel p { line-height: 1.55; }
.auto-ai-status { background: #eef8ff; border-radius: 16px; padding: 10px 12px; font-weight: 900; color: #168fd3; }
.result-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 36px)); text-align: center; }
.eyebrow { margin: 0 0 8px; color: #ef476f; font-weight: 900; letter-spacing: .08em; }
h1 { margin: 0 0 10px; font-size: clamp(34px, 6vw, 58px); }
h2 { margin-top: 0; }
.curriculum-selector { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin: 14px 0 16px; padding: 12px; border-radius: 22px; background: linear-gradient(135deg, rgba(238,248,255,.95), rgba(255,244,214,.9)); border: 1px solid rgba(93,201,255,.35); }
.curriculum-selector label { display: grid; gap: 5px; font-size: 13px; font-weight: 900; color: #3f4a63; }
.curriculum-selector select { width: 100%; border: 2px solid #dde8f7; border-radius: 14px; padding: 9px 10px; background: #fff; color: var(--ink); font-weight: 900; }
.zone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.zone-card { border-radius: 22px; text-align: left; min-height: 190px; display: grid; gap: 6px; align-content: start; background: linear-gradient(135deg, #ffffff, #fff4d6); border: 1px solid rgba(255,209,102,.45); }
.zone-card.loading { filter: grayscale(.15); opacity: .72; }
.zone-card .zone-emoji, .zone-card > span:first-child { font-size: 38px; }
.zone-card strong { display: block; font-size: 23px; }
.zone-card small { color: var(--muted); font-size: 16px; }
.zone-mode-badge { display: inline-block; align-self: start; padding: 3px 10px; border-radius: 999px; background: linear-gradient(135deg, #ff9671, #ffd166); color: #fff; font-size: 12px; font-weight: 900; letter-spacing: .5px; box-shadow: 0 2px 6px rgba(255,150,113,.35); }
.zone-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 14px; background: rgba(255,255,255,.72); }
.zone-meta em { font-style: normal; color: #ef476f; font-weight: 900; }
.zone-route, .zone-ability, .zone-reward { font-size: 13px; line-height: 1.35; color: #3f4a63; }
.zone-personalized-tip { padding: 7px 9px; border-radius: 14px; background: linear-gradient(135deg, rgba(91,231,169,.16), rgba(93,201,255,.14)); color: #25304a; font-size: 13px; line-height: 1.35; font-weight: 800; }
.zone-ai-thinking { display: grid; gap: 3px; padding: 6px 8px; border-radius: 12px; background: rgba(255,255,255,.66); color: #506070; font-size: 12px; line-height: 1.28; }
.zone-ai-thinking span { display: block; }
.zone-reward { color: #0b8f63; font-weight: 900; }
.level-list { display: flex; gap: 6px; flex-wrap: wrap; }
.level-chip { display: inline-grid; gap: 1px; min-width: 58px; padding: 5px 7px; border-radius: 12px; background: linear-gradient(135deg, #eef8ff, #ffffff); border: 1px solid rgba(93,201,255,.35); font-size: 12px; color: #168fd3; }
.level-chip b { color: var(--ink); }
.skin-row, .settings-row, .action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.settings-row { justify-content: space-between; color: var(--muted); }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(28, 37, 65, .42); padding: 18px; }
.modal-card { width: min(720px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 30px; padding: 28px; box-shadow: var(--shadow); }
.question-text { font-size: 25px; line-height: 1.65; font-weight: 900; }
.question-visual { margin: 14px 0 18px; padding: 12px; border-radius: 22px; background: linear-gradient(135deg, #f7fcff, #fff8e8); border: 2px solid rgba(93, 201, 255, .28); text-align: center; }
.question-visual svg, .question-visual img { width: min(100%, 560px); max-height: 300px; border-radius: 18px; display: block; margin: 0 auto; }
.question-visual figcaption { margin-top: 8px; color: var(--muted); font-weight: 800; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0; }
.option-btn { min-height: 64px; font-size: 22px; background: #eef8ff; display: flex; align-items: center; gap: 10px; padding: 8px 14px; text-align: left; }
.option-btn .opt-tts { flex: none; font-size: 22px; padding: 4px 8px; border-radius: 999px; background: #fff4d6; cursor: pointer; user-select: none; line-height: 1; }
.option-btn .opt-tts:hover, .option-btn .opt-tts:focus { background: #ffe08a; outline: 2px solid #f4a261; }
.option-btn .opt-label { flex: none; font-weight: 700; color: #4a5578; min-width: 24px; }
.option-btn .opt-text { flex: 1 1 auto; }
.tiny-btn { background: #fff4d6; }
.quiz-audio-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.quiz-audio-bar .replay-btn { font-size: 16px; padding: 6px 14px; background: #5dc9ff; color: #062035; font-weight: 700; }
.quiz-audio-bar .replay-btn:hover, .quiz-audio-bar .replay-btn:focus { background: #7ed6ff; }
.quiz-audio-tip { color: #4a5578; font-size: 13px; }
/* 答题时锁定视觉暗示：canvas 半透明，家长/孩子一眼看到"专注做题模式"。 */
#gameCanvas.answering-lock { filter: brightness(0.9) saturate(0.9); transition: filter .18s ease; }
.hint, .feedback, .pinyin { color: #ef476f; font-weight: 900; }
.touch-controls { left: 18px; right: 18px; bottom: 18px; display: none; align-items: flex-end; justify-content: space-between; pointer-events: none; touch-action: none; }
.joystick-base { width: 118px; height: 118px; border-radius: 50%; background: rgba(255,255,255,.72); border: 4px solid rgba(37,48,74,.22); box-shadow: var(--shadow); position: relative; pointer-events: auto; touch-action: none; }
.joystick-knob { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--green)); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); box-shadow: 0 8px 18px rgba(0,0,0,.16); }
.mobile-actions { display: grid; gap: 10px; pointer-events: auto; }
.mobile-actions button { min-width: 112px; }
.parent-body { overflow: auto; background: linear-gradient(135deg, #eaf7ff, #fff7e8); }
.parent-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 50px; }
.parent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.back-link { color: white; background: #25304a; border-radius: 999px; padding: 12px 18px; text-decoration: none; font-weight: 900; }
.parent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.parent-card { background: rgba(255,255,255,.92); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.parent-card.wide { grid-column: 1 / -1; }
.lock-card { width: min(520px, 100%); margin: 40px auto; }
.lock-card input { width: 100%; border: 2px solid #dde8f7; border-radius: 18px; padding: 14px; margin: 8px 0; font-size: 22px; box-sizing: border-box; }
.lock-card label { display: block; margin: 14px 0 6px; font-weight: 700; color: #25304a; }
.lock-card h2 { margin: 6px 0 12px; }
.lock-card .subtitle { color: #6b7ba0; margin: 0 0 4px; font-size: 14px; }
.lock-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.lock-actions button { flex: 1; min-width: 140px; }
button.ghost { background: rgba(255,111,145,.14); color: #ef476f; border: 2px dashed #ef476f; }
button.ghost:hover { background: rgba(255,111,145,.24); }
.parent-account-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.account-btn { background: #fff; border: 2px solid #dde8f7; border-radius: 16px; padding: 14px 10px; font-size: 15px; font-weight: 800; color: #25304a; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; transition: all .2s; }
.account-btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.account-btn.selected { border-color: var(--primary); background: linear-gradient(135deg, rgba(255,111,145,.15), rgba(255,150,113,.15)); box-shadow: 0 4px 12px rgba(255,111,145,.25); }
.account-btn small { font-weight: 400; color: #6b7ba0; font-size: 11px; }
.parent-header .subtitle { margin: 4px 0 0; color: rgba(255,255,255,.85); font-size: 14px; }
.parent-header .subtitle a { color: #ffe066; text-decoration: underline; }
.overview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.overview-grid div { background: #f7fbff; border-radius: 18px; padding: 14px; }
.overview-grid span { color: var(--muted); display: block; }
.overview-grid strong { font-size: 24px; }
.wrong-item { border-left: 6px solid var(--primary); background: #fff8fb; border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.eye-care-settings { background: linear-gradient(135deg, rgba(255,253,240,.96), rgba(235,255,243,.94)); border: 2px solid rgba(91,231,169,.28); }
.setting-line { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 12px; margin: 8px 0; border-radius: 18px; background: #f7fbff; font-weight: 900; }
.setting-line label { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setting-line input[type="number"] { width: 92px; border: 2px solid #cfe8d8; border-radius: 14px; padding: 8px 10px; font-weight: 900; }
.eye-care-settings .feedback { color: #0b8f63; background: rgba(91,231,169,.12); border-radius: 16px; padding: 12px; }
.empty { color: var(--muted); padding: 20px; background: #f7fbff; border-radius: 18px; }
@media (max-width: 900px) {
  body { font-size: 16px; }
  .topbar { top: 8px; left: 8px; right: 8px; padding: 10px 12px; border-radius: 18px; }
  .topbar strong { font-size: 18px; }
  .topbar span { display: none; }
  .icon-btn { padding: 10px 12px; }
  .hud { top: 70px; left: 8px; right: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 13px; }
  .hud div { padding: 7px 8px; border-radius: 12px; }
  .landing-panel { top: 50%; width: calc(100vw - 18px); max-height: 74vh; padding: 18px; }
  .curriculum-selector { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .zone-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .zone-card { min-height: 102px; padding: 12px; }
  .zone-card strong { font-size: 19px; }
  .zone-card small { font-size: 14px; }
  .play-panel { right: 8px; bottom: calc(150px + env(safe-area-inset-bottom)); width: min(330px, calc(100vw - 16px)); padding: 14px; font-size: 14px; }
  .utility-dock { right: 8px; top: auto; bottom: calc(142px + env(safe-area-inset-bottom)); align-items: flex-end; }
  .dock-rail { gap: 8px; }
  .dock-btn { width: 58px; min-height: 56px; border-radius: 18px; font-size: 18px; }
  .dock-btn span { font-size: 11px; }
  .drawer-panel { width: min(320px, calc(100vw - 82px)); max-height: 44vh; padding: 14px; }
  .interaction-prompt { bottom: 124px; max-width: calc(100vw - 24px); text-align: center; font-size: 14px; }
  .combo-text { top: 18%; font-size: 22px; padding: 14px 20px; }
  .level-up-text { top: 28%; padding: 16px 18px; }
  .touch-controls { display: flex; z-index: 8; bottom: env(safe-area-inset-bottom); }
  .modal-card { padding: 20px; border-radius: 24px; }
  .question-text { font-size: 21px; }
  .option-grid { grid-template-columns: 1fr; }
  .option-btn { min-height: 56px; font-size: 20px; }
  .parent-grid, .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 32px; }
  .zone-grid { grid-template-columns: 1fr; }
  .play-panel { left: 8px; width: auto; }
  .utility-dock { bottom: calc(126px + env(safe-area-inset-bottom)); }
  .drawer-panel { width: min(300px, calc(100vw - 74px)); }
  .joystick-base { width: 104px; height: 104px; }
  .joystick-knob { width: 48px; height: 48px; }
}
