/* ========================================================
   CVC Kids — 儿童拼读课件全局样式  v3.0
   设计语言：3D 卡通、单词卡片、明亮护眼、大按钮
   ======================================================== */

/* ── 设计变量 ─────────────────────────────────── */
:root {
  --sky:       #e8f6ff;
  --sky2:      #d4eeff;
  --blue:      #4facf7;
  --blue-deep: #2a8de0;
  --blue-soft: #b8dff8;
  --yellow:    #ffd93d;
  --yellow-s:  #fff5c0;
  --green:     #52d48a;
  --green-s:   #c2f0d8;
  --pink:      #ff8fc8;
  --pink-s:    #ffe0f2;
  --purple:    #b388ff;
  --purple-s:  #ede0ff;
  --orange:    #ffad56;
  --orange-s:  #ffecd2;
  --white:     #ffffff;
  --text:      #2d4a6a;
  --text-lite: #6a90b0;
  --line:      #c0e0f5;

  --r-pill: 999px;
  --r-xl:   30px;
  --r-lg:   22px;
  --r-md:   16px;

  --sh-card: 0 16px 48px rgba(60, 130, 200, 0.13);
  --sh-btn:  0 8px 22px rgba(60, 130, 200, 0.22);
  --sh-sm:   0 4px 14px rgba(60, 130, 200, 0.10);
}

/* ── 重置 & 基础 ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Nunito", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  color: var(--text);
  background: linear-gradient(160deg, #eaf6ff 0%, #fef9f0 45%, #f0faff 100%);
  background-attachment: fixed;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ── 顶栏 ─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  border-bottom: 2.5px solid var(--blue-soft);
  box-shadow: 0 3px 20px rgba(79, 172, 247, 0.10);
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  font-family: "Baloo 2", sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--blue-deep);
  letter-spacing: 2px;
  flex-shrink: 0;
}
.brand span { color: var(--orange); }

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}
.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--blue-soft);
  border-radius: var(--r-pill);
  padding: 10px 20px;
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-deep);
  background: var(--yellow-s);
  box-shadow: 0 4px 12px rgba(255,217,61,.20);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.nav-chip:hover {
  transform: translateY(-3px) scale(1.04);
  background: var(--yellow);
  box-shadow: 0 8px 22px rgba(255,217,61,.35);
}
.nav-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── 容器 ────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 36px auto 64px;
  padding: 0 24px;
}

/* ── 卡片 ────────────────────────────────────── */
.card {
  background: var(--white);
  border: 2.5px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: 36px;
}
.card + .card { margin-top: 22px; }
.card-single { padding: 44px; }

/* 卡片顶部彩带 */
.card[data-accent="blue"]  { border-top: 5px solid var(--blue); }
.card[data-accent="green"] { border-top: 5px solid var(--green); }
.card[data-accent="pink"]  { border-top: 5px solid var(--pink); }
.card[data-accent="yellow"]{ border-top: 5px solid var(--yellow); }

/* ── 标题系统 ─────────────────────────────────── */
.title {
  font-family: "Baloo 2", sans-serif;
  font-size: 46px;
  font-weight: 800;
  color: var(--blue-deep);
  letter-spacing: 2px;
  line-height: 1.2;
  margin-bottom: 10px;
}
.subtitle {
  font-size: 21px;
  color: var(--text-lite);
  line-height: 1.6;
  margin-bottom: 0;
}
.section-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-lite);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 22px;
  border-radius: 3px;
  background: var(--blue);
}

/* ── 按钮系统 ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  padding: 15px 30px;
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  background: var(--yellow-s);
  color: var(--text);
  border-color: #ffe080;
  box-shadow: 0 6px 0 #f0c800, var(--sh-btn);
  transition: transform .14s, box-shadow .14s, filter .14s;
  position: relative;
  top: 0;
}
.btn:active {
  top: 4px;
  box-shadow: 0 2px 0 #f0c800, 0 4px 10px rgba(60,130,200,.12);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.04); }

.btn.primary {
  background: linear-gradient(145deg, #5ec9ff, #2a9de8);
  color: #fff;
  border-color: #2a9de8;
  box-shadow: 0 6px 0 #1878c0, var(--sh-btn);
}
.btn.primary:active { box-shadow: 0 2px 0 #1878c0, 0 4px 10px rgba(60,130,200,.15); }

.btn.success {
  background: linear-gradient(145deg, #5ae09e, #28b872);
  color: #fff;
  border-color: #28b872;
  box-shadow: 0 6px 0 #1a8e56, var(--sh-btn);
}
.btn.success:active { box-shadow: 0 2px 0 #1a8e56, 0 4px 10px rgba(40,184,114,.15); }

.btn.soft {
  background: linear-gradient(145deg, #ff9dd6, #ff6bb5);
  color: #fff;
  border-color: #ff6bb5;
  box-shadow: 0 6px 0 #d9459a, var(--sh-btn);
}
.btn.soft:active { box-shadow: 0 2px 0 #d9459a, 0 4px 10px rgba(255,107,181,.15); }

.btn.purple {
  background: linear-gradient(145deg, #c4a4ff, #9f6fff);
  color: #fff;
  border-color: #9f6fff;
  box-shadow: 0 6px 0 #7550d4, var(--sh-btn);
}

.btn.orange {
  background: linear-gradient(145deg, #ffca6e, #ff9f36);
  color: #fff;
  border-color: #ff9f36;
  box-shadow: 0 6px 0 #d47a18, var(--sh-btn);
}

.btn.sm {
  padding: 10px 18px;
  font-size: 16px;
}

/* 单词卡专用：更紧凑的小按钮 */
.word-card .btn {
  padding: 10px 16px;
  font-size: 15px;
  min-width: 0;
  flex: 0 1 auto;
}

/* ── 首页 — 元音大卡片 ────────────────────────── */
.vowel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.vowel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 18px 24px;
  border-radius: var(--r-xl);
  border: 3px solid var(--line);
  background: linear-gradient(160deg, #fff 0%, #f4faff 100%);
  box-shadow: var(--sh-card);
  cursor: pointer;
  transition: transform .22s, box-shadow .22s;
  text-decoration: none;
}
.vowel-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 24px 56px rgba(60,130,200,.22);
}
.vowel-card:nth-child(1) { border-top: 5px solid #4facf7; }
.vowel-card:nth-child(2) { border-top: 5px solid #52d48a; }
.vowel-card:nth-child(3) { border-top: 5px solid #ff8fc8; }
.vowel-card:nth-child(4) { border-top: 5px solid #ffad56; }
.vowel-card:nth-child(5) { border-top: 5px solid #b388ff; }

.vowel-big {
  font-family: "Baloo 2", sans-serif;
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 10px;
}
.vowel-card:nth-child(1) .vowel-big { color: #2a8de0; }
.vowel-card:nth-child(2) .vowel-big { color: #22a868; }
.vowel-card:nth-child(3) .vowel-big { color: #e0489e; }
.vowel-card:nth-child(4) .vowel-big { color: #d4780a; }
.vowel-card:nth-child(5) .vowel-big { color: #7b4dd4; }

.vowel-count {
  font-size: 16px;
  color: var(--text-lite);
  font-weight: 600;
}

/* ── 元音页 — 单词网格 ────────────────────────── */
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 0;
}
.word-card {
  border-radius: var(--r-lg);
  border: 2.5px solid var(--line);
  padding: 22px 20px 24px;
  background: #fff;
  box-shadow: var(--sh-sm);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;          /* 防止子元素溢出卡片 */
  min-width: 0;              /* 允许 grid 收缩 */
  display: flex;
  flex-direction: column;
}
.word-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(60,130,200,.16);
  border-color: var(--blue-soft);
}
.word-en {
  font-family: "Baloo 2", sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: var(--blue-deep);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.word-zh {
  font-size: 18px;
  color: var(--text-lite);
  margin-bottom: 16px;
}
.word-card .btn-row {
  display: flex;
  flex-wrap: wrap;           /* 按钮自动换行，不撑出卡片 */
  gap: 10px;
  margin-top: auto;          /* 贴底对齐 */
}

/* ── 元音页 — 练习区（修复重叠核心） ────────── */
.practice-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.practice-block {
  background: linear-gradient(145deg, var(--sky) 0%, #fff 100%);
  border: 2px solid var(--blue-soft);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.practice-block-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.practice-block-label .icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.practice-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.practice-block.green-block {
  background: linear-gradient(145deg, var(--green-s) 0%, #fff 100%);
  border-color: #a0e4c0;
}
.practice-block.green-block .icon-badge { background: var(--green); }
.practice-block.pink-block {
  background: linear-gradient(145deg, var(--pink-s) 0%, #fff 100%);
  border-color: #ffc0e0;
}
.practice-block.pink-block .icon-badge { background: var(--pink); }

/* ── Hero 布局（单词学习页）────────────────────── */
.hero-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 36px;
  align-items: start;
}

/* ── 图片框 ──────────────────────────────────── */
.image-box {
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 3px solid var(--line);
  background: linear-gradient(145deg, var(--sky) 0%, #fff 100%);
  min-height: 280px;
  box-shadow: var(--sh-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-box img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
}

/* ── 标签 hint ───────────────────────────────── */
.hint {
  background: linear-gradient(145deg, var(--sky) 0%, #fff 100%);
  border: 2px dashed var(--blue-soft);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 19px;
  color: var(--text-lite);
  line-height: 1.6;
}
.hint.cn-hint {
  background: linear-gradient(145deg, var(--yellow-s) 0%, #fff 100%);
  border-color: #ffe080;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.hidden { display: none !important; }

/* ── 信息行 ──────────────────────────────────── */
.info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

/* ── 反馈 ───────────────────────────────────── */
.feedback {
  margin-top: 18px;
  min-height: 46px;
  font-weight: 800;
  font-size: 24px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  transition: background .3s;
}
.feedback:not(:empty) { background: #f0faff; }
.feedback.ok  { color: #0d9668; background: var(--green-s) !important; }
.feedback.bad { color: #c94a4a; background: #ffe8e8 !important; }

/* ── 字母 & 插槽 ─────────────────────────────── */
.letters, .slots, .choices {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.letter {
  min-width: 86px;
  min-height: 86px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 3px solid var(--blue-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(145deg, #f0f9ff, #fff);
  color: var(--blue-deep);
  cursor: grab;
  user-select: none;
  box-shadow: 0 4px 0 var(--blue-soft), var(--sh-sm);
  transition: transform .15s, box-shadow .15s;
}
.letter:hover { transform: scale(1.08) rotate(-2deg); }
.letter:active { cursor: grabbing; }

.slot {
  min-width: 86px;
  min-height: 86px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 3px dashed #c0d8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Baloo 2", sans-serif;
  font-size: 38px;
  font-weight: 800;
  background: linear-gradient(145deg, #fffbf0, #fff);
  color: var(--text-lite);
  box-shadow: inset 0 3px 10px rgba(200,220,240,.4);
  transition: border-color .2s, background .2s;
}
.slot.filled {
  border-style: solid;
  border-color: var(--blue);
  color: var(--blue-deep);
  background: linear-gradient(145deg, #e6f5ff, #fff);
  box-shadow: 0 4px 0 var(--blue-soft);
}

.word-option {
  font-size: 22px;
  min-width: 100px;
  padding: 14px 22px;
}
.blank-slot {
  min-width: 130px;
  font-size: 22px;
}

/* ── 图片选项 ─────────────────────────────────── */
.choice-card {
  cursor: pointer;
  width: 240px;
  height: 190px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 3px solid var(--line);
  background: var(--sky);
  box-shadow: 0 6px 0 var(--blue-soft), var(--sh-sm);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  top: 0;
}
.choice-card:hover {
  transform: translateY(-5px);
  border-color: var(--blue);
  box-shadow: 0 12px 0 var(--blue-soft), 0 18px 36px rgba(60,130,200,.18);
}
.choice-card:active {
  top: 4px;
  box-shadow: 0 2px 0 var(--blue-soft), 0 4px 12px rgba(60,130,200,.12);
}
.choice-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pic-choices {
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}

/* ── 句子 token ────────────────────────────────── */
.sentence {
  font-size: 38px;
  line-height: 1.9;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--blue-deep);
}
.token {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 8px 0;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--blue-soft);
  background: linear-gradient(145deg, #f0f9ff, #fff);
  cursor: pointer;
  font-weight: 700;
  font-size: 24px;
  color: var(--blue-deep);
  box-shadow: 0 4px 0 var(--blue-soft);
  transition: transform .14s, box-shadow .14s;
  position: relative;
  top: 0;
}
.token:hover  { transform: translateY(-2px); background: #e0f3ff; }
.token:active { top: 3px; box-shadow: 0 1px 0 var(--blue-soft); }
.token.selected {
  background: linear-gradient(145deg, #d4eeff, #e8f6ff);
  border-color: var(--blue);
}

/* ── 三连图 ──────────────────────────────────── */
.panel3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.panel3 .image-box { min-height: 190px; }

/* ── 句子排序 ─────────────────────────────────── */
.order-instruction {
  font-size: 20px;
  color: var(--text-lite);
  font-weight: 700;
  margin-bottom: 12px;
}
.order-bank {
  min-height: 108px;
  padding: 18px;
  background: linear-gradient(145deg, var(--sky) 0%, #fff 100%);
  border-radius: var(--r-md);
  border: 2.5px dashed var(--blue-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.order-result-label {
  font-size: 20px;
  color: var(--text-lite);
  font-weight: 700;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.order-result {
  min-height: 90px;
  padding: 16px 20px;
  background: linear-gradient(145deg, var(--yellow-s) 0%, #fff 100%);
  border-radius: var(--r-md);
  border: 2.5px solid #ffe09a;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ── 填空区 ──────────────────────────────────── */
.blank-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 32px;
  line-height: 2.2;
  margin: 22px 0;
}
.blank-options-label {
  font-size: 20px;
  color: var(--text-lite);
  font-weight: 700;
  margin: 16px 0 10px;
}
.blank-options {
  min-height: 76px;
  padding: 14px;
  background: linear-gradient(145deg, #f8fdff 0%, #fff 100%);
  border-radius: var(--r-md);
  border: 2.5px dashed var(--blue-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ── 看句选图 ─────────────────────────────────── */
.pic-sentence {
  font-size: 36px;
  text-align: center;
  padding: 22px 24px;
  background: linear-gradient(145deg, var(--sky) 0%, #fff 100%);
  border-radius: var(--r-md);
  border: 2.5px solid var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 700;
  margin: 20px 0;
  line-height: 1.7;
}

/* ── 复习页布局 ───────────────────────────────── */
.review-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── 通用栏 ──────────────────────────────────── */
.divider {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 24px 0;
}

/* ── 装饰星星 / 气泡（背景点缀）────────────── */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 360px; height: 360px;
  top: -80px; left: -100px;
  background: radial-gradient(circle, rgba(79,172,247,.08) 0%, transparent 70%);
}
body::after {
  width: 300px; height: 300px;
  bottom: -60px; right: -80px;
  background: radial-gradient(circle, rgba(255,173,86,.09) 0%, transparent 70%);
}

/* ── 响应式 ──────────────────────────────────── */
@media (max-width: 860px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .title  { font-size: 36px; }
  .vowel-big { font-size: 56px; }
  .panel3 { grid-template-columns: 1fr; }
  .choice-card { width: calc(50% - 10px); height: 160px; }
  .card { padding: 22px; }
  .card-single { padding: 26px; }
  .topbar-inner { flex-wrap: nowrap; padding: 12px 16px; }
  .nav-buttons { display: none; }
}
@media (max-width: 560px) {
  .choice-card { width: 100%; max-width: 260px; }
}
