/* ============================================================
   妞妞背单词 — Pad 触屏儿童友好样式
   大字号 / 高饱和活泼色 / 触控热区 ≥ 56px / 适配视网膜屏
   ============================================================ */

:root {
  --c-primary: #ff7043;      /* 活力橘 */
  --c-primary-dark: #f4511e;
  --c-green: #66bb6a;
  --c-orange: #ffa726;
  --c-bg: #fff8e7;           /* 奶油底色 */
  --c-card: #ffffff;
  --c-text: #37474f;
  --c-text-light: #78909c;
  --radius: 24px;
  --shadow: 0 6px 20px rgba(255, 112, 67, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: linear-gradient(160deg, #fff8e7 0%, #ffe9d6 55%, #ffd9e8 100%);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.view {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px
           calc(env(safe-area-inset-bottom, 0px) + 40px);
}

/* ---------- 按钮（大触控热区） ---------- */
.btn {
  border: none;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 700;
  min-height: 60px;
  padding: 0 28px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; }
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: #f1f3f5;
  color: var(--c-text-light);
}
.btn-block { width: 100%; display: block; }
.btn-round {
  width: 64px; height: 64px;
  min-height: 64px;
  border-radius: 50%;
  padding: 0;
  font-size: 26px;
  flex-shrink: 0;
}
.btn-speak {
  min-height: 48px;
  font-size: 18px;
  background: #e3f2fd;
  color: #1e88e5;
  border-radius: 999px;
  padding: 0 18px;
}
.btn-mini-speak {
  width: 48px; height: 48px;
  min-height: 48px;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
  background: #fff3e0;
}

/* ---------- 大号输入框 ---------- */
.big-input {
  width: 100%;
  min-height: 64px;
  border: 3px solid #ffd1b0;
  border-radius: 20px;
  padding: 0 22px;
  font-size: 26px;
  color: var(--c-text);
  background: var(--c-card);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.big-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 5px rgba(255, 112, 67, 0.15);
}
.big-input::placeholder { color: #b0bec5; }

/* ---------- 登录卡片 ---------- */
.login-card {
  margin-top: 12vh;
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 32px;
  text-align: center;
}
.login-mascot { font-size: 84px; line-height: 1; }
.login-title { font-size: 40px; margin: 14px 0 8px; color: var(--c-primary-dark); }
.login-subtitle { font-size: 20px; color: var(--c-text-light); margin-bottom: 26px; }
.login-error { margin-top: 14px; color: #e53935; font-size: 18px; }
.login-card .big-input { margin-bottom: 18px; text-align: center; letter-spacing: 2px; }

/* ---------- 主界面头部 ---------- */
.app-header { text-align: center; margin: 10px 0 24px; }
.app-title { font-size: 34px; color: var(--c-primary-dark); }
.app-tagline { font-size: 19px; color: var(--c-text-light); margin-top: 8px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  margin-bottom: 22px;
}
.card-title { font-size: 24px; margin-bottom: 16px; }
.count-pill {
  display: inline-block;
  min-width: 36px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--c-orange);
  color: #fff;
  font-size: 20px;
  text-align: center;
}

.input-row { display: flex; gap: 14px; align-items: center; }
.word-input { flex: 1; }

/* ---------- 预检结果 ---------- */
.inspect-result { margin-top: 22px; }
.pop-in { animation: popIn 0.28s ease both; }
@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  70% { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}
.inspect-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inspect-word { font-size: 42px; font-weight: 800; color: #2e7d32; word-break: break-all; }
.inspect-phonetic { font-size: 22px; color: #1e88e5; margin: 8px 0 4px; min-height: 26px; }
.inspect-translation { font-size: 24px; color: var(--c-text); margin-bottom: 12px; min-height: 30px; }
.inspect-result .btn-block { margin-top: 16px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-orange { background: #fff3e0; color: #e65100; }

/* ---------- 成功动画反馈 ---------- */
.success-toast {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #e8f5e9;
  border-radius: 18px;
  padding: 16px;
  font-size: 21px;
  font-weight: 700;
  color: #2e7d32;
}
.success-emoji { font-size: 34px; }
.bounce-in { animation: bounceIn 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both; }
@keyframes bounceIn {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- 今日清单 ---------- */
.today-list { list-style: none; }
.today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  border-bottom: 2px dashed #ffe0b2;
  font-size: 21px;
}
.today-item:last-child { border-bottom: none; }
.today-word { font-weight: 800; font-size: 24px; color: #33691e; min-width: 0; word-break: break-all; }
.today-translation { flex: 1; color: var(--c-text-light); font-size: 19px; }
.today-item .badge { margin: 0; flex-shrink: 0; font-size: 15px; padding: 4px 12px; }
.today-empty { text-align: center; color: #b0bec5; font-size: 20px; padding: 18px 0 6px; }

/* ---------- 超纲拦截模态弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(55, 71, 79, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 34px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: popIn 0.28s ease both;
}
.modal-mascot { font-size: 60px; line-height: 1; margin-bottom: 14px; }
.modal-text { font-size: 23px; line-height: 1.55; margin-bottom: 26px; }
.modal-actions { display: flex; gap: 14px; }
.modal-actions .btn { flex: 1; }

/* ---------- 全局轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 48px);
  transform: translateX(-50%);
  background: rgba(55, 71, 79, 0.92);
  color: #fff;
  font-size: 19px;
  padding: 14px 26px;
  border-radius: 999px;
  z-index: 200;
  white-space: nowrap;
}

/* ---------- 横屏 iPad 微调 ---------- */
@media (orientation: landscape) and (min-width: 900px) {
  .view { max-width: 760px; }
  .login-card { margin-top: 8vh; }
}

/* ============================================================
   复习闯关模块（闪卡认读 + 拼写闯关）
   ============================================================ */

/* 进度条 */
.progress-track {
  height: 16px;
  background: #ffe0b2;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 8px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--c-green), var(--c-orange));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.progress-text { font-size: 17px; color: var(--c-text-light); text-align: center; margin-bottom: 14px; }

/* 模式切换 Tab */
.mode-switch { display: flex; gap: 12px; margin-bottom: 20px; }
.btn-mode {
  flex: 1;
  min-height: 54px;
  font-size: 20px;
  background: #f1f3f5;
  color: var(--c-text-light);
  border-radius: 16px;
}
.btn-mode.active {
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.3);
}

/* ---------- 闪卡 CSS 3D 翻转 ---------- */
.flashcard {
  perspective: 1200px;
  height: 280px;
  cursor: pointer;
  margin-bottom: 18px;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}
.flashcard-front { background: #ffffff; }
.flashcard-back {
  background: linear-gradient(150deg, #e8f5e9, #c8e6c9);
  transform: rotateY(180deg);
}
.fc-word { font-size: 52px; font-weight: 800; color: #2e7d32; word-break: break-all; }
.fc-phonetic { font-size: 22px; color: #1e88e5; min-height: 26px; }
.fc-pos { font-size: 18px; color: #8d6e63; font-style: italic; min-height: 22px; }
.fc-hint { font-size: 16px; color: #b0bec5; margin-top: 4px; }
.fc-translation { font-size: 34px; font-weight: 800; color: #1b5e20; }
.fc-back-word { display: block; font-size: 22px; color: #558b2f; margin-bottom: 6px; }
.fc-back-meaning { display: block; }
.fc-example-en { font-size: 18px; color: #33691e; line-height: 1.5; }
.fc-example-zh { font-size: 16px; color: #689f38; }

/* 认读反馈三连（未翻卡前锁定防误触） */
.fb-row { display: flex; gap: 12px; }
.fb-row.locked { opacity: 0.35; pointer-events: none; }
.fb-btn { flex: 1; min-height: 64px; font-size: 19px; border-radius: 18px; }
.fb-green { background: #c8e6c9; color: #1b5e20; }
.fb-yellow { background: #fff9c4; color: #827717; }
.fb-red { background: #ffcdd2; color: #b71c1c; }

/* ---------- 拼写闯关 ---------- */
.sp-translation { font-size: 30px; font-weight: 800; color: #1b5e20; text-align: center; margin-bottom: 12px; }
#spell-panel { display: flex; flex-direction: column; gap: 14px; align-items: center; }
#spell-panel .btn-speak { min-width: 180px; }
.spell-input { text-align: center; letter-spacing: 3px; font-size: 30px; }
.spell-input.ok { border-color: var(--c-green); box-shadow: 0 0 0 5px rgba(102, 187, 106, 0.2); }
.spell-input.bad { border-color: #e53935; box-shadow: 0 0 0 5px rgba(229, 57, 53, 0.18); }
.spell-feedback { font-size: 22px; font-weight: 800; min-height: 28px; }
.spell-feedback.ok { color: #2e7d32; }
.spell-feedback.bad { color: #e53935; }
.spell-answer { font-size: 20px; color: #bf360c; background: #fff3e0; border-radius: 12px; padding: 10px 18px; }
.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

/* ---------- 完成面板 ---------- */
.done-mascot { font-size: 72px; text-align: center; line-height: 1.2; }
.done-summary { font-size: 20px; line-height: 1.8; text-align: center; color: var(--c-text); padding: 12px 0 4px; }
