/* 温馨 · 手机优先 */
:root {
  --bg: #faf6f0;
  --surface: #fffdf9;
  --text: #2b2620;
  --muted: #8a7f73;
  --line: #eee5d9;
  --accent: #d97757;          /* 杏橘 */
  --accent-dk: #c4663f;
  --accent-bg: #fbeee6;

  --absent: #a89c8e;  --absent-bg: #f2ece3;   /* 未到达 */
  --napping: #7a86e8; --napping-bg: #eef0fc;  /* 午休中 */
  --awake: #3f9d6a;   --awake-bg: #e7f4ec;    /* 已起床 */
  --danger: #d0563f;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg) radial-gradient(120% 60% at 50% -10%, #fff3e6 0%, transparent 60%) no-repeat;
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; color: inherit; }
input { font: inherit; }

.wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.date, .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.link { background: none; border: none; color: var(--muted); font-size: 14px; padding: 6px 0; }
.nav { margin-bottom: 14px; }
.back { background: none; border: none; font-size: 15px; color: var(--muted); padding: 6px 0; }
.lbl { font-size: 13px; color: var(--muted); margin: 20px 0 8px; }
.mt { margin-top: 12px; } .mt2 { margin-top: 22px; }
.row-b { display: flex; justify-content: space-between; align-items: center; }
.center-t { text-align: center; }

/* 卡片 */
.card, .list-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 2px 10px rgba(120, 80, 40, .05);
}
.card { padding: 18px; }
.card + .card { margin-top: 12px; }
.list-card { padding: 0 16px; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: none; }
.li .l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.li .t { font-weight: 500; } .li .d { color: var(--muted); font-size: 13px; }
.ico { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-dk); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.ico.dark { background: var(--accent); color: #fff; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--accent-bg); color: var(--accent-dk); font-size: 12px; font-weight: 500; }
.bigtxt { font-size: 24px; font-weight: 700; margin-top: 10px; }

/* 状态 */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.absent { color: var(--absent); background: var(--absent-bg); }
.pill.napping { color: var(--napping); background: var(--napping-bg); }
.pill.awake { color: var(--awake); background: var(--awake-bg); }
.pill.big { height: 36px; padding: 0 16px; font-size: 16px; }
.tl { display: flex; gap: 32px; justify-content: center; color: var(--muted); font-size: 14px; }
.tl b { display: block; color: var(--text); font-size: 20px; font-weight: 600; }

/* 按钮 */
.primary { width: 100%; height: 52px; border: none; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; box-shadow: 0 6px 16px rgba(217, 119, 87, .25); }
.primary:active { background: var(--accent-dk); }
.primary:disabled { opacity: .45; box-shadow: none; }
.secondary { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 600; font-size: 15px; }
.primary + .secondary, .secondary + .secondary { margin-top: 10px; }
.cta { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; border: none; border-radius: 20px; padding: 26px 22px; color: #fff;
  background: linear-gradient(135deg, #e8895f, var(--accent)); box-shadow: 0 10px 24px rgba(217, 119, 87, .3); }
.cta b { display: block; font-size: 24px; font-weight: 700; }
.cta span { opacity: .85; font-size: 13px; }
.cta i { font-style: normal; font-size: 28px; opacity: .7; }

/* 登录 / 落地 */
.center { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.mark { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(217,119,87,.3); }
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.login input { width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 18px; outline: none; margin: 24px 0 12px; }
.login .act { width: 100%; height: 52px; font-size: 16px; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 套餐 + 平面图 */
.plans { display: flex; gap: 10px; }
.plan { flex: 1; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 14px; text-align: left; }
.plan.on { border-color: var(--accent); background: #fff8f3; }
.plan .p { font-size: 22px; font-weight: 700; margin-top: 4px; }
.plan .o { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.map { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
.map-in { position: relative; width: 100%; padding-bottom: 109.2%; }
.zone { position: absolute; border-radius: 8px; }
.zone.solid { background: #f7f1e8; border: 1px solid var(--line); }
.zone.dash { background: rgba(247, 241, 232, .5); border: 1px dashed var(--line); }
.zone-t { position: absolute; font-size: 10px; color: var(--muted); white-space: nowrap; }
.lp-bl { left: 6px; bottom: 4px; } .lp-tl { left: 6px; top: 4px; } .lp-tr { right: 6px; top: 4px; }
.bedq { position: absolute; box-sizing: border-box; background: #fff; border: 1.5px solid #6b5e50; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.bedq .pl { position: absolute; background: #e9dfd2; border-radius: 2px; }
.bedq.top .pl { top: 3px; left: 18%; right: 18%; height: 6px; } .bedq.bottom .pl { bottom: 3px; left: 18%; right: 18%; height: 6px; }
.bedq.left .pl { left: 3px; top: 18%; bottom: 18%; width: 6px; } .bedq.right .pl { right: 3px; top: 18%; bottom: 18%; width: 6px; }
.bedq.part { border-color: var(--absent); background: var(--absent-bg); color: var(--muted); }
.bedq.full { border: 1.5px dashed var(--line); background: var(--bg); color: #c2b7aa; }
.bedq.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bedq.on .pl { background: rgba(255,255,255,.55); }
.legend { display: flex; justify-content: center; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid #6b5e50; background: #fff; vertical-align: -2px; margin-right: 5px; }
.legend i.part { border-color: var(--absent); background: var(--absent-bg); } .legend i.full { border: 1.5px dashed var(--line); background: var(--bg); }
.paybar { position: sticky; bottom: 0; margin: 20px -16px -24px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: rgba(250, 246, 240, .95); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }

/* 弹层 */
.sheet-mask { position: fixed; inset: 0; background: rgba(60, 40, 20, .35); display: flex; align-items: flex-end; z-index: 10; }
.sheet { width: 100%; max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.sheet .sub { margin-bottom: 18px; }
.tiers { display: flex; gap: 10px; }
.tier { flex: 1; border: 2px solid var(--line); border-radius: 18px; padding: 22px 12px; text-align: center; background: var(--surface); }
.tier b { display: block; font-size: 22px; font-weight: 700; } .tier span { font-size: 13px; color: var(--muted); }
.tier.off { opacity: .35; border-style: dashed; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); outline: none; font-size: 16px; }
.field input:focus { border-color: var(--accent); }
.share { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: 12px; padding: 10px 12px; margin: 8px 0 18px; }
.share code { flex: 1; font-size: 12px; color: var(--muted); word-break: break-all; }
.btns { display: flex; gap: 8px; }
.btn { flex: 1; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: none; }
.btn.danger { color: var(--danger); }

/* 老师看板 */
.stats { display: flex; gap: 8px; margin-bottom: 18px; }
.stat { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; } .stat span { font-size: 12px; color: var(--muted); }
.stat.absent b { color: var(--absent); } .stat.napping b { color: var(--napping); } .stat.awake b { color: var(--awake); }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 14px 16px; box-shadow: 0 2px 10px rgba(120,80,40,.04); }
.who { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 17px; } .bed { color: var(--muted); font-size: 13px; margin-top: 1px; } .time { color: var(--muted); font-size: 12px; margin-top: 4px; }
.act { height: 44px; min-width: 92px; padding: 0 16px; border: none; border-radius: 13px; font-weight: 600; font-size: 15px; color: #fff; background: var(--accent); transition: transform .1s; }
.act:active { transform: scale(.97); }
.act.napping { background: var(--napping); } .act.awake { background: var(--awake); }
.act.done { background: var(--absent-bg); color: var(--muted); font-weight: 500; }
.undo { background: none; border: none; color: var(--muted); font-size: 13px; padding: 8px 4px; }
.add { width: 100%; height: 50px; margin-top: 14px; border: 1px dashed #d9cdbd; border-radius: 16px; background: transparent; color: var(--muted); font-size: 15px; }
.form { display: flex; gap: 8px; margin-top: 14px; }
.form input { flex: 1; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); outline: none; font-size: 16px; }
.form input:focus { border-color: var(--accent); }
.form .act { min-width: 72px; }

/* 叫起时间 */
.huge { font-size: 48px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
.tag.blue { background: var(--napping-bg); color: var(--napping); }
.seg2 { display: flex; background: var(--absent-bg); border-radius: 999px; padding: 3px; margin-bottom: 22px; }
.seg2 button { flex: 1; height: 40px; border: none; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.seg2 button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(120,80,40,.12); }
.timebox { width: 200px; margin: 14px auto 0; padding: 8px 0; border-bottom: 2px solid var(--accent); }
.timebox input { width: 100%; border: none; background: transparent; outline: none; color: var(--text); font-size: 48px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.li input[type=date], .li input[type=time] { border: none; background: transparent; font-size: 16px; text-align: right; outline: none; color: var(--text); }
.link.danger { color: var(--danger); }

/* 叫起顺序表 */
.ord { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ord:last-child { border-bottom: none; }
.ord .tm { font-size: 20px; font-weight: 700; min-width: 62px; font-variant-numeric: tabular-nums; }
.ord .tm.sp { color: var(--napping); }
.ord .nm { flex: 1; min-width: 0; }
.ord .nm b { font-weight: 600; } .ord .nm span { display: block; color: var(--muted); font-size: 12px; }
.ord.done { opacity: .45; } .ord.done .nm b { text-decoration: line-through; }
.ord .act { height: 36px; min-width: 72px; padding: 0 12px; font-size: 13px; }
.sheet.tall { max-height: 88dvh; overflow-y: auto; }

/* 待确认报名（置顶通知） */
.notice { background: #fff4e8; border: 1.5px solid #f0c9ad; border-radius: 18px; padding: 14px 16px 6px; margin-bottom: 16px; }
.notice-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 16px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.pend { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f0dccb; }
.pend-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pend-btns .act { height: 40px; min-width: 76px; font-size: 14px; }

.exp-soon { color: var(--accent-dk) !important; font-weight: 600; }
.exp-over { color: var(--danger) !important; font-weight: 600; }
.sel { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; color: var(--text); }

/* 邀请好友：整页最显眼的一块 */
.invite { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: none; border-radius: 18px; padding: 16px 18px; color: #fff;
  background: linear-gradient(135deg, #ff9a62 0%, #f0704d 55%, #d95a8a 100%); box-shadow: 0 10px 26px rgba(240, 112, 77, .35); }
.invite b { display: block; font-size: 18px; font-weight: 700; }
.invite small { display: block; font-size: 13px; opacity: .9; margin-top: 2px; }
.invite > span:nth-child(2) { flex: 1; }
.invite i { font-style: normal; font-size: 26px; opacity: .8; }
.invite-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.invite-ico.big { width: 72px; height: 72px; font-size: 30px; margin: 0 auto; color: #fff; background: linear-gradient(135deg, #ff9a62, #d95a8a); box-shadow: 0 10px 26px rgba(240,112,77,.35); }

/* 邀请海报预览 */
.poster-mask { position: fixed; inset: 0; background: rgba(40, 25, 10, .6); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.poster-box { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 14px; }
.poster-box img { display: block; width: 100%; max-height: 66vh; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); }
