/* ===== 一年级同步学 · H5 样式（可爱、大按钮、适配手机/平板/PC） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #fff7ec;
  --card: #ffffff;
  --primary: #ff8a3d;
  --primary-2: #ffd166;
  --green: #4caf50;
  --blue: #4d96ff;
  --text: #4a3b2a;
  --muted: #9b8b78;
  --radius: 22px;
  --shadow: 0 6px 18px rgba(255,138,61,.18);
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Comic Sans MS", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 760px; margin: 0 auto; min-height: 100vh; padding: 16px; padding-bottom: 40px; }

.loading { text-align: center; padding: 80px 0; color: var(--muted); font-size: 20px; }

/* 顶部条 */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 44px; }
.topbar .back { font-size: 26px; background: var(--card); border: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; }
.topbar .title { font-size: 20px; font-weight: 800; }
.topbar .crumb { font-size: 13px; color: var(--muted); margin-left: auto; }

/* 欢迎/首页 */
.home-hero { text-align: center; padding: 26px 10px 18px; }
.home-hero h1 { font-size: 30px; font-weight: 900; color: var(--primary); letter-spacing: 1px; }
.home-hero p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.home-hero .kid { font-size: 64px; }

/* 通用卡片网格 */
.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-1 { grid-template-columns: 1fr; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 14px; cursor: pointer; text-align: center; transition: transform .12s;
  border: 3px solid transparent; user-select: none;
}
.card:active { transform: scale(.96); }
.card .ic { font-size: 46px; }
.card .nm { font-size: 20px; font-weight: 800; margin-top: 8px; }
.card .py { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card.subject-yuwen { border-color: #ffd6a5; }
.card.subject-shuxue { border-color: #a5d8ff; }
.card.subject-yingyu { border-color: #caffbf; }
.card.selected { border-color: var(--primary); transform: scale(1.02); }

.section-title { font-size: 18px; font-weight: 800; margin: 18px 4px 10px; display: flex; align-items: center; gap: 8px; }

/* 学习页 */
.study-head { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.study-head .loc { font-size: 14px; color: var(--muted); }
.study-head h2 { font-size: 24px; font-weight: 900; margin-top: 4px; }
ruby rt { font-size: 12px; color: var(--primary); }

.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 16px; }
.mode-btn { padding: 22px 10px; border-radius: var(--radius); font-size: 20px; font-weight: 800; border: none; box-shadow: var(--shadow); cursor: pointer; }
.mode-btn.review { background: linear-gradient(135deg,#ffd166,#ff8a3d); color: #fff; }
.mode-btn.preview { background: linear-gradient(135deg,#a5d8ff,#4d96ff); color: #fff; }

.step-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-height: 200px; }
.step-card .kind-tag { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 20px; background: #fff0d6; color: var(--primary); margin-bottom: 10px; }
.step-card .kind-tag.quiz { background: #e3f2fd; color: var(--blue); }
.step-card .body { font-size: 19px; line-height: 1.7; }
.step-card .hint { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* 选择题 */
.options { display: grid; gap: 10px; margin-top: 14px; }
.opt { padding: 14px; border-radius: 16px; background: #f6f1e7; border: 2px solid transparent; font-size: 18px; cursor: pointer; text-align: center; }
.opt.correct { background: #e6f7e6; border-color: var(--green); color: var(--green); font-weight: 800; }
.opt.wrong { background: #fdeaea; border-color: #ff6b6b; color: #ff6b6b; }
.opt:disabled { cursor: default; }

.feedback { margin-top: 12px; font-size: 18px; font-weight: 800; min-height: 24px; }
.feedback.good { color: var(--green); }
.feedback.try { color: var(--primary); }

/* 字词卡 word / 朗读 read / 听力 listen / 看图 image */
.step-card .word-big { font-size: 64px; font-weight: 900; color: var(--primary); text-align: center; line-height: 1.2; }
.step-card .pinyin { text-align: center; font-size: 22px; color: var(--blue); margin-top: 6px; }
.step-card .emoji { text-align: center; font-size: 52px; margin-top: 8px; }
.step-card .emoji.big { font-size: 88px; }
.step-card .meaning { text-align: center; font-size: 17px; color: var(--text); margin-top: 8px; }
.step-card .read-text { font-size: 22px; line-height: 1.9; text-align: center; }
.step-card .audio { display: block; margin: 14px auto 0; padding: 10px 18px; border-radius: 16px; background: #e3f2fd; color: var(--blue); border: none; font-size: 16px; font-weight: 700; cursor: pointer; }
.step-card .kind-tag.word { background: #fff0d6; color: var(--primary); }
.step-card .kind-tag.read { background: #e8f5e9; color: var(--green); }
.step-card .kind-tag.listen { background: #ede7f6; color: #7e57c2; }
.step-card .kind-tag.image { background: #fce4ec; color: #ec407a; }

/* 上一步/下一步 */
.nav-row { display: flex; gap: 12px; margin-top: 16px; }
.nav-row button { flex: 1; padding: 14px; border-radius: 16px; border: none; font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); }
.nav-row .prev { background: #fff; color: var(--muted); }
.nav-row .next { background: var(--primary); color: #fff; }
.nav-row .next:disabled { opacity: .4; }

/* 家长旁白 */
.parent-note { margin-top: 16px; background: #f3f7e9; border-radius: 16px; padding: 12px 14px; }
.parent-note summary { cursor: pointer; font-size: 15px; color: #7a8a55; font-weight: 700; }
.parent-note .pn-body { margin-top: 8px; font-size: 15px; color: #5d6b40; line-height: 1.6; }

/* 完成庆祝 */
.celebrate { text-align: center; padding: 40px 10px; }
.celebrate .big { font-size: 72px; animation: pop .5s ease; }
.celebrate h2 { font-size: 28px; color: var(--green); margin: 12px 0; }
.celebrate p { color: var(--muted); }
@keyframes pop { 0%{transform:scale(.3);opacity:0} 70%{transform:scale(1.15)} 100%{transform:scale(1);opacity:1} }

/* 进度点 */
.dots { display: flex; gap: 6px; justify-content: center; margin: 12px 0; }
.dots .d { width: 10px; height: 10px; border-radius: 50%; background: #e6ddcc; }
.dots .d.on { background: var(--primary); }
.dots .d.done { background: var(--green); }

/* PC 端：平板/桌面不再拉伸，限制宽度已由 #app max-width 处理 */
@media (min-width: 900px) {
  #app { padding-top: 30px; }
  .card .ic { font-size: 56px; }
  .home-hero .kid { font-size: 80px; }
}
