/* ==========================================================================
   《新版人教PEP三年级上册英语 · 萌宠单词大冒险》
   Mobile-First 马卡龙护眼童趣风（375px–430px 手机端零溢出适配）
   ========================================================================== */
:root {
  --bg-page: #EEF5F1;
  --bg-app: #FFFDF7;
  --mint: #1B9574;
  --mint-light: #E6F8F1;
  --mint-border: #97DEC5;
  --coral: #FF6B47;
  --coral-light: #FFF0EA;
  --coral-border: #F8B69F;
  --lemon: #F5A600;
  --lemon-light: #FFF9DF;
  --lemon-border: #F0D278;
  --lavender: #7553C2;
  --lavender-light: #F3EDFF;
  --lavender-border: #CBB7F5;
  --sky: #287BC4;
  --sky-light: #EAF5FF;
  --sky-border: #A4CEFA;
  --ink: #17212B;
  --muted: #526170;
  --border: #E4E9EE;
  --radius-lg: 18px;
  --radius-md: 13px;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg-page);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

.en {
  font-family: "Segoe UI", "Noto Sans SC", Arial, sans-serif;
}

/* 手机 App 外壳：桌面居中 414px，真机全屏 */
.app-shell {
  width: 100%;
  max-width: 430px;
  min-width: 320px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(20, 48, 40, 0.14);
}

/* ==================== 顶部状态栏 ==================== */
.top-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, #E6F8F1 0%, #FFF9E3 55%, #FFF0EA 100%);
  border-bottom: 1.5px solid #D3EAE0;
  padding: 8px 12px 9px;
  z-index: 20;
}

.owner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #FFFFFF;
  border: 1.5px solid var(--mint-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 800;
  color: #115E49;
  box-shadow: 0 2px 6px rgba(27, 149, 116, 0.08);
  cursor: pointer;
}
.owner-banner.locked {
  border-color: var(--coral-border);
  color: #B8421D;
  background: #FFF9F6;
}
.owner-action {
  font-size: 11px;
  background: var(--coral);
  color: #FFFFFF;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}
.owner-bound-tag {
  font-size: 10.5px;
  background: var(--mint-light);
  color: var(--mint);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-row {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1.4px solid #DCE5EC;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.stat-points { border-color: var(--lemon-border); background: #FFFDF2; color: #9A6400; }
.stat-timer  { font-size: 11.5px; color: var(--muted); padding: 4px 9px; }
.stat-jar {
  border-color: var(--coral-border);
  background: #FFF4F0;
  color: #C2441F;
  cursor: pointer;
  position: relative;
}
.stat-jar:active { transform: scale(0.96); }
.jar-badge {
  background: #E84A27;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.jar-badge.zero { background: #1B9574; }

/* ==================== 中间滚动内容区 ==================== */
.main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 14px;
  -webkit-overflow-scrolling: touch;
}
.main-content.quiz-locked-scroll {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 8px;
  overflow-y: auto;
}

/* 单元切换横向条（不引起整页溢出） */
.unit-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 9px;
}
.unit-btn {
  border: 1.6px solid #D4DFE8;
  background: #FFFFFF;
  border-radius: 11px;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: transform 0.1s;
}
.unit-btn:active { transform: scale(0.95); }
.unit-btn.active {
  background: var(--mint);
  border-color: #127358;
  color: #FFFFFF;
  box-shadow: 0 3px 0 #106A50;
}
.unit-btn.locked-unit {
  background: #F6F8FA;
  color: #7B8794;
}
.u-mini { font-size: 9.5px; font-weight: 700; opacity: 0.9; }

/* 提示横幅 */
.info-banner {
  background: var(--lemon-light);
  border: 1.4px dashed var(--lemon-border);
  border-radius: 12px;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: #6B4700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* ==================== Tab 1: 拼读课堂 ==================== */
.unit-header-card {
  background: #FFFFFF;
  border: 1.6px solid var(--mint-border);
  border-radius: 14px;
  padding: 9px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.uh-title { font-size: 15px; font-weight: 900; color: var(--ink); }
.uh-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.uh-go-quiz {
  background: var(--coral);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 #C84423;
  white-space: nowrap;
}
.uh-go-quiz:active { transform: translateY(2px); box-shadow: none; }

.word-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phonics-card {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1.8px solid #DCE5EE;
  padding: 11px 12px;
  box-shadow: 0 4px 10px rgba(20, 40, 58, 0.05);
}
.pc-mint { border-color: var(--mint-border); }
.pc-coral { border-color: var(--coral-border); }
.pc-lemon { border-color: var(--lemon-border); }
.pc-sky { border-color: var(--sky-border); }
.pc-lavender { border-color: var(--lavender-border); }

.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.level-pill {
  font-size: 10.8px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.lvl-l2 { background: #FFF5CC; color: #8F5A00; border: 1px solid #ECC95B; }
.lvl-l1 { background: #FFE8DF; color: #B83D18; border: 1px solid #F6A88D; }
.lvl-read { background: #E9F5FF; color: #195E9E; border: 1px solid #93C5F5; }

.rule-pill {
  font-size: 10.8px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F4F7FA;
  color: #334155;
}

.pc-word-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pc-word {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #111827;
}
.pc-phonetic {
  font-size: 13px;
  color: #52606D;
  font-family: "Segoe UI", "Lucida Sans Unicode", Arial, sans-serif;
}
.pc-meaning {
  font-size: 14.5px;
  font-weight: 800;
  color: #1E293B;
  margin-top: 2px;
}

/* 字母组合高亮 */
.seg-hl {
  display: inline-block;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 6px;
  font-weight: 900;
  line-height: 1.15;
}
.hl-mint { background: #CCF2E5; color: #0E6B51; border: 1.2px solid #8AD8BE; }
.hl-coral { background: #FFE0D4; color: #B83D18; border: 1.2px solid #F6A88D; }
.hl-lemon { background: #FFF0B3; color: #8F5D00; border: 1.2px solid #ECC95B; }
.hl-sky { background: #D7ECFF; color: #195E9E; border: 1.2px solid #93C5F5; }
.hl-lavender { background: #E9DFFF; color: #56379C; border: 1.2px solid #BFA8F5; }
.hl-alt { background: #FFE8B5 !important; color: #945200 !important; border: 1.2px solid #E8B858 !important; }

.seg-silent {
  display: inline-block;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #64748B;
  border: 1.4px dashed #94A3B8;
  text-decoration: line-through;
  text-decoration-color: #E04826;
  text-decoration-thickness: 2px;
  line-height: 1.15;
}

.pc-chant {
  margin-top: 7px;
  background: #FFFDF3;
  border: 1.2px dashed #E8CF80;
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 12px;
  color: #3D3110;
  font-weight: 600;
  line-height: 1.4;
}

.pc-actions {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-audio {
  border: 1.5px solid var(--mint-border);
  background: var(--mint-light);
  color: #0E694F;
  border-radius: 11px;
  padding: 9px 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-audio.follow {
  border-color: var(--coral-border);
  background: var(--coral-light);
  color: #C2441F;
}
.btn-audio.follow.done {
  border-color: var(--lemon-border);
  background: var(--lemon-light);
  color: #8F5A00;
}
.btn-audio:active { transform: scale(0.96); }

/* ==================== 跟读打分弹窗 ==================== */
.follow-badge {
  display: inline-block;
  background: var(--mint-light);
  color: #0E694F;
  border: 1.3px solid var(--mint-border);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.follow-word {
  font-size: 34px;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
}
.follow-sub {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.follow-chant {
  margin: 8px 0 11px;
  background: #FFFDF3;
  border: 1.2px dashed #E8CF80;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #3D3110;
}
.follow-listen-btn {
  width: 100%;
  border: 1.6px solid var(--mint-border);
  background: var(--mint-light);
  color: #0E694F;
  border-radius: 12px;
  padding: 9px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  margin-bottom: 12px;
}
.mic-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.mic-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #FF7B54, #FF5A36);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 5px 0 #C43B1B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.mic-btn:active { transform: translateY(2px); }
.mic-btn.listening {
  background: linear-gradient(135deg, #1B9574, #14B88A);
  box-shadow: 0 0 0 6px rgba(27, 149, 116, 0.22);
  animation: pulseMic 1s infinite;
}
.mic-ic { font-size: 21px; }
.heard-box {
  width: 100%;
  min-height: 36px;
  background: #F8FAFC;
  border: 1.4px solid #DCE5EE;
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}
.heard-box.ok { background: #E6F8F1; border-color: var(--mint); color: #0E694F; }
.heard-box.err { background: #FFF1EC; border-color: var(--coral); color: #C23A1C; }
.fallback-read {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1.2px dashed #DCE5EE;
}
.fallback-read.hidden { display: none; }
.fb-tip {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
@keyframes pulseMic {
  0%, 100% { box-shadow: 0 0 0 4px rgba(27, 149, 116, 0.25); }
  50% { box-shadow: 0 0 0 11px rgba(27, 149, 116, 0.08); }
}

/* ==================== Tab 2: 4 大趣味闯关模式 ==================== */
.mode-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}
.m4-btn {
  border: 1.5px solid #D5E0EA;
  background: #FFFFFF;
  border-radius: 11px;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 900;
  color: #475569;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.m4-btn .m4-pts { font-size: 9.5px; font-weight: 700; opacity: 0.85; }
.m4-btn.active {
  background: var(--mint);
  border-color: #127358;
  color: #FFFFFF;
  box-shadow: 0 3px 0 #0F634B;
}
.m4-btn.m4-king.active {
  background: var(--coral);
  border-color: #D44723;
  box-shadow: 0 3px 0 #AD3618;
}

/* 模式1：听音选词大卡片 */
.listen-hero-btn {
  margin: 8px auto 10px;
  border: none;
  border-radius: 18px;
  padding: 14px 26px;
  background: linear-gradient(135deg, #1FA37F, #168265);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 5px 0 #0F5E48;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.listen-hero-btn:active { transform: translateY(2px); }

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}
.choice-card {
  background: #FFFFFF;
  border: 2px solid #D4E0EA;
  border-bottom: 4px solid #A9BACB;
  border-radius: 16px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
}
.choice-card:active { transform: translateY(2px); }
.choice-word {
  display: block;
  font-size: 21px;
  font-weight: 900;
  color: #111827;
}
.choice-cn {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #52606D;
  margin-top: 4px;
}
.choice-card.ok {
  background: #D9F7EB;
  border-color: #158A6A;
  border-bottom-color: #0E654D;
}
.choice-card.err {
  background: #FFE5DD;
  border-color: #E04826;
  border-bottom-color: #B43418;
  animation: shake 0.35s;
}

/* 模式2：缺字母拼图槽 */
.ans-slot.fixed-slot {
  background: #F1F5F9;
  border-color: #CBD5E1;
  border-bottom-width: 2px;
  color: #334155;
  cursor: default;
}

/* ==================== Tab 2: 拼写闯关 & 专属虚拟键盘 ==================== */
.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #EDF2F7;
  padding: 3px;
  border-radius: 12px;
  flex: 1;
}
.mode-btn {
  border: none;
  background: transparent;
  padding: 6px 6px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  color: #4A5568;
  cursor: pointer;
}
.mode-btn.active-bronze {
  background: #FFFFFF;
  color: #B45309;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.mode-btn.active-king {
  background: #1B9574;
  color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(27, 149, 116, 0.25);
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
}
.progress-dots {
  display: flex;
  gap: 5px;
}
.p-dot {
  width: 24px;
  height: 8px;
  border-radius: 999px;
  background: #DCE5EE;
}
.p-dot.done { background: var(--mint); }
.p-dot.cur  { background: var(--coral); }
.streak-pill {
  background: #FFF1E8;
  color: #D4471E;
  border: 1.2px solid #F6B298;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
}
.mistake-mode-tag {
  background: #E84A27;
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 900;
}

.quiz-card {
  background: #FFFFFF;
  border: 2px solid var(--mint-border);
  border-radius: 18px;
  padding: 12px 12px 10px;
  text-align: center;
  box-shadow: 0 5px 14px rgba(20, 50, 40, 0.06);
  margin-bottom: 8px;
}
.quiz-card.mistake-card {
  border-color: var(--coral-border);
  background: #FFFDFB;
}
.quiz-meaning {
  font-size: 21px;
  font-weight: 900;
  color: #111827;
  margin: 2px 0 4px;
}
.quiz-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.quiz-listen-mini {
  background: var(--mint-light);
  border: 1.3px solid var(--mint-border);
  color: #0E694F;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* 答案输入槽 */
.answer-slots {
  margin: 12px auto 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  align-items: center;
}
.ans-slot {
  min-width: 30px;
  height: 40px;
  padding: 0 5px;
  border-radius: 10px;
  border: 2px solid #CBD5E1;
  border-bottom-width: 3.5px;
  background: #F8FAFC;
  font-size: 21px;
  font-weight: 900;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ans-slot.filled {
  background: #E9F9F3;
  border-color: var(--mint);
  color: #0D624A;
}
.ans-slot.active-cursor {
  border-color: var(--coral);
  background: #FFF8F4;
}
.ans-slot.space-slot {
  min-width: 18px;
  border-style: dashed;
  background: #FFFDF5;
  color: #94A3B8;
  font-size: 13px;
}
.ans-slot.slot-ok {
  background: #CCF2E5 !important;
  border-color: #128061 !important;
  color: #0A543F !important;
}
.ans-slot.slot-err {
  background: #FFE4DC !important;
  border-color: #E04826 !important;
  color: #B42318 !important;
  animation: shake 0.35s;
}

.quiz-feedback {
  min-height: 24px;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.38;
}
.fb-ok { color: #0F7657; }
.fb-err {
  color: #C23A1C;
  background: #FFF2ED;
  border: 1.2px dashed #F4A58B;
  border-radius: 10px;
  padding: 6px 9px;
  margin-top: 6px;
  text-align: left;
}

/* 青铜模式字母积木区 */
.bronze-tiles-area {
  background: #FFFFFF;
  border: 1.6px solid #DCE5EE;
  border-radius: 16px;
  padding: 12px 10px;
  margin-top: auto;
}
.tiles-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 11px;
}
.letter-tile {
  min-width: 44px;
  height: 46px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1.8px solid #8CD5BC;
  border-bottom: 4px solid #1B9574;
  background: #FFFFFF;
  font-size: 21px;
  font-weight: 900;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.letter-tile:active { transform: translateY(2px); border-bottom-width: 2px; }
.letter-tile.used {
  opacity: 0.25;
  pointer-events: none;
  background: #E2E8F0;
  border-color: #CBD5E1;
}

.bronze-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

/* 王者模式专属 26 字母 QWERTY 虚拟键盘（严禁系统 input） */
.vkb-wrap {
  margin-top: auto;
  background: #EBF2F7;
  border: 1.6px solid #D3DFE8;
  border-radius: 16px;
  padding: 8px 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vkb-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.vkb-key {
  flex: 1;
  max-width: 40px;
  height: 43px;
  border-radius: 9px;
  border: 1.4px solid #CBD6E2;
  border-bottom: 3px solid #9FB0C2;
  background: #FFFFFF;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.vkb-key:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
  background: #E6F8F1;
}
.vkb-key.k-del {
  max-width: 56px;
  flex: 1.4;
  background: #FFF1EB;
  border-color: #F4B097;
  border-bottom-color: #D46742;
  color: #B83D18;
  font-size: 16px;
}
.vkb-key.k-apos {
  max-width: 54px;
  flex: 0.9;
  background: #FFF9DF;
  border-color: #EED073;
  border-bottom-color: #C99610;
  font-size: 20px;
}
.vkb-key.k-space {
  max-width: none;
  flex: 2.1;
  font-size: 13.5px;
  font-family: "Noto Sans SC", sans-serif;
}
.vkb-key.k-speak {
  max-width: none;
  flex: 1.5;
  background: #EAF5FF;
  border-color: #9CC9F5;
  border-bottom-color: #3C82C4;
  color: #195E9E;
  font-size: 12.5px;
  font-family: "Noto Sans SC", sans-serif;
}
.vkb-key.k-submit {
  max-width: none;
  flex: 1.7;
  background: var(--mint);
  border-color: #12785C;
  border-bottom-color: #0D5843;
  color: #FFFFFF;
  font-size: 14px;
  font-family: "Noto Sans SC", sans-serif;
}

.act-btn {
  border: 1.5px solid #CBD5E1;
  border-bottom: 3px solid #94A3B8;
  background: #FFFFFF;
  color: #1E293B;
  border-radius: 11px;
  padding: 10px 6px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}
.act-btn.primary {
  background: var(--mint);
  border-color: #12785C;
  border-bottom-color: #0C5642;
  color: #FFFFFF;
}
.act-btn.warn {
  background: var(--coral);
  border-color: #D94E2B;
  border-bottom-color: #B0391B;
  color: #FFFFFF;
}
.act-btn:active { transform: translateY(2px); }

/* 结算卡片 */
.summary-card {
  background: #FFFFFF;
  border: 2px solid var(--mint-border);
  border-radius: 20px;
  padding: 20px 16px;
  text-align: center;
  margin-top: 12px;
}
.summary-card h2 { margin: 8px 0 6px; font-size: 20px; }
.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.ss-box {
  background: #FFFDF4;
  border: 1.5px solid var(--lemon-border);
  border-radius: 13px;
  padding: 10px;
}
.ss-box strong { display: block; font-size: 22px; color: var(--mint); }
.ss-box span { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ==================== Tab 3: 萌宠乐园 ==================== */
.pet-stage {
  background: linear-gradient(180deg, #E8FAF3 0%, #FFFDF5 72%, #F6EFE1 100%);
  border: 2px solid var(--mint-border);
  border-radius: 20px;
  padding: 12px 14px 14px;
  text-align: center;
  position: relative;
  margin-bottom: 11px;
}
.pet-lv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pet-lv-badge {
  background: var(--mint);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 11px;
  border-radius: 999px;
}
.pet-tag { font-size: 11.5px; font-weight: 700; color: var(--muted); }

.speech-bubble {
  display: inline-block;
  background: #FFFFFF;
  border: 1.8px solid var(--coral-border);
  color: #C2441F;
  font-size: 13.5px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(255, 107, 71, 0.14);
  margin: 4px 0 2px;
  min-height: 32px;
}
.pet-svg-box {
  width: 176px;
  height: 162px;
  margin: 0 auto;
  cursor: pointer;
}
.pet-svg { width: 100%; height: 100%; display: block; }
.pet-svg.mood-eat { animation: bouncePet 0.45s ease 2; }

.exp-wrap {
  margin-top: 4px;
}
.exp-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
}
.exp-bar {
  height: 11px;
  background: #E2ECE7;
  border-radius: 999px;
  overflow: hidden;
}
.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #1B9574, #4AD3A8);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.section-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  margin: 10px 0 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-sub { font-size: 11px; font-weight: 700; color: var(--muted); }

.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.food-card {
  background: #FFFFFF;
  border: 1.8px solid #DCE5EE;
  border-bottom: 3.5px solid #B8C7D6;
  border-radius: 15px;
  padding: 9px 6px;
  text-align: center;
  cursor: pointer;
}
.food-card:active { transform: translateY(2px); }
.food-svg { width: 42px; height: 42px; display: block; margin: 0 auto 4px; }
.food-name { font-size: 12.5px; font-weight: 900; color: var(--ink); display: block; }
.food-exp { font-size: 10.5px; color: var(--mint); font-weight: 800; display: block; margin: 2px 0 5px; }
.food-cost {
  display: inline-block;
  background: var(--lemon-light);
  border: 1.2px solid var(--lemon-border);
  color: #8F5A00;
  font-size: 11.5px;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 999px;
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.outfit-btn {
  background: #FFFFFF;
  border: 1.5px solid #DCE5EE;
  border-radius: 12px;
  padding: 7px 2px;
  text-align: center;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 800;
  color: #334155;
}
.outfit-btn.equipped {
  border-color: var(--mint);
  background: var(--mint-light);
  color: #0E694F;
}
.outfit-btn .o-ic { font-size: 19px; display: block; margin-bottom: 2px; }
.outfit-btn .o-st { font-size: 9.5px; color: var(--coral); display: block; margin-top: 1px; }

/* ==================== 底部三栏固定导航 ==================== */
.bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #FFFFFF;
  border-top: 1.5px solid #D9E5DF;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
.nav-btn {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  font-weight: 800;
  color: #64748B;
  cursor: pointer;
}
.nav-btn .nav-ic { font-size: 20px; line-height: 1.1; }
.nav-btn.active {
  background: var(--mint-light);
  color: var(--mint);
}

/* ==================== 弹窗通用样式 ==================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 28, 38, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-mask.hidden { display: none; }
.modal-box {
  width: 100%;
  max-width: 370px;
  background: #FFFDF7;
  border: 2.5px solid var(--mint-border);
  border-radius: 22px;
  padding: 20px 18px 18px;
  box-shadow: 0 20px 44px rgba(10, 25, 35, 0.28);
  text-align: center;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #EDF2F7;
  font-size: 16px;
  font-weight: 900;
  color: #475569;
  cursor: pointer;
}
.modal-title {
  margin: 4px 0 6px;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
}
.modal-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.field-group {
  text-align: left;
  margin-bottom: 11px;
}
.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
}
.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.8px solid #CBD5E1;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  background: #FFFFFF;
  outline: none;
}
.modal-input:focus { border-color: var(--mint); }
.modal-err {
  color: #D63C1D;
  font-size: 12px;
  font-weight: 800;
  min-height: 18px;
  margin-bottom: 8px;
}
.modal-btn {
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 12px;
  font-size: 15px;
  font-weight: 900;
  color: #FFFFFF;
  background: var(--mint);
  box-shadow: 0 4px 0 #106A50;
  cursor: pointer;
}
.modal-btn.coral {
  background: var(--coral);
  box-shadow: 0 4px 0 #C2441F;
}
.modal-btn:active { transform: translateY(2px); }

/* Toast 提示 */
.toast {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #16232F;
  color: #FFE66D;
  font-size: 13.5px;
  font-weight: 900;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 200;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes bouncePet {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
