/*
 * 可操作原型：殼層、首頁、裝置外框、模擬推播、小組平板
 * tokens.css／components.css／dark.css 由 ui-design/html-prototype/assets 複製，不在那裡修改；
 * 新的 token 與元件寫在這個檔案
 */

/* ── 新增狀態色（v1.1）：base（圖示、邊框）／ink（淺底上的文字）／tint（淺底） ── */
:root {
  --st-late:           #0D9488;  /* 晚到（teal） */
  --st-late-ink:       #0F766E;
  --st-late-tint:      #F0FDFA;
  --st-arrived:        #0284C7;  /* 已到班（sky） */
  --st-arrived-ink:    #0369A1;
  --st-arrived-tint:   #F0F9FF;
  --st-check:          #D97706;  /* 待檢核（amber） */
  --st-check-ink:      #B45309;
  --st-check-tint:     #FFFBEB;
  --hw-submitted:      #334155;  /* 待批改（作業狀態） */
  --hw-submitted-ink:  #334155;
  --hw-submitted-tint: #FFFFFF;

  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --pbar-h: 46px;
}

.badge--st-late      { color: var(--st-late-ink);     background: var(--st-late-tint);     border-color: #99F6E4; }
.badge--st-arrived   { color: var(--st-arrived-ink);  background: var(--st-arrived-tint);  border-color: #BAE6FD; }
.badge--st-check     { color: var(--st-check-ink);    background: var(--st-check-tint);    border-color: #FDE68A; }
.badge--st-noclass   { color: var(--n-500); background: var(--n-100); border-color: var(--n-200); border-style: dashed; }
.badge--hw-submitted { color: var(--hw-submitted-ink); background: var(--hw-submitted-tint); border-color: var(--n-400); }

/* 狀態色變數，給卡片左側色條使用 */
.st-not-arrived { --c: var(--st-not-arrived); }
.st-late        { --c: var(--st-late); }
.st-absent      { --c: var(--st-absent); }
.st-arrived     { --c: var(--st-arrived); }
.st-in-progress { --c: var(--st-in-progress); }
.st-check       { --c: var(--st-check); }
.st-stay        { --c: var(--st-stay); }
.st-done        { --c: var(--st-done); }
.st-left        { --c: var(--st-left); }
.st-noclass     { --c: var(--n-300); }

/* 原生表單元件套用 components.css 的外觀 */
input.input, select.select { width: 100%; outline: none; }
input.input:focus, select.select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
input.input::placeholder { color: var(--text-disabled); }
select.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
select.select:disabled, input.input:disabled { background-color: var(--bg-subtle); color: var(--text-3); cursor: not-allowed; }
.segmented > button { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 6px; border: 0; background: transparent; font-size: var(--fs-body-sm); color: var(--text-2); font-weight: var(--fw-medium); cursor: pointer; }
.segmented > button.is-on { background: #fff; color: var(--text); box-shadow: var(--shadow-1); }
button.btn:disabled { background: var(--n-100); color: var(--text-disabled); border-color: var(--n-200); cursor: not-allowed; }
.ic.warn { color: var(--warn); }

/* ════════════════════════════════════════════
   頁面骨架
   ════════════════════════════════════════════ */
html, body { height: 100%; }
body { background: var(--n-100); overflow: hidden; }
#app { height: 100%; display: flex; flex-direction: column; }

/* 原型外框：淺色、細，和系統本身的深藍側欄區分 */
.pbar {
  height: var(--pbar-h); flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 0 16px; background: #fff; color: var(--n-600); border-bottom: 1px solid var(--n-200); z-index: 60;
  font-family: var(--font-sans); letter-spacing: .02em;
}
.pbar button { font: inherit; letter-spacing: inherit; cursor: pointer; }
.pbar-brand { justify-self: start; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; color: var(--n-800); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pbar-brand .logo { width: 22px; height: 22px; border-radius: 6px; background: var(--n-900); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
/* 角色切換：置中的分段按鈕 */
.rpills { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--n-100); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.rpill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 6px; border: 0; background: transparent; color: var(--n-500); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s, color .12s; }
.rpill .ic { font-size: 14px; }
.rpill:hover:not(:disabled):not(.is-on) { color: var(--n-900); }
.rpill.is-on { background: #fff; color: var(--n-900); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px var(--n-200); }
.rpill:disabled { color: var(--n-300); cursor: default; }

.stage { flex: 1; min-height: 0; overflow: auto; position: relative; }

/* ════════════════════════════════════════════
   首頁：選擇角色
   ════════════════════════════════════════════ */
.stage--home { background: var(--bg-app); }
.landing { max-width: 1040px; margin: 0 auto; padding: 48px 24px 40px; }
.ld-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 36px; }
.ld-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--n-900); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.ld-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.ld-lead { margin: 0; font-size: 17px; color: var(--text-2); }
.ld-meta { margin: 10px 0 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; }
.ld-sec { margin-bottom: 24px; }
.ld-sec h2 { font-size: 13px; color: var(--text-3); font-weight: 600; letter-spacing: .06em; margin: 0 0 10px 4px; }
.ld-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rolecard {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 16px 16px 18px; cursor: pointer; font: inherit; color: var(--text); min-height: 104px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.rolecard:hover:not(:disabled) { border-color: var(--n-400); box-shadow: var(--shadow-2); }
.rolecard:active:not(:disabled) { transform: scale(.99); }
.rolecard.is-off { cursor: default; opacity: .55; }
.rc-ic { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--n-900); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.rolecard.is-off .rc-ic { background: var(--n-400); }
.rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-nm { font-size: 18px; font-weight: 700; }
.rc-nm small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 8px; }
.rc-ds { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.rc-dev { font-size: 12px; color: var(--text-3); }
.rc-go { color: var(--text-3); font-size: 22px; flex: none; }
.rc-soon { font-size: 12px; background: var(--n-100); border-radius: 999px; padding: 3px 10px; color: var(--text-3); }
.ld-foot { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 28px; }

/* ════════════════════════════════════════════
   裝置外框（平板、手機、大螢幕）
   ════════════════════════════════════════════ */
.stage--tablet { display: flex; flex-direction: column; overflow: hidden; background: #E2E8F0; }
.dev-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.dev-bar > .ic { font-size: 16px; color: var(--text-3); }
.dev-bar .dv-lbl { font-weight: 600; color: var(--text); margin-right: 10px; }
.dv-tab { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.dv-tab.is-on { background: var(--n-900); color: #fff; border-color: var(--n-900); font-weight: 600; }
.dev-fit { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dev-box { position: relative; flex: none; }
.dev-frame {
  position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden;
  background: var(--bg-app); border-radius: 18px;
  box-shadow: 0 0 0 10px #111827, 0 0 0 11px #374151, 0 24px 60px rgba(15,23,42,.35);
}

/* ════════════════════════════════════════════
   模擬推播（家長手機的 LINE 通知）
   ════════════════════════════════════════════ */
#pushWrap { position: fixed; top: calc(var(--pbar-h) + 12px); right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: 340px; pointer-events: none; }
.push {
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 32px rgba(15,23,42,.22);
  padding: 10px 14px 10px; transform: translateY(-10px); opacity: 0; transition: all .35s ease; pointer-events: auto;
}
.push.on { transform: none; opacity: 1; }
.push .ph { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); }
.push .ph b { color: var(--text); font-weight: 600; }
.push .ph .ap { width: 20px; height: 20px; border-radius: 6px; background: #06C755; color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.push .ph .kd { font-size: 11px; background: #DCFCE7; color: #166534; border-radius: 999px; padding: 1px 8px; }
.push .ph .tm { margin-left: auto; }
.push .pb { font-size: 14px; color: var(--text); margin-top: 6px; line-height: 1.5; }
.push .pt { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ════════════════════════════════════════════
   小組平板（1180×820）
   ════════════════════════════════════════════ */
.tb { height: 100%; display: flex; flex-direction: column; background: var(--bg-app); }
.tb-head {
  height: 72px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px 0 24px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.tb-head .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.tb-head .who { display: flex; flex-direction: column; gap: 2px; }
.tb-head .who h1 { margin: 0; font-size: 24px; line-height: 1.2; display: flex; align-items: baseline; gap: 10px; }
.tb-head .who h1 small { font-size: 15px; font-weight: 500; color: var(--text-2); }
.tb-head .who .sub { font-size: 13px; color: var(--text-2); }
.tb-grp { display: flex; align-items: center; gap: 14px; }
.tb-grp h1 { margin: 0; font-size: 26px; }
.tb-leader { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); background: var(--bg-subtle); border-radius: 999px; padding: 4px 12px; }
.tb-leader .ic { color: #CA8A04; }
.tb-clock { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tb-clock b { font-size: 20px; color: var(--text); margin-left: 4px; }

/* 置頂：計時器、請來拿作業 */
.tb-pin { flex: none; display: flex; gap: 12px; padding: 14px 20px 0; }
.tb-timer {
  width: 340px; flex: none; border-radius: var(--r-lg); padding: 12px 18px; background: var(--n-900); color: #fff;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center;
}
.tb-timer .lbl { grid-column: 1; font-size: 12.5px; color: var(--n-400); display: flex; align-items: center; gap: 6px; }
.tb-timer .task { grid-column: 1; font-size: 18px; font-weight: 700; }
.tb-timer .by { grid-column: 1 / -1; font-size: 12px; color: var(--n-400); margin-top: 2px; }
.tb-timer .cd { grid-column: 2; grid-row: 1 / 3; font-size: 40px; font-weight: 700; letter-spacing: .02em; }
.tb-timer.is-up { background: var(--danger); animation: pulse 1s ease-in-out infinite alternate; }
.tb-timer.is-up .lbl, .tb-timer.is-up .by { color: #FECACA; }
.tb-timer.is-up .cd { font-size: 32px; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } to { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.tb-alert { flex: 1; min-width: 0; border-radius: var(--r-lg); background: var(--hw-correcting-tint); border: 2px solid var(--hw-correcting); overflow: hidden; }
.tb-alert .hd { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--hw-correcting); color: #fff; font-weight: 700; font-size: 16px; }
.tb-alert .hd .ic { font-size: 20px; }
.tb-alert .row { display: flex; align-items: center; gap: 14px; padding: 8px 16px; font-size: 16px; }
.tb-alert .row + .row { border-top: 1px solid #FED7AA; }
.tb-alert .row > b { font-size: 18px; min-width: 72px; }
.tb-alert .row .al-hw { color: var(--text-2); }
.tb-alert .row .to { margin-left: auto; color: var(--hw-correcting-ink); }

/* 組員格狀清單 */
.tb-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.tb-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--text);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px 14px 20px; min-height: 168px; cursor: pointer; overflow: hidden;
}
.tb-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c, var(--n-300)); }
.tb-card:active { background: var(--bg-subtle); }
.tb-card.st-left, .tb-card.st-absent, .tb-card.st-noclass { background: #FBFCFD; }
.tb-card.st-left .c-nm, .tb-card.st-absent .c-nm, .tb-card.st-noclass .c-nm { color: var(--text-2); }
.tb-card.is-dim { opacity: .4; cursor: default; }
.tb-card.is-picked { border-color: var(--n-900); box-shadow: 0 0 0 2px var(--n-900); }
.c-top { display: flex; align-items: center; gap: 8px; }
.c-nm { font-size: 22px; font-weight: 700; line-height: 1.2; }
.c-lead { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: #A16207; background: #FEF9C3; border-radius: 6px; padding: 2px 7px; }
.c-st { margin-left: auto; }
.c-att { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.c-reg { display: flex; gap: 6px; }
.c-hw { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--n-100); }
.c-hwrow { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.c-hwrow .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-hw.is-draft .c-hwrow { color: var(--text-3); }

.tb-foot { flex: none; height: 76px; display: flex; align-items: center; gap: 20px; padding: 0 20px 0 24px; background: var(--bg-surface); border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.tb-foot .right { margin-left: auto; display: flex; gap: 12px; }
.tb-foot .sum b, .tb-foot .sel-n b { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; margin: 0 2px; }
.tb-foot.is-select { background: var(--n-50); }
.f-err { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 500; }

/* 學生頁 */
.tb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.tb-center { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.tb-center p { margin: 0; }
.att-line { font-size: 18px; color: var(--text-2); }
.btn-signin { height: 96px; min-width: 360px; font-size: 32px; border-radius: 20px; gap: 14px; }
.btn-signin .ic { font-size: 34px; }
.big-ic { width: 88px; height: 88px; border-radius: 50%; background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; font-size: 44px; color: var(--text-2); }
.big-t { font-size: 28px; font-weight: 700; }
.tb-cols { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.m-card { padding: 6px 0 8px; }
.m-card-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; font-size: 14px; }
.m-list { display: flex; flex-direction: column; padding: 0 12px; }
.m-list .banner { margin: 0 8px 10px; }
.m-hw { display: grid; grid-template-columns: 1fr auto auto 136px; gap: 14px; align-items: center; min-height: 72px; padding: 8px 8px; border-top: 1px solid var(--n-100); }
.m-hw .t { display: flex; flex-direction: column; font-size: 18px; line-height: 1.3; }
.m-hw .t small { font-size: 14px; color: var(--text-2); }
.m-hw .act { display: flex; justify-content: flex-end; }
.m-hw .act .btn { width: 136px; }
.m-hw.st-done .t { color: var(--text-3); }
.m-hw.st-correcting { background: linear-gradient(90deg, var(--hw-correcting-tint), transparent 60%); border-radius: 8px; }
.m-hw.is-draft { grid-template-columns: 1fr auto; min-height: 52px; color: var(--text-2); font-size: 16px; }
.m-empty { display: flex; align-items: center; gap: 8px; padding: 18px 8px; color: var(--text-3); font-size: 15px; }
.m-side { display: flex; flex-direction: column; gap: 12px; }
.m-side > .btn { width: 100%; justify-content: flex-start; padding: 0 18px; height: 56px; font-size: 17px; }
.btn-leave { height: 96px !important; justify-content: center !important; font-size: 28px !important; background: var(--st-done); color: #fff; border-radius: 16px; gap: 12px; }
.btn-leave .ic { font-size: 30px; }
.btn-leave:hover { background: var(--st-done-ink); }
.leave-off { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 18px; border-radius: 12px; border: 1.5px dashed var(--n-300); color: var(--text-3); font-size: 14px; }
.leave-off .ic { font-size: 20px; }
.m-scores { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px; }
.m-scores .lbl { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.sc-row { display: flex; align-items: center; gap: 4px; font-size: 14px; padding: 4px 0; }
.sc-row > span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.sc-row small { color: var(--text-3); font-size: 12px; }
.sc-row b { font-size: 20px; margin-right: 4px; }
.sc-row .btn { padding: 0 8px; }

/* 登記表單 */
.tb-form { display: flex; flex-direction: column; gap: 14px; }
.f-att { display: flex; align-items: center; gap: 20px; padding: 14px 16px; }
.f-att .section-title { margin-right: 8px; }
.f-lv { display: flex; align-items: center; gap: 10px; }
.f-lv .lv { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.f-lv .select { width: 120px; }
.f-late[aria-pressed="true"] { background: var(--st-late); border-color: var(--st-late); color: #fff; }
.f-att-hint { font-size: 13px; }
.tb-form .hw-head, .tb-form .hw-row { grid-template-columns: 168px 112px 1fr 1fr 150px; }
.f-end { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.f-hw.is-off { opacity: .4; pointer-events: none; }
.f-nohw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }
.f-nohw input { width: 22px; height: 22px; accent-color: var(--n-900); }
.f-nohw.is-disabled { color: var(--text-3); cursor: not-allowed; }
.f-nohw-msg { display: flex; align-items: center; gap: 10px; padding: 10px 12px 6px; color: var(--text-2); }
.f-nohw-msg .ic { font-size: 20px; color: var(--text-3); }

/* 成績 */
.sc-form { max-width: 820px; margin: 0 auto; padding: 24px; }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.sc-grid label { display: flex; flex-direction: column; }
.input-score { font-size: 22px; font-weight: 600; }
.sc-grid .segmented > button { flex: 1; justify-content: center; }
.tag--early-leave .ic { font-size: 12px; }

/* 對話框、提示 */
.tb-frame .dialog { width: 560px; }
.tb-frame .dialog ul.names { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); max-height: 300px; overflow-y: auto; }
.tb-frame .dialog ul.names li { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; font-size: 15px; }
.tb-frame .dialog ul.names li + li { border-top: 1px solid var(--n-100); }
.tb-frame .dialog ul.names li span { color: var(--text-2); font-size: 13.5px; }
.dlg-leave { text-align: center; padding: 36px 32px 28px; }
.dlg-leave h3 { font-size: 26px; margin-bottom: 28px; }
.dlg-leave .actions { justify-content: center; }
.dlg-leave .btn { min-width: 160px; }

.tb-toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 8px; background: var(--n-900); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow-3); animation: rise .2s ease; }
.tb-toast .ic { color: #4ADE80; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.tb-pop { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tb-pop .box { display: flex; flex-direction: column; align-items: center; gap: 6px; background: rgba(15,23,42,.92); color: #fff; border-radius: 20px; padding: 28px 44px; animation: popin .18s ease; }
.tb-pop .box > .ic { font-size: 44px; color: #4ADE80; }
.tb-pop .box b { font-size: 28px; }
.tb-pop .box span { font-size: 16px; color: var(--n-300); }
.tb-pop .box small { font-size: 13px; color: var(--n-400); }
@keyframes popin { from { opacity: 0; transform: scale(.92); } }
.tb-flash { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; animation: popin .2s ease; }
.tb-flash--ok { background: var(--st-arrived); }
.tb-flash--leave { background: var(--st-done); }
.tb-flash .fl-ic { width: 112px; height: 112px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 60px; }
.tb-flash .fl-nm { font-size: 64px; font-weight: 700; line-height: 1.1; }
.tb-flash .fl-msg { font-size: 36px; font-weight: 600; }
.tb-flash .fl-sub { font-size: 22px; opacity: .85; font-variant-numeric: tabular-nums; }

/* ════════════════════════════════════════════
   電腦版殼層（安親老師、主任、系統管理員、櫃檯）
   ════════════════════════════════════════════ */
.stage--tutor, .stage--director, .stage--admin, .stage--desk { overflow: hidden; }
.dk { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); height: 100%; position: relative; background: var(--bg-app); }
.dk-nav .sub { width: 100%; border: 0; background: transparent; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.dk-nav .sub:hover:not(:disabled):not(.is-active) { background: var(--n-800); color: #fff; }
.dk-nav .sub.is-soon { color: var(--n-600); cursor: default; }
.dk-nav .grp { margin-top: 10px; height: 34px; font-size: 13px; color: var(--n-400); }
.dk-nav .grp .ic { font-size: 16px; }
.dk-main { min-height: 0; }
.dk-main .header .sub { margin-left: 4px; }
.dk-main .header .right .btn { height: 38px; }
.dk-main .header .clock b { color: var(--text); font-size: 16px; margin-left: 2px; }
.dk-content { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 12px; }
.dk-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dk-filter .lbl { font-size: 13px; color: var(--text-2); font-weight: 500; }
.dk-filter .lbl:not(:first-child) { margin-left: 8px; }
.dk-note { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.sel-sm { height: 36px !important; width: auto !important; min-width: 120px; font-size: 14px; }
input.input.sel-sm { min-width: 150px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); cursor: pointer; margin-left: 8px; }
.chk input { width: 18px; height: 18px; accent-color: var(--n-900); }
.search { position: relative; display: inline-flex; align-items: center; }
.search > .ic { position: absolute; left: 10px; color: var(--text-3); font-size: 16px; }
.search input { height: 36px; width: 200px; padding-left: 32px; font-size: 14px; }
button.chip { font: inherit; font-size: var(--fs-body-sm); cursor: pointer; height: 36px; }
.st-chips .chip { height: 34px; }
.lnk { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.lnk:hover { text-decoration: underline; }
.dk-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pill { margin-left: 2px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.dk-toast { position: absolute; left: calc(50% + var(--nav-w) / 2); bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 8px; background: var(--n-900); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-3); animation: rise .2s ease; white-space: nowrap; }
.dk-toast .ic { color: #4ADE80; }
.dk-scrim { z-index: 60; }
.dk .dialog { max-height: calc(100% - 48px); overflow-y: auto; }
.dk .dialog .actions { align-items: center; }
.dk .dialog .actions > .muted:first-child { margin-right: auto; font-size: 13px; }
.dlg-wide { width: 720px !important; }
.f-err { color: var(--danger); display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* 批改清單、檢核 */
.gr-sec { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin-top: 8px; }
.gr-sec small { font-size: 13px; color: var(--text-2); font-weight: 400; }
.gr-sec.quick { color: var(--hw-done-ink); }
.gr-list { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.gr-list.quick { border-color: #86EFAC; }
.gr-row { display: grid; grid-template-columns: 52px 128px minmax(180px, 1fr) minmax(200px, 1.3fr) auto; gap: 12px; align-items: center; min-height: 58px; padding: 6px 16px; border-top: 1px solid var(--n-100); font-size: 14px; }
.gr-row:first-child { border-top: 0; }
.gr-row .t { color: var(--text-2); }
.gr-row .nm, .ck-row .nm { display: flex; flex-direction: column; line-height: 1.3; }
.gr-row .nm small, .ck-row .nm small { font-size: 12px; color: var(--text-3); }
.gr-row .nm .lnk, .ck-row .nm .lnk { font-size: 15px; }
.gr-row .hwn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gr-row .st { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gr-row .acts { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.gr-row.quick { box-shadow: inset 4px 0 0 var(--hw-done); }
.gr-row.is-pick { background: var(--hw-correcting-tint); }
.gr-row.is-done { color: var(--text-2); }
.gr-row.is-done .hwn, .gr-row.is-done .nm, .gr-row.is-done .t { opacity: .6; }
.res { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.res.ok { color: var(--hw-done-ink); } .res.ng { color: var(--hw-correcting-ink); }
.pick-lbl { font-size: 13px; color: var(--hw-correcting-ink); font-weight: 600; }
.wrong-pick { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.wrong-pick button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #FDBA74; background: #fff; color: var(--hw-correcting-ink); font: inherit; font-weight: 600; cursor: pointer; }
.wrong-pick button:last-child { width: 44px; }
.wrong-pick button:hover, .wrong-pick button.is-on { background: var(--hw-correcting); color: #fff; border-color: var(--hw-correcting); }
.ck-row { display: grid; grid-template-columns: 128px minmax(160px, 1fr) 170px minmax(200px, auto) 130px; gap: 12px; align-items: center; min-height: 60px; padding: 6px 16px; border-top: 1px solid var(--n-100); font-size: 14px; }
.ck-row:first-child { border-top: 0; }
.ck-row .sum { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.ck-row .wait { color: var(--text-2); font-size: 13px; }
.ck-row .wait b { color: var(--text); font-size: 15px; }
.ck-row .stay { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ck-row .acts { display: flex; justify-content: flex-end; }
.ck-row.is-done { background: #FCFDFE; }
.tag--stay { color: var(--st-stay-ink); background: var(--st-stay-tint); border-color: #DDD6FE; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* 表格 */
.tbl-card { overflow: hidden; }
.tbl-card .table th { position: static; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--n-50); }
.table td.row-acts { text-align: right; white-space: nowrap; }
.table td .sent { display: inline-flex; align-items: center; gap: 4px; color: var(--hw-done-ink); font-size: 13px; }
.table .badge-s + .muted { font-size: 12px; }

/* 今日學生狀態：轉換對話框 */
.ts-dlg { width: 600px; }
.dreg-hd { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dreg-hd h3 { margin: 0 0 2px; display: flex; align-items: baseline; gap: 8px; }
.dreg-hd h3 small { font-size: 14px; font-weight: 500; color: var(--text-2); }
.dreg-hd .muted { font-size: 13px; }
.dreg-hd .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ts-sec { font-size: 12.5px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; margin: 12px 0 6px; }
.ts-tr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--n-100); }
.ts-tr .muted { font-size: 12.5px; }
.ts-to { display: inline-flex; align-items: center; gap: 6px; width: 140px; color: var(--text-3); }
.ts-other { display: flex; gap: 8px; flex-wrap: wrap; }
.send-list { border: 1px solid var(--border); border-radius: var(--r-md); max-height: 340px; overflow-y: auto; margin-bottom: 8px; }
.send-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 14px; }
.send-row + .send-row { border-top: 1px solid var(--n-100); }
.send-row b { min-width: 60px; }
.send-row > span:nth-child(2) { color: var(--text-2); flex: 1; }

/* 電腦版作業登記 */
.dreg { width: 1000px; }
.dreg-att { display: flex; align-items: center; gap: 16px; padding: 12px 14px; background: var(--bg-subtle); border-radius: var(--r-md); margin-bottom: 12px; }
.dreg-att .muted { font-size: 13px; }
.dreg-att .select { width: 110px; height: 40px; }
.dreg-hw { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 12px; }
.dreg-hw.is-off, .dreg-stay.is-off { opacity: .4; pointer-events: none; }
.dreg-sub { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dreg .hw-head, .dreg .hw-row { grid-template-columns: 150px 104px 1fr 1fr 140px; }
.dreg .hw-row .input, .dreg .hw-row .select { height: 40px; }
.dreg .segmented { height: 40px; }
.dreg-stay { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 4px; }
.dreg-stay .input { flex: 1; height: 40px; }
.dreg-stay .muted { font-size: 13px; }
.stay-tg { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.stay-tg input { width: 20px; height: 20px; accent-color: var(--st-stay); }
.stay-tg.is-disabled { color: var(--text-3); cursor: not-allowed; }
.dlg-wide .sc-grid, .dialog .sc-grid { gap: 14px 18px; }
.dialog .sc-grid .segmented { display: flex; height: 44px; }
.dialog .sc-grid .segmented > button { flex: 1; justify-content: center; }
.dialog .sc-grid .input, .dialog .sc-grid .select { height: 44px; }

/* 學生當天紀錄面板 */
.dk-panel { z-index: 50; }
.dk-panel .sp-bd { overflow-y: auto; }
.dk-panel .sp-hd .row1 .badge { margin-left: 4px; }
.sp-ev { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.sp-ev span, .hw-card .log span { display: flex; gap: 8px; }
.sp-ev .t, .hw-card .log .t { font-style: normal; font-variant-numeric: tabular-nums; color: var(--text-3); width: 40px; flex: none; }
.hw-card .top .muted { font-size: 13px; }
.hw-card .log .is-void { text-decoration: line-through; color: var(--text-3); }
.hw-err { font-size: 12.5px; color: var(--hw-correcting-ink); }

/* 接送狀況 */
.pk-stats { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; }
button.stat { font: inherit; text-align: left; cursor: pointer; color: var(--text); padding: 12px 14px; }
button.stat .lbl { font-size: 13px; white-space: nowrap; }
button.stat .v { font-size: 28px; }
button.stat:hover { border-color: var(--c); }
.pk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pk-cols .list-card { max-height: 300px; }
.pk-cols .list-card > .head .ic { font-size: 18px; color: var(--text-3); }
.pk-cols .list-card { overflow-y: auto; }
.pk-cols .w-row .muted { font-size: 13px; }
.w-row .wait { font-size: 16px; }

/* 今日小組 */
.gt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.gt-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.gt-card header { display: flex; align-items: baseline; gap: 10px; }
.gt-card header h2 { margin: 0; font-size: 20px; }
.gt-sec .lbl { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.gt-leader { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.gt-acting { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.gt-timer { display: flex; align-items: center; gap: 14px; background: var(--n-900); color: #fff; border-radius: var(--r-md); padding: 10px 14px; }
.gt-timer > div { flex: 1; display: flex; flex-direction: column; }
.gt-timer small { color: var(--n-400); font-size: 12px; }
.gt-timer .cd { font-size: 28px; font-weight: 700; }
.gt-timer.is-up { background: var(--danger); }
.gt-timer.is-up small { color: #FECACA; }
.gt-form { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; }
.gt-form .input, .gt-form .select { height: 40px; }
.gt-mem { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-m { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 4px 6px 4px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.gt-m > span { display: inline-flex; align-items: center; gap: 3px; }
.gt-m > span .ic { color: #CA8A04; font-size: 12px; }

/* 報表 */
.rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rp-card { padding: 14px 16px 6px; }
.rp-card h3 { margin: 0 0 6px; font-size: 16px; }
.rp-card .table td { height: 44px; }
.rp-total td { font-weight: 700; background: var(--bg-subtle) !important; }
.rp-foot { font-size: 12.5px; margin: 8px 0; }
.rp-days td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; height: auto; }
.rp-hw { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 4px; }
.rp-hw .muted { font-size: 12.5px; }
.c-lead { font-size: 11px; }
.dk-content > * { flex-shrink: 0; }
.gr-row.is-pick .st { display: none; }
.gr-row.is-pick .acts { grid-column: 4 / -1; }
.pick-lbl { white-space: nowrap; }
.dialog .wrong-pick { margin-bottom: 14px; }
.push { padding: 8px 12px; }
.push .pb { font-size: 13.5px; margin-top: 4px; }

/* ════════════════════════════════════════════
   樓下大螢幕（1920×1080，深色）
   ════════════════════════════════════════════ */
:root {
  --dk-st-late:    #2DD4BF;
  --dk-st-arrived: #38BDF8;
  --dk-st-check:   #FBBF24;
}
.stage--tv { display: flex; flex-direction: column; overflow: hidden; background: #CBD5E1; }
.tv-frame { border-radius: 10px; background: var(--dk-bg); }
.tv-frame .tv { font-family: var(--font-sans); }
.tv-stats9 { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 16px; }
.tv-stats9 .tv-stat { padding: 18px 20px; }
.tv-stats9 .tv-stat .lbl { font-size: 22px; white-space: nowrap; }
.tv-stats9 .tv-stat .lbl .ic { font-size: 24px; }
.tv-stats9 .tv-stat .v { font-size: 68px; }
.tv-wait { flex: 1; min-height: 0; }
.tv-wait .head { height: 84px; font-size: 36px; }
.tv-wait .head .ic { font-size: 38px; }
.tv-wait .head small { font-size: 24px; margin-left: 8px; }
.tv-wait-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 104px; column-gap: 0; }
.tv-wait-grid .row { height: auto; border-top: 1px solid var(--dk-border); padding: 0 36px; }
.tv-wait-grid .row:nth-child(-n+2) { border-top: 0; }
.tv-wait-grid .row:nth-child(odd) { border-right: 1px solid var(--dk-border); }
.tv-wait-grid .row .nm { font-size: 44px; }
.tv-wait-grid .row .nm small { font-size: 24px; }
.tv-wait-grid .row .t { font-size: 28px; }
.tv-wait-grid .row .t b { font-size: 44px; color: var(--dk-hw-done); }
.tv-empty { display: flex; align-items: center; justify-content: center; height: 300px; font-size: 32px; color: var(--dk-text-3); }
.tv-top .clock { min-width: 120px; text-align: right; }
.sp-acts { display: flex; gap: 8px; }
.w-row .nm { white-space: nowrap; }

/* ════════════════════════════════════════════
   家長手機（390×844）：LINE、綁定網頁、家長頁面
   ════════════════════════════════════════════ */
.stage--parent { display: flex; flex-direction: column; overflow: hidden; background: #E2E8F0; }
.dv-note { margin-left: auto; }
.ph-frame { border-radius: 46px; background: #fff; box-shadow: 0 0 0 10px #111827, 0 0 0 11px #374151, 0 24px 60px rgba(15,23,42,.35); }
.ph-screen { height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #fff; }
.ph-status { height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0; font-size: 15px; background: #fff; }
.ph-status .ic { font-size: 16px; }
.ph-sms { position: absolute; top: 50px; left: 10px; right: 10px; z-index: 30; background: rgba(245,245,247,.97); border-radius: 18px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 14px; transform: translateY(-20px); opacity: 0; transition: all .3s ease; }
.ph-sms.on { transform: none; opacity: 1; }
.ph-sms .hd { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.ph-sms .hd .ic { color: #fff; background: #34C759; border-radius: 5px; padding: 2px; font-size: 16px; }
.ph-sms .hd b { color: var(--text); }
.ph-sms .hd span { margin-left: auto; }

/* LINE 聊天 */
.lc { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lc-bar { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; border-bottom: 1px solid #eee; font-size: 16px; }
.lc-bar .ic { font-size: 20px; color: var(--text-2); }
.lc-ok .ic { font-size: 14px; color: #fff; background: #06C755; border-radius: 50%; padding: 2px; }
.lc-body { flex: 1; min-height: 0; overflow-y: auto; background: #8CABD8; padding: 12px 10px 16px; display: flex; flex-direction: column; gap: 10px; }
.lc-day { align-self: center; font-size: 11px; color: #fff; background: rgba(0,0,0,.18); border-radius: 999px; padding: 2px 10px; }
.msg-in { display: flex; align-items: flex-end; gap: 6px; }
.msg-in .av { width: 32px; height: 32px; border-radius: 50%; background: var(--n-900); color: #fff; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; align-self: flex-start; }
.msg-in .bub { background: #fff; border-radius: 4px 16px 16px 16px; padding: 8px 12px; font-size: 14px; line-height: 1.5; max-width: 250px; overflow: hidden; }
.msg-in .msg-time { font-size: 10px; color: #EEF2F7; flex: none; }
.lc-btn { display: block; width: calc(100% + 24px); margin: 8px -12px -8px; padding: 10px; border: 0; border-top: 1px solid #eee; background: #fff; color: #06C755; font: inherit; font-weight: 600; cursor: pointer; }
.lc-input { height: 44px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #fff; color: var(--text-3); border-top: 1px solid #eee; font-size: 14px; }
.lc-input .fake { flex: 1; background: #F2F3F5; border-radius: 999px; padding: 4px 12px; }
.lc-menu-tg { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--text-2); }
.rm { height: 172px; flex: none; display: flex; }
.rm-cell { flex: 1; border: 0; color: #fff; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.rm-cell .ic { font-size: 36px; margin-bottom: 4px; }
.rm-cell b { font-size: 20px; }
.rm-cell small { font-size: 12.5px; opacity: .85; }
.rm-main { background: var(--n-900); }
.rm-bind { background: #06C755; }
.rm-cell:active { filter: brightness(.92); }

/* LINE 內開啟的網頁 */
.wv { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-app); }
.wv-bar { height: 50px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #fff; border-bottom: 1px solid var(--border); }
.wv-bar button { width: 36px; height: 36px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.wv-bar div { display: flex; flex-direction: column; line-height: 1.2; }
.wv-bar b { font-size: 14px; }
.wv-bar small { font-size: 11px; color: var(--text-3); }
.wv-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.pf { padding: 22px 20px 28px; display: flex; flex-direction: column; gap: 8px; }
.pf-h { margin: 6px 0 0; font-size: 22px; }
.pf-p { margin: 0 0 6px; color: var(--text-2); font-size: 14.5px; }
.pf-lbl { font-size: 13px; color: var(--text-2); font-weight: 500; margin-top: 6px; }
.pf-in { height: 50px !important; font-size: 17px !important; }
.pf-otp { letter-spacing: .3em; font-size: 22px !important; font-weight: 600; text-align: center; }
.kb-suggest { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--n-100); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.kb-suggest .ic { font-size: 14px; }
.pf-err { margin: 2px 0; color: var(--danger); font-size: 13.5px; display: flex; gap: 6px; align-items: flex-start; }
.pf-err .ic { margin-top: 3px; flex: none; }
.pf-btn { height: 50px; width: 100%; margin-top: 10px; font-size: 16px; }
.pf-btn2 { width: 100%; }
.pf-steps { display: flex; gap: 6px; }
.pf-steps i { width: 28px; height: 4px; border-radius: 2px; background: var(--n-200); }
.pf-steps i.on { background: var(--n-900); }
.pf-ok { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: var(--st-done-tint); border: 1px solid #BBF7D0; border-radius: 14px; padding: 14px; color: var(--st-done-ink); margin-bottom: 6px; }
.pf-ok .ic { font-size: 26px; }
.pf-ok b { font-size: 17px; }
.pf-ok span { font-size: 13px; color: var(--text-2); }
.pf-ok.big { padding: 36px 14px; margin-top: 30px; }
.pf-ok.big .ic { font-size: 44px; }
.pf-ok.big b { font-size: 22px; }
.pf-link { border: 0; background: none; color: var(--focus); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; align-self: center; }
.pf-links { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--text-3); margin-top: 6px; }
.pf-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 20px 0 16px; }
.pf-brand span { width: 56px; height: 56px; border-radius: 16px; background: var(--n-900); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.pf-brand b { font-size: 20px; }

/* 家長頁面 */
.pt-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; background: #fff; }
.pt-head > b { font-size: 18px; }
.pt-out { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer; }
.pt-kids { display: flex; gap: 4px; background: var(--n-100); border-radius: 10px; padding: 3px; }
.pt-kids button { border: 0; background: none; font: inherit; font-size: 15px; padding: 6px 14px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.pt-kids button.is-on { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
.pt-tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-bottom: 1px solid var(--border); flex: none; }
.pt-tabs button { border: 0; background: none; font: inherit; font-size: 14px; height: 42px; color: var(--text-2); border-bottom: 2px solid transparent; cursor: pointer; }
.pt-tabs button.is-on { color: var(--text); font-weight: 600; border-bottom-color: var(--n-900); }
.pt-body { padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.pt-hero { display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, var(--c) 9%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); border-radius: 16px; padding: 16px; }
.pt-hero .ic-wrap { width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.pt-hero b { font-size: 19px; display: block; line-height: 1.3; }
.pt-hero small { font-size: 13px; color: var(--text-2); display: block; margin-top: 2px; }
.pt-sec { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 8px; }
.pt-hw { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.pt-hw > div { display: flex; flex-direction: column; min-width: 0; }
.pt-hw b { font-size: 15px; }
.pt-hw small { font-size: 12.5px; color: var(--text-3); }
.pt-err { color: var(--hw-correcting-ink) !important; font-size: 12.5px; }
.pt-empty { text-align: center; color: var(--text-3); padding: 24px 0; font-size: 14px; }
.pt-kid { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; text-align: left; border: 1px solid var(--border); border-left: 6px solid var(--c); background: #fff; border-radius: 14px; padding: 14px 14px 14px 16px; font: inherit; cursor: pointer; margin-top: 8px; }
.pt-kid b { font-size: 19px; }
.pt-kid span { font-size: 13px; color: var(--text-3); }
.pt-kid em { font-style: normal; font-size: 14px; color: var(--text-2); margin-top: 4px; }
.pt-kid .ic { grid-column: 2; grid-row: 1 / 4; align-self: center; color: var(--text-3); font-size: 20px; }
.pt-dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pt-dates button { flex: none; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.pt-dates button small { font-size: 11px; color: var(--text-3); }
.pt-dates button.is-on { background: var(--n-900); border-color: var(--n-900); color: #fff; }
.pt-dates button.is-on small { color: var(--n-300); }
.pt-meta { display: flex; justify-content: space-between; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--text-2); }
.pt-meta b { color: var(--text); font-size: 15px; margin-left: 2px; }
.pt-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pt-filter .select { grid-column: 1 / -1; height: 40px; }
.pt-filter .input { height: 40px; font-size: 13px; padding: 0 8px; }
.pt-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pt-sum div { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.pt-sum small { font-size: 12px; color: var(--text-3); }
.pt-sum b { font-size: 22px; }
.pt-tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 14px; }
.pt-tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.pt-tbl td { padding: 9px 12px; border-bottom: 1px solid var(--n-100); }
.pt-sc { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.pt-sc > div { display: flex; flex-direction: column; }
.pt-sc small { font-size: 12.5px; color: var(--text-3); }
.pt-sc .num { font-size: 26px; font-weight: 700; }

/* ════════════════════════════════════════════
   主任後台
   ════════════════════════════════════════════ */
.stage--director { display: flex; flex-direction: column; }
.stage--director > .dk { flex: 1; min-height: 0; height: auto; }
.stage--director > .dev-bar .ic { font-size: 15px; }
.dv-tab { display: inline-flex; align-items: center; gap: 6px; }
.seg-sm { height: 36px; }
.seg-sm > button { font-size: 13px; padding: 0 12px; }
.dk-hint { margin: 0; font-size: 13px; }
.f-note { font-size: 12.5px; margin: 8px 0 0; }
.td-wrap { white-space: normal; max-width: 360px; font-size: 13px; }
.table tr.is-muted td { color: var(--text-3); }
.day-pick { display: flex; gap: 6px; }
.day-pick button { flex: 1; height: 40px; border: 1px solid var(--border-strong); background: #fff; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; }
.day-pick button.is-on { background: var(--n-900); border-color: var(--n-900); color: #fff; }
.sd-head { display: flex; align-items: center; gap: 12px; }
.sd-head h2 { margin: 0; font-size: 22px; }
.sd-head .right { margin-left: auto; display: flex; gap: 8px; }
.sd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.sd-grid.two { grid-template-columns: 1fr 1fr; }
.rp-card h3 { display: flex; align-items: baseline; gap: 8px; }
.rp-card h3 .muted { font-size: 13px; font-weight: 400; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 8px 10px; margin: 6px 0 10px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.sd-g { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; flex-wrap: wrap; }
.sd-tl { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; }
.sd-tl > div { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.sd-tl .t { font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sd-tl span { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sd-tl span .ic { color: var(--text-3); }
.sd-tl small { color: var(--text-3); width: 100%; }
.sd-tl em { font-style: normal; color: var(--text-3); font-size: 12.5px; }
.kid-pick { border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px; }
.kid-pick .input { width: 100% !important; margin-bottom: 6px; }
.kid-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-height: 180px; overflow-y: auto; }
.kid-list label { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.kid-list label.is-on { background: var(--bg-subtle); font-weight: 600; }
.kid-list small { color: var(--text-3); font-weight: 400; font-size: 11.5px; margin-left: auto; }
.gd-line { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 10px 12px; background: var(--bg-subtle); border-radius: var(--r-md); font-size: 14px; }
.gd-line .btn { margin-left: auto; }
.gm-set { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; }
.gm-set label { display: flex; flex-direction: column; }
.gm-set .input, .gm-set .select { height: 40px; }
.gm-mem { grid-column: span 2; padding-bottom: 12px; }
.gm-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--n-100); font-size: 14px; }
.gm-row b { font-size: 15px; }
.gm-row .select { margin-left: auto; min-width: 150px; }
.gm-add { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.gm-add .select { flex: 1; width: auto !important; }
.sd-grid > .gm-mem + section { grid-column: 1 / -1; }
.sj-in { height: 36px !important; width: 160px !important; font-weight: 600; }
.chk-line { display: inline-flex; align-items: center; gap: 8px; height: 44px; font-size: 14px; }
.chk-line input { width: 18px; height: 18px; accent-color: var(--n-900); }
.chk-line.is-disabled { color: var(--text-3); }
.temp-pw { font-size: 30px; font-weight: 700; letter-spacing: .12em; background: var(--bg-subtle); border-radius: 10px; padding: 14px; text-align: center; margin-bottom: 12px; }
.pend { margin: 10px 0 4px; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.8; }
.st-card { padding: 4px 18px; }
.st-row { display: flex; align-items: center; gap: 20px; padding: 16px 0; border-top: 1px solid var(--n-100); }
.st-row:first-child { border-top: 0; }
.st-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.st-row small { color: var(--text-3); font-size: 13px; }

/* 主任手機版 */
.dm { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg-app); }
.dm-head { height: 50px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border); font-size: 18px; }
.dm-sub { margin-left: auto; font-size: 13px; color: var(--text-3); }
.dm-back { border: 0; background: none; font-size: 20px; padding: 0; display: flex; cursor: pointer; }
.dm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 6px; }
.dm-tabs { height: 74px; flex: none; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-top: 1px solid var(--border); padding-bottom: 18px; }
.dm-tabs button { border: 0; background: none; font: inherit; font-size: 11.5px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; }
.dm-tabs button .ic { font-size: 22px; }
.dm-tabs button.is-on { color: var(--text); font-weight: 600; }
.dm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dm-stats > div { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; }
.dm-stats span { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.dm-stats span .ic { color: var(--c); }
.dm-stats b { font-size: 22px; line-height: 1.2; }
.dm-sec { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 10px; }
.dm-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.dm-row b { font-size: 15px; }
.dm-row small { color: var(--text-3); font-size: 12px; }
.dm-row > span:last-child { margin-left: auto; color: var(--text-2); font-size: 13px; }
.dm-row.warn > .ic { color: var(--warn); }
.dm-row.err > .ic { color: var(--danger); }
.dm-empty { text-align: center; color: var(--text-3); font-size: 13.5px; padding: 14px 0; }
.dm-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border-strong); border-radius: 12px; padding: 0 12px; height: 46px; margin-bottom: 4px; color: var(--text-3); }
.dm-search input { border: 0; outline: none; font: inherit; font-size: 16px; flex: 1; background: none; }
.dm-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.dm-name { display: flex; align-items: center; gap: 8px; }
.dm-name b { font-size: 22px; }
.dm-card > small { color: var(--text-3); font-size: 13px; }
.dm-card .kv { grid-template-columns: 80px 1fr; margin-top: 10px; }
.dm-fix { height: 46px; width: 100%; }
.dm-confirm { background: var(--warn-tint); border: 1px solid var(--warn-border); border-radius: 12px; padding: 12px; font-size: 14px; }
.dm-confirm p { margin: 0 0 10px; }
.dm-confirm div { display: flex; gap: 8px; justify-content: flex-end; }
.dm-hw { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; }
.dm-hw > div { display: flex; flex-direction: column; }
.dm-hw small { color: var(--text-3); font-size: 12px; }
.stage--director .dev-fit { flex: 1; }
.dk-nav .menu > * { flex-shrink: 0; }
.dk-nav .sub { height: 38px; }
.dk-nav .grp { height: 32px; margin-top: 8px; }
.w-row .nm { flex: none; }
.btn-ghost:disabled { background: transparent !important; border-color: transparent !important; }
.tb-grid { grid-auto-rows: max-content; }

/* ════════════════════════════════════════════
   系統管理員：角色權限、裝置帳號；平板／大螢幕停用畫面
   ════════════════════════════════════════════ */
.pm-types { padding-bottom: 14px; }
.pm-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm-type-grid > div { display: flex; flex-direction: column; gap: 2px; background: var(--bg-subtle); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--text-2); }
.pm-type-grid b { color: var(--text); font-size: 14px; }
.pm-table th:not(:first-child), .pm-c { text-align: center; width: 104px; }
.pm-table td { height: 44px; }
.pm-sec td { background: var(--bg-subtle) !important; font-weight: 700; height: 38px !important; }
.pm-ok { display: inline-flex; align-items: flex-start; color: var(--hw-done-ink); font-size: 18px; }
.pm-ok sup { font-size: 11px; color: var(--text-2); margin-left: 1px; font-weight: 600; }
.pm-p2 td { color: var(--text-3); }
.pm-p2 .tag { margin-right: 6px; }
.pm-notes p { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.tb-notice { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.tb-notice p { margin: 0; }
.tb-login { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-size: 20px; }
.tb-login .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--n-900); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.tv-off { align-items: center; justify-content: center; gap: 18px; }
.tv-off > div { font-size: 80px; color: var(--dk-text-3); }
.tv-off b { font-size: 56px; }
.tv-off span { font-size: 30px; color: var(--dk-text-2); }
