/* AI双胞胎作业监督大屏：暖色、适合孩子；白天 / 夜间两套配色；大屏 1920×1080 等比缩放，手机单列 */
:root {
  --ink: #3A342E; --ink-2: #5E564E; --ink-3: #8A8178;
  --gold: #E0A04A; --gold-2: #F3C97A;
  --peach: #FF8B6A; --peach-d: #E56A4C; --peach-bg: #FFF0EA;
  --mint: #2FB6A8; --mint-d: #1E958A; --mint-bg: #E6F7F4;
  --ok: #2EBE7A; --ok-bg: #E6F8EE; --warn: #FF9F43; --warn-bg: #FFF1E0;
  --tilt: #E8B830; --tilt-bg: #FFF6D9; --away: #FF6B6B; --away-bg: #FFECEC; --stand: #A98BEA; --stand-bg: #F2ECFF;
  --wait: #B8B0A6;
  --panel: rgba(255,255,255,0.82); --panel-b: rgba(224,160,74,0.30); --line: rgba(120,100,80,0.12);
  --bg: radial-gradient(900px 500px at 8% -10%, rgba(255,214,153,.55), transparent 60%),
        radial-gradient(800px 480px at 96% 0%, rgba(168,220,255,.5), transparent 62%),
        radial-gradient(700px 420px at 80% 110%, rgba(170,235,210,.45), transparent 60%),
        linear-gradient(180deg, #FFF6E8 0%, #EAF4FF 48%, #F0FFF7 100%);
  --shadow: 0 8px 24px rgba(196,140,70,.12);
  --fs: 18px;
}
body.theme-night {
  --ink: #F4EBE0; --ink-2: #D5C6B6; --ink-3: #B2A090;
  --panel: rgba(52,40,32,0.90); --panel-b: rgba(232,176,110,0.38); --line: rgba(232,176,110,0.16);
  --peach-bg: rgba(255,139,106,.13); --mint-bg: rgba(47,182,168,.13); --ok-bg: #1C3D2C;
  --warn-bg: #4A3218; --tilt-bg: rgba(232,184,48,.16); --away-bg: #4A2424; --stand-bg: rgba(169,139,234,.16);
  --bg: radial-gradient(800px 460px at 12% -8%, rgba(180,110,50,.28), transparent 60%),
        radial-gradient(700px 420px at 95% 0%, rgba(120,70,30,.3), transparent 62%),
        radial-gradient(600px 380px at 80% 110%, rgba(80,50,20,.35), transparent 60%),
        linear-gradient(180deg, #2C241C 0%, #241C16 50%, #1E1814 100%);
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); background-attachment: fixed; color: var(--ink); font-size: var(--fs);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .6s; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- 大屏：1920×1080 设计稿，整体等比缩放 ---------- */
body.big { overflow: hidden; }
body.big .stage { position: fixed; inset: 0; overflow: hidden; }
body.big .page { width: 1920px; height: 1080px; transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.page { padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 10px; }

.header { height: 76px; flex: none; display: grid; grid-template-columns: 540px 1fr 540px; align-items: center;
  padding: 0 18px; background: var(--panel); border: 1.5px solid var(--panel-b); border-radius: 18px; box-shadow: var(--shadow); }
.h-left, .h-right { display: flex; align-items: center; gap: 10px; }
.h-right { justify-content: flex-end; }
.h-center { text-align: center; }
.date-block { line-height: 1.15; margin-right: 6px; }
.date-block .d { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.date-block .t { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.title-ornament { display: flex; align-items: center; justify-content: center; gap: 10px; }
.main-title { font-size: 34px; letter-spacing: 3px; font-weight: 900;
  background: linear-gradient(90deg, var(--peach-d), var(--gold), var(--mint-d)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.star { color: var(--gold); font-size: 22px; }
.wing { width: 90px; height: 10px; border-radius: 6px; background: linear-gradient(90deg, transparent, var(--gold-2), var(--peach)); }
.wing.r { background: linear-gradient(90deg, var(--mint), var(--gold-2), transparent); }
.sub-title { font-size: 15px; color: var(--ink-3); margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--panel-b); font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.chip b { color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wait); display: inline-block; }
.chip.on .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(46,190,122,.22); }
.chip.off .dot { background: var(--away); box-shadow: 0 0 0 4px rgba(255,107,107,.22); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--panel-b); background: var(--panel);
  cursor: pointer; font-size: 19px; }
.icon-btn:hover { filter: brightness(1.05); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; color: var(--ink-2); margin-right: 4px; }
.switch input { display: none; }
.slider { width: 46px; height: 26px; border-radius: 13px; background: var(--wait); position: relative; transition: .25s; }
.slider::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .25s; }
.switch input:checked + .slider { background: var(--mint); }
.switch input:checked + .slider::after { left: 23px; }

/* 异常提醒条 */
.alert-bar { flex: none; display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 14px; font-size: 20px; font-weight: 700;
  animation: pulse 2s infinite; }
.alert.danger { background: #FF6B6B; color: #fff; }
.alert.warn { background: #FF9F43; color: #fff; }
.alert.info { background: var(--mint); color: #fff; animation: none; }
.alert .a-ico { font-size: 24px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,107,.45); } 50% { box-shadow: 0 0 0 8px rgba(255,107,107,0); } }

.grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 450px 1fr 460px; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.panel { background: var(--panel); border: 1.5px solid var(--panel-b); border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px 16px; min-height: 0; backdrop-filter: blur(6px); }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.p-head h2 { font-size: 21px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.p-head h2::before { content: ""; width: 6px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, var(--gold-2), var(--peach)); }
.p-note { font-size: 14px; color: var(--ink-3); }
.badge { font-size: 13px; padding: 2px 8px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.badge.calib { background: var(--tilt-bg); color: #B98A10; border: 1px dashed #E8B830; }
body.theme-night .badge.calib { color: #F3C97A; }
.kid-jie { --kid: var(--peach); --kid-d: var(--peach-d); --kid-bg: var(--peach-bg); }
.kid-mei { --kid: var(--mint); --kid-d: var(--mint-d); --kid-bg: var(--mint-bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--kid); color: #fff; font-weight: 800; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px; flex: none; }

/* 左：今日表现 */
.today-card .t-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 20px; font-weight: 800; }
.today-card .t-head .p-note { margin-left: auto; }
.t-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.t-box { background: var(--kid-bg); border-radius: 14px; padding: 10px 12px; }
.t-box .lbl { font-size: 15px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.t-box .val { font-size: 36px; font-weight: 900; color: var(--kid-d); font-variant-numeric: tabular-nums; line-height: 1.2; }
.t-box .val small { font-size: 17px; font-weight: 700; margin: 0 2px; }
.t-box .cmp { font-size: 14px; color: var(--ink-3); }
.cmp .up { color: var(--ok); font-weight: 700; } .cmp .down { color: var(--away); font-weight: 700; }
.t-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cnt { border-radius: 12px; padding: 6px 4px; text-align: center; }
.cnt .n { font-size: 28px; font-weight: 900; line-height: 1.15; }
.cnt .l { font-size: 14px; color: var(--ink-2); }
.cnt.head_low { background: var(--away-bg); } .cnt.head_low .n { color: var(--away); }
.cnt.tilt { background: var(--tilt-bg); } .cnt.tilt .n { color: #D19E12; }
.cnt.away { background: var(--warn-bg); } .cnt.away .n { color: var(--warn); }
.cnt.voice { background: rgba(120,160,255,.13); } .cnt.voice .n { color: #5B7FE0; }
.dist-panel { flex: 1; display: flex; flex-direction: column; }
.dist-row { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 200px; }
.donut { min-height: 200px; }

/* 中：实时状态 */
.live-panel { flex: 1.25; display: flex; flex-direction: column; }
.live-row { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; }
.live-card { border-radius: 16px; border: 2px solid var(--kid); background: var(--kid-bg); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 21px; font-weight: 800; }
.lc-head .cam { margin-left: auto; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.pill { font-size: 17px; font-weight: 800; padding: 3px 12px; border-radius: 20px; color: #fff; background: var(--wait); white-space: nowrap; }
.pill.l0 { background: var(--ok); } .pill.l1 { background: var(--warn); } .pill.l2 { background: var(--away); }
.lc-view { flex: 1; position: relative; min-height: 220px; margin: 0 12px; border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; }
body.theme-night .lc-view { background: rgba(0,0,0,.25); }
.lc-view img, .lc-view canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.lc-view .ph { color: var(--ink-3); font-size: 16px; text-align: center; padding: 10px; line-height: 1.6; }
.concl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px; }
.concl svg { width: 110px; height: 110px; }
.concl .big { font-size: 34px; font-weight: 900; }
.concl .ai { font-size: 18px; color: var(--ink-2); max-width: 92%; }
.lc-foot { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px 12px; }
.lc-facts { font-size: 16px; color: var(--ink-2); line-height: 1.7; }
.lc-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ring { width: 96px; text-align: center; font-size: 13px; color: var(--ink-3); }
.ring svg { width: 88px; height: 88px; display: block; margin: 0 auto; }
.ring .rt { font-size: 18px; font-weight: 900; fill: var(--ink); }
.ring .rs { font-size: 11px; fill: var(--ink-3); }

/* 时间轴 */
.timeline-panel { flex: none; }
.timeline { position: relative; padding: 4px 0 26px 92px; }
.tl-row { position: relative; height: 34px; margin: 6px 0; }
.tl-name { position: absolute; left: -92px; top: 4px; width: 86px; font-size: 17px; font-weight: 800; display: flex; gap: 6px; align-items: center; }
.tl-name .avatar { width: 26px; height: 26px; font-size: 13px; }
.tl-track { position: absolute; inset: 0; border-radius: 10px; background: var(--line); overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; }
.tl-axis { position: absolute; left: 92px; right: 0; bottom: 0; height: 22px; font-size: 13px; color: var(--ink-3); }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.tl-now { position: absolute; top: -2px; bottom: 20px; width: 2px; background: var(--peach-d); z-index: 2; }
.tl-now::after { content: "现在"; position: absolute; top: -18px; left: -14px; font-size: 12px; color: var(--peach-d); font-weight: 700; }
.legend { display: flex; gap: 16px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; }
.c-normal { background: var(--ok); } .c-tilt { background: var(--tilt); } .c-head_low { background: var(--away); }
.c-stand { background: var(--stand); } .c-away { background: #C9C1B8; }
body.theme-night .c-away { background: #5A5650; }

/* 小结 */
.summary-panel { flex: none; }
.summary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary { background: var(--kid-bg); border-radius: 14px; padding: 12px 14px; font-size: 18px; line-height: 1.65; }
.summary .s-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 4px; }

/* 右：星星 */
.star-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--kid-bg); margin-bottom: 8px; }
.star-row .who { font-weight: 800; font-size: 18px; }
.star-row .stars-n { font-size: 34px; font-weight: 900; color: var(--gold); line-height: 1; }
.star-row .stars-n small { font-size: 15px; color: var(--ink-3); font-weight: 600; }
.star-row .vs { font-size: 15px; color: var(--ink-2); text-align: right; line-height: 1.5; }
.pk { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; padding: 6px 0 2px; }
.pk .pk-badge { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.pk .n { font-size: 40px; font-weight: 900; color: var(--gold); }
.reward { margin-bottom: 6px; }
.reward .r-top { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.reward .r-top .cost { margin-left: auto; color: var(--gold); font-weight: 800; }
.bar-line { display: grid; grid-template-columns: 44px 1fr 60px 56px; gap: 8px; align-items: center; font-size: 14px; margin: 3px 0; }
.bar { height: 12px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--kid); border-radius: 8px; }
.mini-btn { font-size: 13px; padding: 2px 6px; border-radius: 8px; border: 1px solid var(--kid); background: transparent; color: var(--kid-d); cursor: pointer; }
.mini-btn:disabled { opacity: .35; cursor: default; }
.trend-panel { flex: none; }
.trend { height: 175px; }
.rewards-panel { flex: none; max-height: 290px; overflow: auto; }
body.mobile .rewards-panel { max-height: none; }
.col { overflow: hidden; }
body.mobile .col { overflow: visible; }
.events-panel { flex: 1; display: flex; flex-direction: column; }
.events { list-style: none; overflow: auto; flex: 1; min-height: 80px; }
.events li { display: grid; grid-template-columns: 56px auto 1fr; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 16px; }
.events .tm { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 15px; }
.events .who { font-size: 13px; padding: 1px 7px; border-radius: 8px; color: #fff; background: var(--kid, #9a9184); }
.events li.alert-ev { color: var(--away); font-weight: 700; }
.empty { color: var(--ink-3); font-size: 15px; padding: 8px 0; }

/* 设置弹窗 */
.modal { position: fixed; inset: 0; background: rgba(30,25,20,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.modal-box { width: min(760px, 100%); max-height: 92vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 20px; border: 1.5px solid var(--panel-b); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
body.theme-night .modal-box { background: #3A2E26; }
body.theme-day .modal-box { background: #FFFDF8; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 6px; }
.modal-head h2 { font-size: 22px; }
.modal-head .icon-btn { margin-left: auto; }
.tabs { display: flex; gap: 6px; padding: 6px 20px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--panel-b); background: transparent; border-radius: 10px; padding: 6px 12px; cursor: pointer; font-size: 16px; }
.tabs button.on { background: var(--gold); color: #fff; border-color: var(--gold); }
.set-form { overflow: auto; padding: 8px 20px 0; display: flex; flex-direction: column; min-height: 0; }
.tab-body { display: none; } .tab-body.on { display: block; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 17px; }
.row input[type=number], .row input[type=time], .row select, .row input[type=text] { width: 180px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--panel-b); background: transparent; }
.row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--mint); }
.ph-row { padding: 6px 0; }
.ph-row span { font-size: 15px; color: var(--ink-2); display: block; margin-bottom: 3px; }
.ph-row input { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--panel-b); background: transparent; }
.rw-row { display: grid; grid-template-columns: 60px 1fr 100px 40px; gap: 8px; padding: 6px 0; }
.rw-row input { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--panel-b); background: transparent; min-width: 0; }
.hint { font-size: 15px; color: var(--ink-3); margin: 6px 0; }
.modal-foot { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 0 16px; background: inherit; }
.modal-foot .err { margin-right: auto; }
.btn { border: none; background: var(--gold); color: #fff; border-radius: 10px; padding: 8px 20px; font-size: 17px; font-weight: 700; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--panel-b); }
.err { color: var(--away); font-size: 15px; }
.ledger { list-style: none; margin-top: 10px; font-size: 14px; color: var(--ink-2); max-height: 200px; overflow: auto; }
.ledger li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: rgba(40,35,30,.9); color: #fff; padding: 10px 22px; border-radius: 12px; z-index: 60; font-size: 17px; }

/* 登录 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1.5px solid var(--panel-b); border-radius: 22px; padding: 32px 28px; text-align: center; box-shadow: var(--shadow); }
.login-logo { font-size: 46px; }
.login-card h1 { font-size: 24px; margin: 6px 0; }
.login-card .sub { color: var(--ink-3); margin-bottom: 18px; font-size: 15px; }
.login-card input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--panel-b); margin-bottom: 12px; font-size: 18px; background: #fff; }
.login-card button { width: 100%; padding: 12px; border: none; border-radius: 12px; background: linear-gradient(90deg, var(--peach), var(--gold)); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
.login-card .err { margin-top: 10px; min-height: 20px; }

/* ---------- 手机 / 窄屏：单列 ---------- */
body.mobile { --fs: 16px; }
body.mobile .page { padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); }
body.mobile .header { height: auto; grid-template-columns: 1fr auto; grid-template-areas: "c c" "l r"; gap: 8px; padding: 10px 12px; }
body.mobile .h-center { grid-area: c; }
body.mobile .h-left { grid-area: l; flex-wrap: wrap; }
body.mobile .h-right { grid-area: r; gap: 6px; }
body.mobile .main-title { font-size: 22px; letter-spacing: 1px; }
body.mobile .wing, body.mobile .hide-m { display: none; }
body.mobile .date-block .t { font-size: 18px; }
body.mobile .date-block .d { font-size: 13px; }
body.mobile .icon-btn { width: 36px; height: 36px; font-size: 17px; }
body.mobile .chip { height: 30px; font-size: 13px; }
body.mobile .grid { display: flex; flex-direction: column; }
body.mobile .col { display: contents; }
body.mobile .live-panel { order: 1; } body.mobile .stars-panel { order: 2; }
body.mobile .today-card { order: 3; } body.mobile .summary-panel { order: 4; }
body.mobile .timeline-panel { order: 5; } body.mobile .rewards-panel { order: 6; }
body.mobile .dist-panel { order: 7; } body.mobile .trend-panel { order: 8; } body.mobile .events-panel { order: 9; }
body.mobile .live-row, body.mobile .summary-row { grid-template-columns: 1fr; }
body.mobile .lc-view { min-height: 170px; }
body.mobile .concl svg { width: 76px; height: 76px; }
body.mobile .concl .big { font-size: 26px; }
body.mobile .t-box .val { font-size: 30px; }
body.mobile .alert { font-size: 16px; padding: 9px 12px; }
body.mobile .events { max-height: 360px; }
body.mobile .timeline { padding-left: 70px; }
body.mobile .tl-name { left: -70px; width: 66px; font-size: 14px; }
body.mobile .tl-axis { left: 70px; }
body.mobile .tl-name .avatar { display: none; }
body.mobile .p-head h2 { font-size: 18px; }

/* ---------- v3 布局 ---------- */
.chip-btn { cursor: pointer; font-weight: 700; color: var(--ink); }
.today-panel { flex: 1; display: flex; flex-direction: column; }
.today-kid { flex: 1; display: grid; grid-template-columns: 1fr 160px; grid-template-rows: auto 1fr; gap: 8px 10px; padding: 8px 0 10px; }
.today-kid + .today-kid { border-top: 1px dashed var(--line); padding-top: 12px; }
.today-kid .k-head { grid-column: 1 / 3; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.st-chip { font-size: 14px; padding: 2px 10px; border-radius: 12px; font-weight: 700; background: var(--line); color: var(--ink-2); }
.st-chip.l0 { background: var(--ok-bg); color: var(--ok); } .st-chip.l1 { background: var(--warn-bg); color: var(--warn); } .st-chip.l2 { background: var(--away-bg); color: var(--away); }
.today-kid .t-big { margin-bottom: 8px; }
.k-donut { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.k-donut .donut { width: 150px; height: 150px; min-height: 0; }
.k-donut .dl { font-size: 13px; color: var(--ink-3); text-align: center; line-height: 1.5; }
.rest-panel { flex: none; }
.rest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rest-card { background: var(--kid-bg); border-radius: 14px; padding: 10px; text-align: center; }
.rest-card .rc-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.rest-card .ring { width: auto; }
.rest-card .ring svg { width: 116px; height: 116px; }
.rest-card .rc-txt { font-size: 15px; color: var(--ink-2); line-height: 1.5; margin-top: 4px; }
.rest-card .rc-txt b { color: var(--kid-d); }
.live-bar { display: flex; justify-content: space-between; align-items: center; margin: -2px 0 10px; }
.mode-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; background: var(--mint-bg); color: var(--mint-d); font-weight: 700; margin-left: 4px; }
.lc-view .cam-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(40,30,20,.72); color: #fff; font-size: 13px; padding: 3px 8px; border-radius: 8px; }
.lc-view .live-tag { position: absolute; right: 8px; bottom: 8px; background: #FF5A5A; color: #fff; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 8px; }
.lc-foot { grid-template-columns: 1fr; }
.switch.small { font-size: 14px; }
.switch.small .slider { width: 40px; height: 22px; }
.switch.small .slider::after { width: 16px; height: 16px; }
.switch.small input:checked + .slider::after { left: 21px; }
.badge.okb { background: var(--ok-bg); color: var(--ok); }
.star-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.star-cards.pk { grid-template-columns: 1fr auto 1fr; align-items: center; }
.star-card { background: var(--kid-bg); border: 1.5px solid var(--kid); border-radius: 14px; text-align: center; padding: 10px 6px; }
.star-card .who { font-weight: 800; font-size: 16px; }
.star-card .n { font-size: 40px; font-weight: 900; color: var(--kid-d); line-height: 1.1; }
.star-card .n small { font-size: 16px; }
.star-card .vs { font-size: 15px; font-weight: 700; }
.star-card .vs.up { color: var(--ok); } .star-card .vs.down { color: var(--warn); }
.star-card .say { font-size: 13px; color: var(--ink-3); }
.star-card .bal { font-size: 13px; color: var(--ink-3); }
.pk-badge { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.pk-note { text-align: center; font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.rewards { margin-top: 10px; border-radius: 14px; border: 1px solid var(--panel-b); padding: 8px 12px; }
.rewards .rw-title { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.rw-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; font-size: 15px; padding: 3px 0; }
.rw-line .ok { color: var(--ok); font-weight: 700; }
.rw-btns { display: flex; gap: 4px; }
.prog { display: grid; grid-template-columns: 40px 1fr 64px; gap: 8px; align-items: center; font-size: 14px; margin-top: 4px; }
.prog b { color: var(--kid-d); text-align: right; }
.events-panel { min-height: 0; }
.trend { height: 190px; }
/* 设置：分节 */
.modal-box { width: min(820px, 100%); }
.set-form { gap: 10px; padding-bottom: 0; }
.sec { border: 1px solid var(--panel-b); border-radius: 14px; padding: 6px 14px 8px; }
.sec legend { font-weight: 800; font-size: 17px; padding: 0 6px; }
.row em { display: block; font-style: normal; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.row > span:first-child { flex: 1; }
.unit { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.unit input[type=number] { width: 110px !important; text-align: center; }
.unit input[type=time] { width: 120px !important; }
.seg { display: inline-flex; border: 1px solid var(--panel-b); border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: transparent; padding: 6px 14px; cursor: pointer; }
.seg button.on { background: var(--gold-2); color: #5a3a10; font-weight: 800; }
details summary { cursor: pointer; padding: 8px 0; font-size: 16px; color: var(--ink-2); }
body.mobile .today-kid { grid-template-columns: 1fr 120px; }
body.mobile .k-donut .donut { width: 120px; height: 120px; }
body.mobile .today-panel { order: 3; } body.mobile .rest-panel { order: 4; }
body.mobile .live-bar { flex-wrap: wrap; gap: 6px; }
body.mobile .sw-label { display: inline; }
body.mobile .h-right .sw-label { display: none; }
body.mobile .row { flex-wrap: wrap; }

/* v2.1 新动作 */
.t-counts2 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 6px; }
.cnt2 { border-radius: 10px; padding: 3px 2px; text-align: center; font-size: 13px; color: var(--ink-2); white-space: nowrap;
  background: color-mix(in srgb, var(--c) 13%, transparent); }
.cnt2 b { display: block; font-size: 19px; font-weight: 900; line-height: 1.15; color: var(--c); }
.cnt .l { white-space: nowrap; }
.c-chin_rest { background: #F59F5B; } .c-too_close { background: #E8590C; } .c-lean_back { background: #4DABF7; }
.c-still { background: #94A3B8; } .c-look_around { background: #20C5C5; }
.bh-note { font-size: 13px; color: var(--ink-3); margin: 2px 0 8px; }
.bh-table { display: grid; gap: 2px; }
.bh-row { display: grid; grid-template-columns: 1fr 52px 52px 150px; align-items: center; gap: 6px; padding: 5px 4px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.bh-row em { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); }
.bh-row > span:nth-child(2), .bh-row > span:nth-child(3) { text-align: center; }
.bh-head { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.bh-row input[type=number] { width: 64px; }
.bh-row .na { color: var(--ink-3); font-style: normal; }
body.mobile .bh-row { grid-template-columns: 1fr 40px 40px 110px; font-size: 14px; }

/* 今日表现：加了第二排计数后压缩一下高度 */
.today-kid { grid-template-columns: 1fr 138px; padding: 4px 0 6px; gap: 6px 10px; }
.today-kid + .today-kid { padding-top: 8px; }
.today-kid .t-big { margin-bottom: 6px; gap: 8px; }
.today-kid .t-box { padding: 6px 10px; }
.today-kid .t-box .val { font-size: 32px; white-space: nowrap; line-height: 1.15; }
.today-kid .cnt { padding: 3px 4px; }
.today-kid .cnt .n { font-size: 24px; }
.today-kid .cnt .l { font-size: 13px; }
.k-donut .donut { width: 132px; height: 132px; }
.k-donut .dl { font-size: 12px; line-height: 1.4; }
/* 手机：实时卡片标题换行，名字不再被挤成竖排；长页面背景铺满 */
body.mobile .lc-head { flex-wrap: wrap; row-gap: 4px; font-size: 19px; }
body.mobile .lc-head .cam { flex-basis: 100%; margin-left: 0; order: 9; }
body.mobile { height: auto; min-height: 100vh; background-attachment: scroll; }
html:has(body.mobile) { height: auto; }
