/* 拼音王国 · 课程页（一屏一页的「闯关」形态）
   ① 壳 ② 顶栏 ③ 底部导航 ④ 通用卡片 ⑤ 封面 ⑥ 拼音王国 ⑦ 字母 ⑧ 儿歌
   ⑨ 声调 ⑩ 四声表 ⑪ 写字 ⑫ 坐姿 ⑬ 练习 ⑭ 视频 ⑮ 完成 ⑯ 弹层 ⑰ 宽屏 ⑱ 窄屏 */

/* ① 壳 ------------------------------------------------------------------ */
.deck-page {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fdf6e8;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.deck-top {
  flex: 0 0 auto;
  height: 50px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #fffdf7;
  border-bottom: 2px solid #f0e6d2;
  z-index: 5;
}
.deck-top__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f4ecd9;
  color: #7a6a4a;
  font-size: 22px;
  line-height: 1;
}
.deck-top__title { font-size: 15px; font-weight: 700; color: #6b5a38; }
.deck-top__step { font-size: 13px; color: #a4947a; font-variant-numeric: tabular-nums; }

.deck {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
}

/* ② 轨道：整条横着移动，一屏 = 一页 */
.deck__track {
  display: flex;
  height: 100%;
  transition: transform .3s cubic-bezier(.4, .1, .2, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  padding: 14px 16px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

/* ③ 底部导航 ------------------------------------------------------------ */
.deck-bar {
  flex: 0 0 auto;
  height: 62px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 8px;
  padding: 0 14px calc(env(safe-area-inset-bottom, 0px) / 2);
  background: #fffdf7;
  border-top: 2px solid #f0e6d2;
}

.deck-bar__btn {
  width: 56px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: #eef4ec;
  color: #2f7d5b;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.deck-bar__btn--next { background: #2f7d5b; color: #fff; }
.deck-bar__btn:active { transform: scale(.94); }
.deck-bar__btn[disabled] { opacity: .35; }

.deck-bar__dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e3d9c4;
  transition: .2s ease;
}
.dot.is-on { background: #2f7d5b; transform: scale(1.5); }
.dot.is-done { background: #b9d8c6; }

/* ④ 通用 ---------------------------------------------------------------- */
.slide h2 {
  font-size: 21px;
  color: #4a3f2b;
  letter-spacing: .02em;
}
.slide .sub { font-size: 14px; color: #8c7d64; margin-top: -6px; }

.big-letter {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", "Songti SC", serif;
  line-height: 1;
  color: #2f7d5b;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #e8dcc4;
  font-size: 15px;
  color: #6b5a38;
  cursor: pointer;
}
.pill:active { transform: scale(.97); }
.pill--amber { background: #fff3dd; border-color: #f0cf95; color: #8a5a10; }
.pill--go { background: #2f7d5b; border-color: #2f7d5b; color: #fff; font-size: 17px; font-weight: 700; padding: 11px 28px; }

.say {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff3dd;
  color: #8a5a10;
  font-size: 12.5px;
  white-space: nowrap;
}
.say::before { content: "🔊"; }

.art {
  display: block;
  max-height: 34vh;
  max-width: 74%;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(90, 70, 30, .12));
}

/* ⑤ 封面 ---------------------------------------------------------------- */
.slide--cover .cover-letters {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 78px;
  letter-spacing: .12em;
  color: #2f7d5b;
  line-height: 1;
}
.slide--cover .cover-sub { color: #8c7d64; font-size: 15px; }
.slide--cover .art { max-height: 32vh; }

/* ⑥ 拼音王国 ------------------------------------------------------------ */
.houses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 420px; }
.house {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 6px;
}
.house img { width: 100%; height: auto; max-height: 22vh; object-fit: contain; }
.house__label {
  font-size: 15px;
  font-weight: 700;
  color: #6b5a38;
  background: #fff;
  border: 2px solid #e8dcc4;
  border-radius: 12px;
  padding: 3px 10px;
  min-height: 30px;
  opacity: .25;
  transition: .2s ease;
}
.house.is-open .house__label { opacity: 1; }
.house.is-target img { transform: scale(1.04); }
.house.is-target.is-open .house__label { border-color: #2f7d5b; color: #2f7d5b; box-shadow: 0 0 0 4px rgba(47, 125, 91, .12); }
.house__note { font-size: 12px; color: #9d8f77; min-height: 16px; }
.kingdom-tail { font-size: 15px; color: #4a3f2b; background: #eef4ec; border-radius: 14px; padding: 10px 14px; }

/* ⑦ 字母页 -------------------------------------------------------------- */
.letter-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 460px;
}
.letter-big {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 110px;
  line-height: 1;
  color: #2f7d5b;
  cursor: pointer;
  transition: transform .18s ease;
}
.letter-big.is-pop { transform: scale(1.12); }
.letter-side { display: grid; gap: 8px; justify-items: center; }
.letter-side .art { max-height: 26vh; max-width: 100%; }
.letter-rhyme { font-size: 17px; color: #4a3f2b; }
.letter-speak { font-size: 16px; color: #8a5a10; background: #fff3dd; border-radius: 12px; padding: 6px 12px; }
.letter-extra { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.letter-example { font-size: 14px; color: #8c7d64; }

.bg-pink { background: radial-gradient(circle at 50% 40%, #ffeef2, #fdf6e8 70%); }
.bg-amber { background: radial-gradient(circle at 50% 40%, #fff3dd, #fdf6e8 70%); }
.bg-sky { background: radial-gradient(circle at 50% 40%, #e8f4ff, #fdf6e8 70%); }

/* ⑧ 儿歌 ---------------------------------------------------------------- */
.rhyme-lines { display: grid; gap: 8px; margin-top: 4px; }
.rhyme-line {
  border: 0;
  background: #fff;
  border-radius: 14px;
  border: 2px solid #f0e6d2;
  padding: 10px 14px;
  font-size: 19px;
  color: #4a3f2b;
  cursor: pointer;
  transition: .18s ease;
}
.rhyme-line.is-on { background: #eef4ec; border-color: #2f7d5b; transform: scale(1.02); }

/* ⑨ 声调 ---------------------------------------------------------------- */
.cars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 420px; }
.car {
  border: 2px solid #f0e6d2;
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  display: grid;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
  transition: .16s ease;
}
.car.is-on { border-color: #2f7d5b; background: #f2faf5; transform: translateY(-2px); }
.car img { width: 100%; max-height: 12vh; object-fit: contain; }
.car__name { font-size: 14px; font-weight: 700; color: #6b5a38; }
.car__tip { font-size: 12px; color: #9d8f77; }
.car__letter { font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif; font-size: 30px; color: #2f7d5b; }

/* ⑩ 四声表 -------------------------------------------------------------- */
.tone-table { display: grid; gap: 8px; width: 100%; max-width: 420px; }
.tone-row2 { display: grid; grid-template-columns: 40px repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; }
.tone-row2__letter { font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif; font-size: 22px; color: #b3a68c; }
.tone-cell2 {
  border: 2px solid #f0e6d2;
  background: #fff;
  border-radius: 12px;
  padding: 8px 2px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 28px;
  color: #2f7d5b;
  cursor: pointer;
}
.tone-cell2:active { transform: scale(.96); }

/* ⑪ 写字 ---------------------------------------------------------------- */
.write-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 460px; align-items: center; }
.write-stage img { width: 100%; max-height: 28vh; object-fit: contain; }
.write-tip { font-size: 15px; color: #4a3f2b; }
.write-steps { display: grid; gap: 6px; text-align: left; max-width: 420px; }
.write-steps li {
  background: #fff;
  border: 2px solid #f0e6d2;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  color: #6b5a38;
  list-style: none;
}

/* ⑫ 坐姿 ---------------------------------------------------------------- */
.posture { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 460px; align-items: end; }
.posture img { width: 100%; max-height: 26vh; object-fit: contain; }
.posture-tips { display: grid; gap: 6px; text-align: left; max-width: 420px; }
.posture-tips li { font-size: 14px; color: #6b5a38; background: #fff; border: 2px solid #f0e6d2; border-radius: 12px; padding: 8px 12px; list-style: none; }

/* ⑬ 练习 ---------------------------------------------------------------- */
.quiz-q { font-size: 21px; color: #4a3f2b; line-height: 1.5; }
.quiz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 10px; width: 100%; max-width: 420px; }
.quiz-opt {
  border: 2px solid #f0e6d2;
  background: #fff;
  border-radius: 16px;
  padding: 18px 6px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 30px;
  color: #4a3f2b;
  cursor: pointer;
  transition: .16s ease;
}
.quiz-opt:active { transform: scale(.97); }
.quiz-opt.is-right { border-color: #2f7d5b; background: #e6f6ec; color: #1f5b41; }
.quiz-opt.is-wrong { border-color: #c2564e; background: #fdeeed; color: #a53f38; }
.quiz-opt.is-mark { font-size: 42px; line-height: 1.2; }
.quiz-opt[disabled] { cursor: default; }
.quiz-mascot { width: 124px; height: auto; opacity: .95; }
.quiz-why { font-size: 14px; color: #6b5a38; background: #fff; border-radius: 12px; padding: 8px 12px; max-width: 420px; }

/* ⑭ 视频 ---------------------------------------------------------------- */
.video-gate { display: grid; gap: 10px; justify-items: center; }
.video-gate .lock { font-size: 40px; }
.video-gate p { font-size: 15px; color: #6b5a38; }
.videos { display: grid; gap: 12px; width: 100%; max-width: 520px; }
.vcard { background: #fff; border: 2px solid #f0e6d2; border-radius: 16px; overflow: hidden; }
.vcard__head { display: flex; gap: 8px; align-items: baseline; padding: 8px 12px; background: #f2faf5; font-size: 14px; color: #4a3f2b; }
.vcard__head b { color: #1f5b41; }
.vcard__head .time { margin-left: auto; color: #9d8f77; font-size: 12.5px; }
.vcard video { display: block; width: 100%; max-height: 42vh; background: #000; }

/* ⑮ 完成 ---------------------------------------------------------------- */
.finish-text { font-size: 16px; color: #6b5a38; }
.finish-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ⑯ 弹层 ---------------------------------------------------------------- */
.pop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(40, 32, 16, .45);
  padding: 20px;
}
.pop__body {
  background: #fffdf7;
  border-radius: 22px;
  padding: 26px 22px;
  max-width: 340px;
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.pop__letter {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 96px;
  line-height: 1;
  color: #2f7d5b;
}
.pop__tip { font-size: 15px; color: #6b5a38; }
.pop__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .9);
  font-size: 20px;
  color: #6b5a38;
  cursor: pointer;
}

/* ⑰ 宽屏 ---------------------------------------------------------------- */
@media (min-width: 720px) {
  .slide { padding: 20px 24px 12px; }
  .letter-big { font-size: 150px; }
  .art { max-height: 38vh; }
  .slide--cover .cover-letters { font-size: 96px; }
}

/* ⑱ 矮屏（横屏手机 / 小屏）--------------------------------------------- */
@media (max-height: 640px) {
  .art { max-height: 26vh; }
  .letter-big { font-size: 84px; }
  .slide h2 { font-size: 18px; }
  .deck-bar { height: 54px; }
}

/* ⑲ 板块选择（先选板块，再进板块里的每一屏） ---------------------------- */
.deck-top__stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: #fff3c9;
  color: #8a5a10;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: transform .18s ease;
}
.deck-top__stars::before { content: "⭐"; font-size: 13px; }
.deck-top__stars.is-bump { transform: scale(1.25); }

.star-fly {
  position: fixed;
  z-index: 99;
  font-size: 22px;
  pointer-events: none;
  transform: translate(0, 0) scale(1);
  transition: transform .58s cubic-bezier(.4, .1, .3, 1), opacity .58s ease;
  will-change: transform, opacity;
}

.picker {
  height: 100%;
  overflow-y: auto;
  padding: 18px 16px 20px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.picker__head { display: grid; gap: 2px; justify-items: center; margin-bottom: 2px; }
.picker__letters {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-size: 54px;
  letter-spacing: .14em;
  color: #2f7d5b;
  line-height: 1.1;
}
.picker__hint { font-size: 13.5px; color: #8c7d64; }
.picker__cards { display: grid; gap: 12px; }

.sec-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .10), 0 10px 20px rgba(90, 70, 30, .12);
  transition: transform .14s ease, box-shadow .14s ease;
}
.sec-card:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, .10); }
.sec-card__emoji {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .28);
  font-size: 30px;
}
.sec-card__body { display: grid; gap: 2px; min-width: 0; }
.sec-card__body strong { font-size: 19px; letter-spacing: .02em; }
.sec-card__desc { font-size: 12.5px; opacity: .88; }
.sec-card__prog {
  font-size: 12.5px;
  background: rgba(255, 255, 255, .26);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.sec-card--video { background: linear-gradient(135deg, #4a8fe0, #2f6bd0); }
.sec-card--learn { background: linear-gradient(135deg, #4fb37a, #2f7d5b); }
.sec-card--read  { background: linear-gradient(135deg, #f0a83c, #d98616); }
.sec-card--write { background: linear-gradient(135deg, #9b7fe0, #7452c8); }
.sec-card--play  { background: linear-gradient(135deg, #f0708d, #d94e6f); }

.star-row { font-size: 22px; letter-spacing: 2px; line-height: 1.4; max-width: 420px; word-break: break-all; }

@media (max-width: 380px) {
  .sec-card { grid-template-columns: 54px minmax(0, 1fr); }
  .sec-card__emoji { width: 54px; height: 54px; font-size: 25px; }
  .sec-card__prog { grid-column: 2; justify-self: start; }
  .picker__letters { font-size: 44px; }
}
