:root {
  --bg: #fff8e1;
  --bg2: #fffde7;
  --ink: #4e342e;
  --muted: #9e8b7e;
  --primary: #ff8a65;
  --primary-d: #f4511e;
  --card: #ffffff;
  --ok: #66bb6a;
  --no: #ef5350;
  --shadow: 0 6px 18px rgba(255, 138, 101, 0.18);
  --radius: 22px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  user-select: none;
  overflow-x: hidden;
}
#app { min-height: 100vh; min-height: 100dvh; }

/* 容器 */
.screen {
  max-width: 560px; margin: 0 auto; padding: 20px 18px 32px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 100vh; min-height: 100dvh;
}

/* 按键 */
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; font-size: 20px; font-weight: 700; padding: 16px 22px;
  border-radius: 999px; box-shadow: var(--shadow); transition: transform .12s;
}
.btn-primary.big { font-size: 22px; padding: 18px; }
.btn-primary:active { transform: scale(0.96); }
.btn-ghost { color: var(--muted); font-size: 17px; padding: 12px; }
.btn-ghost:active { transform: scale(0.96); }
.btn-danger { background: #ffebee; color: var(--no); border-radius: 14px; padding: 12px; font-size: 16px; margin-top: 8px; }
.muted { color: var(--muted); text-align: center; font-size: 15px; }

/* 欢迎 */
.welcome { justify-content: center; align-items: center; text-align: center; }
.welcome-bubble { font-size: 40px; animation: float 2.4s ease-in-out infinite; }
.welcome-title { font-size: 30px; margin: 4px 0 8px; }
.kid-list { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.kid-pick {
  background: var(--card); border-radius: 20px; padding: 14px 18px; width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--shadow); transition: transform .12s;
}
.kid-pick:active { transform: scale(0.95); }
.kid-avatar { font-size: 44px; }
.kid-name { font-size: 19px; font-weight: 700; }
.kid-track { font-size: 13px; color: var(--muted); }

/* 家长锁 */
.lock-screen { position: fixed; inset: 0; background: rgba(78,52,46,.45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.lock-card { background: #fff; border-radius: 26px; padding: 26px; width: 100%; max-width: 340px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.lock-emoji { font-size: 46px; }
.lock-q { font-size: 30px; font-weight: 800; color: var(--primary-d); }
.lock-input { font-size: 24px; text-align: center; padding: 12px; border-radius: 14px; border: 2px solid #ffe0b2; }
.lock-err { color: var(--no); font-size: 14px; min-height: 18px; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 17px; font-weight: 600; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; }
.field input[type=text], .field input:not([type=checkbox]) { font-size: 18px; padding: 12px; border-radius: 14px; border: 2px solid #ffe0b2; }
.seg { display: flex; gap: 8px; }
.seg-btn { flex: 1; padding: 12px; border-radius: 14px; background: #fff3e0; color: var(--muted); font-size: 16px; font-weight: 700; transition: all .15s; }
.seg-btn.on { background: var(--primary); color: #fff; }
.pet-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.pet-choice { font-size: 38px; padding: 10px 12px; border-radius: 16px; background: #fff3e0; transition: all .12s; }
.pet-choice.on { background: var(--primary); transform: scale(1.08); }

/* 首页 */
.home-top { display: flex; align-items: center; justify-content: space-between; }
.kid-chip { background: #fff; border-radius: 999px; padding: 10px 16px; font-size: 17px; font-weight: 700; box-shadow: var(--shadow); }
.icon-btn { font-size: 24px; background: #fff; border-radius: 50%; width: 44px; height: 44px; box-shadow: var(--shadow); }
.pet-stage { background: #fff; border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.pet-info { flex: 1; }
.pet-name { font-size: 22px; font-weight: 800; }
.pet-sub { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.grow-bar { height: 12px; background: #ffe0b2; border-radius: 999px; overflow: hidden; }
.grow-fill { height: 100%; background: linear-gradient(90deg, #ffd54f, #66bb6a); transition: width .6s ease; }
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.module-card {
  background: var(--card); border-radius: var(--radius); padding: 22px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-bottom: 5px solid var(--mc); box-shadow: var(--shadow); transition: transform .12s;
}
.module-card:active { transform: scale(0.95); }
.m-emoji { font-size: 52px; }
.m-name { font-size: 22px; font-weight: 800; }
.m-stars { font-size: 14px; color: #ffb300; letter-spacing: 1px; }

/* 游戏 */
.game-top { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 14px; background: #ffe0b2; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #ffd54f); transition: width .35s; }
.mini-pet { width: 46px; height: 46px; }
.q-card { background: #fff; border-radius: var(--radius); padding: 22px 16px; box-shadow: var(--shadow); text-align: center; }
.q-prompt { font-size: 20px; font-weight: 700; color: var(--primary-d); margin-bottom: 10px; }
.q-display { font-size: 46px; font-weight: 800; margin: 6px 0 14px; letter-spacing: 2px; }
.count-emoji { font-size: 30px; line-height: 1.6; }
.listen-btn { background: #fff3e0; color: var(--primary-d); font-size: 20px; font-weight: 700; padding: 14px 22px; border-radius: 999px; box-shadow: var(--shadow); }
.listen-btn:active { transform: scale(0.95); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.choice {
  background: #fff; border: 3px solid #ffe0b2; border-radius: 18px; padding: 20px 10px;
  font-size: 34px; font-weight: 800; color: var(--ink); min-height: 74px;
  display: flex; align-items: center; justify-content: center; transition: transform .12s;
}
.choice:active { transform: scale(0.95); }
.choice.correct { background: #e8f5e9; border-color: var(--ok); color: #2e7d32; animation: pop .3s; }
.choice.wrong { background: #ffebee; border-color: var(--no); color: #c62828; }
.feedback { min-height: 26px; text-align: center; font-size: 20px; font-weight: 700; opacity: 0; transition: opacity .2s; }
.feedback.show { opacity: 1; }
.feedback.ok { color: var(--ok); }
.feedback.no { color: var(--no); }

/* 小结 */
.summary { justify-content: center; align-items: center; text-align: center; }
.summary-emoji { font-size: 64px; animation: pop .4s; }
.summary-stars { font-size: 34px; color: #ffb300; letter-spacing: 3px; }
.big-pet { width: 120px; height: 120px; margin: 8px auto; }

/* 报告/设置 */
.sel { font-size: 17px; padding: 12px; border-radius: 14px; border: 2px solid #ffe0b2; background: #fff; }
.report-pet { background: #fff; border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); }
.report-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.report-table th, .report-table td { padding: 12px; text-align: left; font-size: 16px; border-bottom: 1px solid #fff3e0; }
.report-table th { background: #fff3e0; color: var(--muted); }

/* 动画 */
@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pop { animation: pop .35s ease; }
.bounce { animation: bounce .5s ease; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-14px); } 60% { transform: translateY(0); } 80% { transform: translateY(-6px); } }

/* 彩屑 */
.confetti { position: absolute; top: 0; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.4s ease-in forwards; }
@keyframes fall { 0% { transform: translateY(-10px) rotate(0); opacity: 1; } 100% { transform: translateY(90px) rotate(320deg); opacity: 0; } }

/* 宠物 SVG */
.pet-svg { width: 88px; height: 104px; }
.pet-stage .pet-svg { width: 84px; height: 100px; }
.pet-svg.animal { animation: float 3s ease-in-out infinite; }
.pet-svg.plant { transition: transform .5s; }

/* 护眼提示 */
.eye-tip { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: #4e342e; color: #fff; padding: 14px 18px; border-radius: 16px; font-size: 16px; z-index: 60; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.eye-tip button { background: #ffd54f; color: #4e342e; border-radius: 10px; padding: 6px 12px; font-weight: 700; }

/* 平板适配 */
@media (min-width: 768px) {
  .screen { padding: 32px 28px 48px; gap: 22px; }
  .module-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .m-emoji { font-size: 64px; }
  .q-display { font-size: 60px; }
  .choice { font-size: 42px; min-height: 92px; }
  .welcome-title { font-size: 40px; }
}
