/* ============================================================
   home22.css —— V2.2 首页（hm-）、课页（lsn-）、探险卡片流（mp）、游戏结算（gx-）的样式（B 负责）
   抄原型 proto.css / proto2.css / proto3.css 的 .ptop/.hero/.rec2/.xrow/.lph/.strip/.pgrid/.gend
   孩子看到的字一律不小于 14px；首页 375×812 一屏放下不滚
   ============================================================ */

/* ---------- 首页顶栏：头像 ＋ 伙伴小卡 ---------- */
.hm { padding-bottom: 0; }
.hm-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: calc(8px + env(safe-area-inset-top)); min-height: calc(56px + env(safe-area-inset-top)); margin-bottom: 8px;
}
.hm-me {
  display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; cursor: pointer;
  padding: 3px 10px 3px 3px; border-radius: 22px; position: relative;
}
.hm-me::before { content: ""; position: absolute; inset: -6px -4px; }        /* 点击区域撑到约50px */
.hm-me i {
  width: 38px; height: 38px; border-radius: 50%; background: #FF8FB1; border: 2px solid #4A3728;
  display: grid; place-items: center; overflow: hidden; font-style: normal; flex: none;
}
.hm-me i img, .hm-me i svg { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.hm-me.hop { animation: hmhop .45s; }
.hm-mp {
  display: flex; align-items: center; gap: 6px; cursor: pointer; min-height: 48px;
  background: #fff; border: 2px solid #4A3728; border-radius: 14px; padding: 2px 9px 2px 2px;
}
.hm-mp .pc.tiny, .lsn-c .pc.tiny { margin: 0; }
.hm-qm {
  width: 34px; height: 45px; border-radius: 6px; background: #2b2440; color: #fff; flex: none;
  display: grid; place-items: center; font-weight: 900; font-size: 18px;
}
.hm-qt { font-size: 14px; font-weight: 800; color: #8B7A63; }

/* ---------- 大卡 ---------- */
.hm-hero {
  background: #fff; border: 3px solid #4A3728; border-radius: 20px; padding: 10px; margin: 0 0 12px;
  box-shadow: 0 5px 0 rgba(74, 55, 40, .15); cursor: pointer;
}
.hm-hero .hc { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 12px; border: 2px solid #E6DCCB; }
.hm-hero .hc.emo { display: grid; place-items: center; font-size: 64px; background: #FFF1D6; }
.hm-hero .hc.sm { height: 96px; }
.hm-hero .hc.emo.sm { font-size: 44px; }
.hm-hero .hb { margin: 8px 2px 10px; text-align: center; }
.hm-hero .hb small { display: block; font-size: 14px; color: #B5602A; font-weight: 800; }
.hm-hero .hb b { display: block; font-size: 21px; line-height: 1.3; }
.hm-hero .hb span { display: block; font-size: 15px; color: #6f6252; }
.hm-hero.done { background: #F9F5EE; cursor: default; }

/* 大绿按钮（首页、课页、弹窗、结算共用） */
.hm-go {
  display: block; width: 100%; font: inherit; font-weight: 900; font-size: 22px; border: 0; border-radius: 18px;
  padding: 12px; background: #7BC96F; color: #fff; box-shadow: 0 5px 0 #5aa64f; cursor: pointer;
}
.hm-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #5aa64f; }
.hm-go.jump { animation: hmjump .5s; }
/* 次要的那条路：一行灰字，不像按钮 */
.hm-later {
  display: block; width: 100%; background: none; border: 0; font: inherit; font-size: 15px; color: #8B7A63;
  text-decoration: underline; padding: 10px 0; margin: 0; cursor: pointer;
}

/* 3颗精灵球（这一课做到第几关；伙伴层数用的是 v22.css 的 .seg5 小菱形） */
.hm-balls { display: flex; gap: 10px; justify-content: center; }
.hm-balls .pb, .lsn-strip .pb {
  display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #4A3728; font-style: normal;
  background: linear-gradient(#fff 0 46%, #4A3728 46% 54%, #fff 54%); opacity: .35; flex: none;
}
.hm-balls .pb.on, .lsn-strip .pb.on { opacity: 1; background: linear-gradient(#FF6B6B 0 46%, #4A3728 46% 54%, #fff 54%); }
.hm-balls .pb.cur, .lsn-strip .pb.cur { opacity: 1; box-shadow: 0 0 0 3px rgba(255, 201, 60, .75); }
.hm-balls.md { margin-top: 6px; }
.hm-balls.md .pb { width: 18px; height: 18px; }
.hm-balls.xs { gap: 4px; margin-top: 4px; justify-content: flex-start; }
.hm-balls.xs .pb { width: 12px; height: 12px; border-width: 1.5px; }
.hm-balls.xs .pb.cur { box-shadow: 0 0 0 2px rgba(255, 201, 60, .75); }

/* ---------- 最近4课：两行两列 ---------- */
.hm-sec { font-weight: 800; font-size: 14px; color: #8B7A63; margin: 4px 0 8px; }
.hm-rec { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; transition: opacity .3s; }
.hm-rec.dim { opacity: .5; }
.hm-rec .r2 {
  display: flex; gap: 8px; align-items: center; min-width: 0; cursor: pointer;
  background: #fff; border: 1.5px solid #E6DCCB; border-radius: 12px; padding: 6px;
}
.hm-rec.dim .r2 { background: transparent; border-color: transparent; }
.r2c { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; flex: none; display: block; }
.r2c.emo { display: grid; place-items: center; background: #FFF1D6; font-size: 26px; }
.r2m { min-width: 0; }
.r2m b { display: block; font-size: 14px; line-height: 1.25; text-wrap: balance; }

/* ---------- 做完才出的那一行 ---------- */
.hm-xrow {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; cursor: pointer;
  background: #FFF1D6; border: 2px dashed #E9C46A; border-radius: 14px; padding: 9px 12px;
}
.hm-xrow i { font-style: normal; font-size: 22px; }
.hm-xrow b { flex: 1; font-size: 15px; line-height: 1.3; text-wrap: balance; }
.hm-xrow .st { font-size: 15px; white-space: nowrap; }
.hm-xrow.ok {
  justify-content: center; cursor: default; font-size: 15px; font-weight: 800; color: #3c8a33;
  background: #EAF6E4; border: 2px solid #CFE8C4;
}

/* ---------- 点伙伴弹的大卡 ---------- */
.hm-pmod .pc { margin: 4px auto 12px; }
.hm-pmod p { font-size: 16px; font-weight: 800; margin: 0 0 12px; text-wrap: balance; }
.hm-three { display: flex; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.hm-three .pc.mini { width: 70px; height: 93px; margin: 0; }

@keyframes hmhop { 0%, 100% { transform: translateY(0) } 40% { transform: translateY(-8px) } 70% { transform: translateY(2px) } }
@keyframes hmjump { 0%, 100% { transform: translateY(0) } 35% { transform: translateY(-10px) } 65% { transform: translateY(2px) } }

/* ---------- 探险：卡片流 ---------- */
.mp .lead, .mp .scene-meta .en, .mp .scene-meta .desc, .mp .unit-badge { font-size: 14px; }
.mp-st { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mp-st .hm-balls.xs { margin-top: 0; }
.mp-st .hm-balls.xs .pb { width: 14px; height: 14px; }
.lsn-tag {
  font-style: normal; font-size: 14px; font-weight: 800; line-height: 1.4;
  background: #FFC93C; border-radius: 8px; padding: 0 7px;
}

/* ---------- 课页 ---------- */
.lsn-h {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: calc(8px + env(safe-area-inset-top)); min-height: calc(56px + env(safe-area-inset-top)); margin-bottom: 6px;
}
.lsn-back {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid #E6DCCB; background: #fff; position: relative;
  display: grid; place-items: center; font: inherit; font-size: 28px; line-height: 1; font-weight: 900; color: #8B7A63;
  padding: 0 2px 4px 0; cursor: pointer;
}
.lsn-back::after { content: ""; position: absolute; inset: -6px; }
.lsn-c {
  display: flex; align-items: center; gap: 6px; min-height: 48px; cursor: pointer;
  background: #fff; border: 2px solid #4A3728; border-radius: 14px; padding: 2px 10px 2px 2px;
  font-size: 14px; font-weight: 800;
}
.lsn-c small { font-size: 14px; }
.lsn-c.st { padding: 4px 12px; font-size: 18px; }
.lsn-cv { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 14px; border: 3px solid #4A3728; }
.lsn-cv.emo { display: grid; place-items: center; background: #FFF1D6; font-size: 64px; }
.lsn-t { font-size: 22px; margin: 10px 0 0; text-align: center; line-height: 1.3; }
.lsn-v { font-size: 15px; text-align: center; color: #6f6252; cursor: pointer; padding: 8px 0; margin: -2px 0 4px; text-wrap: balance; }
.lsn-strip { display: flex; justify-content: center; gap: 30px; margin: 12px 0 2px; }
.lsn-strip span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lsn-strip em { font-style: normal; font-size: 20px; line-height: 1; }
.lsn-strip .pb { width: 18px; height: 18px; }
.lsn-sec { margin-top: 10px; }
.lsn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lsn-grid .pg {
  font: inherit; color: inherit; cursor: pointer; min-height: 88px; padding: 8px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; border: 2px solid #E6DCCB; border-radius: 14px; text-align: center; transition: opacity .3s;
}
.lsn-grid .pg:active { transform: translateY(2px); }
.lsn-grid .pg i { font-style: normal; font-size: 26px; line-height: 1.2; }
.lsn-grid .pg b { font-size: 14px; }
.lsn-grid .pg .st { font-size: 15px; white-space: nowrap; }      /* 她靠这一行判断「还能不能拿星」 */
.lsn-grid .pg.full { opacity: .5; }                               /* 拿满了变淡，不挪位置 */

/* ---------- 游戏：✕ 回课页、配错不变红 ---------- */
.gx-x { font-size: 20px; font-weight: 900; }
.mg.oops { border-color: #E08A00; animation: mgshake .32s; }

/* ---------- 游戏结算：只放星星 ---------- */
.gx-end { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gx-cap {
  align-self: flex-end; position: relative; display: flex; align-items: center; gap: 2px;
  margin-top: calc(14px + env(safe-area-inset-top)); height: 36px; padding: 0 8px; font-weight: 900; font-size: 18px;
}
.gx-big { display: flex; justify-content: center; gap: 10px; font-size: 60px; margin: 80px 0 10px; color: #D9CDBB; line-height: 1.1; }
.gx-big i { font-style: normal; }
.gx-line { font-size: 16px; font-weight: 800; margin: 6px 0 30px; min-height: 24px; }
.gx-btns { width: 100%; visibility: hidden; opacity: 0; transition: opacity .3s; }
.gx-btns.on { visibility: visible; opacity: 1; }

/* ---------- 老游戏头上的进度小点（修复X：不写「第几个」「答对几个」「试了几次」「连击」） ---------- */
.gx-dots { display: flex; gap: 7px; justify-content: center; align-items: center; margin: 2px 0 12px; min-height: 12px; }
.gx-dots i { width: 10px; height: 10px; border-radius: 50%; background: #E6DCCB; transition: background .2s, opacity .2s; }
.gx-dots i.done { background: #7BC96F; }
.gx-dots i.cur { background: #FFC93C; box-shadow: 0 0 0 3px rgba(255, 201, 60, .3); }
.gx-dots.sm { margin: -2px 0 10px; }
.gx-dots.sm i { width: 8px; height: 8px; background: #B5A48C; box-shadow: none; }
.gx-dots.sm i.gone { background: transparent; box-shadow: inset 0 0 0 1.5px #D9CDBB; }
.pop-target { justify-content: center; }
.pop-target .pt-en { flex: 0 1 auto; }
.pop-target .btn-speak { margin: 0; }
.lsn-again { margin-top: 14px; }

/* ---------- 学习小屋切换行（10-30）：英语｜语文｜数学＋总⭐，在今天页最上面 ---------- */
.hm-hub { display: flex; align-items: center; gap: 6px; margin: 8px 0 2px; }
.hm-hub a, .hm-hub span { flex: 1; text-align: center; font-size: 15px; font-weight: 800; padding: 6px 0; border-radius: 99px; border: 2px solid #E6DCCB; color: #8A7E70; text-decoration: none; background: #fff; }
.hm-hub span.on { background: #4A3728; border-color: #4A3728; color: #fff; }
.hm-hub a:active { transform: translateY(1px); }
.hm-hub b { flex: none; font-size: 15px; color: #B5602A; padding-left: 4px; white-space: nowrap; }

/* ---------- 顶栏（10-30 第二版）：左头像＋总⭐，右「英语 ▾」切科目 ---------- */
.hm-st { font-size: 19px; font-weight: 900; color: #B5602A; white-space: nowrap; }
.hm-subj { position: relative; }
.hm-sbtn { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 14px 0 16px; font: inherit; font-size: 18px; font-weight: 900; color: #4A3728; background: #fff; border: 2.5px solid #4A3728; border-radius: 14px; box-shadow: 0 3px 0 #4A3728; cursor: pointer; }
.hm-sbtn i { font-style: normal; font-size: 14px; color: #8A7E70; }
.hm-sbtn[aria-expanded="true"] { transform: translateY(2px); box-shadow: 0 1px 0 #4A3728; }
.hm-smenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 132px; background: #fff; border: 2.5px solid #4A3728; border-radius: 16px; box-shadow: 0 6px 0 rgba(74, 55, 40, .25); padding: 6px; display: grid; gap: 4px; }
.hm-smenu[hidden] { display: none; }
.hm-smenu a, .hm-smenu span { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 10px; font-size: 18px; font-weight: 800; color: #4A3728; text-decoration: none; }
.hm-smenu span.on { background: #FFF1D6; color: #B5602A; }
.hm-smenu span i { font-style: normal; font-size: 14px; }
.hm-smenu a:active { background: #F6F1E6; }

/* ---------- 学习小屋：语文、数学的内容层（10-30 tabs/subject.js） ---------- */
#subjFrame { position: fixed; z-index: 5; background: #fbf4e8; border-radius: 18px 18px 0 0; overflow: hidden; }
#subjFrame[hidden] { display: none; }
#subjFrame iframe { display: block; width: 100%; height: 100%; border: 0; }
#subjFrame iframe[hidden] { display: none; }
.subj-empty { margin: 40px 8px 0; text-align: center; background: #fff; border: 2.5px solid #4A3728; border-radius: 20px; box-shadow: 0 4px 0 rgba(74, 55, 40, .25); padding: 26px 18px; }
.subj-empty i { display: block; font-style: normal; font-size: 44px; }
.subj-empty b { display: block; font-size: 20px; margin: 8px 0 6px; color: #4A3728; }
.subj-empty p { margin: 0; color: #8A7E70; font-size: 15px; line-height: 1.6; }
.hm-sbtn.solo { cursor: default; }
.hm-smenu button { display: flex; justify-content: center; align-items: center; padding: 10px 8px; border-radius: 10px; font: inherit; font-size: 18px; font-weight: 800; color: #4A3728; background: none; border: 0; cursor: pointer; }
.hm-smenu button:active { background: #F6F1E6; }
/* #app 自己是 z-index:1 的一层，内容层放它下面（z-index:0）：顶栏和「科目 ▾」下拉自然盖在内容层上；
   内容层露出来的时候 #app 那块透明的地方不接点击，点击落到下面的语文/数学页面上（10-30 测出来下拉被挡） */
#subjFrame { z-index: 0; }
body.subj-on #app { pointer-events: none; }
body.subj-on #app .hm-top, body.subj-on #app .subj-empty { pointer-events: auto; }
/* 语文 · 拓展（10-30 晚）：句子诊所、世界史、节气、阅读小屋 */
.subj-ext { margin-top: 4px; }
.subj-ext > .hm-read:first-child { margin-top: 4px; }
.hm-read.hm-clinic { background: #FDEBEA; border-color: #E07A6E; box-shadow: 0 3px 0 #EBB3AA; }
.hm-read.hm-clinic span { color: #A3483C; }
.subj-back { margin: 2px 0 0; border: 0; background: none; font: inherit; font-size: 16px; font-weight: 800; color: #8A7E70; padding: 6px 2px; cursor: pointer; position: relative; }
body.subj-on #app .subj-back { pointer-events: auto; }
