/* ==========================================================================
   动物悄悄话 · 样式（tag 25qx0）
   字体：只用系统字体。⚠ 不许引 Google Fonts / 任何境外资源 —— 大陆打不开会白屏。
   圆体优先（iOS「圆体-简」/ Windows「幼圆」），拿不到再退苹方/雅黑，保住童趣。
   ========================================================================== */
:root {
  --bg: #FFF6EC; --card: #FFFFFF; --ink: #5A4636; --ink2: #9A8576;
  --coral: #FF9F68; --coral-d: #F2793B; --teal: #5DC9C9; --yellow: #FFD56B;
  --pink: #FFB3C7; --purple: #B7A6F0; --green: #9BD98C; --blue: #8FC7F0;
  --shadow: 0 10px 24px rgba(180, 140, 100, .18);
  --r: 26px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
#app {
  position: relative; max-width: 440px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% 0%, #FFF0DD 0%, var(--bg) 55%),
    radial-gradient(80% 40% at 90% 100%, #FFE3EC 0%, transparent 60%),
    radial-gradient(80% 40% at 5% 90%, #DFF3EA 0%, transparent 60%);
}
/* top bar */
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px 6px; }
.topbar .back {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; border: none; box-shadow: var(--shadow);
  font-size: 18px; color: var(--ink); display: none; align-items: center; justify-content: center; cursor: pointer;
}
.topbar .title { font-size: 19px; flex: 1; }
.topbar .title small { display: block; font-size: 11px; color: var(--ink2); font-family: system-ui, sans-serif; font-weight: 400; }

/* 开关条（声音 / 童声）—— 刻意不放在右上角：那一格留给门禁的身份胶囊，
   否则「试用剩 N 天 / 已激活 / VIP 会员」会压住按钮。 */
.ctlrow { display: flex; gap: 8px; justify-content: flex-end; padding: 2px 18px 0; }
.ctl {
  border: none; border-radius: 999px; padding: 7px 13px; font-size: 12px; font-family: inherit;
  background: #fff; color: var(--ink2); box-shadow: var(--shadow); cursor: pointer; white-space: nowrap;
}
.ctl.on { background: #FFF0D6; color: #B5793A; }
.ctl:active { transform: scale(.95); }

.view { flex: 1; overflow-y: auto; padding: 6px 18px 24px; display: none; animation: fade .35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

/* home */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.bubble {
  max-width: 250px; background: #fff; border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow);
  font-size: 16px; color: var(--ink); position: relative; margin-bottom: 6px; opacity: 0; transform: translateY(6px) scale(.96);
  transition: .25s; text-align: center;
}
.bubble.show { opacity: 1; transform: none; }
.bubble:after {
  content: ""; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  border: 9px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.hint { font-size: 12px; color: var(--ink2); margin-top: 6px; font-family: system-ui, sans-serif; }

.ladder {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; background: #fff;
  border-radius: var(--r); padding: 12px 10px; box-shadow: var(--shadow);
}
.ladder .step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.ladder .dot { width: 18px; height: 18px; border-radius: 50%; background: #F0E2D2; position: relative; transition: .3s; }
.ladder .step.done .dot { background: var(--coral); }
.ladder .step.now .dot { background: var(--coral); box-shadow: 0 0 0 5px rgba(255, 159, 104, .25); }
.ladder .step span { font-size: 10px; color: var(--ink2); font-family: system-ui, sans-serif; }
.ladder .bar { flex: 0 0 10px; height: 3px; background: #F0E2D2; border-radius: 3px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.mod {
  background: var(--card); border-radius: var(--r); padding: 16px 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .12s; position: relative; overflow: hidden; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.mod:active { transform: scale(.97); }
.mod .emoji { font-size: 34px; }
.mod .nm { font-size: 16px; margin-top: 6px; }
.mod .ds { font-size: 11px; color: var(--ink2); font-family: system-ui, sans-serif; margin-top: 2px; }
.mod.locked .emoji { filter: grayscale(.4); }
.mod .lock { position: absolute; top: 12px; right: 14px; font-size: 14px; }
.mod.t1 { background: linear-gradient(160deg, #FFF3E6, #FFE6D2); }
.mod.t2 { background: linear-gradient(160deg, #EAF7F2, #D6F0E6); }
.mod.t3 { background: linear-gradient(160deg, #EAF1FB, #DCEBFB); }
.mod.t4 { background: linear-gradient(160deg, #FBEEF4, #F8DCE8); }
.mod.t5 { background: linear-gradient(160deg, #F1ECFB, #E6DCF8); }
.mod.t6 { background: linear-gradient(160deg, #FFF7DA, #FBE9B0); }

/* generic panel */
.panel { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-top: 14px; }
.center { text-align: center; }
.bigbtn {
  margin-top: 18px; border: none; border-radius: 18px; padding: 14px 26px; font-size: 17px; font-family: inherit;
  color: #fff; background: var(--coral); box-shadow: var(--shadow); cursor: pointer; transition: transform .12s;
}
.bigbtn:active { transform: scale(.96); }
.bigbtn.teal { background: var(--teal); }
.bigbtn.blue { background: var(--blue); }
.bigbtn.purple { background: var(--purple); }

/* listen cards */
.words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.word {
  background: linear-gradient(160deg, #FFF7E8, #FFE9D6); border-radius: 22px; box-shadow: var(--shadow);
  padding: 16px 6px; text-align: center; cursor: pointer; transition: transform .12s; min-height: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.word:active { transform: scale(.95); }
.word .tx { font-size: 21px; color: var(--ink); }
.word .st { font-size: 11px; color: #B5793A; font-family: system-ui; margin-top: 3px; }

/* whisper */
.rec { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 24px; }
.mic {
  width: 120px; height: 120px; border-radius: 50%; background: var(--pink); display: flex; align-items: center; justify-content: center;
  font-size: 50px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; user-select: none; touch-action: none;
  -webkit-user-select: none; -webkit-touch-callout: none;
}
.mic.ready { animation: readypulse 1.4s infinite; }
@keyframes readypulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 179, 199, .55) } 50% { box-shadow: 0 0 0 14px rgba(255, 179, 199, 0) } }
.pwhisper { margin: 14px auto 0; display: inline-block; background: #FFF0D6; color: #B5793A; font-size: 13px; padding: 8px 16px; border-radius: 20px; font-family: system-ui, sans-serif; }
.animal-hero { line-height: 1; margin-bottom: 4px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.link { display: block; margin: 12px auto 0; background: none; border: none; color: var(--coral-d); font-size: 13px; font-family: system-ui, sans-serif; cursor: pointer; text-decoration: underline; }
.mic:active { transform: scale(.95); }
.mic.recording { animation: pulse 1.1s infinite; background: var(--coral); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242, 121, 59, .5) } 70% { box-shadow: 0 0 0 22px rgba(242, 121, 59, 0) } 100% { box-shadow: 0 0 0 0 rgba(242, 121, 59, 0) } }
.privacy { font-size: 12px; color: var(--ink2); text-align: center; font-family: system-ui, sans-serif; margin-top: 10px; line-height: 1.6; }

/* calm breathing */
.breath { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 20px; }
.breathcircle {
  width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #BDE9DF, #5DC9C9);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; transition: transform 4s ease-in-out; box-shadow: var(--shadow);
}
.breathcircle.in { transform: scale(1.18); }
.breathcircle.out { transform: scale(.82); }

/* garden */
.garden-welcome { text-align: center; font-size: 15px; color: var(--ink); background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-top: 14px; line-height: 1.6; }
.garden-welcome b { color: var(--coral-d); }
.garden {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; min-height: 200px; align-content: flex-start;
  background: linear-gradient(180deg, #EAF7EF, #DFF3E7); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow);
}
.flower { font-size: 38px; animation: pop .4s ease; cursor: pointer; }
@keyframes pop { from { transform: scale(0) } to { transform: scale(1) } }
.stars { text-align: center; font-size: 16px; margin-top: 10px; }

/* story */
.storybox { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-top: 14px; text-align: center; }
.storyfox { line-height: 1; margin: 4px 0; }
.storytxt { font-size: 17px; margin: 14px 0; min-height: 52px; }
.choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.chip { border: none; border-radius: 16px; padding: 12px 18px; font-size: 15px; font-family: inherit; background: var(--yellow); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.chip:active { transform: scale(.96); }
.story-mic-wrap { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mic.small { width: 86px; height: 86px; font-size: 34px; }
#storyRecState { font-size: 13px; color: var(--ink2); font-family: system-ui; text-align: center; }

/* parent */
.stat { display: flex; gap: 12px; margin-top: 14px; }
.stat .box { flex: 1; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 14px; text-align: center; }
.stat .num { font-size: 26px; color: var(--coral-d); }
.stat .lb { font-size: 11px; color: var(--ink2); font-family: system-ui, sans-serif; }
.guide { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 16px; margin-top: 14px; }
.guide h3 { margin: 0 0 8px; font-size: 16px; }
.guide p { margin: 6px 0; font-size: 13px; color: var(--ink); font-family: system-ui, sans-serif; line-height: 1.6; }
.guide .warn { color: var(--coral-d); }
.locktip { font-size: 12px; color: var(--ink2); text-align: center; font-family: system-ui, sans-serif; margin-top: 14px; }

.footer-note { text-align: center; font-size: 11px; color: var(--ink2); font-family: system-ui, sans-serif; margin-top: 18px; line-height: 1.6; }

/* home hero (dynamic animal) */
.hero { margin-top: 6px; cursor: pointer; filter: drop-shadow(0 12px 14px rgba(200, 150, 110, .28)); animation: bob 3.2s ease-in-out infinite; transition: transform .12s; user-select: none; }
.hero:active { transform: scale(.95); }
.swapbtn { margin-top: 10px; border: none; border-radius: 16px; padding: 8px 16px; font-size: 13px; font-family: system-ui, sans-serif; background: #FFF0D6; color: #B5793A; cursor: pointer; box-shadow: var(--shadow); }
.swapbtn:active { transform: scale(.95); }

/* pick cards (onboarding + whisper top) */
.pick-head { text-align: center; font-size: 19px; margin-bottom: 4px; }
.pick-sub { text-align: center; font-size: 12px; color: var(--ink2); font-family: system-ui; margin-bottom: 12px; }
.namebox { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.ninput { border: 2px solid #FFE0C2; border-radius: 16px; padding: 11px 14px; font-size: 15px; font-family: inherit; outline: none; color: var(--ink); background: #FFFDF9; }
.ninput:focus { border-color: var(--coral); }
.ninput::placeholder { color: #C9B6A4; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pick-card {
  background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 12px 6px 12px; text-align: center; cursor: pointer;
  transition: transform .12s, border .2s; border: 3px solid transparent; position: relative;
}
.pick-card:active { transform: scale(.96); }
.pick-card.sel { border-color: var(--coral); }
.pick-card .pe { display: block; margin: 2px auto; }
.pick-card .pn { font-size: 14px; margin-top: 2px; }
.pick-card .ps { font-size: 10px; color: var(--ink2); font-family: system-ui; margin-top: 2px; }
.pick-card .pchoose { margin-top: 8px; display: inline-block; border: none; border-radius: 14px; padding: 7px 12px; font-size: 12px; font-family: inherit; background: var(--coral); color: #fff; box-shadow: var(--shadow); cursor: pointer; }
.pick-card .preview { position: absolute; top: 8px; right: 8px; font-size: 14px; background: #FFF0D6; color: #B5793A; border-radius: 50%; width: 26px; height: 26px; line-height: 26px; cursor: pointer; }

/* listen categories + animal sounds */
.cats { display: flex; gap: 8px; overflow-x: auto; margin-top: 14px; padding-bottom: 4px; }
.cat { flex: 0 0 auto; border: none; border-radius: 16px; padding: 8px 14px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink2); box-shadow: var(--shadow); cursor: pointer; }
.cat.on { background: var(--coral); color: #fff; }
.sec-title { font-size: 14px; color: var(--ink2); font-family: system-ui; margin: 16px 0 2px; }
.sound-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.sound-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 14px 6px; text-align: center; cursor: pointer; transition: transform .12s; }
.sound-card:active { transform: scale(.95); }
.sound-card .ic { display: flex; justify-content: center; }
.sound-card .tx { font-size: 14px; margin-top: 4px; }
.sound-card .st { font-size: 10px; color: var(--ink2); font-family: system-ui; }

/* whisper top selector */
.who-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.who { width: 48px; height: 48px; border-radius: 50%; background: #FFF0D6; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 3px solid transparent; transition: transform .12s; overflow: hidden; }
.who:active { transform: scale(.9); }
.who.sel { border-color: var(--coral); background: #FFE0C2; }

/* cute animal svg + animations */
.ac { display: block; overflow: visible; }
.ac .eye { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
.ac.talking { animation: acbob .3s ease-in-out infinite; }
@keyframes acbob { 0%, 100% { transform: translateY(0) rotate(-2deg) } 50% { transform: translateY(-3px) rotate(2deg) } }
.ac .omouth { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scaleY(.15); transition: .1s; }
.ac.talking .omouth { opacity: 1; transform: scaleY(1); }
.ac.talking .smile { opacity: 0; }
.hero svg { width: 150px; height: 150px; }
.pick-card .pe svg { width: 60px; height: 60px; }
.animal-hero svg { width: 104px; height: 104px; }
.who svg { width: 34px; height: 34px; }
.sound-card .ic svg { width: 54px; height: 54px; }
.storyfox svg { width: 96px; height: 96px; }

::-webkit-scrollbar { width: 0; }
