/* 我的学习小世界 — 5~7 岁儿童友好视觉与 iPad 横屏触控样式 */

:root {
  --font-kid: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Rounded Mplus 1c", -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-soft: 0 8px 20px rgba(24, 58, 92, 0.14);
  --shadow-btn: 0 5px 0 rgba(0, 0, 0, 0.16);
  --radius-lg: 22px;
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-kid);
  background: #59CCF5;
  color: #243B53;
}

.hidden {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}

button:active:not(:disabled) {
  transform: translateY(3px) scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ==================== 主岛世界 ==================== */

.world-screen {
  background: #59CCF5;
}

#worldCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.world-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world-hud > * {
  pointer-events: auto;
}

.world-top-bar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.world-top-bar > * {
  pointer-events: auto;
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #FFFDF2, #FFE999);
  border: 3px solid #FFFFFF;
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 24px;
  font-weight: 800;
  color: #9C5700;
  min-width: 106px;
}

.coin-pill.pop {
  animation: coinPop 0.4s ease;
}

@keyframes coinPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.world-center-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.island-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 3px solid #FFFFFF;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-soft);
}

.switch-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: #486581;
  font-size: 17px;
  font-weight: 800;
  min-height: 46px;
  white-space: nowrap;
}

.switch-mascot {
  font-size: 22px;
  line-height: 1;
}

.switch-tab.tab-english.active {
  background: linear-gradient(135deg, #3B9EFF, #1C7ED6);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(28, 126, 214, 0.3);
}

.switch-tab.tab-pinyin.active {
  background: linear-gradient(135deg, #40C057, #2B9348);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(43, 147, 72, 0.3);
}

.study-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px 7px 12px;
  border-radius: 999px;
  border: 3px solid #FFFFFF;
  color: #FFFFFF;
  text-align: left;
  min-height: 56px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft), 0 4px 0 rgba(0, 0, 0, 0.16);
}

.study-cta-btn.cta-english {
  background: linear-gradient(135deg, #FF9F1C, #FF6B35);
}

.study-cta-btn.cta-pinyin {
  background: linear-gradient(135deg, #F06543, #D9483B);
}

.study-cta-icon {
  font-size: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.study-cta-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.study-cta-text strong {
  font-size: 16px;
}

.study-cta-text small {
  font-size: 12px;
  opacity: 0.94;
  margin-top: 2px;
}

.top-tools {
  display: flex;
  gap: 8px;
}

.icon-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 3px solid #FFFFFF;
  box-shadow: var(--shadow-soft);
  font-size: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 模式提示条与 Toast */
.mode-banner {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 68px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(36, 59, 83, 0.9);
  color: #FFFFFF;
  padding: 10px 14px 10px 20px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  z-index: 20;
  max-width: 90vw;
}

.mode-cancel-btn {
  background: #FF6B6B;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.world-toast {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 74px);
  left: 50%;
  transform: translateX(-50%);
  background: #FFF9DB;
  color: #8F4A00;
  border: 3px solid #FFD43B;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  z-index: 25;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 选中建筑操作条 */
.tile-action-bar {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(255, 255, 255, 0.97);
  border: 3px solid #FFD43B;
  border-radius: 20px;
  padding: 8px 12px;
  box-shadow: 0 12px 28px rgba(18, 52, 86, 0.25);
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tile-action-title {
  font-size: 14px;
  font-weight: 800;
  color: #243B53;
}

.tile-action-buttons {
  display: flex;
  gap: 8px;
}

.tile-act-btn {
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  min-height: 44px;
}

.act-move {
  background: #339AF0;
  box-shadow: 0 3px 0 #1C7ED6;
}

.act-delete {
  background: #FF8787;
  box-shadow: 0 3px 0 #E03131;
}

.act-delete.armed {
  background: #E03131;
  animation: pulseBtn 0.7s infinite alternate;
}

/* 缩放控制 */
.camera-controls {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 224px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 15;
}

.cam-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #FFFFFF;
  box-shadow: var(--shadow-soft);
  font-size: 22px;
  font-weight: 800;
  color: #243B53;
}

/* 底部商店建造栏 */
.shop-dock {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 3px solid #FFFFFF;
  border-radius: 26px;
  padding: 8px 12px 10px;
  box-shadow: 0 10px 28px rgba(18, 52, 86, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-dock.dock-pinyin {
  background: rgba(247, 255, 250, 0.94);
  border-color: #D9F2E3;
}

.shop-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shop-header-row::-webkit-scrollbar {
  display: none;
}

.shop-island-badge {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: #FFFFFF;
  background: linear-gradient(135deg, #3B9EFF, #1C7ED6);
  white-space: nowrap;
}

.dock-pinyin .shop-island-badge {
  background: linear-gradient(135deg, #40C057, #2B9348);
}

.shop-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shop-categories::-webkit-scrollbar {
  display: none;
}

.shop-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #EEF6FF;
  color: #3B5B78;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.shop-cat-btn.active {
  background: #FF9F43;
  color: #FFFFFF;
  box-shadow: 0 3px 0 #E67E22;
}

.shop-items-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.shop-card {
  flex: 0 0 auto;
  width: 96px;
  background: #FFFFFF;
  border: 3px solid #E6F0FA;
  border-radius: 18px;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 4px 0 #D8E6F2;
}

.shop-card.selected {
  border-color: #FF9F1C;
  background: #FFF9DB;
  transform: translateY(-4px);
  box-shadow: 0 6px 0 #F08C00;
}

.shop-card.locked {
  opacity: 0.72;
}

.shop-card-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  pointer-events: none;
}

.shop-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #243B53;
}

.shop-card-price {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.shop-card-price.can-buy {
  background: #FFF3BF;
  color: #9C5700;
}

.shop-card-price.need-more {
  background: #F1F3F5;
  color: #868E96;
}

/* ==================== 英语岛 & 拼音岛学习界面 ==================== */

.theme-english {
  background: linear-gradient(180deg, #B8E7FF 0%, #E7F6FF 60%, #D3F0FF 100%);
}

.theme-pinyin {
  background: linear-gradient(180deg, #C8F5D4 0%, #EFFDF2 60%, #D9F7E1 100%);
}

.island-top-bar {
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.big-nav-btn {
  padding: 12px 20px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #243B53;
  font-size: 18px;
  font-weight: 800;
  border: 3px solid #FFFFFF;
  box-shadow: var(--shadow-soft), 0 4px 0 rgba(0, 0, 0, 0.1);
  min-height: 54px;
}

.island-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.island-mascot {
  font-size: 28px;
}

.group-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4px 16px 8px;
}

.group-arrow-btn {
  background: #FFFFFF;
  color: #243B53;
  font-size: 17px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  min-height: 46px;
}

.group-title-badge {
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 800;
  color: #1F3A52;
  min-width: 210px;
  text-align: center;
}

.learn-cards-grid {
  flex: 1;
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px max(24px, env(safe-area-inset-left));
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.learn-cards-grid.count-2 {
  grid-template-columns: repeat(2, minmax(180px, 280px));
}

.learn-cards-grid.count-3 {
  grid-template-columns: repeat(3, minmax(170px, 260px));
}

.learn-cards-grid.count-4 {
  grid-template-columns: repeat(4, minmax(150px, 240px));
}

.letter-card {
  position: relative;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 5px solid var(--card-accent, #4DABF7);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.1), 0 14px 28px rgba(24, 58, 92, 0.14);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 255px;
  gap: 8px;
}

.letter-card.studied {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF5 100%);
}

.letter-card.bouncing {
  animation: jellyBounce 0.48s ease;
}

@keyframes jellyBounce {
  0% { transform: scale(1); }
  25% { transform: scale(1.1, 0.92); }
  55% { transform: scale(0.95, 1.07); }
  80% { transform: scale(1.03, 0.98); }
  100% { transform: scale(1); }
}

.card-star {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 22px;
}

.english-glyph {
  font-size: clamp(78px, 11vw, 118px);
  font-weight: 900;
  line-height: 1.05;
  color: var(--card-accent, #1C7ED6);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
  margin-top: 8px;
}

.pinyin-glyph-wrap {
  width: 100%;
  max-width: 155px;
  color: #1F3A52;
  margin-top: 4px;
}

.pinyin-fourline-svg {
  width: 100%;
  height: auto;
  display: block;
}

.card-anchor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  color: #334E68;
}

.anchor-emoji {
  font-size: 24px;
}

.anchor-hint {
  font-size: 22px;
  color: #E8590C;
}

.card-speaker-chip {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--card-accent, #4DABF7);
  padding: 6px 14px;
  border-radius: 999px;
}

.learn-bottom-bar {
  padding: 12px max(20px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.learn-action-btn {
  padding: 16px 30px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 900;
  min-height: 62px;
  border: 4px solid #FFFFFF;
}

.btn-auto-read {
  background: #FFFFFF;
  color: #243B53;
  box-shadow: var(--shadow-soft), 0 5px 0 #CBD5E1;
}

.btn-start-quiz {
  background: linear-gradient(135deg, #FF9F1C, #FF6B35);
  color: #FFFFFF;
  box-shadow: var(--shadow-soft), 0 6px 0 #D9480F;
}

.btn-start-quiz.pulse-ready {
  animation: pulseBtn 0.9s infinite alternate;
}

@keyframes pulseBtn {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

/* ==================== 听音测试界面 ==================== */

.quiz-progress-stars {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.88);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 24px;
  box-shadow: var(--shadow-soft);
}

.quiz-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 24px max(20px, env(safe-area-inset-bottom));
}

.quiz-prompt-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.quiz-mascot-bubble {
  background: #FFFFFF;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  color: #243B53;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.quiz-mascot-bubble.happy {
  background: #FFF3BF;
  color: #B45309;
}

.big-speaker-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4DABF7, #228BE6);
  color: #FFFFFF;
  border: 4px solid #FFFFFF;
  box-shadow: 0 8px 0 #1864AB, 0 12px 24px rgba(24, 100, 171, 0.25);
  font-size: 22px;
  font-weight: 900;
  min-height: 70px;
}

.big-speaker-btn.ringing {
  animation: jellyBounce 0.45s ease;
}

.speaker-emoji {
  font-size: 32px;
}

.quiz-options-grid {
  display: grid;
  gap: 20px;
  justify-content: center;
  width: 100%;
  max-width: 960px;
}

.quiz-options-grid.count-2 {
  grid-template-columns: repeat(2, minmax(180px, 280px));
}

.quiz-options-grid.count-3 {
  grid-template-columns: repeat(3, minmax(160px, 240px));
}

.quiz-options-grid.count-4 {
  grid-template-columns: repeat(4, minmax(145px, 210px));
}

.quiz-option-card {
  position: relative;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 5px solid var(--card-accent, #4DABF7);
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.11), 0 12px 24px rgba(0, 0, 0, 0.1);
  min-height: 195px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option-card.correct {
  border-color: #40C057;
  background: #EBFBEE;
  transform: scale(1.06);
  box-shadow: 0 8px 0 #2B8A3E;
}

.quiz-option-card.tried-wrong {
  opacity: 0.48;
  filter: grayscale(0.4);
}

.quiz-option-card.wrong-shake {
  animation: gentleShake 0.42s ease;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  50% { transform: translateX(9px); }
  75% { transform: translateX(-6px); }
}

.card-burst-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  gap: 8px;
  animation: burstUp 0.85s ease forwards;
}

@keyframes burstUp {
  0% { opacity: 1; transform: translateY(0) scale(0.7); }
  100% { opacity: 0; transform: translateY(-65px) scale(1.35); }
}

.big-next-btn {
  padding: 12px 28px;
  border-radius: 999px;
  background: #40C057;
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 0 #2B8A3E;
}

/* 通关总结卡片 */
.quiz-summary-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.summary-card {
  background: #FFFFFF;
  border: 5px solid #FFD43B;
  border-radius: 32px;
  padding: 28px 34px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 18px 40px rgba(24, 58, 92, 0.18);
}

.summary-chest {
  font-size: 64px;
  line-height: 1.1;
}

.summary-card h2 {
  margin: 8px 0 4px;
  font-size: 32px;
  color: #D9480F;
}

.summary-sub {
  margin: 0 0 16px;
  font-size: 17px;
  color: #627D98;
}

.summary-reward-box {
  background: #FFF9DB;
  border: 3px dashed #FAB005;
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.summary-reward-box strong {
  font-size: 32px;
  color: #B45309;
}

.summary-balance {
  font-size: 18px;
  margin-bottom: 20px;
  color: #334E68;
}

.summary-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.summary-btn {
  padding: 15px 24px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 900;
  min-height: 58px;
}

.btn-go-build {
  background: linear-gradient(135deg, #40C057, #2B9348);
  color: #FFFFFF;
  box-shadow: 0 5px 0 #1E6E35;
}

.btn-play-again {
  background: #E7F5FF;
  color: #1971C2;
  box-shadow: 0 5px 0 #A5D8FF;
}

/* ==================== 家长锁与家长面板 ==================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  position: relative;
  background: #FFFFFF;
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gate-card {
  width: 100%;
  max-width: 390px;
  padding: 26px;
  text-align: center;
}

.gate-question {
  font-size: 38px;
  font-weight: 900;
  margin: 14px 0 18px;
  color: #1C7ED6;
}

.gate-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gate-choice-btn {
  padding: 16px;
  border-radius: 16px;
  background: #E7F5FF;
  color: #1864AB;
  font-size: 24px;
  font-weight: 900;
}

.gate-error {
  color: #E03131;
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

.parent-panel {
  width: 100%;
  max-width: 760px;
}

.parent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 2px solid #F1F5F9;
}

.parent-header h3 {
  margin: 0;
  font-size: 20px;
}

.modal-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F1F5F9;
  font-size: 18px;
  font-weight: 800;
  color: #486581;
}

.gate-card .modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
}

.parent-body {
  padding: 16px 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.parent-sec {
  background: #F8FAFC;
  border-radius: 18px;
  padding: 14px 16px;
}

.parent-sec h4 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #102A43;
}

.report-block {
  margin-bottom: 12px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stat-chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}

.chip-new {
  background: #E2E8F0;
  color: #64748B;
}

.chip-learning {
  background: #FFF3BF;
  color: #B45309;
}

.chip-mastered {
  background: #D3F9D8;
  color: #2B8A3E;
}

.legend-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #486581;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.dot-new { background: #CBD5E1; }
.dot-learning { background: #FAB005; }
.dot-mastered { background: #40C057; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}

.seg-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.seg-btn {
  padding: 7px 12px;
  border-radius: 10px;
  background: #E2E8F0;
  color: #334E68;
  font-size: 13px;
  font-weight: 700;
}

.seg-btn.active {
  background: #228BE6;
  color: #FFFFFF;
}

.stage-roadmap {
  font-size: 12px;
  color: #627D98;
  line-height: 1.6;
  background: #FFFFFF;
  padding: 10px 12px;
  border-radius: 12px;
}

.ipad-tip {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #334E68;
  background: #E7F5FF;
  padding: 10px 12px;
  border-radius: 12px;
}

.backup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.parent-btn {
  padding: 10px 16px;
  border-radius: 12px;
  background: #228BE6;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
}

.parent-btn.danger {
  background: #FA5252;
}

.backup-msg {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #2B8A3E;
  min-height: 18px;
}

/* ==================== 多阶段课程与多题型增强样式 ==================== */

.stage-tabs-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 2px 16px 6px;
  flex-wrap: wrap;
}

.stage-tab-btn {
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #334E68;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.theme-english .stage-tab-btn.active {
  background: linear-gradient(135deg, #3B9EFF, #1C7ED6);
  color: #FFFFFF;
  border-color: #FFFFFF;
  box-shadow: 0 4px 0 #1864AB;
}

.theme-pinyin .stage-tab-btn.active {
  background: linear-gradient(135deg, #40C057, #2B9348);
  color: #FFFFFF;
  border-color: #FFFFFF;
  box-shadow: 0 4px 0 #1E6E35;
}

.learn-cards-grid.count-5 {
  grid-template-columns: repeat(5, minmax(132px, 196px));
  gap: 14px;
}

.pair-glyph {
  font-size: clamp(58px, 7.6vw, 88px);
  letter-spacing: 2px;
}

.pair-lower {
  margin-left: 6px;
  opacity: 0.85;
}

.word-big-emoji {
  font-size: clamp(58px, 7.5vw, 82px);
  line-height: 1.05;
  margin-top: 8px;
}

.word-big-text {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  color: #243B53;
}

.word-initial-hi {
  color: var(--card-accent, #FF6B6B);
  font-size: 1.18em;
}

.btn-stage-challenge {
  background: linear-gradient(135deg, #7950F2, #5F3DC4);
  color: #FFFFFF;
  box-shadow: var(--shadow-soft), 0 6px 0 #422699;
}

.quiz-prompt-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.quiz-prompt-badge {
  background: #FFFFFF;
  border: 4px solid #FFD43B;
  border-radius: 22px;
  padding: 10px 24px;
  box-shadow: var(--shadow-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
}

.quiz-prompt-badge.pair-badge {
  font-size: 52px;
  font-weight: 900;
  color: #1C7ED6;
  min-width: 96px;
  justify-content: center;
  line-height: 1;
}

.quiz-prompt-badge.word-badge span,
.quiz-prompt-badge.pinyin-badge span {
  font-size: 46px;
  line-height: 1;
}

.quiz-prompt-badge.word-badge small,
.quiz-prompt-badge.pinyin-badge small {
  font-size: 22px;
  font-weight: 900;
  color: #243B53;
}

.quiz-option-card.opt-word {
  flex-direction: column;
  gap: 8px;
}

.opt-word-emoji {
  font-size: clamp(52px, 6.5vw, 72px);
  line-height: 1;
}

.opt-word-label {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 900;
  color: #243B53;
}

.stage-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  background: #FFFFFF;
  padding: 8px 12px;
  border-radius: 12px;
}

.stage-stat-line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #486581;
}

.stat-chip {
  width: auto;
  min-width: 34px;
  padding: 0 7px;
}

/* ==================== 手机与窄屏响应式适配 ==================== */

@media (max-width: 768px) {
  .world-top-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .world-center-controls {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .switch-tab {
    padding: 6px 12px;
    font-size: 14px;
    min-height: 40px;
  }

  .study-cta-btn {
    padding: 5px 14px 5px 8px;
    min-height: 46px;
  }

  .study-cta-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .study-cta-text strong {
    font-size: 14px;
  }

  .learn-cards-grid.count-4,
  .learn-cards-grid.count-5 {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
    gap: 12px;
  }

  .learn-bottom-bar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .learn-action-btn {
    padding: 12px 18px;
    font-size: 16px;
    min-height: 50px;
  }

  .learn-cards-grid.count-3 {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 10px;
  }

  .letter-card {
    min-height: 190px;
    padding: 12px 8px;
  }

  .quiz-options-grid.count-4 {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
  }

  .quiz-option-card {
    min-height: 145px;
  }

  .island-title-pill {
    font-size: 15px;
    padding: 8px 14px;
  }

  .big-nav-btn {
    font-size: 15px;
    padding: 10px 14px;
  }
}
