/* ============ Eevee English — 儿童友好主题 ============ */
:root {
  --pink: #ff8fab;
  --pink-deep: #f75c7e;
  --peach: #ffd6a5;
  --mint: #b8e6d0;
  --sky: #a8d8f0;
  --lilac: #d4b8f0;
  --cream: #fff6ec;
  --brown: #8a6240;
  --ink: #4a3728;
  --gold: #ffc93c;
  --green-ok: #6cc96c;
  --red-no: #ff6b6b;
  --radius: 24px;
  --shadow: 0 6px 0 rgba(138, 98, 64, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "PingFang SC", "Baloo 2", "Comic Sans MS", "Segoe UI Rounded", sans-serif;
  background: linear-gradient(160deg, #ffeef4 0%, #e8f6ff 55%, #fff6e0 100%);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.hidden { display: none !important; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px;
  font-family: inherit; font-size: 20px; font-weight: 700;
  padding: 14px 28px; cursor: pointer;
  background: var(--gold); color: var(--ink);
  box-shadow: 0 5px 0 #d9a520;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #d9a520; }
.btn.primary { background: var(--pink); color: #fff; box-shadow: 0 5px 0 var(--pink-deep); }
.btn.primary:active { box-shadow: 0 1px 0 var(--pink-deep); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.btn.ghost:active { box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.sm { font-size: 16px; padding: 9px 18px; }
.btn.big { font-size: 26px; padding: 18px 44px; }

/* ---------- 页面骨架 ---------- */
.page { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.page-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 24px 32px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 20px 10px;
}
.topbar .back { font-size: 26px; background: #fff; border-radius: 50%; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer; border: none; }
.topbar .title { font-size: 22px; font-weight: 800; }
.topbar .star-count { background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 800;
  box-shadow: var(--shadow); font-size: 18px; color: var(--brown); }

/* ---------- 首页 ---------- */
.home-hero { display: flex; align-items: center; gap: 16px; padding: 8px 24px; }
.home-hero .mascot { width: 130px; height: 130px; object-fit: contain;
  animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0,0,0,.12)); }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.home-hero h1 { font-size: 30px; line-height: 1.25; }
.home-hero p { font-size: 16px; color: var(--brown); margin-top: 6px; }

.home-nav { display: flex; gap: 12px; padding: 6px 24px 12px; }
.nav-chip {
  flex: 1; text-align: center; padding: 12px 6px; border-radius: 18px; background: #fff;
  box-shadow: var(--shadow); font-weight: 800; font-size: 16px; cursor: pointer; border: none;
}
.nav-chip .ic { font-size: 24px; display: block; margin-bottom: 4px; }

.level-section { margin: 8px 0; }
.level-head { display: flex; align-items: center; gap: 10px; margin: 14px 4px 10px; }
.level-badge {
  padding: 6px 16px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 15px;
}
.level-badge.l1 { background: var(--green-ok); }
.level-badge.l2 { background: var(--sky); color: var(--ink); }
.level-badge.l3 { background: var(--lilac); color: var(--ink); }
.level-desc { font-size: 13px; color: var(--brown); }

.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; }
.lesson-card {
  background: #fff; border-radius: var(--radius); padding: 14px; cursor: pointer; border: none;
  box-shadow: var(--shadow); text-align: left; font-family: inherit; position: relative;
  display: flex; flex-direction: column; gap: 6px; transition: transform .1s;
}
.lesson-card:active { transform: scale(.97); }
.lesson-card .l-title { font-size: 18px; font-weight: 800; }
.lesson-card .l-sub { font-size: 13px; color: var(--brown); }
.lesson-card .l-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.done-tag { background: var(--mint); color: #1c7a4d; border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 12px; }
.todo-tag { background: #ffe9ef; color: var(--pink-deep); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 12px; }
.lesson-card .l-stars { margin-left: auto; color: var(--gold); font-weight: 800; }

/* ---------- 课程页 ---------- */
.lesson-stage {
  flex: 1; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.stage-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: .9; z-index: 0; transition: background-image .4s;
}
.stage-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.25) 0%, rgba(255,246,236,.85) 60%); z-index: 1; }
.stage-content { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 12px 24px 24px; }

.progress-dots { display: flex; gap: 8px; justify-content: center; padding: 8px 0 14px; }
.pdot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.9); border: 2px solid var(--brown); opacity: .35; }
.pdot.active { opacity: 1; background: var(--gold); transform: scale(1.25); }
.pdot.done { opacity: .9; background: var(--green-ok); border-color: #3f9e3f; }

/* 步骤标题 */
.step-title { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.step-tip { text-align: center; font-size: 14px; color: var(--brown); margin-bottom: 12px; }

/* ---------- 单词卡 ---------- */
.word-card-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 10px 2px 16px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  /* 右缘渐隐：提示"还能往右滑"，避免裁切被误认为显示错误 */
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
}
.word-card {
  width: 148px; min-width: 148px; background: #fff; border-radius: 20px; padding: 12px 10px;
  text-align: center; box-shadow: var(--shadow); cursor: pointer;
  border: 3px solid transparent; flex-shrink: 0; overflow: hidden;  /* 内容永不溢出卡片 */
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.word-card.current { border-color: var(--pink); background: #fff6f9; }
.word-card .w-en { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1.2; word-break: break-word; }
.word-card .w-zh { font-size: 14px; color: var(--brown); line-height: 1.3; }
.word-card .w-emoji { font-size: 40px; }
/* 缩略图固定 100×100 容器，图片 contain 居中，任何引擎下都不会撑破卡片
   （选择器特异性 0,3,1，确保覆盖通用 .word-thumb.small 规则） */
.word-card .word-thumb { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.word-card .word-thumb.small img, .word-card .word-thumb.small .wt-emoji {
  width: 100px; height: 100px; max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 14px; display: block; margin: 0; font-size: 48px;
}
.word-card .speaker { margin-top: 8px; font-size: 20px; }

.word-focus {
  background: #fff; border-radius: 28px; padding: 28px 24px; text-align: center;
  box-shadow: var(--shadow); margin: 6px auto 14px; max-width: 560px; width: 100%;
}
.word-focus .wf-emoji { font-size: 72px; }
.word-focus .wf-img { width: 240px; height: 240px; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow); }
.l-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; vertical-align: middle; }
.l-thumb-sm { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.word-focus .wf-en { font-size: 44px; font-weight: 800; margin: 8px 0 2px; letter-spacing: 1px; }
.word-focus .wf-phon { font-size: 18px; color: var(--brown); }
.word-focus .wf-zh { font-size: 22px; color: var(--pink-deep); font-weight: 700; margin-top: 6px; }
.wf-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ---------- 跟读纠音 ---------- */
.read-line {
  background: #fff; border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow);
  font-size: 26px; font-weight: 700; line-height: 1.6; text-align: center; max-width: 640px;
  margin: 0 auto 14px; width: 100%;
}
.read-line .tok { padding: 2px 4px; border-radius: 8px; }
.tok.ok { color: #2e9e4f; }
.tok.bad { color: var(--red-no); background: #ffe3e3; text-decoration: underline wavy var(--red-no); }
.tok.miss { color: #bbb; }

.mic-wrap { display: grid; grid-template-columns: auto auto auto; justify-content: center; align-items: center; gap: 14px; }
.mic-wrap .mic-hint { grid-column: 1 / -1; }
.mic-btn {
  width: 110px; height: 110px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--pink); color: #fff; font-size: 46px;
  box-shadow: 0 8px 0 var(--pink-deep), 0 0 0 10px rgba(255,143,171,.2);
  transition: transform .1s;
}
#read-demo, #read-slow { width: 76px; height: 76px; font-size: 34px; background: var(--peach); box-shadow: 0 6px 0 var(--gold-deep, #e8a33d), 0 0 0 6px rgba(255,200,120,.25); }
.mic-btn:active { transform: scale(.94); }
.mic-btn.recording { background: var(--red-no); box-shadow: 0 8px 0 #c0392b, 0 0 0 10px rgba(255,107,107,.25); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.07) } }
.mic-hint { font-size: 15px; color: var(--brown); font-weight: 700; }

.score-badge {
  position: fixed; top: 22%; left: 50%; transform: translateX(-50%) scale(0);
  font-size: 64px; z-index: 50; transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  background: #fff; border-radius: 28px; padding: 18px 34px; box-shadow: 0 10px 30px rgba(0,0,0,.2);
  font-weight: 900; text-align: center;
}
.score-badge.show { transform: translateX(-50%) scale(1); }
.score-badge small { display: block; font-size: 16px; color: var(--brown); font-weight: 700; }

/* ---------- 对话 ---------- */
.dialog-scene { display: flex; flex-direction: column; gap: 12px; max-width: 700px; margin: 0 auto; width: 100%; }
.bubble-row { display: flex; gap: 10px; align-items: flex-end; }
.bubble-row.me { flex-direction: row-reverse; }
.avatar {
  width: 74px; height: 74px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 3px solid #fff; box-shadow: var(--shadow); background: #fff;
}
.avatar.emoji-av { display: flex; align-items: center; justify-content: center; font-size: 40px; background: var(--sky); }
.bubble {
  max-width: 68%; padding: 14px 18px; border-radius: 22px; font-size: 20px; font-weight: 600;
  line-height: 1.5; box-shadow: var(--shadow); position: relative; cursor: pointer;
}
.bubble .zh { display: block; font-size: 13px; font-weight: 500; color: var(--brown); margin-top: 4px; }
.bubble.them { background: #fff; border-bottom-left-radius: 6px; }
.bubble.mine { background: var(--mint); border-bottom-right-radius: 6px; }
.bubble.pending { outline: 3px dashed var(--gold); }
.bubble .mini-play { position: absolute; top: -10px; right: -6px; background: var(--gold); border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 15px; border: none; }

.dialog-actions { display: flex; gap: 12px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.ai-cards { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; max-width: 700px; margin: 6px auto; width: 100%; -webkit-overflow-scrolling: touch; }
.ai-card { flex-shrink: 0; width: 76px; background: #fff; border: 2px solid transparent; border-radius: 14px; padding: 6px 4px 4px; text-align: center; cursor: pointer; box-shadow: var(--shadow); }
.ai-card:active { border-color: var(--pink); }
.ai-card img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; display: block; margin: 0 auto; }
.ai-card span { display: block; font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 对战 ---------- */
.battle-arena { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; width: 100%; }
.fighters { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 6px; gap: 12px; }
.fighter { text-align: center; flex: 1; }
.fighter img, .fighter .f-sprite { width: 120px; height: 120px; object-fit: contain; }
.f-sprite { font-size: 76px; display: flex; align-items: center; justify-content: center; }
.hp-bar { width: 130px; height: 14px; background: #eee; border-radius: 999px; margin: 6px auto; overflow: hidden; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.12); }
.hp-fill { height: 100%; background: linear-gradient(90deg, #ff6b6b, #ffc93c, #6cc96c); background-size: 300%; border-radius: 999px; transition: width .5s; }
.vs-flash { font-size: 34px; font-weight: 900; color: var(--pink-deep); animation: bob 1s infinite; }

.battle-q { background: #fff; border-radius: 20px; padding: 16px 20px; width: 100%; box-shadow: var(--shadow); text-align: center; }
.battle-q .q-label { font-size: 13px; color: var(--brown); font-weight: 700; margin-bottom: 6px; }
.battle-q .q-text { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-opt {
  padding: 14px; border-radius: 16px; border: 3px solid #ffe0b2; background: #fff9f0;
  font-size: 20px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.q-opt:active { transform: scale(.96); }
.q-opt.correct { background: #e3f9e5; border-color: var(--green-ok); }
.q-opt.wrong { background: #ffe3e3; border-color: var(--red-no); }
.q-opt.speak-opt { grid-column: 1 / -1; background: var(--pink); color: #fff; border-color: var(--pink-deep); font-size: 22px; }

.battle-fx { font-size: 40px; font-weight: 900; min-height: 52px; text-align: center; }
.fx-hit { color: var(--pink-deep); animation: shake .4s; }
.fx-miss { color: #999; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

/* 抓捕 */
.capture-scene { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; }
.wild-sprite { font-size: 100px; animation: bob 1.2s infinite; }
.capture-hint { font-size: 20px; font-weight: 800; text-align: center; }
.ball-row { display: flex; gap: 14px; }
.pokeball { width: 74px; height: 74px; border-radius: 50%; border: none; cursor: pointer; font-size: 44px;
  background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.pokeball:active { transform: scale(.9); }
.pokeball.shake { animation: ballshake .6s infinite; }
@keyframes ballshake { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-14deg)} 75%{transform:rotate(14deg)} }
.catch-result { font-size: 30px; font-weight: 900; text-align: center; }

/* ---------- 完成页 ---------- */
.finish-panel { text-align: center; padding: 30px 20px; }
.finish-panel .mascot-big { width: 180px; animation: bob 2s infinite; }
.finish-stars { font-size: 52px; letter-spacing: 8px; margin: 12px 0; }
.finish-stats { background: #fff; border-radius: 20px; padding: 16px 24px; display: inline-block;
  box-shadow: var(--shadow); font-size: 18px; font-weight: 700; line-height: 2; margin-bottom: 18px; }

/* ---------- 收藏 / 打卡 ---------- */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.collect-card { background: #fff; border-radius: 20px; padding: 14px; text-align: center; box-shadow: var(--shadow); }
.collect-card .c-sprite { font-size: 54px; }
.collect-card .c-name { font-weight: 800; font-size: 16px; margin-top: 4px; }
.collect-card .c-from { font-size: 12px; color: var(--brown); }
.collect-card.locked { opacity: .4; filter: grayscale(1); }

.streak-banner {
  background: linear-gradient(120deg, var(--peach), var(--pink)); color: #fff; border-radius: 22px;
  padding: 18px 22px; display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.streak-banner .s-num { font-size: 40px; font-weight: 900; }
.streak-banner .s-txt { font-size: 16px; font-weight: 700; line-height: 1.5; }

.checkin-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; background: #fff;
  border-radius: 20px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.cal-day { aspect-ratio: 1; border-radius: 12px; background: #f6f0ea; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 12px; color: var(--brown); font-weight: 700; }
.cal-day.hit { background: var(--mint); color: #1c7a4d; }
.cal-day.today { outline: 3px solid var(--gold); }
.cal-day .d-star { font-size: 14px; }

/* ---------- 设置 ---------- */
.setting-row { background: #fff; border-radius: 18px; padding: 14px 18px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.setting-row .s-label { font-weight: 800; font-size: 17px; }
.setting-row .s-sub { font-size: 12px; color: var(--brown); }
.speed-opts { display: flex; gap: 8px; }
.speed-opt { border: none; border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 15px;
  background: #f2ece6; cursor: pointer; font-family: inherit; color: var(--ink); }
.speed-opt.on { background: var(--pink); color: #fff; }
.voice-opts { display: flex; gap: 8px; }

/* toast */
#toast {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 12px 26px; border-radius: 999px; font-weight: 700;
  font-size: 16px; z-index: 99; transition: transform .3s; max-width: 80%; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }

#tts-indicator { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 16px; background: var(--gold);
  border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; z-index: 60; animation: pulse 1s infinite; }

/* iPad 适配 */
@media (min-width: 900px) {
  .page-scroll { padding: 20px 48px 40px; }
  .word-focus .wf-en { font-size: 52px; }
  .read-line { font-size: 30px; }
}

/* ============ 进化系统 ============ */
.bond-mini { font-size: 13px; color: var(--brown); margin-top: 6px; font-weight: 600; }
.type-badge {
  display: inline-block; color: #fff; font-size: 12px; font-weight: 800;
  padding: 2px 10px; border-radius: 10px; margin: 4px 0;
}
.evo-current {
  border-radius: var(--radius); padding: 20px; display: flex; align-items: center;
  gap: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.evo-hero-img { width: 130px; height: 130px; object-fit: contain; }
.evo-hero-name { font-size: 26px; font-weight: 900; color: var(--ink); }
.evo-hero-name span { font-size: 16px; color: var(--brown); font-weight: 600; }
.evo-hero-type {
  display: inline-block; color: #fff; font-size: 13px; font-weight: 800;
  padding: 3px 12px; border-radius: 12px; margin: 6px 0;
}
.evo-hero-skills { font-size: 14px; color: var(--brown); font-weight: 600; }
.evo-bond-card {
  background: #fff; border-radius: 18px; padding: 14px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.evo-bond-head { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.evo-bond-head b { color: var(--pink-deep); font-size: 20px; }
.evo-bond-bar {
  height: 14px; background: #f3ede7; border-radius: 8px; overflow: hidden;
}
.evo-bond-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  transition: width .5s;
}
.evo-bond-sub { font-size: 12px; color: var(--brown); margin-top: 8px; line-height: 1.6; }
.evo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px;
}
.evo-card {
  position: relative; background: #fff; border: 3px solid #f0e8e0; border-radius: 16px;
  padding: 12px 8px; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 150px;
}
.evo-card.current { box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
.evo-card.locked { background: #faf7f4; }
.evo-card-img { width: 72px; height: 72px; object-fit: contain; }
.evo-card-q { font-size: 48px; line-height: 72px; opacity: .35; }
.evo-card-name { font-size: 14px; font-weight: 800; color: var(--ink); }
.evo-card-cond { font-size: 11px; color: var(--brown); line-height: 1.4; }
.evo-card-tag {
  position: absolute; top: -8px; right: -6px; color: #fff; font-size: 11px;
  font-weight: 800; padding: 2px 8px; border-radius: 8px;
}
.evo-use, .evo-do { margin-top: auto; }
.evo-tip {
  margin-top: 12px; padding: 10px 14px; background: linear-gradient(120deg, var(--gold), var(--peach));
  border-radius: 14px; font-size: 14px; font-weight: 800; color: var(--ink); text-align: center;
  animation: tipPop .5s;
}
@keyframes tipPop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bond-gain {
  font-size: 15px; font-weight: 800; color: var(--pink-deep); margin: 4px 0 8px;
}
.glow-hint { animation: glowPulse 1.2s infinite; }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, .7); }
  50% { box-shadow: 0 0 0 10px rgba(255, 201, 60, 0); }
}

/* 进化过场动画 */
.evo-overlay {
  position: fixed; inset: 0; background: rgba(30, 20, 50, .92); z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.evo-anim { position: relative; width: 240px; height: 240px; }
.evo-anim-glow {
  position: absolute; inset: -40px; animation: glowSpin 2s linear infinite;
}
@keyframes glowSpin { from { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.15); } to { transform: rotate(360deg) scale(1); } }
.evo-anim-img {
  position: absolute; inset: 0; margin: auto; width: 200px; height: 200px; object-fit: contain;
  animation: evoShake .5s infinite;
}
.evo-anim-img.done { animation: evoDone .8s; }
@keyframes evoShake { 0%,100% { transform: scale(1); filter: brightness(1.6); } 50% { transform: scale(1.08); filter: brightness(2.4); } }
@keyframes evoDone { from { transform: scale(.5); filter: brightness(3); } to { transform: scale(1); filter: brightness(1); } }
.evo-anim-text { color: #fff; font-size: 22px; font-weight: 900; margin-top: 20px; line-height: 1.6; }

/* ============ 对战技能动画 ============ */
.battle-arena { position: relative; }
.skill-banner {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, .95); border: 3px solid var(--gold); border-radius: 999px;
  padding: 6px 20px; font-size: 18px; font-weight: 900; color: var(--ink);
  z-index: 20; animation: bannerIn .3s; white-space: nowrap;
}
.skill-banner.fade { animation: bannerOut .4s forwards; }
@keyframes bannerIn { from { transform: translateX(-50%) scale(.5); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes bannerOut { to { transform: translateX(-50%) scale(.8) translateY(-16px); opacity: 0; } }
.skill-proj {
  position: absolute; font-size: 34px; z-index: 15; pointer-events: none;
  transition: transform .55s cubic-bezier(.4, 0, .8, 1); filter: drop-shadow(0 0 8px currentColor);
}
.skill-burst {
  position: absolute; font-size: 60px; z-index: 16; pointer-events: none;
  transform: translate(-50%, -50%); animation: burstPop .6s forwards;
}
@keyframes burstPop {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}
.hit-flash { animation: hitFlash .6s; }
@keyframes hitFlash {
  0%, 100% { filter: none; transform: translateX(0); }
  20% { filter: brightness(2) saturate(0); transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { filter: brightness(1.5); transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ============ 调试模式开关 ============ */
.toggle { position: relative; display: inline-block; width: 52px; height: 30px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #ddd; border-radius: 30px;
  transition: .25s; cursor: pointer;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--pink-deep); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ============ 调试面板 ============ */
.debug-panel {
  background: #fff8f0; border: 2px dashed var(--gold); border-radius: 16px;
  padding: 12px 14px; margin-bottom: 14px;
}
/* 调试模式浮动跳过按钮 */
.debug-skip-btn {
  position: fixed; right: 16px; bottom: 18px; z-index: 50;
  background: rgba(232, 120, 60, 0.92); color: #fff; border: none;
  border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 800;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.debug-skip-btn:active { transform: scale(0.94); }

/* ============ 扩充环节：句型/拼读/阅读/写作/高频词/价值观 ============ */
.sight-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px auto 0; max-width: 620px; }
.sight-label { font-size: 13px; font-weight: 800; color: var(--brown); }
.sight-chip {
  background: #fff; border: 2px solid var(--gold); border-radius: 999px;
  padding: 5px 14px; font-size: 15px; font-weight: 800; color: var(--brown); cursor: pointer;
}
.sight-chip:active { transform: scale(.94); }
.grammar-pattern { font-size: 26px; font-weight: 900; color: var(--pink-deep); margin: 6px 0 2px; }
.grammar-examples { margin-top: 12px; width: 100%; }
.g-ex-row { display: flex; align-items: center; gap: 12px; justify-content: flex-start; text-align: left; }
.g-ex-en { font-size: 20px; font-weight: 800; color: var(--ink); }
.g-ex-zh { font-size: 14px; color: var(--brown); margin-top: 2px; }
.grammar-quiz { width: 100%; max-width: 640px; margin: 0 auto; }
.word-focus .q-text { font-size: 21px; font-weight: 800; text-align: center; }
.word-focus .q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phonics-rule { font-size: 28px; font-weight: 900; color: var(--gold-deep, #d98b1f); letter-spacing: 1px; margin: 6px 0 2px; }
.phonics-words { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.p-chip {
  background: #fff; border: 2px solid var(--peach); border-radius: 14px;
  padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.p-chip b { font-size: 17px; color: var(--ink); }
.p-chip small { font-size: 12px; color: var(--brown); }
.p-chip.on { border-color: var(--pink-deep); background: var(--pink); }
.p-chip.on b, .p-chip.on small { color: #fff; }
.passage-title { font-size: 20px; font-weight: 900; color: var(--brown); text-align: center; margin-bottom: 8px; }
.passage-text { font-size: 18px; line-height: 1.9; color: var(--ink); }
.pass-sent { cursor: pointer; border-radius: 6px; padding: 0 2px; }
.pass-sent.on { background: #fff3d6; }
.w-zh-prompt { font-size: 19px; font-weight: 800; color: var(--brown); margin-bottom: 4px; }
.w-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 46px; margin: 10px 0; }
.w-slot {
  min-width: 54px; height: 40px; border: 2px dashed var(--peach); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: var(--ink);
  padding: 0 8px; background: #fff3e0;
}
.w-slot:empty::before { content: "?"; color: #d8b98f; font-weight: 800; }
.w-slot.filled { border-style: solid; border-color: var(--gold); cursor: pointer; background: #fff; color: var(--pink-deep); }
.w-slot.bad { border-color: var(--red-no); background: #ffe3e3; animation: shake .4s; }
.w-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.w-chip {
  background: var(--pink); color: #fff; border: none; border-radius: 12px;
  padding: 9px 15px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.w-chip.used { opacity: .3; pointer-events: none; }
.w-chip:active { transform: scale(.94); }
.values-card {
  display: flex; align-items: center; gap: 10px; background: #fff6ec;
  border: 2px dashed var(--gold); border-radius: 16px; padding: 10px 14px; margin: 10px auto 0; max-width: 460px; text-align: left;
}
.values-card .vc-emoji { font-size: 30px; }
.values-card b { font-size: 16px; color: var(--brown); }
.values-card .vc-zh { font-size: 13px; color: var(--ink); margin-top: 2px; }
.debug-panel.hidden { display: none; }
.dbg-head {
  font-size: 13px; font-weight: 800; color: var(--brown);
  margin: 10px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #f0e4d4;
}
.dbg-head:first-child { margin-top: 0; }
.dbg-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 5px 0;
}
.dbg-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.dbg-stepper { display: flex; align-items: center; gap: 8px; }
.dbg-btn {
  background: #fff; border: 2px solid var(--peach); border-radius: 10px;
  padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--brown);
  cursor: pointer; min-width: 44px;
}
.dbg-btn:active { background: var(--peach); }
.dbg-val {
  min-width: 48px; text-align: center; font-size: 16px; font-weight: 900; color: var(--pink-deep);
}
.dbg-forms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dbg-form {
  background: #fff; border: 2px solid #eee; border-radius: 10px; padding: 4px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dbg-form.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,201,60,.3); }
.dbg-form img { width: 40px; height: 40px; object-fit: contain; }
.dbg-form span { font-size: 10px; color: var(--brown); font-weight: 600; }

/* ============ 属性对战 ============ */
.hp-text { font-size: 12px; font-weight: 800; color: var(--brown); margin-top: 2px; }
.dmg-num {
  position: absolute; z-index: 17; pointer-events: none;
  transform: translate(-50%, 0); font-size: 28px; font-weight: 900;
  text-shadow: 0 2px 0 #fff, 0 0 6px #fff;
  animation: dmgFloat 1s forwards;
}
.dmg-num.crit { font-size: 36px; }
.dmg-num.weak { font-size: 22px; opacity: .8; }
.dmg-num.none { font-size: 20px; color: #999 !important; }
@keyframes dmgFloat {
  0% { opacity: 0; margin-top: 10px; }
  20% { opacity: 1; }
  100% { opacity: 0; margin-top: -34px; }
}
.fx-none { color: #999; }

/* ============ 技能图鉴（收藏页） ============ */
.skill-learned-box {
  background: #fff; border-radius: 18px; padding: 12px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.skill-box-title { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip {
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: #fffaf3; border: 2px solid var(--peach); border-radius: 999px;
  padding: 3px 10px;
}
.learned-skills {
  font-size: 15px; font-weight: 800; color: var(--ink); margin: 6px auto 2px;
  background: linear-gradient(120deg, var(--gold), var(--peach));
  border-radius: 12px; padding: 8px 14px; max-width: 420px;
  animation: tipPop .5s;
}

/* ============ 地图模式 ============ */
.map-card {
  width: 100%; text-align: left; background: #fff; border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
  border-left: 8px solid var(--mapcolor, var(--pink)); cursor: pointer;
  transition: transform .12s;
}
.map-card:active { transform: scale(.98); }
.map-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.map-badge {
  background: var(--mapcolor, var(--pink)); color: #fff; font-weight: 900; font-size: 13px;
  padding: 3px 12px; border-radius: 999px; letter-spacing: .5px;
}
.map-name { font-size: 21px; font-weight: 900; color: var(--ink); }
.map-book { font-size: 13px; color: var(--brown); font-weight: 700; }
.map-desc { font-size: 13px; color: var(--brown); margin: 3px 0 10px; }
.map-path-mini { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.mp-dot { width: 11px; height: 11px; border-radius: 50%; background: #e8e0d8; }
.mp-dot.done { background: var(--mapcolor, var(--pink)); }
.mp-dot.cur { background: var(--gold); box-shadow: 0 0 0 3px rgba(255,201,60,.35); }
.map-progress { display: flex; align-items: center; gap: 12px; }
.map-prog-bar { flex: 1; height: 10px; background: #f0e8e0; border-radius: 6px; overflow: hidden; }
.map-prog-fill { height: 100%; background: var(--mapcolor, var(--pink)); border-radius: 6px; transition: width .4s; }
.map-prog-txt { font-size: 12px; font-weight: 800; color: var(--brown); white-space: nowrap; }

/* 地图详情页 */
.map-head {
  background: linear-gradient(135deg, var(--mapcolor), var(--pink-deep));
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; color: #fff;
  box-shadow: var(--shadow);
}
.map-head-name { font-size: 22px; font-weight: 900; }
.map-head-desc { font-size: 13px; opacity: .95; margin-top: 4px; }
.map-head-prog { font-size: 14px; font-weight: 800; margin-top: 8px; }
.map-path { position: relative; padding: 10px 0; }
.map-path::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px;
  background: repeating-linear-gradient(var(--mapcolor), var(--mapcolor) 12px, transparent 12px, transparent 22px);
  border-radius: 3px; transform: translateX(-50%); opacity: .35;
}
.map-node { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 26px; width: 50%; }
.map-node.left { margin-right: auto; padding-right: 26px; flex-direction: row-reverse; text-align: right; }
.map-node.right { margin-left: auto; padding-left: 26px; }
.map-node-btn {
  flex-shrink: 0; width: 62px; height: 62px; border-radius: 50%; border: 4px solid var(--mapcolor);
  background: #fff; display: flex; align-items: center; justify-content: center; position: relative;
  cursor: pointer; box-shadow: var(--shadow); transition: transform .12s;
}
.map-node-btn:active:not(:disabled) { transform: scale(.92); }
.map-node-btn:disabled { cursor: not-allowed; opacity: .55; border-color: #ccc; }
.map-node.open .map-node-btn { animation: nodePulse 1.6s infinite; }
@keyframes nodePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,201,60,.5); } 50% { box-shadow: 0 0 0 10px rgba(255,201,60,0); } }
.mn-num { position: absolute; top: -8px; left: -8px; background: var(--mapcolor); color: #fff; font-size: 12px; font-weight: 900; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mn-emoji { font-size: 28px; }
.map-node-info { min-width: 0; }
.mn-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.mn-unit { font-size: 11px; color: var(--brown); font-style: italic; margin-top: 2px; }
.mn-stars { color: var(--gold); font-size: 14px; margin-top: 3px; }
.mn-go { color: var(--mapcolor); font-size: 12px; font-weight: 800; margin-top: 3px; }
.map-node.done .mn-title::after { content: " ✓"; color: var(--green-ok); }
.map-end { text-align: center; color: var(--brown); font-weight: 700; padding: 16px 0 30px; font-size: 15px; }

/* ============ 单词缩略图（带 emoji 兜底） ============ */
.word-thumb { display: inline-flex; position: relative; }
.word-thumb img { object-fit: contain; display: block; }
.word-thumb .wt-emoji { align-items: center; justify-content: center; display: none; }
.word-thumb.big img, .word-thumb.big .wt-emoji { width: 240px; height: 240px; font-size: 120px; }
.word-thumb.small img, .word-thumb.small .wt-emoji { width: 96px; height: 96px; font-size: 46px; }
.word-thumb.chip img, .word-thumb.chip .wt-emoji { width: 58px; height: 58px; font-size: 30px; }
.word-thumb.sm img, .word-thumb.sm .wt-emoji { width: 34px; height: 34px; font-size: 20px; }
.wf-thumb { display: flex; justify-content: center; }

/* ============ iPhone 竖屏适配（≤560px） ============ */
@media (max-width: 560px) {
  .page-scroll { padding: 14px 14px 34px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .topbar .title { font-size: 16px; }

  /* 首页 hero 与地图卡 */
  .home-hero { padding: 14px; gap: 10px; }
  .home-hero .mascot { width: 84px; height: 84px; flex-shrink: 0; }
  .home-hero > div { min-width: 0; flex: 1; }
  .home-hero h1 { font-size: 20px; overflow-wrap: break-word; }
  .home-hero p { font-size: 13px; overflow-wrap: break-word; }
  .home-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 0 12px; }
  .nav-chip { font-size: 13px; padding: 11px 6px; }
  .map-card { padding: 14px 14px; }
  .map-name { font-size: 18px; }

  /* 地图路径：窄屏改为单列，全部靠右排列 */
  .map-path::before { left: 31px; transform: none; }
  .map-node { width: 100%; }
  .map-node.left, .map-node.right { margin: 0 0 22px 0; padding: 0 0 0 74px; flex-direction: row; text-align: left; }
  .map-node-btn { position: absolute; left: 0; }
  .map-node.left .map-node-btn { position: absolute; left: 0; }

  /* 单词页 */
  .stage-content { padding: 10px 14px 20px; }
  .word-focus { padding: 14px; }
  .word-thumb.big img, .word-thumb.big .wt-emoji { width: 170px; height: 170px; font-size: 84px; }
  .word-focus .wf-en { font-size: 32px; }
  .word-focus .wf-zh { font-size: 18px; }
  .word-thumb.small img, .word-thumb.small .wt-emoji { width: 76px; height: 76px; font-size: 36px; }
  .word-card { width: 122px; min-width: 122px; padding: 10px 8px; }
  .word-card .word-thumb { width: 76px; height: 76px; }
  .word-card .word-thumb.small img, .word-card .word-thumb.small .wt-emoji { width: 76px; height: 76px; font-size: 36px; }
  .word-card .w-en { font-size: 15px; }
  .word-card .w-zh { font-size: 12px; }
  /* 三按钮改 3 列等宽网格，minmax(0,1fr) 强制可收缩，杜绝横向溢出 */
  .wf-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .wf-actions .btn { font-size: 13px; padding: 10px 2px; gap: 3px; min-width: 0; }
  .wf-actions .btn .btn-ic { font-size: 15px; }

  /* 跟读/对话 */
  .read-line { font-size: 20px; }
  .bubble { font-size: 15px; max-width: 86%; }
  .mic-btn { width: 64px; height: 64px; font-size: 30px; }

  /* 对战：精灵缩小、题目紧凑 */
  .fighter img, .fighter .f-sprite { width: 84px; height: 84px; }
  .fighters { gap: 6px; padding: 4px 2px; }
  .vs-flash { font-size: 22px; }
  .type-badge { font-size: 10px; padding: 2px 7px; }
  .hp-text { font-size: 11px; }
  .q-text { font-size: 17px; }
  .q-opt { font-size: 15px; padding: 12px 8px; min-height: 48px; }
  .q-options { gap: 8px; }
  .skill-banner { font-size: 15px; padding: 4px 14px; }
  .skill-proj { font-size: 26px; }
  .dmg-num { font-size: 22px; }

  /* 抓捕 */
  .wild-sprite img { width: 110px !important; height: 110px !important; }
  .read-line { max-width: 100%; }

  /* 收藏/进化/设置 */
  .collection-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .collect-card { padding: 8px 4px; }
  .collect-card img { width: 56px !important; height: 56px !important; }
  .c-name { font-size: 12px; }
  .c-from { font-size: 10px; }
  .evo-grid { grid-template-columns: repeat(3, 1fr); }
  .evo-current { flex-direction: column; text-align: center; }
  .evo-hero-img { width: 100px; height: 100px; }
  .checkin-calendar { gap: 4px; }
  .cal-day { font-size: 12px; }
  .setting-row { flex-wrap: wrap; }
  .speed-opts { width: 100%; justify-content: flex-start; }
  .dbg-forms { grid-template-columns: repeat(4, 1fr); }
  .btn { min-height: 46px; }   /* 触控友好 */
  .ai-card img, .ai-card .word-thumb img { width: 46px; height: 46px; }
  .finish-panel { padding: 18px 14px; }
  .mascot-big { width: 110px; height: 110px; }
}

/* iPhone 刘海屏底部安全区 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .page-scroll { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .dialog-actions { padding-bottom: env(safe-area-inset-bottom); }
}

/* ============ 平板横屏（高度≤820px）：压缩焦点卡，让单词卡行首屏可见 ============ */
@media (min-width: 700px) and (max-height: 820px) {
  .word-focus { padding: 16px 20px; margin: 4px auto 10px; }
  .word-thumb.big img, .word-thumb.big .wt-emoji { width: 190px; height: 190px; font-size: 92px; }
  .word-focus .wf-en { font-size: 34px; margin: 4px 0 0; }
  .word-focus .wf-zh { font-size: 17px; margin-top: 2px; }
  .wf-actions { margin-top: 10px; }
  .wf-actions .btn { padding: 10px 20px; font-size: 16px; }
  .word-card { width: 132px; min-width: 132px; }
  .word-card .word-thumb { width: 88px; height: 88px; }
  .word-card .word-thumb.small img, .word-card .word-thumb.small .wt-emoji { width: 88px; height: 88px; font-size: 42px; }
  .word-card .w-en { font-size: 17px; }
  .word-card .w-zh { font-size: 13px; }
}

/* ============ 横屏矮屏适配（iPhone 横屏 / 分屏，高度≤520px；置于平板块之后以覆盖） ============
   物理空间不足竖排 → 焦点卡在左，单词卡行改右栏竖排滚动 */
@media (max-height: 520px) {
  .stage-content { padding: 6px 12px 8px; gap: 10px; flex-direction: row; align-items: stretch; }
  .stage-content > .step-title, .stage-content > .step-tip { display: none; }
  .word-focus { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 12px; margin: 0; }
  .word-thumb.big img, .word-thumb.big .wt-emoji { width: 88px; height: 88px; font-size: 44px; }
  .word-focus .wf-en { font-size: 20px; margin: 2px 0 0; }
  .word-focus .wf-zh { font-size: 12px; margin-top: 0; }
  .wf-actions { margin-top: 6px; width: 100%; }
  .wf-actions .btn { padding: 5px 6px; font-size: 12px; min-height: 30px; }
  #wf-feedback { min-height: 16px !important; margin-top: 4px !important; font-size: 13px !important; }
  .word-card-row { flex: 0 0 108px; width: 108px; overflow-x: hidden; overflow-y: auto; flex-direction: column; padding: 4px 2px; }
  .word-card { width: 96px; min-width: 96px; padding: 6px; margin: 0 0 6px 0; }
  .word-card .word-thumb { width: 52px; height: 52px; }
  .word-card .word-thumb.small img, .word-card .word-thumb.small .wt-emoji { width: 52px; height: 52px; font-size: 24px; }
  .word-card .w-en { font-size: 12px; }
  .word-card .w-zh { font-size: 10px; }
  .word-card .speaker { margin-top: 4px; font-size: 14px; }
  /* "学会了下一步"按钮：作为第三栏收窄变小，不再遮挡卡列 */
  .stage-content > .dialog-actions { margin: 0 !important; display: flex; align-items: center; flex: 0 0 auto; }
  .stage-content > .dialog-actions .btn.big { font-size: 13px; padding: 10px 10px; min-height: 0; width: 76px; line-height: 1.3; }
  .fighters img, .fighters .f-sprite { width: 72px !important; height: 72px !important; }
  .mic-btn { width: 56px; height: 56px; font-size: 26px; }
}

/* ============ 邀请码门禁页 ============ */
.gate-page {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--cream), var(--peach));
}
.gate-box {
  width: min(420px, 88vw); background: #fff; border-radius: 28px; padding: 32px 26px;
  box-shadow: var(--shadow); text-align: center;
}
.gate-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.gate-title { font-size: 26px; font-weight: 900; color: var(--ink); margin-top: 12px; }
.gate-sub { font-size: 14px; color: var(--brown); margin: 6px 0 18px; }
.gate-input {
  width: 100%; box-sizing: border-box; font-size: 20px; font-weight: 800; letter-spacing: 2px;
  text-align: center; text-transform: uppercase; color: var(--ink);
  padding: 14px 10px; border: 3px solid var(--peach); border-radius: 16px;
  background: #fffaf3; outline: none; font-family: inherit;
}
.gate-input:focus { border-color: var(--pink-deep); }
.gate-btn { width: 100%; margin-top: 14px; }
.gate-msg { min-height: 22px; margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--red-no); }
.gate-hint { font-size: 12px; color: var(--brown); margin-top: 14px; line-height: 1.7; }

/* ---------- 拼读词卡/选项的🔊标识 ---------- */
.p-chip { position: relative; }
.p-play { position: absolute; top: 4px; right: 6px; font-size: 13px; opacity: .75; }
.p-chip.on .p-play { filter: brightness(3); }
.q-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.q-opt-t { flex: 1; }
.q-opt-play { font-size: 16px; opacity: .7; padding: 4px; }

/* ---------- 手机端（≤520px）按钮加大 ---------- */
@media (max-width: 520px) {
  #read-demo, #read-slow { width: 88px; height: 88px; font-size: 40px; }
  #read-mic { width: 150px !important; height: 150px !important; font-size: 62px !important; }
  .mic-wrap { gap: 10px; }
  .p-chip { padding: 12px 16px; min-height: 64px; }
  .p-chip b { font-size: 19px; }
  .q-opt { padding: 18px 14px; font-size: 22px; }
  .wf-actions .btn { min-height: 56px; font-size: 17px; }
  .dialog-actions .btn { min-height: 54px; }
}
