/* ═══════════════ 单词大冒险 · 全局样式 ═══════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #FFF3E0; --bg2: #FFE0B2;
  --primary: #FF9A56; --primary-dark: #F57C00;
  --secondary: #4FC3F7; --secondary-dark: #0288D1;
  --success: #66BB6A; --danger: #EF5350;
  --gold: #FFC107; --text: #4E342E; --text-light: #8D6E63;
  --card-bg: #FFFFFF; --radius: 18px;
}

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

/* 「整屏定高 + 内部滚动」只给单词乐园用。
   admin.html 共用这个样式表，但它是普通长页面，必须能整页滚动 —— 
   之前这里写死 overflow:hidden，导致管理后台完全滚不动。 */
body.words-body { overflow: hidden; }

body { display: flex; justify-content: center; }
#app {
  width: 100%; max-width: 480px;
  height: 100vh; height: 100dvh;   /* dvh 跟随移动端地址栏伸缩 */
  display: flex; flex-direction: column; overflow: hidden;
}

/* ═══════════════ 顶部状态栏 ═══════════════ */
#topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: linear-gradient(135deg, #FF9A56, #FF7043);
  color: #fff; position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.player-info { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.player-meta { flex: 1; }
.player-name { font-size: 15px; font-weight: 700; }
.xp-bar { width: 90px; height: 8px; background: rgba(255,255,255,0.35); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.xp-fill { height: 100%; background: #FFE082; border-radius: 4px; width: 0%; transition: width 0.4s; }
.xp-text { font-size: 10px; opacity: 0.9; margin-top: 2px; }
.top-stats { display: flex; gap: 10px; }
.stat { background: rgba(255,255,255,0.22); padding: 6px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.btn-logout {
  background: rgba(255,255,255,0.22); border: none; border-radius: 12px;
  width: 34px; height: 34px; font-size: 16px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.btn-logout:active { transform: scale(0.9); }

/* ═══════════════ 主视图容器 ═══════════════ */
#view {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px;
}
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 20px; font-weight: 800; margin: 8px 0 14px; text-align: center; }

/* ═══════════════ 今日任务卡片 ═══════════════ */
.today-card {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border: 2px dashed #FFC107; border-radius: var(--radius);
  padding: 14px; margin-bottom: 16px;
}
.today-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.today-title { font-size: 16px; font-weight: 800; color: #F57C00; }
.today-stats { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.today-bar { height: 10px; background: #FFF8E1; border-radius: 5px; overflow: hidden; border: 1px solid #FFE0B2; }
.today-fill { height: 100%; background: linear-gradient(90deg, #FFC107, #FF9A56); width: 0%; transition: width 0.4s; }
.sub-title { font-size: 17px; font-weight: 800; margin: 20px 0 12px; color: var(--primary-dark); }
.task-date {
  text-align: center; font-size: 16px; font-weight: 800; color: var(--primary-dark);
  background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.owe-alert {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  border: 2px solid var(--danger); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 14px;
  animation: owePulse 1.2s ease-in-out infinite;
}
@keyframes owePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,83,80,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239,83,80,0.15); }
}
.owe-alert-ico { font-size: 30px; }
.owe-alert-title { font-weight: 800; color: var(--danger); font-size: 16px; }
.owe-alert-msg { color: #C62828; font-size: 13px; margin-top: 2px; line-height: 1.4; }
.badge-stage {
  background: #FFF3E0; color: var(--primary-dark); font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 12px; white-space: nowrap;
}

/* ═══════════════ 音标学习 ═══════════════ */
.ph-subtitle { text-align: center; color: var(--text-light); font-size: 13px; margin: -6px 0 16px; }
.ph-group {
  background: #fff; border-radius: var(--radius); margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07); overflow: hidden;
}
.ph-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; cursor: pointer; background: #FFF8F0;
  touch-action: manipulation;
}
.ph-head:active { background: #FFF3E0; }
.ph-head-left { display: flex; align-items: center; gap: 12px; }
.ph-emoji { font-size: 26px; }
.ph-name { font-weight: 800; font-size: 16px; color: var(--text); }
.ph-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.ph-toggle { font-size: 18px; color: var(--text-light); }
.ph-body { display: none; padding: 6px 12px 14px; }
.ph-body.open { display: block; }
.ph-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; border-bottom: 1px dashed #EFEBE9;
}
.ph-item:last-child { border-bottom: none; }
.ph-sym {
  font-size: 24px; font-weight: 800; color: var(--primary-dark);
  background: #FFF3E0; border: 2px solid #FFE0B2; border-radius: 10px;
  width: 64px; height: 48px; cursor: pointer; transition: transform 0.12s;
  flex-shrink: 0; touch-action: manipulation;
}
.ph-sym:active { transform: scale(0.9); }
.ph-tip { flex: 1; font-size: 13px; color: var(--text-light); line-height: 1.4; }
.ph-words { display: flex; flex-direction: column; gap: 6px; }
.ph-wordwrap { text-align: center; }
.ph-wordph { font-size: 12px; color: var(--secondary-dark); margin-top: 2px; font-weight: 500; }
/* 音标视频播放层 */
.ph-video-box {
  background: #fff; border-radius: 18px; padding: 16px; max-width: 420px; width: 92%;
  text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.ph-video-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ph-video-sym { font-size: 28px; font-weight: 800; color: var(--primary-dark); }
.ph-video-close {
  background: #F5F5F5; border: none; border-radius: 50%; width: 32px; height: 32px;
  font-size: 16px; cursor: pointer; color: var(--text-light);
}
.ph-video-box video { width: 100%; border-radius: 12px; background: #000; position: relative; }
.ph-video-tip { font-size: 14px; color: var(--text-light); margin-top: 10px; line-height: 1.5; }
.ph-word {
  background: #E3F2FD; color: var(--secondary-dark); border: none; border-radius: 8px;
  padding: 4px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.ph-word:active { background: #BBDEFB; }
/* 音标视频加载指示器 */
.ph-video-loader {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 2; pointer-events: none;
}
.ph-video-loader.hidden { display: none; }
.ph-spinner { font-size: 32px; animation: phSpin 1s linear infinite; }
.ph-loader-txt { font-size: 13px; color: var(--text-light); font-weight: 600; }
@keyframes phSpin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
/* 音标视频弹层容器需要相对定位 */
#phVideoModal .ph-video-box { position: relative; }
.review-btns { display: flex; gap: 5px; }
.btn-review {
  flex: 1; padding: clamp(7px, 1.4vh, 11px) 2px; font-size: 11px; border-radius: 8px;
  white-space: nowrap;               /* 文字不换行 */
  line-height: 1.3;
}

/* ═══════════════ 地图视图 ═══════════════ */
.unit-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px; box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}
.unit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.unit-title { font-size: 16px; font-weight: 700; }
.unit-title small { color: var(--text-light); font-weight: 500; }
.unit-pct { font-size: 13px; color: var(--primary-dark); font-weight: 700; }
.unit-bar { height: 8px; background: #EFEBE9; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.unit-fill { height: 100%; background: linear-gradient(90deg, var(--secondary), var(--success)); border-radius: 4px; transition: width 0.4s; }

.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level-node {
  position: relative; background: #FFF8F0; border: 2px solid #FFE0B2;
  border-radius: 12px; padding: 8px 4px; text-align: center; cursor: pointer;
  transition: transform 0.15s;
}
.level-node:active { transform: scale(0.95); }
.level-node .lv-num { font-weight: 800; font-size: 14px; color: var(--primary-dark); }
.level-node .lv-stars { font-size: 11px; letter-spacing: -1px; }
.level-node.locked { opacity: 0.45; filter: grayscale(0.7); }
.level-node.done { background: #E8F5E9; border-color: #A5D6A7; }
.level-node .lock-ico { position: absolute; top: 2px; right: 4px; font-size: 12px; }
.level-node.boss { grid-column: span 3; border-style: dashed; border-width: 2px; border-color: var(--gold); background: #FFF8E1; }
.level-node.boss .lv-num { color: var(--gold); }
.level-node.boss.locked { opacity: 0.4; }

/* ═══════════════ 一屏装下的练习布局 ═══════════════ */
/* 复习/纠错/学习三屏：头部一行、卡片弹性伸缩、操作区固定在底，
   页面本身不滚动，保证按钮和跟读条永远可见。-kb 是软键盘高度。 */
.fit-view {
  gap: 8px;
  height: calc(100% - var(--kb, 0px));
  min-height: 0;
}
/* 必须用 .view.fit-view.active 提高优先级，否则会被上面的
   .view.active { display: block } 覆盖掉，弹性布局会静默失效 */
.view.fit-view.active { display: flex; flex-direction: column; }
/* 打字时（键盘弹起）跟读条让位：这时用不到录音，优先保证词卡和按钮 */
body.kb-open .fit-view .pron-box { display: none; }
.fit-head { display: flex; align-items: center; gap: 10px; flex: none; }
.fit-head .icon-btn { width: 34px; height: 34px; font-size: 16px; flex: none; }
.fit-head-mid { flex: 1; min-width: 0; }
.fit-head-line {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 4px;
}
.fit-head-line > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-step { font-size: 12px; color: var(--text-light); font-weight: 500; white-space: nowrap; }
.fit-body {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.fit-side { flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; }

/* ═══════════════ 学习视图 ═══════════════ */
.learn-header, .spell-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0 12px; font-weight: 700; font-size: 16px;
}
.icon-btn {
  background: #fff; border: none; border-radius: 50%; width: 38px; height: 38px;
  font-size: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); cursor: pointer;
}
.word-card {
  background: var(--card-bg); border-radius: 20px;
  padding: clamp(12px, 2.4vh, 26px) 18px;
  text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.wc-emoji { font-size: clamp(34px, 7vh, 62px); line-height: 1.1; }
.wc-emoji.hidden { display: none; }
.wc-en { font-size: clamp(23px, 5.2vh, 38px); font-weight: 800; letter-spacing: 0.5px; line-height: 1.15; }
.wc-ph { color: var(--secondary-dark); font-size: clamp(13px, 2vh, 17px); margin-top: 4px; }
.wc-pos { color: var(--text-light); font-size: 12px; margin-top: 6px; background: #F5F5F5; padding: 2px 12px; border-radius: 20px; }
.wc-cn { font-size: clamp(16px, 2.7vh, 23px); font-weight: 700; margin-top: 6px; }
.btn-speak {
  margin-top: 18px; background: var(--secondary); color: #fff; border: none;
  padding: 10px 24px; border-radius: 24px; font-size: 16px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(2,136,209,0.3); transition: transform 0.15s;
}
.btn-speak:active { transform: scale(0.95); }
.learn-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.learn-progress { color: var(--text-light); font-size: 14px; }

/* ═══════════════ 按钮 ═══════════════ */
.btn {
  border: none; border-radius: 14px; padding: 12px 18px; font-size: 16px;
  font-weight: 700; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
  touch-action: manipulation;   /* 消除双击缩放延迟，移动端响应更快 */
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 12px rgba(245,124,0,0.35); }
.btn-ghost { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.btn-block { width: 100%; margin-top: 16px; }
.btn-success { background: linear-gradient(135deg, #66BB6A, #388E3C); color: #fff; box-shadow: 0 4px 12px rgba(56,142,60,0.35); }
.hidden { display: none !important; }

/* ═══════════════ 拼写练习卡片 ═══════════════ */
.spell-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}
.spell-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.spell-card-title { font-size: 16px; font-weight: 800; color: var(--primary-dark); }
.spell-card-count { font-size: 13px; color: var(--text-light); font-weight: 600; }
.spell-card-body { text-align: center; }
.spell-emoji { font-size: 48px; min-height: 56px; }
.spell-cn { font-size: 24px; font-weight: 800; margin-top: 4px; }
.spell-ph { color: var(--secondary-dark); font-size: 15px; margin: 4px 0 10px; }
.spell-feedback { font-size: 17px; font-weight: 700; min-height: 26px; margin: 6px 0; transition: all 0.2s; }
.spell-ok { color: var(--success); animation: pop 0.3s ease; }
.spell-wrong { color: var(--danger); }
.spell-empty { text-align: center; color: var(--text-light); padding: 20px 0; font-size: 15px; }
.spell-actions { display: flex; gap: 8px; margin-top: 12px; }
@keyframes pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
.spell-card.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* ═══════════════ 复习拼写输入 ═══════════════ */
.spell-box { margin-top: 10px; width: 100%; }
.spell-box .spell-input { width: 100%; max-width: 280px; }

/* ═══════════════ 闯关视图 ═══════════════ */
.quiz-header { display: flex; align-items: center; gap: 10px; padding: 4px 0 14px; }
.quiz-progress { flex: 1; }
.quiz-progress span { font-size: 14px; color: var(--text-light); }
.mini-bar { height: 6px; background: #EFEBE9; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--secondary); width: 0%; transition: width 0.3s; }
.quiz-combo { font-size: 15px; font-weight: 800; color: var(--danger); min-width: 46px; text-align: right; }

.quiz-prompt {
  background: var(--card-bg); border-radius: 20px; padding: 24px; text-align: center;
  margin-bottom: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.qp-en { font-size: 34px; font-weight: 800; }
.qp-cn { font-size: 26px; font-weight: 700; }
.qp-hint { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.qp-ph { color: var(--secondary-dark); font-size: 16px; margin-top: 4px; }
.qp-speak { margin-top: 12px; font-size: 22px; background: none; border: none; cursor: pointer; }

.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  background: #fff; border: 2px solid #EFEBE9; border-radius: 14px;
  padding: 14px 16px; font-size: 17px; font-weight: 600; cursor: pointer;
  text-align: left; transition: all 0.12s;
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option.correct { background: #E8F5E9; border-color: var(--success); }
.quiz-option.wrong { background: #FFEBEE; border-color: var(--danger); }
.quiz-option.disabled { pointer-events: none; }
.quiz-option .opt-letter { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; background: #F5F5F5; border-radius: 50%; margin-right: 10px; font-size: 13px; color: var(--text-light); }

/* 拼写视图 */
.spell-input-wrap { text-align: center; padding: 30px 20px; }
.spell-cn { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.spell-ph { color: var(--secondary-dark); font-size: 16px; margin-bottom: 20px; }
.spell-blanks { font-size: 34px; font-weight: 800; letter-spacing: 8px; margin-bottom: 20px; min-height: 48px; }
.spell-input {
  width: 100%; max-width: 320px; padding: 14px; font-size: 22px; text-align: center;
  border: 3px solid var(--secondary); border-radius: 14px; outline: none;
  letter-spacing: 4px; text-transform: lowercase;
  color: var(--text);
}
.spell-input::placeholder {
  color: rgba(142, 142, 142, 0.4);   /* 淡灰色提示文字 */
  letter-spacing: 1px;
  font-size: 16px;
}
.spell-feedback { margin-top: 16px; font-size: 18px; font-weight: 700; min-height: 28px; }

/* ═══════════════ 结算视图 ═══════════════ */
.result-card { background: var(--card-bg); border-radius: 24px; padding: 28px 22px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.1); margin-top: 20px; }
.result-stars { font-size: 44px; letter-spacing: 6px; }
.result-card h2 { font-size: 26px; margin: 10px 0; }
.result-stats { display: flex; justify-content: center; gap: 20px; font-size: 15px; margin: 14px 0; font-weight: 600; }
.result-words { margin: 10px 0; font-size: 14px; color: var(--text-light); }
.result-words .wrong-word { color: var(--danger); font-weight: 600; }
.result-earn { font-size: 12px; color: var(--text-light); margin: 4px 0 10px; min-height: 16px; }
.result-btns { display: flex; gap: 10px; margin-top: 16px; }
.result-btns .btn { flex: 1; }
.star-pop { display: inline-block; animation: starPop 0.5s ease; }
@keyframes starPop { 0% { transform: scale(0) rotate(-30deg); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* ═══════════════ 错词本 & 成就 ═══════════════ */
.wrong-item {
  background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wrong-item .wi-en { font-weight: 800; font-size: 17px; }
.wrong-item .wi-cn { color: var(--text-light); font-size: 13px; }
.wrong-item .wi-del { background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.5; }
.empty-tip { text-align: center; color: var(--text-light); padding: 50px 0; font-size: 16px; }
.empty-tip .big { font-size: 52px; display: block; margin-bottom: 12px; }

.achieve-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.achieve-item {
  background: #fff; border-radius: 16px; padding: 14px 8px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.achieve-item .ai-ico { font-size: 34px; }
.achieve-item .ai-name { font-size: 12px; font-weight: 600; margin-top: 6px; }
.achieve-item.locked { opacity: 0.35; filter: grayscale(1); }

/* ═══════════════ 底部导航 ═══════════════ */
#bottomnav {
  position: static; flex: none; margin: 0 auto;
  width: 100%; max-width: 480px; display: flex; justify-content: space-around;
  background: #fff; padding: 8px 0 10px; box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 20; border-radius: 18px 18px 0 0;
}
.nav-item { background: none; border: none; font-size: 12px; color: var(--text-light); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 14px; }
.nav-item .nav-ico { font-size: 22px; }
.nav-item.active { color: var(--primary-dark); font-weight: 700; }

/* ═══════════════ 弹窗 & Toast ═══════════════ */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center; z-index: 100; animation: fadeIn 0.2s;
}
.modal-box { background: #fff; border-radius: 20px; padding: 26px 24px; max-width: 320px; width: 90%; text-align: center; }
.modal-box h3 { font-size: 19px; margin-bottom: 10px; }
.modal-box p { color: var(--text-light); font-size: 15px; margin-bottom: 18px; line-height: 1.6; }
.modal-box .btn { width: 100%; }
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 10px 22px; border-radius: 24px;
  font-size: 15px; z-index: 110; animation: fadeIn 0.2s;
}

/* 庆祝动画 */
/* ═══════════════ 登录/注册界面 ═══════════════ */
.login-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FF9A56, #FF7043);
  padding: 20px;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: #fff; border-radius: 22px; padding: 30px 26px;
  max-width: 340px; width: 100%; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.login-logo { font-size: 52px; }
.login-box h1 { font-size: 22px; margin: 8px 0 4px; color: var(--text); }
.login-sub { color: var(--text-light); font-size: 14px; margin-bottom: 18px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  width: 100%; padding: 12px; font-size: 16px;
  border: 2px solid #EFEBE9; border-radius: 10px; outline: none;
  box-sizing: border-box;
}
.auth-form input:focus { border-color: var(--secondary); }
.auth-select {
  width: 100%; padding: 12px; font-size: 14px; color: var(--text);
  border: 2px solid #EFEBE9; border-radius: 10px; outline: none;
  background: #fff; box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
.auth-select:focus { border-color: var(--secondary); }
.auth-sub { font-size: 12px; color: var(--text-light); text-align: left; margin-top: 2px; }
.login-box { max-height: 92vh; overflow-y: auto; }   /* 表单变长后小屏可滚动 */
/* 家长管理入口：做小做淡，孩子不会误点，家长知道在哪 */
.parent-entry {
  display: block; margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed #EFEBE9;
  font-size: 12px; color: #B08A6E; text-decoration: none;
}
.parent-entry:hover, .parent-entry:active { color: var(--primary-dark); text-decoration: underline; }
.forgot-q {
  background: #FFF8E1; border: 2px dashed var(--gold); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-weight: 700; color: #8D6E63; text-align: left;
}
.pwd-divider {
  margin: 18px 0 10px; padding-top: 14px; border-top: 1px dashed #EFEBE9;
  font-size: 13px; font-weight: 700; color: var(--primary-dark);
}
.sq-status {
  font-size: 12px; color: var(--text-light); text-align: left;
  background: #F7F7F7; border-radius: 8px; padding: 8px 10px; line-height: 1.5;
}
.sq-status.ok { background: #E8F5E9; color: #2E7D32; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.auth-switch { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.auth-switch a { color: var(--primary-dark); font-weight: 700; cursor: pointer; }

/* ═══════════════ 复读 · 跟读评测 ═══════════════ */
.pron-box {
  background: #fff; border-radius: 16px; padding: 9px 11px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08); flex: none;
}
.pron-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.pron-title { font-size: 15px; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.pron-status { font-size: 12px; color: var(--text-light); text-align: right; line-height: 1.35; }
.pron-canvas {
  display: none; width: 100%; height: 30px; background: #FFF8F0;
  border-radius: 8px; margin-bottom: 6px;
}
.pron-box.recording .pron-canvas { display: block; }
.pron-btns { display: flex; gap: 6px; }
.pron-btn { flex: 1; padding: clamp(7px, 1.5vh, 11px) 4px; font-size: 12px; border-radius: 9px; white-space: nowrap; }
.pron-btn:disabled { background: #EEEEEE; color: #BDBDBD; box-shadow: none; }
.pron-btn.recording { background: linear-gradient(135deg, #EF5350, #C62828); animation: pronPulse 1s infinite; }
@keyframes pronPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.72; } }

.pron-result { margin-top: 7px; }
.pron-loading { text-align: center; color: var(--text-light); font-size: 14px; padding: 12px 0; }
.pron-err { background: #FFF3E0; color: #E65100; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.pron-heard { font-size: 13px; color: var(--text-light); margin: 8px 0; }
.pron-note { font-size: 11px; color: var(--text-light); background: #F5F5F5; border-radius: 8px; padding: 6px 9px; margin-top: 8px; line-height: 1.4; }
.pron-quota { font-size: 11px; color: var(--text-light); text-align: right; margin-top: 6px; }

/* 紧凑评分条：默认只占一行，音素明细进弹层 */
.pron-compact { display: flex; align-items: center; gap: 10px; }
.psc-score {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 19px;
}
.psc-score.good { background: linear-gradient(135deg, #66BB6A, #2E7D32); }
.psc-score.ok { background: linear-gradient(135deg, #FFB74D, #F57C00); }
.psc-score.bad { background: linear-gradient(135deg, #EF5350, #C62828); }
.psc-bars { flex: 1; min-width: 0; }
.psc-row { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-bottom: 3px; }
.psc-row:last-child { margin-bottom: 0; }
.psc-row > span { width: 26px; color: var(--text-light); flex: none; }
.psc-row > em { flex: 1; height: 6px; background: #EFEBE9; border-radius: 3px; overflow: hidden; display: block; }
.psc-row > em > i { display: block; height: 100%; border-radius: 3px; }
.psc-row > em > i.good { background: linear-gradient(90deg, #81C784, #388E3C); }
.psc-row > em > i.ok { background: linear-gradient(90deg, #FFD54F, #F57C00); }
.psc-row > em > i.bad { background: linear-gradient(90deg, #EF9A9A, #C62828); }
.psc-row > b { width: 24px; text-align: right; font-size: 11px; }
.psc-more {
  flex: none; background: #EEF3FF; border: none; color: var(--secondary-dark);
  font-size: 11px; font-weight: 700; border-radius: 8px; padding: 7px 9px; cursor: pointer;
}
.psc-more:active { transform: scale(0.94); }

/* 发音详情弹层 */
.pron-detail-box {
  max-width: 400px; width: 92%; max-height: 76vh; text-align: left;
  display: flex; flex-direction: column;
}
.pron-detail-body { overflow-y: auto; margin: 6px 0 12px; }
.pron-detail-box h3 { text-align: center; }

.pron-score { display: flex; align-items: center; gap: 14px; }
.ps-big {
  width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800;
}
.ps-big b { font-size: 26px; line-height: 1; }
.ps-big small { font-size: 10px; font-weight: 600; opacity: 0.9; }
.ps-big.good { background: linear-gradient(135deg, #66BB6A, #2E7D32); }
.ps-big.ok { background: linear-gradient(135deg, #FFB74D, #F57C00); }
.ps-big.bad { background: linear-gradient(135deg, #EF5350, #C62828); }
.ps-bars { flex: 1; }
.ps-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.ps-row:last-child { margin-bottom: 0; }
.ps-label { width: 42px; color: var(--text-light); flex-shrink: 0; }
.ps-track { flex: 1; height: 8px; background: #EFEBE9; border-radius: 4px; overflow: hidden; }
.ps-track i { display: block; height: 100%; border-radius: 4px; transition: width 0.4s; }
.ps-track i.good { background: linear-gradient(90deg, #81C784, #388E3C); }
.ps-track i.ok { background: linear-gradient(90deg, #FFD54F, #F57C00); }
.ps-track i.bad { background: linear-gradient(90deg, #EF9A9A, #C62828); }
.ps-val { width: 26px; text-align: right; font-weight: 800; color: var(--text); }

.pron-words { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pron-word { background: #FAFAFA; border-radius: 10px; padding: 7px 10px; }
.pw-head { display: flex; align-items: center; gap: 8px; }
.pw-word { font-weight: 800; font-size: 15px; }
.pw-score { font-size: 12px; font-weight: 800; margin-left: auto; }
.pw-word.good, .pw-score.good { color: #2E7D32; }
.pw-word.ok, .pw-score.ok { color: #E65100; }
.pw-word.bad, .pw-score.bad { color: #C62828; }
.pw-err { font-size: 10px; background: #FFEBEE; color: #C62828; border-radius: 6px; padding: 1px 6px; }
.pw-phones { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.phon {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; padding: 2px 7px; border-radius: 7px; font-weight: 700;
}
.phon.good { background: #E8F5E9; color: #2E7D32; }
.phon.ok { background: #FFF3E0; color: #E65100; }
.phon.bad { background: #FFEBEE; color: #C62828; }

.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.celebrate span { position: absolute; font-size: 26px; animation: floatUp 1.6s ease-out forwards; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-120vh) scale(1.2) rotate(20deg); opacity: 0; }
}

/* ═══════════════ 积分乐园 ═══════════════ */
.reward-hint {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
  border: 2px solid var(--gold); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
  color: #8D6E63; line-height: 1.4;
}
.reward-hint:active { transform: scale(0.98); }
.reward-hint .rh-ico { font-size: 24px; flex-shrink: 0; }
.reward-hint b { color: var(--primary-dark); }

.points-hero {
  background: linear-gradient(135deg, #FF9A56, #FF7043);
  color: #fff; border-radius: 20px; padding: 18px 18px 16px;
  margin-bottom: 14px; box-shadow: 0 6px 18px rgba(245,124,0,0.35);
}
.ph-top { display: flex; justify-content: space-between; align-items: flex-start; }
.ph-balance { font-size: 34px; font-weight: 800; line-height: 1.1; }
.ph-balance small { font-size: 14px; font-weight: 600; margin-left: 6px; opacity: 0.9; }
.ph-lv {
  background: rgba(255,255,255,0.25); border-radius: 12px;
  padding: 5px 12px; font-size: 14px; font-weight: 800;
}
.ph-today { font-size: 13px; margin-top: 10px; opacity: 0.95; }
.ph-today b { font-weight: 800; }
.ph-capbar { height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.ph-capfill { height: 100%; background: #FFE082; border-radius: 4px; width: 0%; transition: width 0.4s; }
.ph-hint { font-size: 12px; margin-top: 8px; opacity: 0.95; line-height: 1.4; }

.points-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.ptab {
  flex: 1; position: relative; border: none; background: #fff; color: var(--text-light);
  border-radius: 12px; padding: 9px 2px; font-size: 12px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.06); white-space: nowrap;
}
.ptab.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.ptab-dot {
  position: absolute; top: 4px; right: 8px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
}
.ptab-panel { display: none; }
.ptab-panel.active { display: block; animation: fadeIn 0.2s; }

/* 兑换商城 */
.reward-card {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border-radius: 16px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.reward-card.poor { opacity: 0.72; }
.reward-card.locked-done { background: #F1F8E9; }
.rw-ico { font-size: 32px; flex-shrink: 0; width: 42px; text-align: center; }
.rw-body { flex: 1; min-width: 0; }
.rw-name { font-weight: 800; font-size: 15px; }
.rw-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.rw-tag {
  display: inline-block; font-size: 10px; font-weight: 700; color: var(--secondary-dark);
  background: #E3F2FD; border-radius: 8px; padding: 2px 7px; margin-top: 5px;
}
.rw-right { text-align: right; flex-shrink: 0; }
.rw-cost { font-size: 14px; font-weight: 800; color: var(--primary-dark); margin-bottom: 5px; }
.rw-gap { font-size: 11px; color: var(--text-light); margin-bottom: 5px; }
.rw-btn { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.rw-btn:disabled { background: #E0E0E0; color: #9E9E9E; box-shadow: none; }

/* 我的兑换 */
.rd-card {
  background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.rd-head { display: flex; align-items: center; gap: 10px; }
.rd-ico { font-size: 24px; }
.rd-name { font-weight: 800; font-size: 14px; flex: 1; }
.rd-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; white-space: nowrap; }
.rd-pending { background: #FFF3E0; color: #E65100; }
.rd-approved { background: #E8F5E9; color: #2E7D32; }
.rd-rejected { background: #FFEBEE; color: #C62828; }
.rd-redeemed { background: #E8F5E9; color: #1B5E20; }
.rd-meta { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.rd-note { font-size: 12px; color: var(--secondary-dark); margin-top: 4px; }
.rd-voucher {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; cursor: pointer;
  background: #F3F6FF; border: 1px dashed #90A4D8; border-radius: 10px; padding: 7px 10px;
}
.rd-voucher:active { transform: scale(0.99); }
.rd-voucher .rdv-label { font-size: 11px; color: var(--text-light); }
.rd-voucher .rdv-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 800; font-size: 15px; letter-spacing: 1px; color: #2C3E70;
}
.rd-voucher .rdv-show { margin-left: auto; font-size: 11px; color: var(--secondary-dark); }

/* 兑换凭证弹窗 */
.voucher-box { max-width: 340px; }
.voucher-title { font-size: 16px; font-weight: 800; color: var(--primary-dark); margin-bottom: 10px; }
.voucher-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 800; letter-spacing: 2px; color: #2C3E70;
  background: repeating-linear-gradient(135deg, #F3F6FF, #F3F6FF 8px, #EAF0FF 8px, #EAF0FF 16px);
  border: 2px dashed #90A4D8; border-radius: 12px; padding: 14px 6px; margin-bottom: 10px;
  user-select: all; -webkit-user-select: all;
}
.voucher-reward { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.voucher-status { font-size: 13px; margin-bottom: 8px; }
.voucher-hint { font-size: 12px; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }

/* 积分明细 */
.ledger-item {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.lg-ico { font-size: 20px; }
.lg-body { flex: 1; min-width: 0; }
.lg-reason { font-size: 14px; font-weight: 600; }
.lg-time { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.lg-amt { font-size: 15px; font-weight: 800; white-space: nowrap; }
.lg-plus { color: var(--success); }
.lg-minus { color: var(--danger); }
.lg-xp { font-size: 11px; color: var(--secondary-dark); font-weight: 700; }

/* 积分规则 */
.rules-card { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.rules-card h3 { font-size: 15px; color: var(--primary-dark); margin-bottom: 10px; }
.rules-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed #EFEBE9; font-size: 13px;
}
.rules-row:last-child { border-bottom: none; }
.rules-row .rr-left { flex: 1; }
.rules-row .rr-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.rules-row .rr-val { font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.rules-note {
  margin-top: 12px; background: #FFF8E1; border-radius: 12px; padding: 10px 12px;
  font-size: 12px; color: var(--text-light); line-height: 1.6;
}

/* 兑换确认弹窗 */
.redeem-ico { font-size: 46px; }
.redeem-btns { display: flex; gap: 10px; margin-top: 6px; }
.redeem-btns .btn { flex: 1; padding: 11px 8px; font-size: 15px; }


/* ═══════════════ 平板 / 横屏：练习屏分两栏 ═══════════════ */
@media (min-width: 680px) {
  #app { max-width: 920px; }
  /* 其余页面仍保持窄栏居中，只有练习屏用足宽度 */
  .view:not(.fit-view) { max-width: 480px; margin: 0 auto; width: 100%; }
  .fit-view .fit-body {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 14px; align-items: stretch;
  }
  .fit-view .fit-side { justify-content: flex-start; }
  .fit-view .word-card { overflow-y: auto; }
}

/* ───────── 今日音标卡（B 档：和单词任务并列） ───────── */
.ph-card { margin-top: 12px; }
.ph-fill { background: linear-gradient(90deg, #66BB6A, #43A047); }
.ph-card-hint {
  margin-top: 8px; font-size: 12px; line-height: 1.5;
  color: var(--text-light); text-align: left;
}
.today-done-badge {
  margin-top: 8px; font-size: 12px; font-weight: 700;
  color: var(--text-light);
}
.today-done-badge.ok { color: #2E7D32; }
.today-done-badge.warn { color: #E65100; }

/* ───────── 音标练习页 ───────── */
.phq-sym {
  font-size: 56px; font-weight: 800; text-align: center;
  color: var(--primary-dark); line-height: 1.1; margin-top: 4px;
}
.phq-group { text-align: center; font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.phq-video {
  width: 100%; max-width: 384px; display: block; margin: 0 auto;
  border-radius: 12px; background: #000;
}
.phq-video.small { max-width: 320px; }
.phq-video-wrap { position: relative; width: 100%; max-width: 384px; margin: 0 auto; }
.phq-video-wrap video { width: 100%; display: block; }
.phq-video-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 2; pointer-events: none;
}
.phq-video-loading.hidden { display: none; }
.phq-tip {
  margin: 12px 0 8px; padding: 10px 12px; border-radius: 10px;
  background: #FFF8E1; font-size: 14px; line-height: 1.6; text-align: left;
}
.phq-words { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.phq-word {
  padding: 6px 12px; border-radius: 999px; background: #F5F5F5;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.phq-word small { display: block; font-weight: 400; font-size: 11px; color: var(--text-light); }
.phq-prompt-q { text-align: center; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.phq-prompt {
  text-align: center; font-size: 32px; font-weight: 800;
  color: var(--primary-dark); margin: 6px 0 16px; word-break: break-word;
}
.phq-opts { display: flex; flex-direction: column; gap: 10px; }
.phq-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 12px; border: 2px solid #EFEBE9;
  background: #fff; font-size: 15px; text-align: left; cursor: pointer;
  color: var(--text); font-family: inherit;
}
.phq-opt:active { border-color: var(--secondary); }
.phq-opt.disabled { opacity: .55; pointer-events: none; }
.phq-result { text-align: center; margin-bottom: 8px; }
.phq-result-ico { font-size: 40px; }
.phq-result-txt { font-size: 17px; font-weight: 800; margin-top: 2px; }
.phq-result.ok .phq-result-txt { color: #2E7D32; }
.phq-result.bad .phq-result-txt { color: var(--primary-dark); }
.phq-gain { margin-top: 6px; font-size: 14px; font-weight: 700; color: #2E7D32; }
.phq-right { margin-top: 6px; font-size: 13px; color: var(--text-light); }
.phq-pronbox { margin: 10px 0; }
.phq-done { text-align: center; padding: 30px 10px; }
.phq-done-ico { font-size: 56px; }
.phq-done-txt { font-size: 20px; font-weight: 800; margin-top: 8px; }
.phq-done-sub { font-size: 14px; color: var(--text-light); margin: 8px 0 20px; }
