*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --blue: #5B9BD5; --pink: #B8E0F6; --blue-light: #E3F2FD; --pink-light: #E8F4FE;
  --ice: #81D4FA; --frost: #E1F5FE; --snow: #F5FBFF;
  --star: #FFD700; --gem: #7C4DFF; --food: #FF8F00; --bg: #E3F2FD; --card: #FFFFFF;
  --text: #1565C0; --text-light: #64B5F6; --shadow: 0 2px 14px rgba(91,155,213,.18);
  --shadow-hover: 0 4px 24px rgba(91,155,213,.28); --radius: 24px; --radius-sm: 14px;
  --green: #4FC3F7; --orange: #FF9800; --purple: #8E24AA;
  --elsa-blue: #29B6F6; --elsa-deep: #0288D1; --elsa-purple: #7C4DFF;
  --elsa-glow: rgba(124,77,255,.15);
}
html { font-size: 16px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #E3F2FD 0%, #E8F5FE 30%, #F0F8FF 100%);
  color: var(--text); max-width: 500px; margin: 0 auto;
  min-height: 100vh; overflow-x: hidden; user-select: none; -webkit-user-select: none;
  position: relative;
}
/* 雪花飘落背景 */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 10%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,.6), transparent),
    radial-gradient(2px 2px at 80% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 30% 50%, rgba(255,255,255,.5), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 15% 70%, rgba(255,255,255,.5), transparent),
    radial-gradient(2px 2px at 50% 80%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,.4), transparent);
  background-size: 300px 300px;
  animation: snowfall 30s linear infinite;
  opacity: 0.6;
}
@keyframes snowfall {
  0% { background-position: 0 0; } 100% { background-position: 300px 300px; }
}
body > * { position: relative; z-index: 1; }
body.daily-locked .bottom-nav { pointer-events: none; opacity: .45; }

/* ====== Header ====== */
.header {
  background: linear-gradient(135deg, #29B6F6, #5B9BD5, #7C4DFF); color: #fff;
  padding: 18px 20px 16px; border-radius: 0 0 32px 32px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 6px 24px rgba(124,77,255,.25);
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-row { display: flex; align-items: center; justify-content: space-between; }
.header h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: 2px; }
.header-date { font-size: .8rem; opacity: .9; margin-top: 4px; }
.header-right { display: flex; gap: 8px; }
.header-badge {
  background: rgba(255,255,255,.3); backdrop-filter: blur(6px); border-radius: 14px;
  padding: 6px 12px; font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: 4px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.3);
}
.header-badge:active { transform: scale(.95); }

/* ====== 屏幕时间条 ====== */
.screen-time-bar {
  margin: 8px 16px; background: var(--card); border-radius: 14px; padding: 8px 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px;
}
.st-icon { font-size: 1.3rem; }
.st-text { font-size: .78rem; font-weight: 600; color: var(--text-light); flex: 1; }
.st-bar { width: 80px; height: 8px; background: #E8E8E8; border-radius: 4px; overflow: hidden; }
.st-bar-fill { height: 100%; border-radius: 4px; transition: width .5s; }
.st-bar-fill.ok { background: var(--green); }
.st-bar-fill.warn { background: var(--orange); }
.st-bar-fill.danger { background: #EF5350; }

/* ====== Pet Zone (ice-fantasy theme) ====== */
.pet-zone {
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(225,245,254,.9)); margin: 8px 16px; border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
  border: 2px solid rgba(124,77,255,.1);
}
.pet-emoji {
  font-size: 3rem; cursor: pointer; transition: transform .3s ease; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--frost); flex-shrink: 0;
  box-shadow: 0 0 12px var(--elsa-glow);
}
.pet-emoji:active { transform: scale(.85) rotate(10deg); }
.pet-bubble {
  position: absolute; top: -8px; right: 12px; background: var(--elsa-purple); color: #fff; border-radius: 12px;
  padding: 4px 10px; font-size: .72rem; font-weight: 700; opacity: 0; transition: opacity .3s; pointer-events: none;
  box-shadow: 0 2px 8px rgba(124,77,255,.3);
}
.pet-bubble.show { opacity: 1; }
.pet-info { flex: 1; }
.pet-name { font-weight: 700; font-size: 1rem; color: var(--elsa-deep); }
.pet-level { font-size: .78rem; color: var(--text-light); }
.pet-bar { height: 8px; background: #E0E0E0; border-radius: 4px; margin-top: 6px; overflow: hidden; }
.pet-bar-fill { height: 100%; background: linear-gradient(90deg, #29B6F6, #7C4DFF); border-radius: 4px; transition: width .5s; }

/* ====== Week Track ====== */
.week-track { margin: 0 16px 8px; background: var(--card); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); display: flex; justify-content: space-between; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 36px; }
.week-day-label { font-size: .65rem; color: var(--text-light); }
.week-day-circle { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }
.week-day-circle.done { background: var(--elsa-blue); color: #fff; }
.week-day-circle.today { background: var(--elsa-purple); color: #fff; box-shadow: 0 0 0 3px rgba(124,77,255,.4); }
.week-day-circle.future { background: #E0E0E0; color: #BBB; }

/* ====== Points Bar ====== */
.points-bar { margin: 0 16px 8px; background: var(--card); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); display: flex; justify-content: space-around; }
.point-item { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.point-icon { font-size: 1.3rem; }

/* ====== Task Cards (bigger icons, bigger buttons) ====== */
.tasks-grid { margin: 0 16px 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.task-card {
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(225,245,254,.85)); border-radius: var(--radius); padding: 16px 8px 12px; text-align: center; box-shadow: var(--shadow);
  cursor: pointer; transition: all .2s; position: relative; border: 2px solid rgba(124,77,255,.08);
}
.task-card:active { transform: scale(.95); box-shadow: var(--shadow-hover); }
.task-card.done-card { border-color: var(--elsa-blue); box-shadow: 0 0 12px rgba(41,182,246,.3); }
.task-icon { font-size: 2.4rem; line-height: 1.2; }
.task-name { font-size: .85rem; font-weight: 700; margin-top: 4px; color: var(--text); }
.task-sub { font-size: .65rem; color: var(--text-light); margin-top: 2px; }
.task-badge { position: absolute; top: 4px; right: 4px; font-size: .55rem; padding: 3px 8px; border-radius: 10px; font-weight: 700; }
.task-badge.done { background: #E6F6EC; color: #43A047; }
.task-badge.todo { background: #FFF3E0; color: #FF9800; }

/* ====== Big Check Button (icon-based) ====== */
.big-check-btn {
  display: block; margin: 16px auto; width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #29B6F6, #7C4DFF); border: none; cursor: pointer;
  font-size: 2.5rem; color: #fff; box-shadow: 0 4px 20px rgba(124,77,255,.35); transition: all .2s;
  text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.big-check-btn:active { transform: scale(.9); }
.big-check-btn.done-btn { background: linear-gradient(135deg, var(--green), #81C784); }

/* ====== Back Button (icon + voice) ====== */
.back-btn {
  margin: 12px 16px 4px; font-size: .85rem; color: var(--elsa-deep); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none; font-weight: 600;
}

/* ====== Bottom Nav ====== */
.bottom-nav { display: flex; background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -2px 16px rgba(0,0,0,.08); position: sticky; bottom: 0; z-index: 100; padding: 6px 0 env(safe-area-inset-bottom, 6px); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; cursor: pointer; transition: all .15s; }
.nav-item:active { transform: scale(.92); }
.nav-icon { font-size: 1.5rem; }
.nav-label { font-size: .65rem; font-weight: 600; color: var(--text-light); }
.nav-item.active .nav-label { color: var(--elsa-purple); }

/* ====== Pages ====== */
.page { display: none; padding-bottom: 70px; }
.page.active { display: block; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ====== Cal / Progress ====== */
.calendar-section, .medal-section, .admin-section, .report-card { margin: 12px 16px; background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.section-title { font-weight: 800; font-size: 1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: .65rem; color: var(--text-light); font-weight: 600; padding: 2px 0; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: .72rem; border-radius: 8px; font-weight: 600; }
.cal-day.has-data { background: var(--elsa-blue); color: #fff; }
.cal-day.today { background: var(--elsa-purple); color: #fff; }
.cal-day.empty { visibility: hidden; }
.progress-section { margin: 12px 16px; }
.progress-bar { height: 12px; background: #E8E8E8; border-radius: 6px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #29B6F6, #7C4DFF); border-radius: 6px; transition: width .5s; }
.progress-label { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 600; }

/* ====== Medal ====== */
.medal-count { text-align: center; font-size: 2.4rem; font-weight: 900; color: var(--star); margin: 8px 0; text-shadow: 0 2px 8px rgba(255,215,0,.4); }
.medal-exchange { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.exchange-item { background: rgba(225,245,254,.7); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; border: 1px solid rgba(41,182,246,.1); }
.exchange-item:active { transform: scale(.97); }
.exchange-info { display: flex; align-items: center; gap: 8px; }
.exchange-icon { font-size: 1.4rem; }
.exchange-name { font-weight: 700; font-size: .88rem; }
.exchange-cost { font-size: .75rem; color: var(--elsa-deep); font-weight: 600; }
.exchange-btn { background: linear-gradient(135deg, #29B6F6, #7C4DFF); color: #fff; border: none; border-radius: 10px; padding: 6px 14px; font-size: .8rem; font-weight: 700; cursor: pointer; }

/* ====== Admin ====== */
.admin-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #F0F0F0; }
.admin-row:last-child { border-bottom: none; }
.admin-label { font-weight: 600; font-size: .88rem; }
.admin-value { font-size: .85rem; color: var(--text-light); }
.admin-input { width: 60px; text-align: center; border: 2px solid var(--blue-light); border-radius: 8px; padding: 4px; font-size: .85rem; font-weight: 600; }
.admin-toggle { width: 44px; height: 24px; background: #DDD; border-radius: 12px; position: relative; cursor: pointer; transition: background .2s; }
.admin-toggle.on { background: var(--elsa-blue); }
.admin-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: left .2s; }
.admin-toggle.on::after { left: 22px; }
.admin-btn { background: linear-gradient(135deg, #29B6F6, #7C4DFF); color: #fff; border: none; border-radius: 12px; padding: 10px; width: 100%; font-size: .9rem; font-weight: 700; cursor: pointer; margin-top: 10px; }

/* ====== Flashcard / Poem / English / Piano ====== */
.flashcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; text-align: center; margin: 12px 16px; }
.flashcard-char { font-size: 6rem; font-weight: 900; color: var(--elsa-deep); font-family: "KaiTi","STKaiti",serif; line-height: 1; text-shadow: 0 4px 12px rgba(124,77,255,.15); }
.flashcard-pinyin { font-size: 1.4rem; color: var(--text-light); margin-top: 8px; }
.flashcard-word { font-size: 1rem; color: var(--text); margin-top: 8px; }
.flashcard-nav { display: flex; justify-content: space-between; margin-top: 16px; }
.flashcard-btn { background: linear-gradient(135deg, #29B6F6, #5B9BD5); color: #fff; border: none; border-radius: 12px; padding: 8px 20px; font-size: .85rem; font-weight: 700; cursor: pointer; }
.speak-btn { background: rgba(124,77,255,.12); border: 2px solid rgba(124,77,255,.2); border-radius: 50%; width: 56px; height: 56px; font-size: 1.5rem; cursor: pointer; margin-top: 10px; }
.speak-btn:active { transform: scale(.9); }

.poem-card { background: linear-gradient(135deg, #F3E5F5, #E1F5FE); border: 2px solid rgba(124,77,255,.15); border-radius: var(--radius); padding: 20px; margin: 12px 16px; text-align: center; box-shadow: var(--shadow); }
.poem-title { font-size: 1.3rem; font-weight: 800; color: var(--elsa-purple); }
.poem-author { font-size: .85rem; color: var(--text-light); margin: 4px 0 12px; }
.poem-line { font-size: 1.1rem; font-weight: 600; line-height: 2; font-family: "KaiTi","STKaiti",serif; }

.eng-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px; text-align: center; margin: 12px 16px; }
.eng-word { font-size: 2.4rem; font-weight: 800; color: var(--elsa-deep); }
.eng-phonetic { font-size: 1rem; color: var(--text-light); margin: 4px 0; }
.eng-cn { font-size: 1.2rem; font-weight: 700; margin-top: 6px; }

.piano-card { background: var(--card); border-radius: var(--radius); padding: 20px; margin: 12px 16px; text-align: center; box-shadow: var(--shadow); }
.timer-display { font-size: 3.2rem; font-weight: 900; color: var(--elsa-deep); margin: 10px 0; font-variant-numeric: tabular-nums; }
.timer-btn { border: none; border-radius: 14px; padding: 12px 32px; font-size: 1rem; font-weight: 800; cursor: pointer; margin: 4px; }
.timer-btn.start { background: linear-gradient(135deg, #29B6F6, #5B9BD5); color: #fff; }
.timer-btn.stop { background: linear-gradient(135deg, #7C4DFF, #9C27B0); color: #fff; }

/* ====== Math ====== */
.numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.numpad-btn { background: rgba(129,212,250,.15); border: 2px solid rgba(129,212,250,.3); border-radius: var(--radius-sm); aspect-ratio: 1.6; font-size: 1.8rem; font-weight: 800; color: var(--elsa-deep); cursor: pointer; }
.numpad-btn:active { transform: scale(.9); background: var(--elsa-blue); color: #fff; border-color: var(--elsa-blue); }
.math-exercise { background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(225,245,254,.9)); border-radius: var(--radius); padding: 20px; margin: 12px 16px; text-align: center; box-shadow: var(--shadow); border: 2px solid rgba(124,77,255,.08); }
.math-visual { font-size: 2.5rem; margin-bottom: 10px; }
.math-question { font-size: 1.8rem; font-weight: 900; color: var(--elsa-deep); margin-bottom: 10px; }

/* ====== Canvas ====== */
.canvas-wrapper { background: var(--card); border-radius: var(--radius); padding: 10px; margin: 12px 16px; box-shadow: var(--shadow); overflow: hidden; }
#tracingCanvas, #freeCanvas { width: 100%; touch-action: none; cursor: crosshair; display: block; border-radius: var(--radius-sm); }
.canvas-controls { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.canvas-btn { border: none; border-radius: 10px; padding: 8px 16px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.canvas-btn.clear { background: #E1F5FE; color: var(--elsa-deep); }
.canvas-btn.undo { background: #F3E5F5; color: var(--elsa-purple); }
.canvas-btn.next { background: linear-gradient(135deg, #29B6F6, #5B9BD5); color: #fff; }

/* ====== Rest Break ====== */
.rest-card { background: linear-gradient(135deg, #E1F5FE, #F3E5F5); border: 2px solid rgba(124,77,255,.15); border-radius: var(--radius); padding: 20px; margin: 12px 16px; text-align: center; box-shadow: var(--shadow); }
.rest-emoji { font-size: 3rem; animation: wiggle 1s ease infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.rest-title { font-size: 1.2rem; font-weight: 800; color: var(--elsa-purple); margin: 8px 0; }
.rest-action { font-size: 2.5rem; margin: 12px 0; }

/* ====== Modal ====== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-overlay.locked { display: flex; }
.modal { background: #fff; border-radius: 24px; padding: 28px 24px; max-width: 360px; width: 100%; text-align: center; }
.modal-emoji { font-size: 3.5rem; margin-bottom: 8px; }
.modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.modal-text { font-size: .88rem; color: var(--text-light); margin-bottom: 14px; line-height: 1.5; }
.modal-btn { background: linear-gradient(135deg, #29B6F6, #7C4DFF); color: #fff; border: none; border-radius: 14px; padding: 12px 32px; font-size: .9rem; font-weight: 700; cursor: pointer; }
.modal-btn.green { background: linear-gradient(135deg, #29B6F6, #66BB6A); }

/* ====== Password Lock ====== */
.lock-screen { background: #fff; border-radius: 24px; padding: 28px 24px; max-width: 320px; width: 100%; text-align: center; }
.lock-dots { display: flex; justify-content: center; gap: 12px; margin: 16px 0; }
.lock-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--elsa-deep); }
.lock-dot.filled { background: var(--elsa-blue); }
.lock-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.lock-btn { background: rgba(129,212,250,.15); border: 2px solid rgba(129,212,250,.3); border-radius: 50%; aspect-ratio: 1; font-size: 1.5rem; font-weight: 800; color: var(--elsa-deep); cursor: pointer; }
.lock-btn:active { transform: scale(.9); }

/* ====== Star Burst ====== */
.star-burst { position: fixed; z-index: 998; pointer-events: none; font-size: 1.8rem; animation: starFly 1s ease-out forwards; }
@keyframes starFly { 0% { opacity:1; transform: translate(0,0) scale(1); } 100% { opacity:0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

/* Voice indicator */
.voice-indicator { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: rgba(124,77,255,.95); color: #fff; padding: 8px 20px; border-radius: 20px; font-size: .8rem; font-weight: 700; z-index: 999; display: none; }
.voice-indicator.show { display: block; animation: fadeIn .3s; }

.report-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #F5F5F5; font-size: .85rem; }
.report-row:last-child { border-bottom: none; }

::-webkit-scrollbar { display: none; }

/* ====== V3.4 冰宫首页 ====== */
:root {
  --v34-ink: #133d86;
  --v34-muted: #5876a8;
  --v34-line: rgba(109, 174, 231, .34);
  --v34-surface: rgba(255, 255, 255, .9);
  --v34-deep: #3522ad;
  --v34-bright: #1674e8;
}

html { background: #dff5ff; }
body {
  max-width: 768px;
  background-color: #eaf9ff;
  color: var(--v34-ink);
  user-select: text;
  -webkit-user-select: text;
}
body::before { display: none; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 3px solid #ffca4b;
  outline-offset: 3px;
}

.ice-hero {
  min-height: 315px;
  padding: max(18px, env(safe-area-inset-top)) 18px 22px;
  background: #0c62d8 url('./assets/ice-palace-hero.webp') center 45% / cover no-repeat;
  border-radius: 0 0 34px 34px;
  box-shadow: 0 14px 34px rgba(35, 90, 181, .3);
  color: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
}
.ice-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(6, 44, 135, .16);
  box-shadow: inset 0 -110px 80px rgba(10, 70, 165, .28);
  pointer-events: none;
}
.hero-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ice-hero h1 {
  font-size: clamp(1.3rem, 5vw, 2rem);
  line-height: 1.2;
  letter-spacing: .08em;
  text-shadow: 0 2px 12px rgba(10, 40, 100, .65);
  max-width: 10em;
}
.header-date {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 13px;
  background-color: rgba(20, 88, 186, .48);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  backdrop-filter: blur(8px);
}
.hero-score { display: flex; gap: 7px; }
.score-chip {
  min-width: 58px;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 18px;
  background-color: rgba(19, 93, 199, .52);
  color: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  backdrop-filter: blur(9px);
  box-shadow: 0 5px 14px rgba(18, 60, 142, .22);
}
button.score-chip { cursor: pointer; }
.score-chip span { font-size: .62rem; opacity: .9; }
.score-chip strong { font-size: 1.05rem; }
.magic-start-btn {
  width: min(100%, 430px);
  min-height: 76px;
  align-self: center;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 24px;
  background-color: rgba(74, 47, 205, .88);
  color: #fff;
  box-shadow: 0 10px 0 rgba(24, 57, 174, .38), 0 16px 28px rgba(34, 48, 160, .32), inset 0 0 20px rgba(255,255,255,.22);
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 2px;
  text-shadow: 0 2px 7px rgba(19, 32, 109, .5);
}
.magic-start-btn:active { transform: translateY(4px); box-shadow: 0 5px 0 rgba(24, 57, 174, .38); }
.magic-start-kicker { font-size: .68rem; letter-spacing: .22em; opacity: .86; }
.magic-start-btn strong { font-size: clamp(1.05rem, 4.8vw, 1.35rem); letter-spacing: .06em; }

#page-home { padding-bottom: 96px; }
#page-home .screen-time-bar {
  margin: 12px 16px 10px;
  min-height: 48px;
  padding: 9px 13px;
  border: 1px solid var(--v34-line);
  background-color: var(--v34-surface);
  backdrop-filter: blur(12px);
}
.st-icon { width: 24px; text-align: center; font-size: 1rem; }
.st-text { color: var(--v34-muted); }

#page-home .pet-zone {
  margin: 10px 16px;
  min-height: 76px;
  padding: 10px 14px;
  border: 1px solid var(--v34-line);
  background-color: var(--v34-surface);
}
.pet-emoji {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border: 1px solid #9bdcff;
  background-color: #dff7ff;
  color: #2472cc;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.65rem;
  font-weight: 800;
}
.pet-name { color: var(--v34-ink); }

#page-home .week-track, #page-home .points-bar {
  border: 1px solid var(--v34-line);
  background-color: var(--v34-surface);
  box-shadow: 0 8px 24px rgba(49, 118, 185, .12);
}
#page-home .week-track { margin-bottom: 10px; }
#page-home .points-bar { margin-bottom: 18px; padding: 10px 7px; }
.point-item { flex-direction: column; gap: 2px; min-width: 54px; color: var(--v34-ink); }
.point-item span { color: var(--v34-muted); font-size: .65rem; font-weight: 600; }
.point-item strong { font-size: 1rem; }

.learning-section { margin: 0 16px 22px; }
.home-section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.home-section-heading h2 { font-size: 1.03rem; letter-spacing: .05em; }
.home-section-heading span { color: var(--v34-muted); font-size: .72rem; font-weight: 700; }
.tasks-grid { margin: 0; }
.core-tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.secondary-tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.secondary-tasks .task-card:last-child { grid-column: 1 / -1; }
.task-card {
  min-height: 196px;
  padding: 9px 9px 12px;
  border: 1px solid rgba(117, 185, 230, .48);
  border-radius: 25px;
  background-color: rgba(255,255,255,.93);
  box-shadow: 0 9px 24px rgba(44, 118, 185, .13), inset 0 0 22px rgba(157, 226, 255, .2);
  color: var(--v34-ink);
  text-align: center;
  overflow: hidden;
  appearance: none;
}
.task-card:active { transform: scale(.975); }
.task-card.done-card { border-color: #39b7e8; box-shadow: 0 0 0 3px rgba(57,183,232,.14), 0 9px 24px rgba(44,118,185,.13); }
.task-illustration {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.55;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  margin-bottom: 8px;
}
.task-name { margin: 0; font-size: 1.05rem; color: var(--v34-ink); }
.task-sub { font-size: .72rem; color: var(--v34-muted); }
.task-badge { top: 16px; right: 16px; font-size: .62rem; padding: 4px 8px; border: 1px solid rgba(255,255,255,.75); }
.task-badge.todo { background-color: rgba(255,255,255,.86); color: #6c78a1; }
.task-badge.done { background-color: #d9f8ee; color: #157755; }
.secondary-tasks .task-card { min-height: 172px; }
.secondary-tasks .task-illustration { aspect-ratio: 1.85; }
.secondary-tasks .task-card:last-child .task-illustration { aspect-ratio: 3.6; object-position: center 62%; }

.bottom-nav {
  position: fixed;
  left: 50%;
  width: min(100%, 768px);
  transform: translateX(-50%);
  min-height: 72px;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  border: 1px solid rgba(127, 188, 230, .45);
  border-bottom: none;
  background-color: rgba(250, 254, 255, .93);
  backdrop-filter: blur(18px);
  box-shadow: 0 -8px 28px rgba(42, 105, 164, .13);
}
.nav-item {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--v34-muted);
}
.nav-item.active { background-color: #e5f5ff; }
.nav-icon { width: 21px; height: 21px; opacity: .72; filter: invert(30%) sepia(49%) saturate(1496%) hue-rotate(178deg); }
.nav-item.active .nav-icon { opacity: 1; filter: invert(21%) sepia(91%) saturate(3421%) hue-rotate(244deg); }
.nav-label { font-size: .7rem; color: inherit; }
.nav-item.active .nav-label { color: var(--v34-deep); }

.page:not(#page-home) { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 112px; }
.back-btn, .flashcard-btn, .canvas-btn, .timer-btn, .admin-btn, .exchange-btn, .modal-btn, .lock-btn, .speak-btn, .big-check-btn {
  min-height: 48px;
}
.back-btn { padding: 8px 12px; border-radius: 12px; background-color: #fff; }
.modal-btn-secondary { margin-top: 8px; background-color: #e5f5ff; color: var(--v34-deep); }

@media (min-width: 600px) {
  .ice-hero { min-height: 390px; padding-inline: 30px; }
  .core-tasks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .secondary-tasks { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .secondary-tasks .task-card:last-child { grid-column: auto; }
  .task-card, .secondary-tasks .task-card { min-height: 184px; }
  .task-illustration, .secondary-tasks .task-illustration, .secondary-tasks .task-card:last-child .task-illustration { aspect-ratio: 1.2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ====== V3.5 unified child pages and parent insights ====== */
:root { --v35-surface:#fff; --v35-soft:#eef9ff; --v35-border:#b9dff5; --v35-ink:#143d7e; --v35-muted:#526f9c; }
[hidden] { display:none !important; }
button { border:0; }
button img, .section-title img, .section-icon { width:20px; height:20px; flex:0 0 auto; }
.home-quick-status { display:grid; grid-template-columns:1fr; }
.pet-emoji img { width:31px; height:31px; filter:invert(39%) sepia(86%) saturate(1560%) hue-rotate(183deg); }

.course-page { min-height:100vh; background:linear-gradient(180deg,#e6f8ff 0,#f8fcff 52%,#edf4ff 100%); color:var(--v35-ink); }
.course-header { margin:0 16px 10px; }
.course-header .back-btn { margin:0 0 8px; min-width:86px; justify-content:center; border:1px solid var(--v35-border); box-shadow:0 5px 14px rgba(40,100,160,.08); color:var(--v35-ink); }
.back-btn img { width:18px; height:18px; }
.course-heading { min-height:82px; display:flex; align-items:center; gap:13px; padding:10px 14px; border:1px solid var(--v35-border); border-radius:23px; background:rgba(255,255,255,.93); box-shadow:0 9px 24px rgba(42,104,160,.12); }
.course-heading>img:not(.header-icon) { width:72px; height:60px; object-fit:cover; border-radius:16px; }
.course-heading .header-icon, .course-heading.simple>img { width:44px; height:44px; padding:9px; border-radius:14px; background:#e4f5ff; filter:invert(29%) sepia(78%) saturate(1834%) hue-rotate(185deg); }
.course-heading span { display:block; color:var(--v35-muted); font-size:.76rem; font-weight:700; margin-bottom:2px; }
.course-heading h2 { font-size:1.18rem; letter-spacing:.03em; }

.poem-card,.flashcard,.eng-card,.math-exercise,.piano-card,.rest-card,.calendar-section,.calendar-detail,.medal-section,.admin-section { border:1px solid var(--v35-border); background:rgba(255,255,255,.94); box-shadow:0 9px 24px rgba(42,104,160,.11); }
.poem-card { background:linear-gradient(145deg,#f8f4ff,#ecfaff); }
.poem-line { border-radius:12px; transition:background .15s,color .15s,transform .15s; }
.poem-line.speaking { background:#d8f2ff; color:#2635a9; transform:scale(1.04); box-shadow:0 0 0 2px rgba(72,151,231,.18); }
.course-tools { display:flex; align-items:center; justify-content:center; gap:10px; color:var(--v35-muted); font-size:.82rem; font-weight:700; margin:8px 16px; }
.round-icon-btn { width:56px; height:56px; border-radius:50%; display:grid; place-items:center; background:linear-gradient(145deg,#e4f8ff,#ece9ff); border:2px solid #b7dff3; }
.round-icon-btn img { width:25px; height:25px; filter:invert(25%) sepia(84%) saturate(2224%) hue-rotate(216deg); }
.flashcard-nav { margin:10px 16px; gap:10px; justify-content:center; }
.flashcard-btn { min-width:124px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; }
.flashcard-btn.accent { background:linear-gradient(135deg,#6a4be2,#2589e6); }
.flashcard-btn img,.canvas-btn img,.timer-btn img,.complete-btn img,.admin-btn img { width:19px; height:19px; filter:brightness(0) invert(1); }
.complete-btn { width:calc(100% - 32px); min-height:58px; margin:16px; border-radius:18px; display:flex; align-items:center; justify-content:center; gap:9px; background:linear-gradient(135deg,#278eea,#6846d7); color:#fff; font-weight:800; font-size:1rem; box-shadow:0 8px 18px rgba(74,73,194,.23); }
.lesson-art { width:100%; max-height:118px; object-fit:cover; border-radius:17px; margin-bottom:12px; }
.lesson-label { font-size:.88rem; font-weight:800; }.lesson-hint,.section-hint { color:var(--v35-muted); font-size:.78rem; line-height:1.55; text-align:center; }
.timer-btn,.canvas-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.color-palette { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin:10px 16px; }
.color-palette button { width:48px; height:48px; border-radius:50%; background:var(--swatch); border:4px solid #fff; box-shadow:0 2px 8px rgba(15,56,105,.24); }

.math-visual { min-height:100px; display:grid; align-content:center; }
.math-crystals { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; padding:6px; }
.math-crystals img { width:34px; height:34px; filter:invert(47%) sepia(91%) saturate(1254%) hue-rotate(178deg); }
.math-crystals.odd-one img:last-child { filter:invert(28%) sepia(94%) saturate(2039%) hue-rotate(237deg); }
.math-question { font-size:1.15rem; line-height:1.5; }.math-feedback { min-height:36px; font-size:1.2rem; font-weight:800; color:#2466c7; margin-top:6px; }
.math-number-card { width:104px; height:104px; margin:auto; display:grid; place-items:center; border-radius:28px; background:linear-gradient(145deg,#dcf5ff,#eee8ff); color:#3c42ba; font-size:4rem; font-weight:900; box-shadow:inset 0 0 0 2px rgba(70,145,220,.16); }
.numpad-btn:disabled { opacity:.62; cursor:default; transform:none; }
#mathCompleteWrap { text-align:center; }

.story-list { margin:12px 16px; display:grid; gap:10px; }
.story-card { width:100%; min-height:88px; padding:9px; display:grid; grid-template-columns:80px 1fr 38px; align-items:center; gap:11px; text-align:left; border:1px solid var(--v35-border); border-radius:20px; background:#fff; box-shadow:0 7px 18px rgba(42,104,160,.1); color:var(--v35-ink); }
.story-card>img:first-child { width:80px; height:66px; object-fit:cover; border-radius:14px; }.story-card span { display:grid; gap:5px; }.story-card strong { font-size:.98rem; }.story-card small { color:var(--v35-muted); font-size:.76rem; }.story-card .story-play { width:23px; height:23px; filter:invert(33%) sepia(72%) saturate(1989%) hue-rotate(204deg); }
.rest-icon { width:76px; height:76px; padding:13px; border-radius:24px; background:#e1f5ff; filter:invert(37%) sepia(85%) saturate(1889%) hue-rotate(190deg); animation:wiggle 1.3s ease infinite; }.rest-card p { color:var(--v35-muted); margin:8px 0 14px; line-height:1.6; }
.rest-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.rest-actions .timer-btn { min-height:52px; padding:12px 16px; }
.rest-actions .listen { background:#e7f5ff; color:#174f93; border:1px solid #afd9f0; }
.rest-actions .listen img { filter:invert(29%) sepia(77%) saturate(1533%) hue-rotate(181deg); }

.calendar-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }.calendar-toolbar h3 { font-size:1rem; }.square-icon-btn { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; background:#e7f6ff; }.square-icon-btn img { width:20px; height:20px; }
.cal-dow { font-size:.75rem; color:var(--v35-muted); }.cal-day { border:1px solid transparent; background:transparent; min-width:36px; min-height:36px; color:var(--v35-ink); }.cal-day.has-data { background:#58b7e7; }.cal-day.today { box-shadow:0 0 0 3px rgba(88,183,231,.25); }.cal-day.selected { outline:3px solid #ffca4b; outline-offset:1px; }
.calendar-detail { margin:12px 16px; border-radius:20px; padding:14px 16px; }.calendar-detail>div { display:flex; align-items:center; justify-content:space-between; }.calendar-detail>div span { font-size:.78rem; color:#365f9b; font-weight:700; }.calendar-detail p { margin:8px 0 5px; color:var(--v35-ink); line-height:1.5; font-size:.86rem; }.calendar-detail small { color:var(--v35-muted); }.subject-progress { margin-bottom:12px; }
.exchange-icon { width:30px; height:30px; padding:5px; border-radius:10px; background:#dff4ff; filter:invert(34%) sepia(80%) saturate(1563%) hue-rotate(183deg); }

.parent-lock { text-align:center; padding:30px 20px 110px; }.lock-icon { width:74px; height:74px; padding:17px; border-radius:24px; background:#e1f5ff; filter:invert(31%) sepia(79%) saturate(1990%) hue-rotate(207deg); }.parent-lock h2 { margin:12px 0 5px; }.parent-lock>p { color:var(--v35-muted); font-size:.84rem; }.lock-dots { min-height:20px; }.lock-numpad { max-width:280px; margin:0 auto; }.lock-btn { min-width:64px; min-height:64px; display:grid; place-items:center; }.lock-btn img { width:22px; height:22px; }.lock-btn.utility { background:#fff0dc; }.lock-btn.confirm { background:#48b9a6; }.lock-btn.confirm img { filter:brightness(0) invert(1); }.pin-status { min-height:24px; color:#a13d55!important; font-weight:700; }
.section-title img { filter:invert(34%) sepia(82%) saturate(1579%) hue-rotate(184deg); }.row-button { width:100%; background:transparent; text-align:left; }.admin-toggle { border:0; }.admin-input { min-width:72px; min-height:48px; font-size:1rem; }.pin-setup { margin-top:14px; padding:12px; border-radius:15px; background:#eef8ff; }.pin-setup label { display:block; font-weight:800; margin-bottom:8px; }.pin-setup>div { display:flex; gap:8px; }.pin-input { flex:1; text-align:left; }.small-action-btn { min-width:96px; min-height:48px; border-radius:12px; background:#337fd7; color:#fff; font-weight:800; }.pin-setup p { color:var(--v35-muted); font-size:.76rem; margin-top:7px; }.admin-btn { display:flex; align-items:center; justify-content:center; gap:8px; }.admin-btn.secondary { background:#dff2ff; color:#174c8e; }.admin-btn.secondary img { filter:invert(29%) sepia(74%) saturate(1432%) hue-rotate(180deg); }.admin-btn.danger { background:#c9455d; }
.report-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:13px; }.report-summary>div { display:grid; gap:3px; text-align:center; padding:10px 4px; background:#eef8ff; border-radius:13px; }.report-summary strong { font-size:1.35rem; }.report-summary span { font-size:.7rem; color:var(--v35-muted); }.report-subjects { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; }.report-subjects>div { display:flex; justify-content:space-between; padding:8px 10px; border:1px solid #d9edf9; border-radius:11px; font-size:.8rem; }.next-suggestion { margin-top:12px; padding:12px; border-radius:14px; background:#f1edff; }.next-suggestion p { margin-top:4px; font-size:.8rem; color:#4d5791; line-height:1.55; }.report-subtitle { margin-top:14px; font-weight:800; }

.voice-player { position:fixed; left:50%; bottom:78px; width:min(calc(100% - 24px),520px); transform:translateX(-50%); z-index:150; display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid #b5d8ee; border-radius:19px; background:rgba(248,253,255,.97); box-shadow:0 8px 30px rgba(25,71,125,.22); backdrop-filter:blur(14px); }.voice-player-icon { width:26px; height:26px; filter:invert(27%) sepia(80%) saturate(2090%) hue-rotate(210deg); }.voice-player-copy { min-width:0; flex:1; display:grid; gap:2px; }.voice-player-copy strong { font-size:.8rem; }.voice-player-copy span { font-size:.7rem; color:var(--v35-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }.voice-control { width:48px; height:48px; display:grid; place-items:center; border-radius:13px; background:#e5f4ff; }.voice-control img { width:20px; height:20px; }
.modal-icon { width:64px; height:64px; padding:13px; margin-bottom:10px; border-radius:21px; background:#e5f5ff; filter:invert(31%) sepia(83%) saturate(1985%) hue-rotate(207deg); }.modal-overlay { display:none; }.modal-overlay.show { display:flex; } #timeModal[style*="flex"] { display:flex!important; }

@media (max-width:520px) {
  .ice-hero { min-height:252px; padding:14px 14px 17px; border-radius:0 0 28px 28px; }.header-date { min-height:32px; margin-top:7px; }.score-chip { min-width:52px; min-height:49px; border-radius:15px; }.magic-start-btn { min-height:64px; border-radius:20px; }
  .home-quick-status { grid-template-columns:1.08fr .92fr; gap:8px; margin:10px 12px 8px; }.home-quick-status .screen-time-bar,.home-quick-status .pet-zone { margin:0!important; min-height:58px!important; padding:8px 10px!important; border-radius:17px!important; }.home-quick-status .screen-time-bar { display:grid; grid-template-columns:20px 1fr; column-gap:5px; }.home-quick-status .st-bar { grid-column:1/-1; width:100%; }.home-quick-status .st-text { font-size:.7rem; }.home-quick-status .pet-emoji { width:42px; min-width:42px; height:42px; }.home-quick-status .pet-level { font-size:.68rem; }.home-quick-status .pet-name { font-size:.83rem; }.home-quick-status .pet-bar { margin-top:3px; }
  #page-home .week-track,#page-home .points-bar { display:none; }.learning-section { margin:0 12px 16px; }.home-section-heading { margin-bottom:7px; }.core-tasks { gap:9px; }.task-card,.secondary-tasks .task-card { min-height:145px; border-radius:20px; padding:7px 7px 9px; }.task-illustration { aspect-ratio:1.75; border-radius:14px; margin-bottom:5px; }.task-name { font-size:.96rem; }.task-sub { font-size:.7rem; }.task-badge { top:10px; right:10px; }.secondary-tasks .task-illustration { aspect-ratio:2.05; }
  .course-header { margin-inline:12px; }.poem-card,.flashcard,.eng-card,.math-exercise,.piano-card,.rest-card,.calendar-section,.calendar-detail,.medal-section,.admin-section,.canvas-wrapper { margin-left:12px; margin-right:12px; }.complete-btn { width:calc(100% - 24px); margin:15px 12px; }.flashcard-nav,.progress-section { margin-left:12px; margin-right:12px; }
}

@media (min-width:600px) {
  .course-header,.poem-card,.flashcard,.eng-card,.math-exercise,.piano-card,.rest-card,.calendar-section,.calendar-detail,.medal-section,.admin-section,.canvas-wrapper,.progress-section,.story-list { max-width:620px; margin-left:auto; margin-right:auto; }.complete-btn { max-width:620px; margin-left:auto; margin-right:auto; }.course-heading { min-height:96px; }.course-heading>img:not(.header-icon) { width:92px; height:74px; }
}

.voice-player>img:first-child { width:26px; height:26px; flex:0 0 26px; filter:invert(27%) sepia(80%) saturate(2090%) hue-rotate(210deg); }

/* ====== V3.6 stability and accessibility ====== */
.task-sub,.task-badge,.nav-label,.course-heading span,.lesson-hint,.section-hint,.story-card small,.voice-player-copy span,.pin-setup p,.report-summary span { font-size:max(.75rem,12px); }
.voice-player { bottom:calc(82px + env(safe-area-inset-bottom)); }
.modal-overlay.show .modal { max-height:calc(100vh - 40px); overflow:auto; }
@media (max-width:520px) {
  .course-header { padding-top:2px; }
  .voice-player { width:calc(100% - 20px); padding:9px 10px; gap:6px; }
  .voice-control { width:46px; height:46px; }
}
