/* 惠米米教培 · 移动端 H5（学员端 / 员工端）— 与后台同一套设计语言 */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-soft: #EFF4FF;
  --secondary: #F97316;
  --dark: #1E293B;
  --gray: #64748B;
  --muted: #94A3B8;
  --border: #E2E8F0;
  --bg: #F1F5F9;
  --ok: #16A34A;
  --ok-soft: #ECFDF3;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--dark);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.6;
  padding-bottom: 74px;
}
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
code { background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }

.mhead { position: sticky; top: 0; z-index: 20; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.mhead-in { max-width: 640px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.mhead .logo { font-weight: 800; font-size: 16px; }
.mhead .who { font-size: 12.5px; opacity: .92; }

.mview { max-width: 640px; margin: 0 auto; padding: 14px 14px 8px; }

/* 卡片 */
.card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 4px 14px rgba(15,23,42,.06); margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.muted { color: var(--gray); font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--gray); }
.kv .v { font-weight: 600; }

/* 课时卡 */
.kid { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.kid .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kid .nm { font-size: 16px; font-weight: 700; }
.balance { display: flex; gap: 8px; }
.balance .b { flex: 1; background: var(--primary-soft); border-radius: 12px; padding: 12px 8px; text-align: center; }
.balance .b b { display: block; font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.balance .b span { font-size: 11.5px; color: var(--gray); }
.balance .b.ok { background: var(--ok-soft); }
.balance .b.ok b { color: var(--ok); }

/* 标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: #FFF7ED; color: #EA580C; }
.tag.gray { background: var(--bg); color: var(--gray); }

/* 按钮 */
.btn { display: block; width: 100%; padding: 13px; border: none; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15.5px; font-weight: 600; cursor: pointer; }
.btn:active { background: var(--primary-dark); }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.wx { background: #07C160; }
.btn.ali { background: #1677FF; }
.btn:disabled { opacity: .6; }
.btn.sm { padding: 9px 14px; font-size: 14px; width: auto; display: inline-block; }

/* 选学员：同一身份在本校区有多张档案时，点一下确定本次为谁付款 */
.kidpick {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; margin-top: 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
}
.kidpick:active { background: var(--primary-soft); border-color: var(--primary); }
.kidpick b { font-weight: 600; }
.kidpick .muted { font-size: 13px; }

/* 输入 */
input, select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 11px; font-size: 15px; background: #fff; font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--primary); }
label.fld { display: block; font-size: 13px; color: var(--gray); margin: 12px 0 6px; }
.coderow { display: flex; gap: 8px; align-items: center; }
.coderow input { flex: 1; min-width: 0; }
.coderow .btn.sm { white-space: nowrap; }

/* 列表 */
.list { margin: 0; padding: 0; }
.li { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.li:last-child { border-bottom: none; }
.li .l { min-width: 0; }
.li .l b { display: block; font-weight: 600; }
.li .l span { font-size: 12.5px; color: var(--gray); }
.empty { text-align: center; color: var(--gray); padding: 30px 10px; font-size: 14px; }

/* 底部标签栏 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; text-align: center; padding: 8px 0 9px; color: var(--gray); font-size: 11.5px; }
.tabbar a .ico { display: block; font-size: 19px; line-height: 1.3; }
.tabbar a.on { color: var(--primary); font-weight: 600; }

/* 提示 */
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(8px); background: rgba(30,41,59,.95); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 99; max-width: 84%; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.note { border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.65; margin-bottom: 12px; }
.note.info { background: var(--primary-soft); color: var(--primary-dark); }
.note.good { background: var(--ok-soft); color: #15803D; }
.note.warn { background: #FFF7ED; color: #C2410C; }

/* 点名 */
.roll { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.roll .nm { flex: 1; font-size: 14.5px; }
.roll select { width: 96px; padding: 8px; font-size: 13.5px; }
.roll input { width: 58px; padding: 8px; font-size: 13.5px; text-align: center; }

.suc { text-align: center; padding: 22px 10px; }
.suc .ico { font-size: 46px; }
.suc h2 { margin: 8px 0 4px; font-size: 18px; }

/* ============================================================
   v20261119.90：学员端拆分 + 销售台 + 教师快速点名
   ============================================================ */

/* 小文字链接（删除/全部到课/临时加人这类轻动作） */
.linkbtn {
  background: none; border: none; padding: 0; margin-left: 10px;
  color: var(--primary); font-size: 13px; font-family: inherit; cursor: pointer;
}
.linkbtn.danger { color: var(--danger); }

/* 「员工入口 / 返回学员端」这类页脚入口 */
.footlink { text-align: center; padding: 18px 0 6px; }
.footlink a { color: var(--gray); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 订单卡（与学员卡是两种东西） ---------- */
.ord {
  background: #fff; border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(15,23,42,.06); margin-bottom: 10px;
}
.ord-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ord-name { font-size: 15px; font-weight: 700; }
.ord-bot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.ord-amt { font-size: 19px; font-weight: 800; color: var(--dark); }
.ord-no { margin-top: 6px; font-size: 12px; color: var(--muted); }
.ord-no code { font-size: 11.5px; }
.ord .btn.sm { margin-top: 10px; }

/* ---------- 教师台：课次卡片 ---------- */
.teach {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: var(--radius); padding: 14px;
  box-shadow: 0 4px 14px rgba(15,23,42,.06); margin-bottom: 10px;
}
.teach-time { width: 54px; text-align: center; flex: none; }
.teach-time b { display: block; font-size: 17px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.teach-time span { font-size: 11.5px; color: var(--muted); }
.teach-main { flex: 1; min-width: 0; }
.teach-cls { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.teach-act { flex: none; text-align: right; }
.teach-act .btn.sm { width: auto; }
.teach-act .linkbtn { display: block; margin: 8px 0 0; font-size: 12px; text-align: right; }

.daygrp { margin-bottom: 4px; }
.daygrp-h { font-size: 13px; font-weight: 700; color: var(--gray); margin: 14px 2px 8px; }

/* ---------- 点名页 ---------- */
.rollbar { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; }
.rollbar .linkbtn { margin-left: 0; }
.roll { display: flex; align-items: center; gap: 10px; }

/* ---------- 销售台 ---------- */
.chips { display: flex; gap: 8px; margin-top: 8px; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; color: var(--gray); font-size: 13px; font-family: inherit; cursor: pointer;
}
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.pickbox { margin-top: 8px; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.pick:last-child { border-bottom: none; }
.pick:active { background: var(--primary-soft); }

.qrbox { text-align: center; padding: 14px 0 6px; }
.qrbox img { width: 168px; height: 168px; image-rendering: pixelated; }
.linkbox {
  background: var(--bg); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; color: var(--gray); word-break: break-all;
  margin: 4px 0 12px; line-height: 1.5;
}

/* 临时加人 / 勾选列表 */
.chk { display: flex; align-items: center; gap: 8px; padding: 11px 2px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.chk:last-child { border-bottom: none; }
.chk input { width: 17px; height: 17px; margin: 0; flex: none; }

/* ============================================================
   合同（v20261119.93）：学员卡片入口 + 合同查看页
   ============================================================ */
.kidakts { display: flex; gap: 8px; margin-top: 10px; }
.kidakts .btn.sm { flex: 0 0 auto; }

.ctrv {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06); margin-bottom: 12px;
}
/* iframe 承载整页排版：合同正文的样式与 H5 完全隔离，长文自带滚动 */
.ctrv iframe { width: 100%; height: calc(100vh - 214px); min-height: 380px; border: 0; display: block; background: #fff; }
.ctrbar { display: flex; gap: 10px; }
.ctrbar .btn { flex: 1; }

/* 手写签名（v20261121.181）：签名框刻意用虚线 + 白底，和表单输入区分开，
   让用户一眼知道「这里要画，不是打字」 */
.sigfield { margin: 10px 0 8px; }
.sigfield input {
  width: 100%; box-sizing: border-box; padding: 11px 13px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink);
}
.sigpad {
  display: block; width: 100%; height: 190px; box-sizing: border-box;
  border: 1px dashed #c3d0e4; border-radius: 12px; background: #fff;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.sigbar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.sigbar .muted { font-size: 12.5px; }
