/* 学霸双娃 H5 · 全局样式（浅色主题，与小程序色板同源） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fa; color: #2b2f36; font-size: 15px;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 32px; }
.boot { text-align: center; color: #9aa0a6; padding: 80px 0; }
.hidden { display: none !important; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; color: #fff; background: var(--primary, #4A90D9);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topbar .bt { flex: 1; font-size: 17px; font-weight: 700; }
.backbtn {
  border: none; background: rgba(255,255,255,0.2); color: #fff; font-size: 14px;
  padding: 6px 12px; border-radius: 10px; cursor: pointer;
}
.page { padding: 14px; }
.foot { text-align: center; font-size: 11px; color: #9aa0a6; padding: 14px 0 4px; }

/* 卡片与通用 */
.card {
  background: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  border: 1px solid #eef1f6; box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.btn {
  display: inline-block; border: none; cursor: pointer; text-align: center;
  background: var(--primary, #4A90D9); color: #fff; font-size: 15px; font-weight: 600;
  padding: 11px 18px; border-radius: 12px;
}
.btn.ghost { background: #eef1f6; color: var(--primary, #4A90D9); }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: 0.45; }
.tag { font-size: 11px; border-radius: 6px; padding: 2px 8px; color: #fff; background: #4A90D9; white-space: nowrap; }
.tag.hard { background: #e8553c; } .tag.warn { background: #f0a83c; } .tag.key { background: #4A90D9; }
.tag.gray { background: #9aa0a6; } .tag.green { background: #2e9e6b; }
/* #573 「已看」/「练过」两个概念用不同色，别混成一个 */
.tag.ok { background: #2e9e6b; } .tag.warn2 { background: #b06a1a; }
/* #573 动画观看进度条 */
.aprogress { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.aprogress .pbar { flex: 1; height: 7px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.aprogress .pfill { height: 100%; background: #2e9e6b; border-radius: 999px; }
.aprogress .plab { font-size: 11px; color: #6b7280; white-space: nowrap; }
.muted { color: #6b7280; font-size: 12.5px; }

/* 学生选择 */
.stu-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.stu-avatar { width: 44px; height: 44px; border-radius: 50%; background: #e8f1fb; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 auto; }
.stu-name { font-size: 16px; font-weight: 700; }
.stu-grade { font-size: 12.5px; color: #6b7280; margin-top: 2px; }
.addform { display: flex; gap: 8px; margin-top: 4px; }
.addform input { flex: 1; }
.addform select { width: 92px; }

/* 首页 */
.home-hero { display: flex; align-items: center; gap: 14px; }
.home-stats { display: flex; gap: 10px; margin: 12px 0; }
.stat { flex: 1; background: #fff; border-radius: 12px; padding: 12px 8px; text-align: center; border: 1px solid #eef1f6; }
.stat .n { font-size: 20px; font-weight: 800; color: var(--primary, #4A90D9); }
.stat .l { font-size: 11.5px; color: #6b7280; margin-top: 3px; }
.zone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zone {
  background: #fff; border-radius: 14px; padding: 16px 14px; cursor: pointer;
  border: 1px solid #eef1f6; text-align: left;
}
.zone .zi { font-size: 24px; }
.zone .zt { font-size: 15px; font-weight: 700; margin-top: 6px; }
.zone .zs { font-size: 11.5px; color: #9aa0a6; margin-top: 3px; }

/* 学科选择 */
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sub-card {
  background: #fff; border-radius: 14px; padding: 15px 14px; cursor: pointer;
  border: 1px solid #eef1f6; border-left: 4px solid var(--sc, #4A90D9);
}
.sub-card .sn { font-size: 16px; font-weight: 700; }
.sub-card .sc { font-size: 12px; color: #9aa0a6; margin-top: 4px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.seg .segbtn {
  flex: 1 0 30%; border: 1px solid #e6eaf0; background: #fff; color: #4b5563; font-size: 13.5px;
  padding: 9px 0; border-radius: 10px; cursor: pointer;
}
.seg .segbtn.on { background: var(--primary, #4A90D9); color: #fff; border-color: var(--primary, #4A90D9); }

/* 答题 */
.qstem { font-size: 16px; line-height: 1.75; white-space: pre-wrap; }
.qopts { margin-top: 12px; }
.opt {
  background: #fff; border: 1.5px solid #e6eaf0; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; font-size: 15px; line-height: 1.5;
  display: flex; gap: 10px;
}
.opt .ol { font-weight: 800; color: var(--primary, #4A90D9); flex: 0 0 auto; }
.opt.sel { border-color: var(--primary, #4A90D9); background: #eef5fd; }
.opt.right { border-color: #2e9e6b; background: #eaf7f0; }
.opt.wrong { border-color: #e8553c; background: #fdeeed; }
.fill-input {
  width: 100%; font-size: 16px; padding: 11px 12px; border: 1.5px solid #e6eaf0;
  border-radius: 10px; margin-top: 8px; font-family: inherit;
}
.fill-input:focus { outline: none; border-color: var(--primary, #4A90D9); }
.feedback { border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: 14px; line-height: 1.65; }
.feedback.ok { background: #eaf7f0; color: #1f7d52; }
.feedback.no { background: #fdeeed; color: #b93a2b; }
.progress { height: 6px; background: #e6eaf0; border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
.progress .bar { height: 100%; background: var(--primary, #4A90D9); transition: width .2s; }

/* 结果 */
.score-hero { text-align: center; padding: 22px 0 14px; }
.score-hero .big { font-size: 46px; font-weight: 900; color: var(--primary, #4A90D9); }
.res-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #f2f4f8; }
.res-row:last-child { border-bottom: none; }
.res-ic { flex: 0 0 auto; font-size: 18px; }
.res-body { flex: 1; min-width: 0; }
.res-stem { font-size: 13.5px; line-height: 1.55; }
.res-ans { font-size: 12.5px; color: #6b7280; margin-top: 3px; }

/* 错题本 */
.w-card { cursor: default; }
.w-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.w-stem { font-size: 14px; line-height: 1.65; margin-top: 8px; white-space: pre-wrap; }
.w-ans { font-size: 12.5px; color: #6b7280; margin-top: 6px; }
.w-foot { display: flex; gap: 8px; margin-top: 10px; }
.w-foot .btn { padding: 7px 14px; font-size: 13px; }
/* #621 理解关联：名句「点我显示」遮盖态 */
.elab-line { font-size: 13px; color: #333; line-height: 1.8; }
.elab-line.covered { color: #b0a8c8; font-style: normal; letter-spacing: 2px; }
.mastered-chip { font-size: 11px; background: #eaf7f0; color: #1f7d52; border-radius: 6px; padding: 2px 8px; }

/* 动画 */
.anim-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.anim-tabs .tab {
  flex: 0 0 auto; border: 1px solid #e6eaf0; background: #fff; color: #4b5563; font-size: 13.5px;
  padding: 7px 15px; border-radius: 18px; cursor: pointer;
}
.anim-tabs .tab.on { background: var(--primary, #4A90D9); color: #fff; border-color: var(--primary, #4A90D9); }
/* #535 学科筛选下拉化：单行 select，节省竖向空间 */
.anim-sel {
  width: 100%; appearance: none; -webkit-appearance: none; margin-bottom: 12px; outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A90D9' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid #e6eaf0; color: #2b2f36; font-size: 14px;
  padding: 10px 32px 10px 12px; border-radius: 12px; cursor: pointer;
}
.anim-sel:focus { border-color: var(--primary, #4A90D9); }
.anim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stage { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid #eef1f6; margin-bottom: 12px; position: relative; }
.stage canvas { display: block; width: 100%; }
/* #573 可拖动提示：贴画布底部，不拦截指针（否则提示本身会吃掉拖拽起点） */
.draghint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px;
  font-size: 11px; color: #8a6d3b; background: rgba(255,248,236,0.92);
  border: 1px solid #f0e0c0; border-radius: 999px; padding: 2px 12px; pointer-events: none;
}
.explain, .tips {
  background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid #eef1f6; line-height: 1.65; font-size: 13px; color: #4b5563;
}
.tips { background: #fff8ec; border-color: #f7e3bf; }
.ctrlbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ctrlbar .btn { padding: 9px 14px; font-size: 14px; }
.speedbox { margin-left: auto; font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.ctrl { padding: 11px 0; border-bottom: 1px solid #f2f4f8; }
.ctrl:last-child { border-bottom: none; }
.clabel { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ctrl input[type=range] { width: 100%; }
.vlab { color: var(--primary, #4A90D9); font-size: 12px; margin-left: 8px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(43,47,54,0.92); color: #fff; font-size: 13.5px;
  padding: 9px 18px; border-radius: 20px; z-index: 99; max-width: 80%;
}
.sync-status {
  position: fixed; right: 10px; bottom: 8px; z-index: 50;
  font-size: 10.5px; color: #9aa0a6; background: rgba(255,255,255,0.85);
  border-radius: 8px; padding: 2px 8px; pointer-events: none;
}
.sync-status:empty { display: none; }
input[type=text], input[type=number], select {
  border: 1.5px solid #e6eaf0; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; font-family: inherit; background: #fff;
}

/* #527 答案报错反馈 */
.fb-rep { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); }
.fb-rep-link { font-size: 13px; color: #e67e22; cursor: pointer; }
.fb-rep-form { margin-top: 8px; }
.fb-rep-types { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-rep-type { font-size: 12.5px; padding: 4px 10px; border-radius: 14px; background: #f5f5f5; color: #666; border: 1px solid #e5e5e5; cursor: pointer; }
.fb-rep-type.sel { background: #fff3e0; color: #e67e22; border-color: #e67e22; font-weight: 600; }
.fb-rep-done { font-size: 13px; color: #1f7d52; }

/* #541 家长看板 */
.p-sub { display: flex; align-items: center; gap: 8px; padding: 10px 2px; border-bottom: 1px dashed #eef1f6; cursor: pointer; font-size: 14.5px; }
.p-sub:last-child { border-bottom: none; }
.p-sub .muted { margin-left: auto; margin-right: 6px; font-size: 12.5px; }
.p-sub .tag { flex-shrink: 0; }
.p-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* #548 学习计划 */
.plan-exams .exam:last-child { border-bottom: none; }
.exam { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed #eef1f6; }
.exam-dot { width: 10px; height: 10px; border-radius: 50%; background: #2e9e6b; flex: 0 0 auto; }
.exam.soon .exam-dot { background: #f0a83c; }
.exam.passed .exam-dot { background: #c7cdd4; }
.exam-mid { flex: 1; min-width: 0; }
.exam-mid b { display: block; font-size: 14px; }
.exam-mid i { display: block; font-style: normal; font-size: 12px; color: #6b7280; margin-top: 1px; }
.exam-tail { font-size: 12.5px; color: #1f7d52; flex-shrink: 0; }
.exam.soon .exam-tail { color: #e67e22; font-weight: 700; }
.exam.passed .exam-tail { color: #9aa0a6; }
.plan-ai-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.ai-chk {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #c7cdd4;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; font-style: normal;
}
.ai-chk.on { background: var(--primary, #4A90D9); border-color: var(--primary, #4A90D9); }

/* ---------------- #552 奖励商城 ---------------- */
.rw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rw-coin { font-size: 30px; }
.rw-num { font-size: 24px; font-weight: 800; color: var(--primary, #4A90D9); line-height: 1.1; }
.rw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rw-item {
  background: #fff; border: 1px solid #eef1f6; border-radius: 12px; padding: 12px 8px;
  text-align: center; cursor: pointer; user-select: none;
}
.rw-item:active { transform: scale(0.97); }
.rw-item.equipped { border-color: var(--primary, #4A90D9); box-shadow: 0 0 0 1px var(--primary, #4A90D9) inset; }
.rw-item .swatch {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px;
  border: 2px solid rgba(0, 0, 0, 0.06);
}
.rw-item .bicon { font-size: 26px; margin-bottom: 4px; }
.rw-name { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.rw-desc { font-size: 10.5px; color: #9aa0a6; margin-top: 4px; }
.rw-arm { font-size: 10.5px; color: #e8553c; margin-top: 5px; font-weight: 600; }

/* ---------------- #558 必背专区 ---------------- */
.bb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; }
.bb-row:active { transform: scale(0.985); }
.bb-icon { font-size: 24px; flex: 0 0 auto; }
.bb-name { font-size: 14px; font-weight: 700; }

/* ---------------- #562 成语填空 ---------------- */
.id-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.id-fchip {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 999px; font-size: 13px;
  background: #fff; border: 1px solid #eef1f6; color: #6b7280; cursor: pointer; user-select: none;
}
.id-fchip.on { background: var(--primary, #4A90D9); border-color: var(--primary, #4A90D9); color: #fff; font-weight: 600; }
.id-head { display: flex; align-items: center; gap: 8px; }
.id-clue { font-size: 15px; margin: 14px 0 16px; line-height: 1.6; }
.id-cells { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.id-fix {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 44px; padding: 0 4px; font-size: 22px; font-weight: 700;
  border-bottom: 2px solid #d8dee6; color: #222;
}
.id-hole {
  width: 44px; height: 44px; text-align: center; font-size: 22px; font-weight: 700;
  border: none; border-bottom: 2px solid var(--primary, #4A90D9); background: #f6f8fb;
  border-radius: 6px 6px 0 0; color: var(--primary, #4A90D9); outline: none;
}
.id-hole:focus { background: #eef4fc; }
.id-hole.reveal { color: #e8553c; border-bottom-color: #e8553c; background: #fdf1ef; }
.id-fb { margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.6; }
.id-fb.right { background: #eefaf3; color: #1f7d52; }
.id-fb.wrong { background: #fdf1ef; color: #e8553c; }
.id-stats { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: #6b7280; }
.id-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.id-gcell { background: #f9fafc; border: 1px solid #eef1f6; border-radius: 12px; padding: 10px; }
.id-gemoji { font-size: 22px; }
.id-gname { font-size: 14px; font-weight: 700; margin-top: 2px; }
.id-gmean { font-size: 11px; color: #6b7280; margin-top: 3px; line-height: 1.5; }

/* #574 名句小卡 5 档自评：色值与背诵页 data-rec-q 五档完全一致（红→绿 = 忘→牢） */
.qrow { display: flex; flex-wrap: wrap; gap: 6px; }
.qb {
  flex: 1; min-width: 30%; padding: 9px 0; border: none; border-radius: 10px;
  color: #fff; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.qb.q0 { background: #e24b4a; }
.qb.q1 { background: #f0915f; }
.qb.q2 { background: #ef9f27; }
.qb.q3 { background: #5aab5a; }
.qb.q4 { background: #1e9e54; }
.qb:active { opacity: .8; }

/* ---------------- #582 数学公式动态讲解 ---------------- */
/* 未展开的步骤压暗但不隐藏 —— 保留「还有几步」的信息，孩子能预期讲解长度 */
.fx { margin: 10px 0 12px; border: 1px solid #dfe6f0; border-radius: 12px; background: #fbfcfe; overflow: hidden; }
.fx-h { padding: 10px 12px 8px; font-size: 14px; font-weight: 700; color: #2c3e50; }
.fx-hint { margin-left: 4px; font-size: 11.5px; font-weight: 400; color: #8a94a6; }
.fx-step { padding: 8px 12px; border-top: 1px dashed #e6ebf3; transition: opacity .18s; }
.fx-step.off { opacity: .34; }
.fx-step.cur { background: #eef5fd; }
.fx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fx-i {
  flex: 0 0 auto; width: 19px; height: 19px; line-height: 19px; text-align: center;
  border-radius: 50%; background: var(--primary, #4A90D9); color: #fff; font-size: 11px; font-weight: 700;
}
.fx-step.off .fx-i { background: #c3ccd9; }
.fx-e { font-size: 14.5px; font-weight: 700; color: #233; font-family: "Cambria Math", Georgia, serif; }
.fx-v { font-size: 14px; font-weight: 800; color: #e8553c; }
.fx-n { margin: 3px 0 0 27px; font-size: 12.5px; color: #6b7688; line-height: 1.5; }
.fx-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid #e6ebf3; background: #f5f8fc; }
.fx-bar .btn { padding: 7px 11px; font-size: 13px; }
.fx-bar .btn[disabled] { opacity: .45; }
.fx-prog { font-size: 12.5px; color: #6b7688; min-width: 42px; text-align: center; }

/* ---------------- #599 AI 战绩卡（对齐微信 pkgquiz/result 的 .ai-card，rpx→px 折半） ---------------- */
.ai-pn { font-size: 28px; font-weight: 800; color: #8894a6; line-height: 1.1; }
.ai-pn .ai-pct { font-size: 13px; font-weight: 600; margin-left: 2px; }
.ai-pn.up { color: #2ecc71; } .ai-pn.down { color: #ff9f43; }
.ai-arrow { font-size: 17px; color: #b6bfcc; margin: 0 6px; }
.ai-delta { margin-left: auto; font-size: 13px; font-weight: 700; color: #8894a6; padding: 4px 12px; border-radius: 999px; background: #f2f4f8; }
.ai-delta.up { color: #1e9e5f; background: #e8f8ef; } .ai-delta.down { color: #d98026; background: #fdf1e2; }
.ai-sum { font-size: 13.5px; color: #5a6675; }

/* ---------------- #608 H5 图题渲染（对齐微信 question/result/wrongbook 的 image，rpx→px 折半） ---------------- */
.qfig { display: block; max-width: 92%; margin: 8px auto 2px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------------- #610 名句小卡基础排版 ----------------
 * 勘误：qt-card / qt-head / qt-text / qt-quote / qt-gloss 五个类此前只在 app.js 里被引用，
 * CSS 从未定义（牌堆一直靠 .card 默认样式兜底，原句与释义字号无区分）。补基础排版，
 * 同时给下面的断点提供可调字号（否则窄屏放大字号无从下手）。
 */
.qt-card { padding: 18px 16px; }
.qt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qt-text { margin: 16px 0 12px; }
.qt-quote { font-size: 20px; line-height: 1.9; font-weight: 700; color: #23324a; }
.qt-gloss { font-size: 15px; line-height: 1.85; color: #3d4756; }

/* ---------------- #610 响应式适配 ----------------
 * 原则：默认样式（560px 主容器既有观感）一个字不动；断点内只做「补属性」式覆盖。
 * 内联 style 已声明的属性（flex / margin-top 等）不重复覆盖 —— 内联优先级高于类，
 * 硬碰只会逼出 !important 军备竞赛。因此 JS 侧对需要响应的行统一补了类名
 * （rhead / qt-topcard / qt-searchrow / cp-parthead / qt-btnrow），
 * 这里只声明它们「内联没写」的属性（flex-wrap 之类）。
 */

/* ① 窄屏手机（≤380px：iPhone SE / 小屏安卓）—— 缩内边距，多列控件改两列而不是挤成一坨 */
@media (max-width: 380px) {
  .page { padding: 10px; }
  .card { padding: 12px 12px; }
  .topbar { padding: 11px 12px; gap: 8px; }
  .topbar .bt { font-size: 16px; }
  .backbtn { padding: 6px 10px; font-size: 13px; }
  .home-stats { gap: 6px; }
  .stat { padding: 10px 4px; }
  .stat .n { font-size: 18px; }
  .stat .l { font-size: 10.5px; }
  .zone { padding: 14px 10px; }
  .zone .zi { font-size: 21px; }
  .zone .zt { font-size: 14px; }
  .sub-grid, .zone-grid, .anim-grid, .rw-grid, .id-gallery { gap: 8px; }
  /* 卷区 / 题数 / 模式：30% 基准在 320px 下会挤成三个窄按钮（字换行）→ 改两列 */
  .seg .segbtn { flex: 1 0 44%; font-size: 13px; }
  /* #574 名句五档自评：保持 3 + 2 两行（#611 真机实测教训：min-width 是「每行最少放几个」的开关，
     不是越大越好 —— 曾设 44% 反而变成 2+2+1 三行、单个 134px 更占竖向空间；30% 才是 3+2） */
  .qb { min-width: 30%; padding: 10px 0; font-size: 12.5px; }
  .opt { padding: 10px 12px; font-size: 14.5px; }
  .fill-input { font-size: 15px; padding: 10px 10px; }
  .score-hero .big { font-size: 38px; }
  .anim-tabs .tab { padding: 6px 12px; font-size: 12.5px; }
  .id-hole, .id-fix { width: 38px; min-width: 38px; height: 40px; font-size: 20px; }
  .rw-item { padding: 10px 6px; }
  .rw-num { font-size: 21px; }
  .qt-card { padding: 14px 12px; }
  .qt-quote { font-size: 17.5px; line-height: 1.8; }
  .qt-gloss { font-size: 14px; }
  /* 内联 flex 行：只补 flex-wrap（内联没声明），窄屏下标题与按钮上下排，不再互相挤压 */
  .rhead, .qt-topcard, .qt-searchrow, .cp-parthead { flex-wrap: wrap; }
  .qt-topcard .btn { width: 100%; margin-top: 8px; }
  .cp-parthead .tag { flex: 0 0 auto; }
}

/* ② 宽屏（≥600px：平板竖屏 / 桌面窄窗）—— 主容器放宽，卡片网格三列，别让 560px 孤零零浮在中间 */
@media (min-width: 600px) {
  #app { max-width: 720px; }
  .page { padding: 18px; }
  .card { padding: 16px 18px; }
  .sub-grid, .zone-grid, .anim-grid, .rw-grid, .id-gallery { grid-template-columns: repeat(3, 1fr); }
  .seg .segbtn { flex: 1 0 22%; }
  .qstem { font-size: 17px; }
  .opt { font-size: 15.5px; padding: 13px 16px; }
  .qrow { gap: 8px; }
  /* #611：宽屏够放五个一排（默认 30% 只放得下 3 个 → 浪费竖向空间），18% 让五档回到单行 */
  .qb { min-width: 18%; font-size: 14px; }
  .qt-quote { font-size: 22px; }
  .qt-gloss { font-size: 15.5px; }
}

/* ⑤ 平板分栏（≥900px：平板横屏 / 桌面窄窗）—— #615 把原 ≥1000 档下放：
   860px 在 1024 平板横屏下两侧留白太多，960px 更吃满；网格四列同步从 1000 下放到 900 */
@media (min-width: 900px) {
  #app { max-width: 960px; }
  .sub-grid, .zone-grid, .id-gallery { grid-template-columns: repeat(4, 1fr); }
  .anim-grid, .rw-grid { grid-template-columns: repeat(4, 1fr); }
  .seg .segbtn { flex: 1 0 18%; }
}

/* ⑥ 手机横屏（landscape 且矮视口 ≤500px 高）—— #615 竖向空间稀缺三招：
   主容器放宽吃满宽度 / 卡片网格升四列减少滚动 / 竖向间距收紧；写在 ≥900 档之后，共享属性以本档为准 */
@media (orientation: landscape) and (max-height: 500px) {
  #app { max-width: 1000px; }
  .page { padding: 10px 16px; }
  .card { margin-bottom: 8px; padding: 10px 14px; }
  .home-stats { margin: 8px 0; gap: 8px; }
  .stat { padding: 8px 4px; }
  .sub-grid, .zone-grid, .anim-grid, .rw-grid, .id-gallery { grid-template-columns: repeat(4, 1fr); }
  .qb { min-width: 14%; }
}

/* ④ 横屏矮视口（≤450px 高）—— 顶栏与 Toast 别吃掉半屏 */
@media (max-height: 450px) {
  .topbar { padding: 8px 12px; }
  .topbar .bt { font-size: 15px; }
  .toast { bottom: 14px; }
}

/* ---------------- #619 H5 校历设置 + 学习月历（对齐微信 pages/schedule·calendar） ---------------- */
.section-title { font-size: 16px; font-weight: 700; color: #2c3e50; margin: 2px 0 10px; }
.lbl { font-size: 14px; color: #5a6675; }
.hl { color: #4A90D9; }
.link-card { text-align: center; color: #4A90D9; font-size: 14px; cursor: pointer; }
.picker { display: inline-block; padding: 7px 12px; border: 1px solid #e3e8ef; border-radius: 10px; background: #f7f9fc; font-size: 14px; color: #2c3e50; }
/* 校历设置 */
.exam-edit { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #eef1f6; }
.exam-edit:first-child { border-top: 0; }
.ee-name { flex: 1; font-size: 14px; font-weight: 600; color: #2c3e50; }
.ee-week { font-size: 13px; color: #8894a6; min-width: 52px; text-align: right; }
/* 月历 */
.exam-bar { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(120deg,#fff5ec,#fff); border: 1px solid #ffe2c4; }
.exam-left { min-width: 0; }
.exam-name { font-size: 15px; font-weight: 700; color: #e67e22; }
.exam-date { font-size: 12.5px; color: #a9794a; margin-top: 2px; }
.exam-count { text-align: center; cursor: pointer; }
.exam-days { font-size: 22px; font-weight: 800; color: #e67e22; line-height: 1.1; }
.exam-tip { font-size: 12px; color: #c08a52; }
.month-nav { width: 34px; height: 34px; line-height: 32px; text-align: center; font-size: 22px; color: #4A90D9; cursor: pointer; border-radius: 9px; }
.month-nav:active { background: #eef4fb; }
.cal-summary { display: flex; gap: 8px; margin: 10px 0 12px; }
.cs { flex: 1; text-align: center; background: #f7f9fc; border-radius: 10px; padding: 8px 4px; }
.cs-n { display: block; font-size: 20px; font-weight: 800; color: #2c3e50; }
.cs-t { display: block; font-size: 12px; color: #8894a6; margin-top: 2px; }
.grid-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.gh { text-align: center; font-size: 12px; color: #aab3c0; }
.week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cell { position: relative; aspect-ratio: 1 / 1; min-height: 38px; border-radius: 9px; background: #f7f9fc; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #2c3e50; cursor: pointer; }
.cell.empty { background: transparent; cursor: default; }
.cell.future { color: #c2c9d4; }
.cell.today { box-shadow: inset 0 0 0 2px #4A90D9; font-weight: 700; }
.cell.sup { box-shadow: inset 0 0 0 2px #ffd9a3; }
.cell.h1 { background: #eaf6ee; } .cell.h2 { background: #cdeed8; } .cell.h3 { background: #a6e0bb; } .cell.h4 { background: #7fd2a2; }
.d-num { line-height: 1; }
.d-dot { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: #4A90D9; }
.d-exam { position: absolute; top: 3px; right: 4px; font-size: 10px; font-weight: 700; color: #e67e22; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 11.5px; color: #8894a6; }
.lg { display: inline-flex; align-items: center; gap: 4px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw1 { background: #eaf6ee; } .sw2 { background: #cdeed8; } .sw3 { background: #a6e0bb; } .sw4 { background: #7fd2a2; } .sw-e { background: #ffe2c4; }
/* 单日详情 */
.sel-state { font-size: 13px; color: #2ecc71; font-weight: 600; }
.sel-line { font-size: 14px; color: #5a6675; margin: 6px 0; }
.day-subs { margin-top: 8px; }
.ds-h { font-size: 13px; color: #8894a6; }
.ds-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ds-ic { font-size: 16px; }
.ds-nm { width: 56px; font-size: 13px; color: #2c3e50; }
.ds-bar { flex: 1; height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.ds-fill { height: 100%; border-radius: 999px; }
.ds-c { width: 28px; text-align: right; font-size: 13px; font-weight: 700; color: #2c3e50; }
.day-wrong { margin-top: 10px; border-top: 1px solid #eef1f6; padding-top: 8px; }
.dw-go { font-size: 13px; color: #4A90D9; cursor: pointer; }
.dw-item { display: flex; gap: 8px; margin-top: 5px; font-size: 12.5px; }
.dw-tag { color: #e67e22; white-space: nowrap; }
.dw-stem { color: #5a6675; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-list { margin-top: 8px; }
.pt { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-top: 1px dashed #eef1f6; }
.pt-r { color: #5a6675; } .pt-d { color: #e6a23c; font-weight: 600; }
.sup-btn { margin-top: 10px; text-align: center; padding: 10px; border-radius: 10px; background: #fff5ec; color: #e67e22; font-weight: 600; cursor: pointer; }
.sup-tip { font-size: 11.5px; color: #a9794a; margin-top: 4px; text-align: center; }
/* #620 官方校历放假格（寒假/暑假/国庆/中秋/元旦，源自深圳市教育局 2026-2027 学年校历） */
.src-badge { font-size: 12px; line-height: 1.5; color: #8894a6; background: #f3f7fb; border: 1px solid #e3edf6; }
.cell.break { background: #f4f6f9; border-style: dashed; border-color: #dde3ec; cursor: default; }
.cell.break .d-num { color: #aab3c0; }
.d-break { font-size: 11px; color: #9aa6b6; margin-top: 2px; text-align: center; }
.sw-break { background: #e7ebf1; border: 1px dashed #c7cfdb; }
