:root {
  --bg: #fff8ee;
  --card: rgba(255, 255, 255, 0.86);
  --text: #2f2b3a;
  --muted: #756f85;
  --primary: #ff8fb3;
  --primary-dark: #ef6e9c;
  --secondary: #7cc7ff;
  --yellow: #ffd76d;
  --green: #7dd6a8;
  --shadow: 0 18px 45px rgba(91, 67, 103, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 219, 121, 0.38), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(124, 199, 255, 0.38), transparent 28%),
    linear-gradient(145deg, #fff7e8 0%, #fff0f6 48%, #ecf8ff 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:active { transform: translateY(1px) scale(0.99); }

.page {
  display: none;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.page.active { display: block; }

.deco-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bubble {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  animation: float 9s ease-in-out infinite;
}

.bubble:nth-child(1) { left: 8%; top: 12%; width: 42px; height: 42px; }
.bubble:nth-child(2) { left: 78%; top: 18%; animation-delay: -2s; }
.bubble:nth-child(3) { left: 15%; bottom: 15%; width: 86px; height: 86px; animation-delay: -4s; }
.bubble:nth-child(4) { right: 8%; bottom: 18%; width: 52px; height: 52px; animation-delay: -6s; }
.bubble:nth-child(5) { left: 48%; top: 78%; width: 34px; height: 34px; animation-delay: -1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}

.home-inner {
  width: min(760px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.home-header,
.stat-card,
.char-section,
.scenes-body,
.objects-panel,
.sentence-panel,
.review-list,
.complete-box {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.home-header {
  text-align: center;
  border-radius: var(--radius-xl);
  padding: 36px 22px 30px;
}

.home-character-wrap {
  width: 116px;
  height: 116px;
  margin: 0 auto 16px;
  border-radius: 36px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fff, #ffe2eb);
  box-shadow: 0 12px 30px rgba(239, 110, 156, 0.22);
}

.home-character {
  font-size: 66px;
  animation: bounce 2.4s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.home-title {
  margin: 0;
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.home-subtitle,
.scenes-intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.stat-num { font-size: 30px; font-weight: 900; }
.stat-label { color: var(--muted); margin-top: 4px; }

.char-section {
  border-radius: var(--radius-xl);
  padding: 20px;
}

.char-label {
  font-weight: 900;
  margin-bottom: 12px;
  text-align: center;
}

.char-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.char-btn {
  border-radius: 22px;
  background: #fff;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(91, 67, 103, 0.09);
  border: 3px solid transparent;
}

.char-btn.selected {
  border-color: var(--primary);
  background: #fff4f8;
}

.char-emoji { font-size: 34px; }

.home-actions { display: grid; gap: 14px; }
.home-small-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.btn {
  border-radius: 999px;
  padding: 16px 22px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(91, 67, 103, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 20px;
}

.btn-secondary { background: #e9f6ff; color: #1d5a86; }
.btn-ghost { background: rgba(255, 255, 255, 0.78); color: #5b5468; }

.top-nav,
.learn-title-bar {
  width: min(1080px, 100%);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.back-btn,
.star-count {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px 16px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(91, 67, 103, 0.1);
}

.nav-title,
.learn-scene-title {
  font-size: 22px;
  font-weight: 950;
  text-align: center;
}

.scenes-body {
  width: min(1080px, 100%);
  margin: 0 auto;
  border-radius: var(--radius-xl);
  padding: 24px;
}

.scenes-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.scene-card {
  min-height: 180px;
  border-radius: 28px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  box-shadow: 0 12px 26px rgba(91, 67, 103, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.8);
}

.scene-emoji { font-size: 42px; }
.scene-title { font-size: 24px; font-weight: 950; margin-top: 8px; }
.scene-title-zh { color: var(--muted); font-weight: 800; }
.scene-progress { margin-top: 16px; font-weight: 900; font-size: 14px; }
.scene-complete { color: #247a53; }

.learn-top {
  width: min(1080px, 100%);
  margin: 0 auto 16px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar-bg {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(91, 67, 103, 0.08);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 0.25s ease;
}

.progress-text { font-weight: 950; min-width: 44px; }

.learn-body {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: stretch;
}

.objects-panel,
.sentence-panel {
  border-radius: var(--radius-xl);
  padding: 20px;
  min-height: 520px;
}

.objects-label { font-weight: 950; margin-bottom: 14px; }
.scene-objects { display: grid; gap: 12px; }

.object-btn {
  border-radius: 20px;
  background: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(91, 67, 103, 0.09);
  border: 3px solid transparent;
}

.object-btn.active { border-color: var(--secondary); background: #eef8ff; }
.object-btn.learned { background: #f4fff8; }
.object-emoji { font-size: 30px; width: 40px; text-align: center; }
.object-name { font-weight: 950; }
.object-en { color: var(--muted); font-size: 13px; }
.object-check { margin-left: auto; }

.sentence-area {
  height: 100%;
  display: grid;
  place-items: center;
}

.empty-state,
.sentence-card-inner {
  width: 100%;
  text-align: center;
}

.empty-emoji { font-size: 72px; }
.empty-title { font-size: 28px; font-weight: 950; margin-top: 8px; }
.empty-subtitle { color: var(--muted); margin-top: 8px; }

.big-emoji { font-size: 88px; }
.object-zh { color: var(--muted); font-weight: 900; margin-top: 6px; }
.english-line {
  margin: 18px 0 8px;
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 950;
  letter-spacing: -0.04em;
  color: #2c2650;
}
.chinese-line { font-size: 22px; color: var(--muted); font-weight: 800; }
.action-line { margin: 16px auto 0; color: #7a5c00; background: #fff5ce; width: fit-content; padding: 8px 14px; border-radius: 999px; font-weight: 900; }
.speak-actions { margin-top: 24px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.speak-btn { background: #fff; border-radius: 999px; padding: 13px 16px; font-weight: 950; box-shadow: 0 8px 18px rgba(91, 67, 103, 0.09); }

.complete-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(60, 43, 72, 0.28);
  backdrop-filter: blur(8px);
  z-index: 20;
  padding: 24px;
}

.complete-overlay.show { display: grid; }
.complete-box { border-radius: var(--radius-xl); width: min(420px, 100%); padding: 32px 24px; text-align: center; }
.complete-trophy { font-size: 74px; }
.complete-en { font-size: 34px; font-weight: 950; margin-top: 8px; }
.complete-zh { color: var(--muted); font-size: 20px; margin-top: 6px; }
.complete-stars { font-size: 32px; margin: 16px 0; }
.complete-actions { display: grid; gap: 12px; }

.review-filters {
  width: min(1080px, 100%);
  margin: 0 auto 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 16px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(91, 67, 103, 0.08);
}

.filter-btn.active { background: #fff1f6; color: var(--primary-dark); }
.review-list { width: min(1080px, 100%); margin: 0 auto; border-radius: var(--radius-xl); padding: 18px; display: grid; gap: 12px; }
.review-item {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  box-shadow: 0 8px 18px rgba(91, 67, 103, 0.08);
}
.review-emoji { font-size: 36px; }
.review-en { font-size: 22px; font-weight: 950; }
.review-zh { color: var(--muted); margin-top: 3px; }
.review-scene { color: #8c86a0; font-size: 13px; margin-top: 4px; }
.review-play { background: #eef8ff; border-radius: 999px; padding: 11px 14px; font-weight: 950; }

@media (max-width: 900px) {
  .scenes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-body { grid-template-columns: 1fr; }
  .objects-panel, .sentence-panel { min-height: auto; }
  .scene-objects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .page { padding: 16px 14px calc(16px + var(--safe-bottom)); }
  .home-inner { min-height: calc(100vh - 32px); gap: 14px; }
  .home-header { padding: 28px 16px 22px; }
  .home-character-wrap { width: 96px; height: 96px; border-radius: 28px; }
  .home-character { font-size: 56px; }
  .home-stats, .char-buttons, .home-small-links, .scene-objects { grid-template-columns: 1fr; }
  .scenes-grid { grid-template-columns: 1fr; }
  .scene-card { min-height: 150px; }
  .top-nav, .learn-title-bar { gap: 8px; }
  .back-btn, .star-count { padding: 10px 12px; font-size: 14px; }
  .nav-title, .learn-scene-title { font-size: 18px; }
  .review-item { grid-template-columns: auto 1fr; }
  .review-play { grid-column: 1 / -1; }
}


/* ======================================================
   本地 Lottie JSON 动画样本
====================================================== */
.object-badges {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.animation-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff3b0;
  box-shadow: 0 4px 10px rgba(137, 104, 21, 0.16);
  font-size: 15px;
}

.animation-stage,
.static-emoji-stage {
  width: min(410px, 100%);
  margin: 0 auto 16px;
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 255, 0.94));
  box-shadow: 0 16px 38px rgba(91, 67, 103, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.lottie-stage {
  position: relative;
  overflow: hidden;
  padding: 12px 12px 10px;
  border: 3px solid #ffd76d;
}

.sentence-lottie-player {
  width: 100%;
  height: 250px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 18%, #fff8d8 0%, #f5fbff 46%, #f2efff 100%);
  overflow: hidden;
}

.animation-caption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 900;
}

.animation-top-label {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 950;
  color: #7a4b00;
  box-shadow: 0 4px 12px rgba(91, 67, 103, 0.13);
}

.static-emoji-stage {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
}

.static-emoji-big {
  font-size: 72px;
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(91, 67, 103, 0.14));
}

@media (max-width: 560px) {
  .animation-stage,
  .static-emoji-stage {
    width: 100%;
  }

  .sentence-lottie-player {
    height: 210px;
  }

  .animation-caption,
  .animation-top-label {
    font-size: 12px;
  }
}


/* ======================================================
   学习流程优化：音标、重点词跟读、还想再练
====================================================== */
.home-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.object-phonetic {
  color: #8c86a0;
  font-size: 12px;
  font-weight: 800;
}

.object-btn.needs-practice {
  background: #fff9e8;
}

.practice-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff0b8;
  box-shadow: 0 4px 10px rgba(137, 104, 21, 0.16);
  font-size: 15px;
}

.keyword-section {
  margin: 14px auto 0;
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(123, 181, 255, 0.28);
  border-radius: 22px;
  padding: 12px;
}

.keyword-title {
  font-size: 14px;
  color: #6d6590;
  font-weight: 950;
  margin-bottom: 8px;
}

.keyword-list {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.keyword-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f8ff;
  box-shadow: 0 5px 12px rgba(91, 67, 103, 0.07);
}

.keyword-word {
  font-size: 17px;
  font-weight: 950;
  color: #2c2650;
}

.keyword-phonetic {
  font-size: 14px;
  font-weight: 900;
  color: #4f6fd2;
}

.keyword-zh {
  font-size: 13px;
  font-weight: 850;
  color: #8c86a0;
}

.learning-actions {
  margin-top: 20px;
}

.result-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-btn {
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 17px;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(91, 67, 103, 0.11);
}

.result-practice {
  background: #fff2bd;
  color: #7a5c00;
}

.result-master {
  background: linear-gradient(135deg, #ff8fb3, #ff6c9e);
  color: #fff;
}

.learn-feedback {
  min-height: 24px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 900;
  color: #7a6f8a;
}

.learn-feedback.success { color: #26804c; }
.learn-feedback.practice { color: #9a6b00; }

.review-keywords {
  color: #4f6fd2;
  font-size: 13px;
  font-weight: 850;
  margin-top: 5px;
}

.review-actions {
  display: grid;
  gap: 8px;
}

.review-practice-item {
  background: #fffdf4;
  border: 2px solid rgba(255, 211, 94, 0.5);
}

.review-play.review-practice {
  background: #fff2bd;
  color: #7a5c00;
}

@media (max-width: 720px) {
  .home-stats { grid-template-columns: 1fr; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .result-btn { width: 100%; }
  .review-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
