/* 冰雪奇缘主题：冰蓝 + 白 + 闪光。大按钮，适合 5 岁触屏。 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Comic Sans MS", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #0c3a66;
  background: linear-gradient(160deg, #eaf6ff 0%, #cfeaff 45%, #b6dcff 100%);
  -webkit-user-select: none; user-select: none;
  overflow-x: hidden;
}
#app, #parent { min-height: 100%; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ---------- 首屏 ---------- */
.start { height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.start-card {
  background: rgba(255,255,255,0.85); border: 4px solid #9fd6ff; border-radius: 32px;
  padding: 40px 48px; text-align: center; box-shadow: 0 12px 40px rgba(80,150,220,0.3);
}
.start-title { font-size: 40px; font-weight: bold; color: #1f6fc4; }
.start-sub { font-size: 20px; margin: 12px 0 28px; color: #4a8fcf; }
.btn-start {
  font-size: 34px; padding: 18px 56px; border-radius: 999px; color: #fff;
  background: linear-gradient(180deg, #5ec0ff, #2a8be0); box-shadow: 0 8px 0 #1c6fb8;
}
.btn-start:active { transform: translateY(4px); box-shadow: 0 4px 0 #1c6fb8; }
.link-parent { display: inline-block; margin-top: 22px; color: #2a8be0; text-decoration: none; font-size: 16px; }

/* ---------- 主页地图 ---------- */
.home { padding: 16px 20px 40px; }
.home-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.home-title { font-size: 26px; font-weight: bold; color: #1f6fc4; }
.group-title { font-size: 22px; margin: 18px 6px 10px; color: #2477c0; }
.islands { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.island {
  background: rgba(255,255,255,0.92); border: 3px solid #bfe3ff; border-radius: 22px;
  padding: 16px 8px; text-align: center; box-shadow: 0 6px 16px rgba(120,180,230,0.25);
  transition: transform .08s;
}
.island:active { transform: scale(0.96); }
.island-icon { font-size: 46px; }
.island-name { font-size: 18px; font-weight: bold; margin-top: 6px; color: #15568f; }
.island-meta { font-size: 13px; color: #6b9fcb; margin-top: 4px; }
.home-foot { text-align: center; color: #5e92c4; margin-top: 24px; }

/* ---------- 关卡通用 ---------- */
.lesson { min-height: 100vh; display: flex; flex-direction: column; padding: 12px 16px 24px; }
.lesson-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lesson-title { font-size: 22px; font-weight: bold; color: #1f6fc4; }
.btn-back, .btn-replay {
  font-size: 17px; padding: 10px 16px; border-radius: 999px; background: #fff; color: #2a8be0;
  border: 2px solid #bfe3ff;
}
.btn-back:active, .btn-replay:active { background: #e8f4ff; }
.lesson-progress { height: 12px; background: #dceeff; border-radius: 999px; margin: 12px 0; overflow: hidden; }
.lesson-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #7cd0ff, #2a8be0); transition: width .3s; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }

.prompt { text-align: center; }
.prompt-emoji { font-size: 90px; line-height: 1; }
.prompt-word { font-size: 56px; font-weight: bold; color: #14457a; letter-spacing: 3px; word-spacing: 8px; }
.prompt-text { font-size: 22px; color: #3a7ab5; margin-top: 6px; }

/* 选项卡片 */
.cards { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 800px; }
.card {
  min-width: 130px; min-height: 130px; padding: 16px 20px; border-radius: 24px;
  background: #fff; border: 4px solid #bfe3ff; box-shadow: 0 6px 14px rgba(120,180,230,0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .08s;
}
.card:active { transform: scale(0.93); border-color: #5ec0ff; }
.card.show { border-color: #ffd76a; }
.card-emoji { font-size: 64px; line-height: 1; }
.card-label { font-size: 32px; font-weight: bold; color: #14457a; }

/* 拼词 / 排句 */
.slots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.slot {
  min-width: 64px; height: 76px; padding: 0 12px; border-radius: 16px; background: #eaf6ff;
  border: 3px dashed #9fd6ff; font-size: 34px; font-weight: bold; color: #14457a;
}
.slot.filled { background: #fff; border-style: solid; border-color: #5ec0ff; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tile {
  min-width: 60px; height: 70px; padding: 0 14px; border-radius: 16px; background: #fff;
  border: 3px solid #bfe3ff; font-size: 32px; font-weight: bold; color: #1f6fc4; box-shadow: 0 4px 0 #cfe7fb;
}
.tile:active { transform: translateY(3px); box-shadow: none; }
.tile.used { opacity: 0.25; pointer-events: none; }
.dragbuild-hint { color: #6b9fcb; font-size: 16px; }

/* 描红 */
.trace-wrap { background: #fff; border: 4px solid #bfe3ff; border-radius: 20px; padding: 8px; }
#traceCanvas { width: min(90vw, 600px); height: auto; touch-action: none; display: block; }
.trace-btns { display: flex; gap: 16px; }
.btn-go, .btn-soft {
  font-size: 22px; padding: 14px 28px; border-radius: 999px; color: #fff;
  background: linear-gradient(180deg, #5ec0ff, #2a8be0); box-shadow: 0 6px 0 #1c6fb8;
}
.btn-soft { background: #fff; color: #2a8be0; border: 2px solid #bfe3ff; box-shadow: 0 4px 0 #cfe7fb; }
.btn-go:active, .btn-soft:active { transform: translateY(3px); box-shadow: none; }

/* 听指令场景 */
.scene {
  position: relative; width: min(92vw, 760px); height: min(60vh, 440px);
  background: linear-gradient(180deg, #eafaff, #d4f0ff); border: 4px solid #bfe3ff; border-radius: 24px;
}
.scene-item { position: absolute; transform: translate(-50%,-50%); font-size: 64px; background: none; }
.scene-item:active { transform: translate(-50%,-50%) scale(0.9); }
.scene-item .mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 48px; }

/* 记忆 */
.memory-show { text-align: center; }

/* 口语 */
.speak-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.speak-status { font-size: 18px; color: #3a7ab5; min-height: 24px; }

/* ---------- 反馈浮层 ---------- */
.fb-overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 50; pointer-events: none; animation: pop .25s ease;
}
.fb-correct { background: rgba(120,220,150,0.18); }
.fb-wrong { background: rgba(255,180,120,0.18); }
.fb-icon { font-size: 150px; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15)); }
.fb-celebrate { background: rgba(180,225,255,0.5); }
.celebrate { text-align: center; }
.celebrate .snow { font-size: 50px; }
.celebrate .big { font-size: 70px; }
.celebrate .msg { font-size: 30px; font-weight: bold; color: #1f6fc4; }
.celebrate .sub { font-size: 20px; color: #4a8fcf; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- 家长后台 ---------- */
.parent { max-width: 900px; margin: 0 auto; padding: 18px; }
.parent-bar { display: flex; align-items: center; justify-content: space-between; }
.parent-title { font-size: 24px; font-weight: bold; color: #1f6fc4; }
.link-home { color: #2a8be0; text-decoration: none; font-size: 17px; }
.btn-reset { font-size: 14px; padding: 8px 14px; border-radius: 999px; background: #fff; color: #c0504d; border: 2px solid #f0c0bf; }
.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.stat-card { background: #fff; border: 3px solid #bfe3ff; border-radius: 18px; padding: 16px; text-align: center; }
.stat-num { font-size: 34px; font-weight: bold; color: #1f6fc4; }
.stat-label { font-size: 14px; color: #6b9fcb; margin-top: 4px; }
.parent h3 { color: #2477c0; margin: 22px 0 10px; }
.mtable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; }
.mtable th, .mtable td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eaf4ff; font-size: 16px; }
.mtable th { background: #eaf6ff; color: #2477c0; }
.bar { display: inline-block; width: 120px; height: 12px; background: #eaf4ff; border-radius: 999px; vertical-align: middle; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #7cd0ff, #2a8be0); }
.bar-num { margin-left: 8px; font-size: 14px; color: #4a8fcf; }
.weak { list-style: none; padding: 0; }
.weak li { background: #fff7e8; border: 2px solid #ffe0a8; border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; color: #a06a00; }
.ok { background: #eafbf0; border: 2px solid #b8e8c8; border-radius: 12px; padding: 12px 14px; color: #2a8a52; }
.parent-note { margin-top: 22px; background: #eaf6ff; border-radius: 14px; padding: 14px 16px; color: #4a7aa8; font-size: 14px; line-height: 1.7; }

@media (max-width: 560px) {
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .prompt-word { font-size: 40px; }
}
