/* 2026-11-15 全站視覺改版（國小校務系統）。只有後端 VISUAL_V2 有開的分校才會套用：
   campus-switch.js 在 <html> 掛 data-visual-theme="A|B|C"（A 晨霧柔彩＝原 warm、B 暖石香檳＝原 teal、C 靜海灰藍＝原 navy）
   與 data-campus-theme="visual"（沿用 theme-campus.css 的換色規則，--t-* 在這裡對到新色票）。
   沒有 data-visual-theme 的分校，這個檔案一條規則都不會生效。
   只改外觀：顏色、字級、間距、對話框寬度與排列；不改欄位、流程、權限與計算。
   色票來源：交付包 03_配色tokens.json。負面色與分數色是固定語意色，不跟配色換。 */
:root{--ui-negative-text:#A83A32;--ui-negative-bg:#FBEDEC;--ui-negative-line:#D98A84;--ui-score-low:#C0392B;--ui-score-mid:#202124;--ui-score-high:#2563A6;--ui-score-full:#B45309}
[data-visual-theme="A"]{--ui-canvas:#F3F5F4;--ui-surface:#FFFFFF;--ui-text:#37434A;--ui-text-muted:#69777C;--ui-divider:#DCE3E1;--ui-nav-bg:#FFF1E4;--ui-nav-line:#E88A35;--ui-tab-bg:#EAF2F7;--ui-tab-line:#5B8CA6;--ui-selected-text:#36586C;--ui-section-1:#EAF2F7;--ui-section-2:#EDF4EE;--ui-section-3:#FFF1E4;--ui-section-4:#F1EDF7;--ui-text-on-tint:#37434A;
 --ui-control:#7F8F96;--ui-line-strong:#C3CDCB;--ui-zebra:#FAFBFB;--ui-hover:#F1F4F3}
[data-visual-theme="B"]{--ui-canvas:#F5F3EF;--ui-surface:#FFFFFF;--ui-text:#403B36;--ui-text-muted:#716960;--ui-divider:#E3DED6;--ui-nav-bg:#F0E7D9;--ui-nav-line:#A48558;--ui-tab-bg:#EEE8EF;--ui-tab-line:#88718B;--ui-selected-text:#66516B;--ui-section-1:#F3EDE3;--ui-section-2:#ECEFE7;--ui-section-3:#F4EAE4;--ui-section-4:#EEE8EF;--ui-text-on-tint:#403B36;
 --ui-control:#8F867B;--ui-line-strong:#CEC7BC;--ui-zebra:#FBFAF8;--ui-hover:#F4F1EC}
[data-visual-theme="C"]{--ui-canvas:#F1F4F6;--ui-surface:#FFFFFF;--ui-text:#34444D;--ui-text-muted:#627480;--ui-divider:#D9E2E7;--ui-nav-bg:#E5EDF4;--ui-nav-line:#66869D;--ui-tab-bg:#E5F0EC;--ui-tab-line:#628579;--ui-selected-text:#3C6257;--ui-section-1:#E7EEF4;--ui-section-2:#E8F0ED;--ui-section-3:#EFEEE8;--ui-section-4:#ECEBF2;--ui-text-on-tint:#34444D;
 --ui-control:#7E909C;--ui-line-strong:#BFCBD3;--ui-zebra:#F9FBFC;--ui-hover:#EFF3F6}
/* 舊配色機制（theme-campus.css）用的變數，對到新色票 */
[data-visual-theme]{--t-bg:var(--ui-canvas);--t-surface:var(--ui-surface);--t-soft:var(--ui-tab-bg);--t-softer:var(--ui-zebra);--t-line:var(--ui-divider);--t-line2:var(--ui-line-strong);
 --t-ink:var(--ui-text);--t-muted:var(--ui-text-muted);--t-primary:var(--ui-selected-text);--t-primary-dark:var(--ui-text);--t-accent:var(--ui-nav-line);--t-eyebrow:var(--ui-selected-text);--t-glow:transparent;
 --t-side:var(--ui-surface);--t-side-text:var(--ui-text);--t-side-muted:var(--ui-text-muted);--t-side-hover:var(--ui-hover);--t-side-active:var(--ui-nav-bg);--t-side-active-text:var(--ui-text);--t-side-line:var(--ui-divider);
 --muted:var(--ui-text-muted);--line:var(--ui-divider);--accent:var(--ui-selected-text)}
html[data-visual-theme]{font-size:16px;color:var(--ui-text);background:var(--ui-canvas)}
html[data-visual-theme] body{background:var(--ui-canvas);color:var(--ui-text);line-height:1.5}
/* ── 共用元件基準（低權重，各頁自己的 class 規則仍可蓋過） ── */
:where(html[data-visual-theme]) button,:where(html[data-visual-theme]) input,:where(html[data-visual-theme]) select,:where(html[data-visual-theme]) textarea{border-radius:8px}
:where(html[data-visual-theme]) input:not([type=checkbox],[type=radio],[type=file],[type=range]),:where(html[data-visual-theme]) select,:where(html[data-visual-theme]) textarea{min-height:42px;padding:9px 12px;font-size:16px;background:#fff;color:var(--ui-text)}
:where(html[data-visual-theme]) textarea{line-height:1.5}
:where(html[data-visual-theme]) p{font-size:14px;line-height:1.6}
:where(html[data-visual-theme]) table{font-size:15px}
:where(html[data-visual-theme]) h1{font-size:21px;letter-spacing:0;margin:0 0 4px}
html[data-visual-theme] input,html[data-visual-theme] select,html[data-visual-theme] textarea{--t-line2:var(--ui-control)}
html[data-visual-theme] input::placeholder,html[data-visual-theme] textarea::placeholder{color:var(--ui-text-muted);opacity:1}
html[data-visual-theme] input:disabled,html[data-visual-theme] select:disabled,html[data-visual-theme] textarea:disabled{background:var(--ui-canvas);color:var(--ui-text-muted);border-style:dashed}
html[data-visual-theme] input[readonly],html[data-visual-theme] textarea[readonly]{background:var(--ui-zebra)}
html[data-visual-theme] input[type=checkbox],html[data-visual-theme] input[type=radio]{accent-color:var(--ui-selected-text)}
html[data-visual-theme] button:focus-visible,html[data-visual-theme] a:focus-visible,html[data-visual-theme] input:focus-visible,html[data-visual-theme] select:focus-visible,html[data-visual-theme] textarea:focus-visible,html[data-visual-theme] summary:focus-visible{outline:3px solid var(--ui-selected-text);outline-offset:2px}
html[data-visual-theme] button:hover:not(:disabled){box-shadow:none}
html[data-visual-theme] ::selection{background:var(--ui-tab-bg)}

/* ── 側欄：白底；主功能選中＝淡底＋左直線＋深色字 ── */
html[data-visual-theme] .sidebar{background:#fff;color:var(--ui-text);border-right:1px solid var(--ui-divider);scrollbar-color:var(--ui-divider) transparent}
html[data-visual-theme] .brand,html[data-visual-theme] .brand span{color:var(--ui-text)}
html[data-visual-theme] .brand small{color:var(--ui-text-muted);font-size:12px}
/* 品牌標誌用原本的橘黃，不跟著配色換 */
html[data-visual-theme] .logo{background:#c45218;color:#fff;box-shadow:none}
html[data-visual-theme] .logo span{color:#ffd584}
html[data-visual-theme] .logo.daily{background:#ffeddd}
html[data-visual-theme] .nav-label,html[data-visual-theme] .sidebar.has-junior .nav-sub{color:var(--ui-text-muted);border-top-color:var(--ui-divider);font-size:12px;letter-spacing:1px}
html[data-visual-theme] .nav-label{margin:28px 12px 8px}
html[data-visual-theme] .nav{color:var(--ui-text);border-radius:6px;font-size:15px;font-weight:500;min-height:44px;padding:9px 12px;margin:2px 0;box-shadow:none}
html[data-visual-theme] .nav:hover{background:var(--ui-hover);color:var(--ui-text)}
html[data-visual-theme] .nav.active{background:var(--ui-nav-bg);color:var(--ui-text);font-weight:700;box-shadow:inset 3px 0 0 var(--ui-nav-line)}
html[data-visual-theme] .nav b{background:var(--ui-canvas);color:var(--ui-text);border-radius:6px;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}
html[data-visual-theme] .nav.active b{background:#fff;color:var(--ui-text)}
html[data-visual-theme] .sidebar.has-junior #junior-nav{background:var(--ui-zebra);border-radius:8px}
html[data-visual-theme] .side-note{border-color:var(--ui-divider);color:var(--ui-text-muted)}
html[data-visual-theme] .side-note p,html[data-visual-theme] .side-note a{color:var(--ui-text-muted)}
html[data-visual-theme] .text-btn{color:var(--ui-selected-text);font-size:14px}
html[data-visual-theme] .side-note .text-btn{font-size:12px}

/* ── 頁首與頁面標題：標語保留但不做巨幅標題 ── */
html[data-visual-theme] header{background:#fff;border-color:var(--ui-divider);height:64px}
html[data-visual-theme] .sidebar-toggle{background:#fff;border-color:var(--ui-line-strong);color:var(--ui-text);border-radius:8px;width:40px;height:40px}
html[data-visual-theme] .breadcrumb{color:var(--ui-text);font-size:14px}
html[data-visual-theme] .breadcrumb span{color:var(--ui-text-muted)}
html[data-visual-theme] .local-label{font-size:12px;color:var(--ui-text-muted)}
html[data-visual-theme] .avatar{background:var(--ui-tab-bg);color:var(--ui-selected-text);border:1px solid var(--ui-divider);box-shadow:none}
html[data-visual-theme] .page{padding-top:24px}
html[data-visual-theme] .page-heading{margin-bottom:20px}
html[data-visual-theme] h1{color:var(--ui-text);font-weight:700}
html[data-visual-theme] .page-heading p,html[data-visual-theme] main>.page>.hint{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] .hint{color:var(--ui-text-muted);font-size:14px;line-height:1.6}
html[data-visual-theme] .eyebrow{color:var(--ui-selected-text);font-size:12px;letter-spacing:1px}
html[data-visual-theme] .section-heading h2{color:var(--ui-text);font-size:18px}
html[data-visual-theme] .section-heading h2::before{background:var(--ui-nav-line);width:3px;border-radius:2px}
html[data-visual-theme] .section-heading span{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] footer{color:var(--ui-text-on-tint);font-size:12px}
html[data-visual-theme] .campus-switch{background:var(--ui-canvas)}
html[data-visual-theme] .campus-switch button{color:var(--ui-text);font-size:14px}
html[data-visual-theme] .campus-switch button.on,html[data-visual-theme] .campus-switch button.busy{background:#fff;color:var(--ui-selected-text);box-shadow:inset 0 -2px 0 var(--ui-tab-line);font-weight:700}
html[data-visual-theme] .campus-switch select,html[data-visual-theme] .campus-overview-link{background:#fff;color:var(--ui-text);border-color:var(--ui-line-strong);font-size:14px}
html[data-visual-theme] .campus-switching{background:#f3f5f4d9}

/* ── 按鈕：白底、深色字、細邊、左側分類色線；主操作靠字重與色線 ── */
html[data-visual-theme] .primary,html[data-visual-theme] .secondary{background:#fff;color:var(--ui-text);border:1px solid var(--ui-line-strong);border-left:3px solid var(--ui-tab-line);border-radius:8px;min-height:40px;padding:8px 14px;font-size:15px;font-weight:500;box-shadow:0 1px 2px #1f2d3314}
html[data-visual-theme] .primary{border-left-color:var(--ui-nav-line);font-weight:700}
html[data-visual-theme] .primary span{margin-left:8px}
html[data-visual-theme] .primary:hover:not(:disabled),html[data-visual-theme] .secondary:hover:not(:disabled){background:var(--ui-hover)}
html[data-visual-theme] .primary:active:not(:disabled),html[data-visual-theme] .secondary:active:not(:disabled){background:var(--ui-canvas)}
html[data-visual-theme] .secondary.danger,html[data-visual-theme] .record button[data-delete-todo],html[data-visual-theme] .py-del{color:var(--ui-negative-text);border-left-color:var(--ui-negative-line)}
html[data-visual-theme] td button:not(.jr-mark):not(.text-btn):not(.primary):not(.secondary),html[data-visual-theme] .record button{background:#fff;color:var(--ui-text);border:1px solid var(--ui-line-strong);border-left:3px solid var(--ui-tab-line);border-radius:8px;min-height:36px;padding:6px 10px;font-size:14px;font-weight:500;box-shadow:0 1px 2px #1f2d3310}
html[data-visual-theme] td button:not(.jr-mark):not(.text-btn):not(.primary):not(.secondary):hover:not(:disabled),html[data-visual-theme] .record button:hover:not(:disabled){background:var(--ui-hover)}
html[data-visual-theme] td button+button{margin-left:6px}
html[data-visual-theme] .add{border:1px solid var(--ui-line-strong);background:#fff;border-radius:8px;width:36px;height:36px}
html[data-visual-theme] .med-dose .clock-actions button.primary{background:#fff;border-color:var(--ui-line-strong);border-left-color:#2f6b4a;color:var(--ui-text)}

/* ── 表格：白底細線、極淡交錯列 ── */
html[data-visual-theme] .table-wrap,html[data-visual-theme] .jr-table-wrap{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;box-shadow:none}
html[data-visual-theme] th{background:var(--ui-section-1);color:var(--ui-text);font-weight:600;font-size:14px}
html[data-visual-theme] th,html[data-visual-theme] td{border-color:var(--ui-divider);padding:12px 14px}
html[data-visual-theme] tbody tr:nth-child(even){background:var(--ui-zebra)}
html[data-visual-theme] tbody tr:hover{background:var(--ui-hover)}
html[data-visual-theme] #students-view td:first-child{font-weight:600;white-space:nowrap}
html[data-visual-theme] #students-view td{color:var(--ui-text)}
html[data-visual-theme] #students-view td:last-child{white-space:nowrap}
html[data-visual-theme] .student-toolbar{gap:8px;flex-wrap:wrap}
html[data-visual-theme] .empty{color:var(--ui-text-muted);font-size:15px}
html[data-visual-theme] .empty small{color:var(--ui-text-muted);font-size:14px}
html[data-visual-theme] .empty-symbol{background:var(--ui-canvas);color:var(--ui-text-muted);transform:none;border-radius:8px}

/* ── 表單 ── */
html[data-visual-theme] .field{font-size:14px;color:var(--ui-text);margin:14px 0;font-weight:500}
html[data-visual-theme] .field input,html[data-visual-theme] .field select,html[data-visual-theme] .field textarea{margin-top:6px;font-weight:400}
html[data-visual-theme] .form-grid{gap:0 20px}
html[data-visual-theme] .form-error{color:var(--ui-negative-text);font-size:14px}
html[data-visual-theme] .check-row{border-color:var(--ui-divider);font-size:15px;min-height:44px;padding:8px 0}
html[data-visual-theme] .check-row span,html[data-visual-theme] .teacher-picker small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .teacher-picker{border:1px solid var(--ui-divider);border-radius:8px;background:#fff}
html[data-visual-theme] .teacher-picker legend{font-size:14px;font-weight:600;color:var(--ui-text);background:var(--ui-section-2);border-radius:6px;padding:4px 10px}
html[data-visual-theme] .teacher-picker-tools{font-size:14px;border-color:var(--ui-divider)}
html[data-visual-theme] .teacher-picker-tools .text-btn{color:var(--ui-selected-text)}
html[data-visual-theme] .teacher-picker-tools [data-teacher-count]{color:var(--ui-text-muted)}
html[data-visual-theme] .teacher-picker .check-row,html[data-visual-theme] .teacher-picker .check-row span{font-size:15px;color:var(--ui-text)}
html[data-visual-theme] .teacher-picker-list{max-height:min(46vh,420px)}
html[data-visual-theme] .notification-recipients{max-height:min(46vh,420px)}
html[data-visual-theme] .notification-recipients .recipient-name{color:var(--ui-text);font-size:15px}
html[data-visual-theme] .notification-recipients small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .profile-group,html[data-visual-theme] .student-items{border-color:var(--ui-divider);border-radius:8px}
html[data-visual-theme] .profile-group legend{background:var(--ui-section-1);border-radius:6px;padding:4px 10px;font-size:14px}
html[data-visual-theme] .student-chosen,html[data-visual-theme] .student-results button.first{background:var(--ui-tab-bg);border-color:var(--ui-tab-line);border-radius:8px}
html[data-visual-theme] .student-results button{border-radius:8px;border-color:var(--ui-line-strong);font-size:16px}
html[data-visual-theme] .lookup-row{border-color:var(--ui-divider);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] .lookup-row span,html[data-visual-theme] .lookup-row small{color:var(--ui-text-muted)}
html[data-visual-theme] .photo-frame{background:var(--ui-canvas);border-radius:8px}
html[data-visual-theme] .photo-preview img{border-radius:8px}
html[data-visual-theme] .item-extra small,html[data-visual-theme] .class-time span,html[data-visual-theme] .announcement-nav span,html[data-visual-theme] .pl-code span,html[data-visual-theme] .pl-list small{color:var(--ui-text-muted)}
html[data-visual-theme] .class-times .class-time b,html[data-visual-theme] .pl-code b,html[data-visual-theme] .pl-h{color:var(--ui-text)}
html[data-visual-theme] .pl-msg{background:#fff;border-color:var(--ui-control);color:var(--ui-text);border-radius:8px}
html[data-visual-theme] .class-row,html[data-visual-theme] .pl-list li,html[data-visual-theme] .profile-log td{border-color:var(--ui-divider)}
html[data-visual-theme] .att-classes button{background:#fff;border-color:var(--ui-line-strong);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] .att-classes button small{color:var(--ui-text-muted)}
html[data-visual-theme] .att-classes button.on{background:var(--ui-tab-bg);border-color:var(--ui-tab-line);color:var(--ui-selected-text);font-weight:700;box-shadow:inset 0 -3px 0 var(--ui-tab-line)}
html[data-visual-theme] .att-classes button.on small{color:var(--ui-selected-text)}

/* 選項鈕（單選／複選的方塊）：選中＝淡底＋框線＋底線＋粗字，不用整塊深色 */
html[data-visual-theme] .notification-days span,html[data-visual-theme] .leave-modes span,html[data-visual-theme] .clock-kind span,html[data-visual-theme] .py-mo span,html[data-visual-theme] .jr-seg span{background:#fff;color:var(--ui-text);border-color:var(--ui-line-strong);border-radius:8px;font-size:15px}
html[data-visual-theme] .notification-days input:checked+span,html[data-visual-theme] .leave-modes input:checked+span,html[data-visual-theme] .clock-kind input:checked+span,html[data-visual-theme] .py-mo input:checked+span,html[data-visual-theme] .jr-seg input:checked+span{background:var(--ui-tab-bg);color:var(--ui-selected-text);border-color:var(--ui-tab-line);box-shadow:inset 0 -3px 0 var(--ui-tab-line);font-weight:700}
html[data-visual-theme] .notification-days input:focus-visible+span,html[data-visual-theme] .leave-modes input:focus-visible+span,html[data-visual-theme] .clock-kind input:focus-visible+span,html[data-visual-theme] .py-mo input:focus-visible+span,html[data-visual-theme] .jr-seg input:focus-visible+span{outline:3px solid var(--ui-selected-text);outline-offset:2px}
html[data-visual-theme] .notification-days legend,html[data-visual-theme] .leave-dates legend,html[data-visual-theme] .clock-kind legend,html[data-visual-theme] .med-times legend{font-size:14px;font-weight:600;color:var(--ui-text)}
html[data-visual-theme] .leave-cal{border-color:var(--ui-divider);border-radius:8px}
html[data-visual-theme] .leave-cal-dow{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .leave-cal-grid button{background:var(--ui-zebra);color:var(--ui-text);border-radius:6px;font-size:15px;min-height:38px}
html[data-visual-theme] .leave-cal-grid button.today{border-color:#d8a520}
html[data-visual-theme] .leave-cal-grid button[aria-pressed=true]{background:var(--ui-tab-bg);color:var(--ui-selected-text);font-weight:700;box-shadow:inset 0 0 0 2px var(--ui-tab-line)}
html[data-visual-theme] .leave-summary{color:var(--ui-selected-text);font-size:15px}

/* ── 對話框：小標題、可捲動的內容區、固定的標題與底部按鈕 ── */
html[data-visual-theme] dialog{border:1px solid var(--ui-divider);border-radius:10px;background:#fff;color:var(--ui-text);box-shadow:0 18px 60px #1f2d3330}
html[data-visual-theme] dialog::backdrop{background:#2a363c66;backdrop-filter:none}
html[data-visual-theme] #modal[open]{display:flex;flex-direction:column;padding:0;overflow:hidden;max-height:calc(100dvh - 48px)}
html[data-visual-theme] #modal-form{display:flex;flex-direction:column;min-height:0;flex:1 1 auto}
html[data-visual-theme] #modal .modal-heading{margin:0;padding:14px 20px;border-bottom:1px solid var(--ui-divider);flex:none}
html[data-visual-theme] #modal .modal-heading h2{color:var(--ui-text);font-size:20px;font-weight:700}
html[data-visual-theme] #modal .modal-heading .close{background:#fff;border:1px solid var(--ui-line-strong);color:var(--ui-text);width:40px;height:40px;border-radius:8px;font-size:22px;line-height:1}
html[data-visual-theme] #modal-content{flex:1 1 auto;min-height:0;overflow:auto;padding:16px 20px;overscroll-behavior:contain}
html[data-visual-theme] #modal #form-error{margin:0;padding:0 20px;flex:none}
html[data-visual-theme] #modal #form-error:not(:empty){padding:8px 20px;background:var(--ui-negative-bg);border-top:1px solid var(--ui-negative-line)}
html[data-visual-theme] #modal .modal-actions,html[data-visual-theme] #modal.clock-modal .modal-actions{position:static;margin:0;padding:12px 20px;border-top:1px solid var(--ui-divider);background:#fff;box-shadow:none;flex:none}
html[data-visual-theme] #modal.clock-modal #save-button{border-radius:8px;font-size:16px;padding:10px 18px}
html[data-visual-theme] .modal-heading h2{color:var(--ui-text)}
html[data-visual-theme] .notification-section{border-top:0;padding-top:0;margin-top:20px;break-inside:avoid}
html[data-visual-theme] .notification-section:first-child{margin-top:0}
html[data-visual-theme] .notification-section h3{font-size:17px;font-weight:700;color:var(--ui-text);background:var(--ui-section-1);border-radius:6px;padding:7px 12px;margin:0 0 10px}
html[data-visual-theme] .notification-section:nth-of-type(4n+2) h3{background:var(--ui-section-2)}
html[data-visual-theme] .notification-section:nth-of-type(4n+3) h3{background:var(--ui-section-3)}
html[data-visual-theme] .notification-section:nth-of-type(4n+4) h3{background:var(--ui-section-4)}
html[data-visual-theme] .notification-section h4{font-size:15px;color:var(--ui-text)}
html[data-visual-theme] .notification-section .hint{font-size:14px}
html[data-visual-theme] .notification-section .check-row{font-size:15px}
html[data-visual-theme] .notification-status{background:var(--ui-tab-bg);color:var(--ui-selected-text);border-radius:8px;font-size:14px}
html[data-visual-theme] .notification-delivery,html[data-visual-theme] .notification-delivery summary{color:var(--ui-text-muted);font-size:14px}
html[data-visual-theme] .holiday-row{font-size:15px;border-color:var(--ui-divider)}
html[data-visual-theme] .announcement-list{color:var(--ui-text);font-size:15px}
html[data-visual-theme] .announcement-note{background:var(--ui-canvas);color:var(--ui-text);border-radius:8px}
html[data-visual-theme] #toast{background:var(--ui-text);color:#fff;border-radius:8px;box-shadow:0 6px 22px #1f2d3330;font-size:15px}
html[data-visual-theme] .bind-box{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ui-tab-line);border-radius:8px}
html[data-visual-theme] .bind-code{color:var(--ui-text)}
html[data-visual-theme] .welcome{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ui-nav-line);border-radius:8px}
html[data-visual-theme] .welcome strong{color:var(--ui-text);font-size:16px}
html[data-visual-theme] .welcome p{color:var(--ui-text-muted);font-size:14px}
html[data-visual-theme] .welcome-icon,html[data-visual-theme] .quick-check{background:var(--ui-tab-bg);color:var(--ui-selected-text);transform:none}
html[data-visual-theme].quick-mode dialog::backdrop,html[data-visual-theme] #quick-done,html[data-visual-theme].quick-mode #quick-loading:not([hidden]){background:var(--ui-canvas)}
html[data-visual-theme] .quick-done-card h2{color:var(--ui-text)}

/* 看板配色：三套的縮圖與色票都用同一組變數畫出來 */
html[data-visual-theme] .theme-choices{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px}
html[data-visual-theme] .theme-choice{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;align-items:flex-start;color:var(--ui-text)}
html[data-visual-theme] .theme-choice:has(input:checked){border-color:var(--ui-tab-line);box-shadow:inset 0 0 0 1px var(--ui-tab-line),inset 0 -3px 0 var(--ui-tab-line);background:var(--ui-zebra)}
html[data-visual-theme] .v2-theme-choice{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 12px}
html[data-visual-theme] .v2-thumb{grid-column:1/-1;order:-1;display:grid;grid-template-columns:30% 1fr;height:96px;border:1px solid var(--ui-divider);border-radius:6px;overflow:hidden;background:var(--ui-canvas)}
html[data-visual-theme] .v2-thumb i,html[data-visual-theme] .v2-thumb u,html[data-visual-theme] .v2-thumb s{display:block;font-style:normal;text-decoration:none}
html[data-visual-theme] .v2-thumb-side{background:var(--ui-surface);border-right:1px solid var(--ui-divider);padding:8px 6px;display:grid;gap:5px;align-content:start}
html[data-visual-theme] .v2-thumb-side u{height:9px;border-radius:3px;background:var(--ui-divider)}
html[data-visual-theme] .v2-thumb-side u.on{background:var(--ui-nav-bg);box-shadow:inset 3px 0 0 var(--ui-nav-line)}
html[data-visual-theme] .v2-thumb-main{padding:8px;display:grid;gap:5px;align-content:start}
html[data-visual-theme] .v2-thumb-tabs{display:flex;gap:4px}
html[data-visual-theme] .v2-thumb-tabs s{flex:1;height:9px;border-radius:3px 3px 0 0;background:var(--ui-surface);border-bottom:2px solid var(--ui-divider)}
html[data-visual-theme] .v2-thumb-tabs s.on{background:var(--ui-tab-bg);border-bottom-color:var(--ui-tab-line)}
html[data-visual-theme] .v2-thumb-band{height:8px;border-radius:3px;background:var(--ui-section-1)}
html[data-visual-theme] .v2-thumb-band.b2{background:var(--ui-section-4)}
html[data-visual-theme] .v2-thumb-row{height:10px;border-radius:3px;background:var(--ui-surface);border:1px solid var(--ui-divider)}
html[data-visual-theme] .v2-theme-text{display:grid;gap:4px;min-width:0}
html[data-visual-theme] .v2-theme-text b{font-size:16px;white-space:nowrap}
html[data-visual-theme] .v2-theme-text small{font-size:13px;color:var(--ui-text-muted);line-height:1.5}
html[data-visual-theme] .theme-swatches{flex-wrap:wrap;gap:4px;margin-top:4px}
html[data-visual-theme] .theme-swatches i{width:22px;height:22px;margin-left:0;border:1px solid #00000022;box-shadow:none}

/* ── 舊版今日看板的卡片（還在用的地方）── */
html[data-visual-theme] .metric{--tile:#fff;--ink:var(--ui-text);border:1px solid var(--ui-divider);border-radius:8px;box-shadow:none;padding:14px 16px}
html[data-visual-theme] .metric:hover{transform:none;box-shadow:none;border-color:var(--ui-divider)}
html[data-visual-theme] .metric-label{font-size:14px;color:var(--ui-text-muted)}
html[data-visual-theme] .metric-label span{background:var(--ui-canvas);border-radius:6px}
html[data-visual-theme] .metric strong{font-size:26px;color:var(--ui-text)}
html[data-visual-theme] .metric-foot{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .card{border-color:var(--ui-divider);border-radius:8px;box-shadow:none}
html[data-visual-theme] .card:hover{transform:none;box-shadow:none}
html[data-visual-theme] .card-heading{background:#fff;border-bottom:1px solid var(--ui-divider);border-left:3px solid var(--category);min-height:0}
html[data-visual-theme] .card-icon{background:var(--tint);border-radius:8px}
html[data-visual-theme] .record{border-color:var(--ui-divider)}
html[data-visual-theme] .record-top strong{color:var(--ui-text);font-size:16px}
html[data-visual-theme] .record p{color:var(--ui-text);font-size:15px;font-weight:400;line-height:1.6}
html[data-visual-theme] .badge{border-radius:6px;font-size:13px}
html[data-visual-theme] .meal-summary,html[data-visual-theme] .meal-summary p{color:var(--ui-text)}
html[data-visual-theme] .meal-summary strong{color:var(--ui-text)}

/* ── 月曆 ── */
html[data-visual-theme] #calendar-view .calendar-panel,html[data-visual-theme] #calendar-view .day-panel{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;box-shadow:none}
html[data-visual-theme] #calendar-view .calendar-top-actions{margin-bottom:12px}
html[data-visual-theme] #calendar-view .calendar-top-actions>span{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] #calendar-view .month-toolbar{padding:14px 16px 10px}
html[data-visual-theme] #calendar-view .month-heading h2{font-size:20px;color:var(--ui-text)}
html[data-visual-theme] #calendar-view .month-icon{background:var(--ui-tab-bg);color:var(--ui-selected-text);border-radius:8px;width:34px;height:34px;font-size:20px}
html[data-visual-theme] #calendar-view .month-actions button{background:#fff;border-color:var(--ui-line-strong);color:var(--ui-text);min-height:40px;font-size:14px}
html[data-visual-theme] #calendar-view .calendar-legend{padding:0 16px 10px;font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .calendar-legend small{font-size:13px}
html[data-visual-theme] #calendar-view .calendar-legend i{width:10px;height:10px}
html[data-visual-theme] #calendar-view .today-dot{background:#f2c14e;border:1px solid #b88a12}
html[data-visual-theme] #calendar-view .selected-dot{background:var(--ui-tab-bg);border-color:var(--ui-tab-line)}
html[data-visual-theme] #calendar-view .weekdays{background:var(--ui-section-1);border-color:var(--ui-divider);color:var(--ui-text);font-size:14px;font-weight:600;padding:8px 0}
html[data-visual-theme] #calendar-view .weekdays span:first-child,html[data-visual-theme] #calendar-view .weekdays span:last-child{color:var(--ui-selected-text)}
html[data-visual-theme] #calendar-view .day-cell{border-color:var(--ui-divider)}
html[data-visual-theme] #calendar-view .day-cell.outside:not(.selected):not(.is-today){background:var(--ui-zebra)}
html[data-visual-theme] #calendar-view .day-cell.is-today{background:#fffbea}
html[data-visual-theme] #calendar-view .day-cell.selected,html[data-visual-theme] #calendar-view .day-cell.selected.is-today{background:var(--ui-tab-bg);box-shadow:inset 0 0 0 2px var(--ui-tab-line)}
html[data-visual-theme] #calendar-view .date-button{font-size:14px}
html[data-visual-theme] #calendar-view .day-cell:not(.outside) .date-button{color:var(--ui-text)}
html[data-visual-theme] #calendar-view .outside .date-button{color:var(--ui-text-muted);opacity:.75}
html[data-visual-theme] #calendar-view .is-today .date-number{background:#f2c14e;color:#2b2f33;box-shadow:inset 0 0 0 1px #b88a12}
html[data-visual-theme] #calendar-view .today-label{color:#6b4e00;font-size:12px;font-weight:700}
html[data-visual-theme] #calendar-view .event-btn{font-size:12px;border-radius:4px;box-shadow:inset 3px 0 0 var(--ink);padding:4px 6px 4px 8px}
html[data-visual-theme] #calendar-view .event-btn b{font-size:12px}
html[data-visual-theme] #calendar-view .extra-btn{font-size:12px;color:var(--ui-selected-text)}
html[data-visual-theme] #calendar-view .calendar-bottom{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] #calendar-view .calendar-bottom span:first-child{color:var(--ui-text)}
html[data-visual-theme] #calendar-view .day-panel{padding:16px}
html[data-visual-theme] #calendar-view .day-heading{margin-bottom:14px}
html[data-visual-theme] #calendar-view .day-heading .eyebrow{font-size:13px}
html[data-visual-theme] #calendar-view .day-heading h2{font-size:20px;color:var(--ui-text)}
html[data-visual-theme] #calendar-view .day-heading>span{background:var(--ui-canvas);color:var(--ui-text);font-size:13px;border-radius:6px}
/* 六分類：白底、左側細色線、分類深色字，不再整塊上色；選中＝淡底＋框線 */
html[data-visual-theme] #calendar-view .category-btn,html[data-visual-theme] dialog .category-btn{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ink);color:var(--ink);border-radius:8px;font-size:14px;font-weight:600;min-height:64px;gap:6px;box-shadow:0 1px 2px #1f2d3310}
html[data-visual-theme] #calendar-view .category-btn b{font-size:18px;color:var(--ui-text);font-variant-numeric:tabular-nums}
html[data-visual-theme] #calendar-view .category-btn b small{font-size:12px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .category-btn:hover{background:var(--ui-hover)}
html[data-visual-theme] #calendar-view .category-btn[aria-pressed=true]{background:var(--bg);border-color:var(--ink);border-left-width:3px;box-shadow:inset 0 -3px 0 var(--ink)}
html[data-visual-theme] #calendar-view .detail-heading{border-color:var(--ui-divider);margin-top:18px}
html[data-visual-theme] #calendar-view .detail-heading h3{font-size:18px;color:var(--ui-text)}
html[data-visual-theme] #calendar-view .detail-heading button{color:var(--ui-selected-text);font-size:14px}
html[data-visual-theme] #calendar-view .detail-record{border-bottom:1px solid var(--ui-divider);padding:12px 0}
html[data-visual-theme] #calendar-view .detail-record:not(.personal-record){border-color:var(--ui-divider)}
html[data-visual-theme] #calendar-view .record-tag,html[data-visual-theme] #inbox-panel .item-tag{font-size:13px;border-radius:4px;font-weight:600}
html[data-visual-theme] #calendar-view .record-status{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .detail-record h4{font-size:16px;color:var(--ui-text)}
html[data-visual-theme] #calendar-view .detail-record p{font-size:15px;color:var(--ui-text);line-height:1.6}
html[data-visual-theme] #calendar-view .personal-record{background:#fff;border-left:3px solid #9471b5}
html[data-visual-theme] #calendar-view .mine-badge{font-size:12px}
html[data-visual-theme] #calendar-view .overdue-badge,html[data-visual-theme] #inbox-panel .item-when.overdue{background:var(--ui-negative-bg);color:var(--ui-negative-text);font-size:13px}
html[data-visual-theme] #calendar-view .calendar-record-actions button,html[data-visual-theme] #inbox-panel .item-actions button,html[data-visual-theme] #calendar-view .att-actions button{font-size:14px;padding:6px 10px;min-height:38px}
html[data-visual-theme] #calendar-view .day-add{background:#fff;border:1px dashed var(--ui-control);color:var(--ui-text);font-size:15px;border-radius:8px;min-height:44px}
html[data-visual-theme] #calendar-view .blank{color:var(--ui-text-muted);font-size:15px}
html[data-visual-theme] #calendar-view .blank strong{color:var(--ui-text);font-size:16px}
html[data-visual-theme] #calendar-view .handover-progress{background:var(--ui-canvas);border-radius:8px}
html[data-visual-theme] #calendar-view .handover-progress p{font-size:14px}
html[data-visual-theme] #calendar-view .handover-progress small{font-size:13px;color:var(--ui-text-on-tint)}
html[data-visual-theme] #calendar-view .handover-progress .unassigned-note{color:var(--ui-text)}
html[data-visual-theme] #calendar-view #calendar-overdue{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ui-negative-line);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] #calendar-view #calendar-overdue summary{font-size:16px}
html[data-visual-theme] #calendar-view #calendar-overdue summary>small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .overdue-item{background:#fff;border-color:var(--ui-divider);color:var(--ui-text);font-size:15px;border-radius:8px}
html[data-visual-theme] #calendar-view .overdue-item small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .calendar-pending-group{background:#fff;border-color:var(--ui-divider);border-radius:8px}
html[data-visual-theme] #calendar-view .calendar-pending-group>summary{color:var(--ui-text);font-size:16px}
html[data-visual-theme] #calendar-view .leave-strip{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ui-nav-line);border-radius:8px}
html[data-visual-theme] #calendar-view .leave-strip.empty{background:#fff;border-color:var(--ui-divider)}
html[data-visual-theme] #calendar-view .leave-strip-head strong{color:var(--ui-text);font-size:16px}
html[data-visual-theme] #calendar-view .leave-strip.empty .leave-strip-head strong{color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .leave-strip>p{color:var(--ui-text-muted);font-size:14px}
html[data-visual-theme] #calendar-view .leave-chip{background:#fff;border-color:var(--ui-line-strong);border-radius:8px}
html[data-visual-theme] #calendar-view .leave-chip strong{color:var(--ui-text);font-size:15px}
html[data-visual-theme] #calendar-view .leave-chip small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] #calendar-view .att-tile{border-radius:8px}
html[data-visual-theme] #calendar-view .att-tile:not(.good):not(.warn){background:#fff;border-color:var(--ui-divider)}
html[data-visual-theme] #calendar-view .att-tile small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .att-tile:not(.good):not(.warn) strong,html[data-visual-theme] #calendar-view .att-row:not(.att-arrived):not(.att-left) strong{color:var(--ui-text)}
html[data-visual-theme] #calendar-view .att-tile.warn{background:var(--ui-negative-bg);border-color:var(--ui-negative-line)}
html[data-visual-theme] #calendar-view .att-tile.warn strong{color:var(--ui-negative-text)}
html[data-visual-theme] #calendar-view .att-row{border-bottom:1px solid var(--ui-divider)}
html[data-visual-theme] #calendar-view .att-row strong{font-size:15px}
html[data-visual-theme] #calendar-view .att-row small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #calendar-view .att-holiday{background:var(--ui-canvas);color:var(--ui-text);border-radius:8px}
html[data-visual-theme] #calendar-view .att-group{color:var(--ui-text);font-size:14px}

/* 我的待處理 */
html[data-visual-theme] #inbox-panel .inbox-wrap{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ui-nav-line);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] #inbox-panel .inbox-wrap>summary{font-size:16px}
html[data-visual-theme] #inbox-panel .inbox-wrap>summary>small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #inbox-panel .inbox-status{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] #inbox-panel .inbox-clear{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid #7fb894;border-radius:8px;font-size:15px}
html[data-visual-theme] #inbox-panel .inbox-clear>span:not(.mark){font-size:14px}
html[data-visual-theme] #inbox-panel .inbox-tile{background:#fff;border:0;border-left:3px solid var(--ui-divider);border-radius:0;padding:4px 14px}
html[data-visual-theme] #inbox-panel .inbox-tile small{font-size:13px;color:var(--ui-text-muted);letter-spacing:0}
html[data-visual-theme] #inbox-panel .inbox-tile strong{color:var(--ui-text);font-variant-numeric:tabular-nums}
html[data-visual-theme] #inbox-panel .inbox-tile strong em{color:var(--ui-negative-text);font-size:13px}
html[data-visual-theme] #inbox-panel .inbox-tile.attention{background:#fff;border-left-color:var(--ui-nav-line)}
html[data-visual-theme] #inbox-panel .inbox-section{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] #inbox-panel .inbox-section.unassigned{background:#fff;border-color:var(--ui-divider)}
html[data-visual-theme] #inbox-panel .inbox-section h2{font-size:17px;color:var(--ui-text)}
html[data-visual-theme] #inbox-panel .inbox-section h2 b{background:var(--ui-canvas);color:var(--ui-text);font-size:13px;border-radius:6px}
html[data-visual-theme] #inbox-panel .inbox-section .section-hint{font-size:14px;color:var(--ui-text-muted)}
html[data-visual-theme] #inbox-panel .inbox-group h3{font-size:14px;color:var(--ui-text-muted);letter-spacing:0}
html[data-visual-theme] #inbox-panel .inbox-item{border-bottom:1px solid var(--ui-divider)}
html[data-visual-theme] #inbox-panel .inbox-item.unread{background:#fff;border-left:3px solid var(--ui-nav-line);border-radius:0}
html[data-visual-theme] #inbox-panel .item-when,html[data-visual-theme] #inbox-panel .item-state{font-size:13px}
html[data-visual-theme] #inbox-panel .item-when:not(.overdue):not(.today),html[data-visual-theme] #inbox-panel .item-state:not(.unread){color:var(--ui-text-muted)}
html[data-visual-theme] #inbox-panel .item-state.unread{color:var(--ui-selected-text)}
html[data-visual-theme] #inbox-panel .inbox-item h4{font-size:16px;color:var(--ui-text)}
html[data-visual-theme] #inbox-panel .inbox-item p{font-size:15px;color:var(--ui-text);line-height:1.6}
html[data-visual-theme] #inbox-panel .inbox-blank{color:var(--ui-text-muted);font-size:15px}
html[data-visual-theme] #inbox-panel .inbox-blank strong{color:var(--ui-text)}
html[data-visual-theme] #inbox-panel .inbox-birthday,html[data-visual-theme] .inbox-birthday{background:var(--ui-section-3);color:var(--ui-text);border-radius:8px}
html[data-visual-theme] .todo-check{color:var(--ui-text);font-size:15px}
html[data-visual-theme] .todo-check:hover{background:var(--ui-hover)}
html[data-visual-theme] .todo-check small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .todo-check-count{font-size:13px}

/* ── 分頁與分類：第二層＝淡底＋底線＋深色字；第三層＝白底＋深色字＋細底線 ── */
html[data-visual-theme] .jr-tabs{border-color:var(--ui-divider);gap:2px}
html[data-visual-theme] .jr-tabs button{color:var(--ui-text);font-size:15px;min-height:44px;border-radius:6px 6px 0 0;border-bottom:3px solid transparent}
html[data-visual-theme] .jr-tabs button:hover{background:var(--ui-hover)}
html[data-visual-theme] .jr-tabs button.on{background:var(--ui-tab-bg);color:var(--ui-selected-text);border-bottom-color:var(--ui-tab-line);font-weight:700}
html[data-visual-theme] .jr-chip,html[data-visual-theme] .care-tabs button{background:#fff;color:var(--ui-text);border:1px solid var(--ui-divider);border-radius:8px;font-size:14px;min-height:40px;box-shadow:none}
html[data-visual-theme] .jr-chip:hover,html[data-visual-theme] .care-tabs button:hover:not(:disabled){background:var(--ui-hover)}
html[data-visual-theme] .jr-chip.on,html[data-visual-theme] .care-tabs button.primary,html[data-visual-theme] .care-tabs button.on,html[data-visual-theme] .care-tabs button[aria-pressed=true]{background:#fff;color:var(--ui-selected-text);border-color:var(--ui-divider);font-weight:700;box-shadow:inset 0 -2px 0 var(--ui-tab-line)}
html[data-visual-theme] .jr-card,html[data-visual-theme] .jr-kpis>div{background:#fff;border:1px solid var(--ui-divider);border-radius:8px}
html[data-visual-theme] .jr-card h3{font-size:17px;color:var(--ui-text)}
html[data-visual-theme] .jr-card h3 small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] .jr-empty{background:#fff;border-color:var(--ui-control);border-radius:8px;color:var(--ui-text-muted)}
html[data-visual-theme] .jr-kpis{gap:0;background:#fff;border:1px solid var(--ui-divider);border-radius:8px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
html[data-visual-theme] .jr-kpis>div{border:0;border-left:1px solid var(--ui-divider);border-radius:0;padding:10px 16px}
html[data-visual-theme] .jr-kpis>div:first-child{border-left:0}
html[data-visual-theme] .jr-kpis span{font-size:14px;color:var(--ui-text-muted)}
html[data-visual-theme] .jr-kpis strong{font-size:22px;color:var(--ui-text)}
html[data-visual-theme] .jr-kpis small{font-size:13px}
html[data-visual-theme] .jr-grid th,html[data-visual-theme] .jr-grid td{padding:8px 10px}
html[data-visual-theme] .jr-grid thead th{background:var(--ui-section-1);color:var(--c,var(--ui-text))}
html[data-visual-theme] .jr-grid tbody th{background:#fff;color:var(--ui-text);font-size:15px}
html[data-visual-theme] .jr-grid tbody tr:nth-child(even) th{background:var(--ui-zebra)}
html[data-visual-theme] .jr-grid tr.jr-stat td,html[data-visual-theme] .jr-grid tr.jr-stat th{background:var(--ui-canvas);color:var(--ui-text);font-size:14px}
html[data-visual-theme] .jr-up{color:#2c7a4b}
html[data-visual-theme] .jr-down,html[data-visual-theme] .jr-warn{color:var(--ui-negative-text)}
html[data-visual-theme] .jr-flat{color:var(--ui-text-muted)}
html[data-visual-theme] .jr-dirty{font-size:14px}

/* ── 期中期末考：分數是實際的輸入欄，平常無外框；滑過、點進去才出現邊界。分數色固定四段，不跟配色換 ── */
html[data-visual-theme] #exams-view .ex-grid .jr-score{border:1px solid transparent;background:transparent;min-height:38px;padding:6px 4px;font-size:16px;font-weight:600;color:var(--ui-text);border-radius:6px}
html[data-visual-theme] #exams-view .ex-grid .jr-score:hover{border-color:var(--ui-control);background:#fff}
html[data-visual-theme] #exams-view .ex-grid .jr-score:focus{border-color:var(--ui-selected-text);background:#fff}
html[data-visual-theme] #exams-view .ex-grid .jr-score:placeholder-shown{border-bottom-color:var(--ui-control);border-radius:6px 6px 0 0}
html[data-visual-theme] #exams-view .ex-grid .jr-score.bad{border-color:var(--ui-negative-text);background:var(--ui-negative-bg)}
html[data-visual-theme] #exams-view .jr-score.low,html[data-visual-theme] #exams-view .jr-avg.low,html[data-visual-theme] #exams-view td.low,html[data-visual-theme] #exams-view .jr-low{color:var(--ui-text)}
html[data-visual-theme] #exams-view [data-sc=l],html[data-visual-theme] #exams-view .ex-grid .jr-score[data-sc=l]{color:var(--ui-score-low)}
html[data-visual-theme] #exams-view [data-sc=m],html[data-visual-theme] #exams-view .ex-grid .jr-score[data-sc=m]{color:var(--ui-score-mid)}
html[data-visual-theme] #exams-view [data-sc=h],html[data-visual-theme] #exams-view .ex-grid .jr-score[data-sc=h]{color:var(--ui-score-high)}
html[data-visual-theme] #exams-view [data-sc=f],html[data-visual-theme] #exams-view .ex-grid .jr-score[data-sc=f]{color:var(--ui-score-full)}
html[data-visual-theme] #exams-view [data-sc] small{color:var(--ui-text-muted)}
html[data-visual-theme] #exams-view .ex-grid td small,html[data-visual-theme] #exams-view .ex-grid th small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] #exams-view .ex-grid td small .jr-up{color:#2c7a4b}
html[data-visual-theme] #exams-view .ex-grid td small .jr-down{color:var(--ui-negative-text)}

/* ── 打卡、零用金、餵藥、關懷、招生、代課、月報 ── */
html[data-visual-theme] .clock-now{color:var(--ui-text);font-size:44px}
html[data-visual-theme] .clock-date{color:var(--ui-text-muted);font-size:15px}
html[data-visual-theme] .clock-where{border-radius:8px;font-size:14px}
html[data-visual-theme] .clock-where-info{background:var(--ui-tab-bg);color:var(--ui-selected-text)}
html[data-visual-theme] .clock-where-warn{background:var(--ui-negative-bg);color:var(--ui-negative-text)}
html[data-visual-theme] .clock-punch,html[data-visual-theme] .clock-team,html[data-visual-theme] .petty-row,html[data-visual-theme] button.enroll-row{border-bottom:1px solid var(--ui-divider);font-size:15px;min-height:48px}
html[data-visual-theme] .clock-team strong{color:var(--ui-text)}
/* 還沒打卡是中性的灰藍；外面打卡、有異常才是紅色 */
html[data-visual-theme] .badge.clock-state-none{background:#e9eff3;color:#3f5b6c}
html[data-visual-theme] .badge.clock-outside,html[data-visual-theme] .badge.clock-flag,html[data-visual-theme] .badge.med-badge-late{background:var(--ui-negative-bg);color:var(--ui-negative-text)}
html[data-visual-theme] .clock-actions .text-btn,html[data-visual-theme] .notification-delivery .text-btn{color:var(--ui-selected-text);font-size:14px}
html[data-visual-theme] .clock-ip .text-btn,html[data-visual-theme] .med-time-row .text-btn,html[data-visual-theme] .petty-side .text-btn{color:var(--ui-negative-text);font-size:14px}
html[data-visual-theme] .petty-side .text-btn[data-care-student],html[data-visual-theme] .petty-side .text-btn[data-care-records],html[data-visual-theme] .petty-side .text-btn[data-care-done]{color:var(--ui-selected-text)}
html[data-visual-theme] .incident-timeline{border-color:var(--ui-divider)}
html[data-visual-theme] .incident-timeline li::before{border-color:#fff;background:var(--ui-control)}
html[data-visual-theme] .incident-when{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .incident-timeline p{color:var(--ui-text)}
html[data-visual-theme] .petty-hero span{color:var(--ui-text-muted);font-size:14px}
html[data-visual-theme] .petty-hero strong{font-size:34px}
html[data-visual-theme] .petty-hero strong.petty-neg{color:var(--ui-negative-text)}
html[data-visual-theme] .petty-month h3{font-size:18px;color:var(--ui-text)}
html[data-visual-theme] .petty-totals{color:var(--ui-text);font-size:15px}
/* 一般支出不是損失：金額用深灰；餘額變負才是紅字 */
html[data-visual-theme] .petty-out{color:var(--ui-text)}
html[data-visual-theme] .petty-date{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .petty-note{color:var(--ui-text);font-size:15px}
html[data-visual-theme] .petty-side small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .med-dose{border-left-color:var(--ui-divider)}
html[data-visual-theme] .med-dose.med-late{background:#fff;border-left-color:var(--ui-negative-line)}
html[data-visual-theme] .med-time{color:var(--ui-text);font-weight:700}
html[data-visual-theme] .med-dose small,html[data-visual-theme] .med-done .text-btn{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .care-chip,html[data-visual-theme] .enroll-status{border-radius:6px;font-size:13px}
html[data-visual-theme] .care-chip:not(.care-exam):not(.care-incident):not(.care-absent){background:var(--ui-negative-bg);color:var(--ui-negative-text)}
html[data-visual-theme] .sub-totals{font-size:15px}
html[data-visual-theme] .sub-totals th,html[data-visual-theme] .sub-totals td{padding:8px 10px;border-color:var(--ui-divider)}
html[data-visual-theme] .monthly-report{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;font-size:15px;line-height:1.7;color:var(--ui-text)}

/* ── 分校總覽：白底、細線、數字對齊，不每項一張厚卡 ── */
html[data-visual-theme] .ov-card{border:1px solid var(--ui-divider);border-left:3px solid var(--ui-tab-line);border-radius:8px}
html[data-visual-theme] .ov-card.here{border-color:var(--ui-divider);border-left-color:var(--ui-nav-line);box-shadow:none;background:#fff}
html[data-visual-theme] .ov-head h3{font-size:18px;color:var(--ui-text)}
html[data-visual-theme] .ov-tag{background:var(--ui-canvas);color:var(--ui-text);border-radius:6px;font-size:13px}
html[data-visual-theme] .ov-stats{gap:0;border-top:1px solid var(--ui-divider);border-bottom:1px solid var(--ui-divider)}
html[data-visual-theme] .ov-stat{background:none;border-radius:0;border-left:1px solid var(--ui-divider);padding:8px 10px}
html[data-visual-theme] .ov-stat:nth-child(3n+1){border-left:0}
html[data-visual-theme] .ov-stat b{font-variant-numeric:tabular-nums;color:var(--ui-text)}
html[data-visual-theme] .ov-stat span{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] .ov-stat.warn{background:none}
html[data-visual-theme] .ov-stat.warn b,html[data-visual-theme] .ov-line.warn{color:var(--ui-negative-text)}
html[data-visual-theme] .ov-line,html[data-visual-theme] .ov-incidents{font-size:15px;color:var(--ui-text)}
html[data-visual-theme] .ov-foot{font-size:13px;color:var(--ui-text-muted)}

/* ── 固定週期事項、學生紀錄 ── */
html[data-visual-theme] #student-records-view,html[data-visual-theme] #recurring-view{font-size:16px;max-width:1400px}
html[data-visual-theme] #student-records-view p,html[data-visual-theme] #recurring-view p{color:var(--ui-text);font-size:15px}
html[data-visual-theme] #student-records-view p.hint,html[data-visual-theme] #recurring-view p.hint,html[data-visual-theme] #recurring-view .hint{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] .recurring-list{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;padding:0 18px}
html[data-visual-theme] .recurring-row{border-top:1px solid var(--ui-divider);padding:16px 0}
html[data-visual-theme] .recurring-row:first-child{border-top:0}
html[data-visual-theme] .recurring-row h2{font-size:18px;margin-top:8px;color:var(--ui-text)}
html[data-visual-theme] #recurring-view .recurring-row p.hint,html[data-visual-theme] #recurring-view .recurring-list .hint{color:var(--ui-text-muted)}
html[data-visual-theme] .recurring-grants{background:#fff;border:1px solid var(--ui-divider);border-radius:8px}
html[data-visual-theme] .recurring-dates li{border-color:var(--ui-divider)}
html[data-visual-theme] .recurring-error,html[data-visual-theme] #recurring-view p.recurring-error{color:var(--ui-negative-text)}
html[data-visual-theme] .weekday-picker{border-color:var(--ui-divider)}
html[data-visual-theme] .profile-heading h2{font-size:21px;color:var(--ui-text)}
html[data-visual-theme] .profile-heading small{font-size:16px;color:var(--ui-text-on-tint)}
html[data-visual-theme] .profile-heading p{color:var(--ui-text-on-tint)}
html[data-visual-theme] .profile-notes{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid var(--ui-nav-line);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] .records-filters select{border-color:var(--ui-control);color:var(--ui-text)}
html[data-visual-theme] .records-filters span,html[data-visual-theme] .student-history-row small{color:var(--ui-text-on-tint)}
html[data-visual-theme] .student-timeline{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;padding:0 18px}
html[data-visual-theme] .student-timeline .student-history-row small{color:var(--ui-text-muted)}
html[data-visual-theme] .student-history-row{border-color:var(--ui-divider);padding:14px 0}
html[data-visual-theme] .student-history-row:last-child{border-bottom:0}

/* ── 群組訊息整理：摘要兩欄、短色線、深灰內文 ── */
html[data-visual-theme] .group-notice,html[data-visual-theme] .group-status,html[data-visual-theme] .group-meta{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] .group-batch{background:#fff;border:1px solid var(--ui-divider);border-radius:8px;padding:16px 20px;margin-bottom:16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px}
html[data-visual-theme] .group-batch>*{grid-column:1/-1;min-width:0}
html[data-visual-theme] .group-batch>.group-item{grid-column:auto}
html[data-visual-theme] .group-batch h3{font-size:18px;color:var(--ui-text)}
html[data-visual-theme] .group-batch .group-meta{color:var(--ui-text-muted)}
html[data-visual-theme] .group-item{border-color:var(--ui-divider);border-left:3px solid var(--ui-tab-line);padding:10px 0 12px 12px;margin-top:12px;border-bottom:0}
html[data-visual-theme] .group-item p{color:var(--ui-text);font-size:15px;line-height:1.6}
html[data-visual-theme] .group-item summary{color:var(--ui-selected-text)}
html[data-visual-theme] .group-source,html[data-visual-theme] .group-code{background:var(--ui-canvas);border-radius:8px;color:var(--ui-text)}
html[data-visual-theme] .group-empty h2{font-size:20px;color:var(--ui-text)}

/* ── 薪資 ── */
html[data-visual-theme] .py-label,html[data-visual-theme] .py-hint{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .py-top .py-label{color:var(--ui-text-on-tint);font-size:14px}
html[data-visual-theme] .py-chip{border-radius:6px;font-size:14px;border-color:var(--ui-divider);background:#fff}
html[data-visual-theme] .py-chip.py-locked{background:#fff;border-color:var(--ui-line-strong);border-left:3px solid var(--ui-tab-line);color:var(--ui-text)}
html[data-visual-theme] .py-warn{background:#fff;border:1px solid var(--ui-divider);border-left:3px solid #d9a441;color:var(--ui-text);border-radius:8px;font-size:14px}
html[data-visual-theme] .py-stale,html[data-visual-theme] .py-lock-note{background:#fff;border-color:var(--ui-divider);border-left-color:var(--ui-tab-line);color:var(--ui-text)}
html[data-visual-theme] .py-h{font-size:18px;color:var(--ui-text)}
html[data-visual-theme] .py-h small{font-size:14px;color:var(--ui-text-on-tint)}
html[data-visual-theme] .py-card .py-h small,html[data-visual-theme] .jr-card .py-h small{color:var(--ui-text-muted)}
html[data-visual-theme] .py>.py-body>.hint,html[data-visual-theme] .py-body>.hint{color:var(--ui-text-on-tint)}
html[data-visual-theme] .py-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:14px 20px}
html[data-visual-theme] .py-items{gap:16px 24px}
html[data-visual-theme] .py-field{font-size:14px}
html[data-visual-theme] .py-entry{border-color:var(--ui-divider)}
html[data-visual-theme] .py-mo span{font-size:14px}
html[data-visual-theme] .py-fs[disabled] input,html[data-visual-theme] .py-fs[disabled] select,html[data-visual-theme] .py-fs[disabled] textarea{background:var(--ui-canvas);color:var(--ui-text-muted)}
html[data-visual-theme] .py-savebar{background:linear-gradient(transparent,var(--ui-canvas) 30%)}
html[data-visual-theme] .py-bad{border-color:var(--ui-negative-text)!important;background:var(--ui-negative-bg)!important}
html[data-visual-theme] .py-table th small{font-size:13px;color:var(--ui-text-muted)}
html[data-visual-theme] .py-table td.py-note{font-size:14px;color:var(--ui-text-muted)}
html[data-visual-theme] .py-table td.py-strong{background:var(--ui-section-3);font-weight:700}
html[data-visual-theme] .py-table tr.jr-stat td.py-strong{background:var(--ui-section-3)}
html[data-visual-theme] .py-table tr.jr-stat th,html[data-visual-theme] .py-table tr.jr-stat td{font-weight:700;border-top:2px solid var(--ui-line-strong)}
/* 薪資總覽：中文姓名是按鈕（開個人明細），英文在同一列當次要文字 */
html[data-visual-theme] .py-table th.py-who{white-space:nowrap}
html[data-visual-theme] .py-table th.py-who small{display:inline;margin-left:10px}
html[data-visual-theme] .py-name{background:#fff;color:var(--ui-text);border:1px solid var(--ui-line-strong);border-left:3px solid var(--ui-tab-line);border-radius:8px;min-height:38px;padding:6px 12px;font-size:16px;font-weight:700;box-shadow:0 1px 2px #1f2d3310}
html[data-visual-theme] .py-name:hover{background:var(--ui-hover)}
html[data-visual-theme] .py-sum{border-color:var(--ui-divider);border-radius:8px;font-size:16px}
html[data-visual-theme] .py-sum-main{border:1px solid var(--ui-divider);border-left:3px solid var(--ui-nav-line);background:var(--ui-section-3)}
html[data-visual-theme] .py-sum-main strong{color:var(--ui-text)}
html[data-visual-theme] .py-audit details{border-color:var(--ui-divider);border-radius:8px}
html[data-visual-theme] .py-audit summary small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .py-audit p{font-size:14px}

/* ── 寬螢幕：對話框用寬版，內容多的自動排成兩欄 ── */
@media(min-width:721px){
html[data-visual-theme] #modal{width:min(880px,calc(100vw - 48px));max-width:none}
html[data-visual-theme] #modal.notification-modal,html[data-visual-theme] #modal.overview-modal,html[data-visual-theme] #modal:has(#modal-content .teacher-picker),html[data-visual-theme] #modal:has(#modal-content>.notification-section~.notification-section){width:min(1280px,calc(100vw - 48px))}
html[data-visual-theme] #modal:has(#modal-content>.theme-choices){width:min(980px,calc(100vw - 48px))}
}
@media(min-width:1000px){
html[data-visual-theme] #modal:has(#modal-content .teacher-picker) #modal-content,html[data-visual-theme] #modal:has(#modal-content>.notification-section~.notification-section) #modal-content{column-count:2;column-gap:40px;column-rule:1px solid var(--ui-divider)}
html[data-visual-theme] #modal-content>*{break-inside:avoid}
html[data-visual-theme] #modal-content>.hint:first-child,html[data-visual-theme] #modal-content>.clock-hero,html[data-visual-theme] #modal-content>.petty-hero{column-span:all}
html[data-visual-theme] #modal-content .teacher-picker{margin-top:0}
}
@media(max-width:1000px){
html[data-visual-theme] .group-batch{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:720px){
html[data-visual-theme] .sidebar{border-right:0;border-bottom:1px solid var(--ui-divider);border-radius:0}
html[data-visual-theme] header{background:#fff;height:56px}
html[data-visual-theme] .sidebar .nav{font-size:14px;min-height:42px}
html[data-visual-theme] h1{font-size:20px}
html[data-visual-theme] .jr-kpis>div{border-left:0;border-top:1px solid var(--ui-divider)}
html[data-visual-theme] .jr-kpis>div:first-child{border-top:0}
html[data-visual-theme] #modal[open]{max-height:calc(100dvh - 16px)}
html[data-visual-theme].quick-mode #modal[open]{max-height:100dvh}
html[data-visual-theme] #modal-content{padding:14px 16px}
html[data-visual-theme] #modal .modal-heading,html[data-visual-theme] #modal .modal-actions,html[data-visual-theme] #modal.clock-modal .modal-actions{padding:10px 16px}
html[data-visual-theme] #calendar-view .event-btn{font-size:10px;padding:3px 2px 3px 5px}
html[data-visual-theme] #calendar-view .event-btn b{font-size:10px}
html[data-visual-theme] #calendar-view .date-button{font-size:12px}
html[data-visual-theme] #calendar-view .today-label{font-size:10px}
html[data-visual-theme] th,html[data-visual-theme] td{padding:10px 10px}
}
/* ── 左側功能表：五組分類、可展開收合（nav-groups.js）── */
html[data-visual-theme] #daily-nav.v2-moved,html[data-visual-theme] #admin-nav.v2-moved{display:none}
html[data-visual-theme] .v2-nav{display:flex;flex-direction:column;width:100%}
html[data-visual-theme] .v2-group{border-top:1px solid var(--ui-divider);padding:6px 0}
html[data-visual-theme] .v2-group:first-child{border-top:0}
html[data-visual-theme] .v2-group-head{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 10px 6px 12px;border:0;background:none;color:var(--ui-text);font-size:14px;font-weight:700;letter-spacing:.5px;text-align:left;border-radius:6px}
html[data-visual-theme] .v2-group-head:hover{background:var(--ui-hover)}
html[data-visual-theme] .v2-group-title{flex:1;min-width:0}
html[data-visual-theme] .v2-group-here{font-size:12px;font-weight:500;color:var(--ui-selected-text);white-space:nowrap}
html[data-visual-theme] .v2-group-head.has-current[aria-expanded=false]{box-shadow:inset 3px 0 0 var(--ui-nav-line)}
html[data-visual-theme] .v2-chevron{flex:none;width:8px;height:8px;margin:0 4px 3px;border-right:2px solid var(--ui-text-muted);border-bottom:2px solid var(--ui-text-muted);transform:rotate(45deg);transition:transform .15s}
html[data-visual-theme] .v2-group-head[aria-expanded=false] .v2-chevron{transform:rotate(-45deg);margin-bottom:0}
html[data-visual-theme] .v2-group-items{display:flex;flex-direction:column;padding:2px 0 2px 8px}
html[data-visual-theme] .v2-group-items .nav{gap:10px}
html[data-visual-theme] .v2-ico{flex:none;width:20px;text-align:center;font-style:normal;line-height:1}
html[data-visual-theme] .v2-group-items .nav>svg{flex:none;width:20px;height:16px}
@media(prefers-reduced-motion:reduce){
html[data-visual-theme] .v2-chevron{transition:none}
}
@media(min-width:721px){
html[data-visual-theme].sidebar-collapsed .v2-group-head{display:none}
html[data-visual-theme].sidebar-collapsed .v2-group-items[hidden]{display:flex!important}
html[data-visual-theme].sidebar-collapsed .v2-group-items{padding-left:0}
html[data-visual-theme].sidebar-collapsed .v2-group{padding:4px 0}
}
@media(max-width:720px){
html[data-visual-theme] .v2-group-items{flex-direction:row;flex-wrap:wrap;gap:6px;padding-left:0}
html[data-visual-theme] .v2-group{padding:2px 0}
}
/* 新增記錄的六個入口：維持六宮格，左側用各分類的色線 */
html[data-visual-theme] #modal-content>.quick-choices{grid-template-columns:repeat(3,minmax(0,1fr));margin:12px 0 4px}
html[data-visual-theme] .quick-choices button{font-size:16px;font-weight:600;min-height:64px}
html[data-visual-theme] .quick-choices [data-calendar-add=leaves]{border-left-color:#a15b22}
html[data-visual-theme] .quick-choices [data-calendar-add=pickup]{border-left-color:#3d7753}
html[data-visual-theme] .quick-choices [data-calendar-add=meals]{border-left-color:#3c6d97}
html[data-visual-theme] .quick-choices [data-calendar-add=incidents]{border-left-color:#b55f4b}
html[data-visual-theme] .quick-choices [data-calendar-add=todos]{border-left-color:#7c5da3}
html[data-visual-theme] .quick-choices [data-calendar-add=notes]{border-left-color:#947322}
html[data-visual-theme] #calendar-status{color:var(--ui-text-muted)!important;font-size:14px}
@media(max-width:720px){
html[data-visual-theme] #modal-content>.quick-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:721px){
html[data-visual-theme] #modal:has(#modal-content>.leave-dates),html[data-visual-theme] #modal:has(#modal-content>.student-items){width:min(1280px,calc(100vw - 48px))}
}
@media(min-width:1000px){
html[data-visual-theme] #modal:has(#modal-content>.leave-dates) #modal-content,html[data-visual-theme] #modal:has(#modal-content>.student-items) #modal-content{column-count:2;column-gap:40px;column-rule:1px solid var(--ui-divider)}
}
/* ── 老師管理：左邊綁定碼與新增，右邊名冊（原列原地展開）；停用／解綁用紅字與柔紅線，已綁定淡綠 ── */
html[data-visual-theme] [data-staff-row]{padding:12px 0}
html[data-visual-theme] [data-staff-row] .record-top{gap:8px}
html[data-visual-theme] [data-staff-row] .record-top select{width:auto;flex:0 1 140px;min-height:38px;padding:6px 10px;font-size:14px}
html[data-visual-theme] [data-staff-row] button[data-staff][data-value="0"],html[data-visual-theme] [data-staff-row] button[data-unbind]{color:var(--ui-negative-text);border-left-color:var(--ui-negative-line)}
html[data-visual-theme] .badge.staff-state.is-bound{background:#e7f4ec;color:#2f6b4a}
html[data-visual-theme] .badge.staff-state.is-unbound{background:#e9eff3;color:#3f5b6c}
html[data-visual-theme] .badge.staff-state.is-off{background:var(--ui-canvas);color:var(--ui-text-muted)}
html[data-visual-theme] .campus-link{color:var(--ui-text);font-size:14px}
html[data-visual-theme] .campus-link select{width:auto;min-height:38px;padding:6px 10px;font-size:14px;border-color:var(--ui-control)}
html[data-visual-theme] .campus-link small{color:var(--ui-text-muted);font-size:13px}
html[data-visual-theme] .staff-classes{font-size:14px;color:var(--ui-text)}
@media(min-width:721px){
html[data-visual-theme] #modal:has([data-staff-row]){width:min(1280px,calc(100vw - 48px))}
}
@media(min-width:1000px){
html[data-visual-theme] #modal-content:has(>div>[data-staff-row]){display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);column-gap:40px;align-content:start}
html[data-visual-theme] #modal-content:has(>div>[data-staff-row])>*{grid-column:1}
html[data-visual-theme] #modal-content:has(>div>[data-staff-row])>div:last-child{grid-column:2;grid-row:1/span 30;border-left:1px solid var(--ui-divider);padding-left:24px;margin-left:-16px}
}
/* 對話框裡的分頁（學生關懷）：選中＝淡底＋底線＋深色字 */
html[data-visual-theme] .care-tabs button[aria-selected=true]{background:var(--ui-tab-bg);color:var(--ui-selected-text);border:1px solid var(--ui-divider);font-weight:700;box-shadow:inset 0 -3px 0 var(--ui-tab-line);padding:6px 12px}
html[data-visual-theme] .petty-month h3,html[data-visual-theme] .notification-section .petty-month h3{background:none;padding:0;margin:0;font-size:18px}
/* 代課：請假的老師淡杏線、代課的老師淡綠線 */
html[data-visual-theme] select[name=absent_id]{border-left:3px solid #e0b58a}
html[data-visual-theme] select[name=sub_id]{border-left:3px solid #8fbf9f}
@media(min-width:1000px){
html[data-visual-theme] .monthly-report{column-count:2;column-gap:40px;column-rule:1px solid var(--ui-divider)}
}
/* ══ 薪資逐頁排版（11/15 第二輪）：只用 payroll.js 的 data-pv-* 標記排版，欄位、順序與行為不變 ══ */
html[data-visual-theme] .py-card>h3{background:var(--ui-section-1);border-radius:6px;padding:7px 12px;margin:0 0 10px}
html[data-visual-theme] .py-card>.py-grid+.hint,html[data-visual-theme] .py-card>.py-items+.hint{margin-top:10px}
/* 個人明細（薪資單） */
html[data-visual-theme] .py-body[data-pv-tab=overview-slip] [data-pv-card=應支金額]>h3{background:var(--ui-section-2)}
html[data-visual-theme] .py-body[data-pv-tab=overview-slip] [data-pv-card^=應付金額]>h3{background:var(--ui-section-3)}
html[data-visual-theme] .py-body[data-pv-tab=overview-slip] [data-pv-card^=公司負擔]>h3{background:var(--ui-canvas)}
html[data-visual-theme] .py-body[data-pv-tab=overview-slip] [data-pv-card=其它獎金]>h3{background:var(--ui-section-4)}
/* 每月輸入・個人資料：保險淡藍、請假淡綠、手動核定淡杏、考試獎金淡紫 */
html[data-visual-theme] [data-pv-card=保險與公司負擔]>h3{background:var(--ui-section-1)}
html[data-visual-theme] [data-pv-card=請假天數]>h3,html[data-visual-theme] [data-pv-card=各身分本月時數]>h3{background:var(--ui-section-2)}
html[data-visual-theme] [data-pv-card=手動核定]>h3,html[data-visual-theme] [data-pv-card=兼職其他加給]>h3{background:var(--ui-section-3)}
html[data-visual-theme] [data-pv-card=考試獎金]>h3{background:var(--ui-section-4)}
html[data-visual-theme] [data-pv-card=前月完整月資料]>h3,html[data-visual-theme] [data-pv-card=新生名單]>h3,html[data-visual-theme] [data-pv-card=選用項目]>h3,html[data-visual-theme] [data-pv-card=薪資單備註]>h3{background:var(--ui-canvas)}
/* 續班：已儲存結果與本月編輯分開；制度設定的小班淡綠、大班流失淡紅 */
html[data-visual-theme] [data-pv-card=本月已儲存的結果]>h3{background:var(--ui-section-2)}
html[data-visual-theme] [data-pv-card=本月到期班級]>h3{background:var(--ui-section-1)}
html[data-visual-theme] [data-pv-card^=依三個月前的登記推算]>h3{background:var(--ui-section-3)}
html[data-visual-theme] .py-renew .py-calc{color:var(--ui-text-muted);font-size:14px}
html[data-visual-theme] [data-pv-card=小班全續]>h3{background:var(--ui-section-2)}
html[data-visual-theme] [data-pv-card=大班流失單價]>h3{background:var(--ui-negative-bg);box-shadow:inset 3px 0 0 var(--ui-negative-line)}
html[data-visual-theme] [data-pv-card=大班流失單價] td:first-child input:not([value="0"]){color:var(--ui-negative-text);font-weight:700}
html[data-visual-theme] [data-pv-card=畢業排除月份]>h3{background:var(--ui-canvas)}
/* 考試：分數起點用固定四段色；扣減額（負數）紅字，代表扣減，不是公司虧損 */
html[data-visual-theme] [data-pv-card=考試分數級距] input[data-sc]{font-weight:700}
html[data-visual-theme] [data-pv-card=考試分數級距] input[data-sc=l]{color:var(--ui-score-low)}
html[data-visual-theme] [data-pv-card=考試分數級距] input[data-sc=m]{color:var(--ui-score-mid)}
html[data-visual-theme] [data-pv-card=考試分數級距] input[data-sc=h]{color:var(--ui-score-high)}
html[data-visual-theme] [data-pv-card=考試分數級距] input[data-sc=f]{color:var(--ui-score-full)}
html[data-visual-theme] [data-pv-card=考試分數級距] td:nth-child(2) input[value^="-"]{color:var(--ui-negative-text);font-weight:700}
html[data-visual-theme] .py-table td.py-num:has(>small){white-space:normal}
/* 制度設定的各分區標帶 */
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card:nth-of-type(4n+2)>h3{background:var(--ui-section-2)}
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card:nth-of-type(4n+3)>h3{background:var(--ui-section-3)}
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card:nth-of-type(4n+4)>h3{background:var(--ui-section-4)}
html[data-visual-theme] .py-tier{max-width:none}
html[data-visual-theme] .py-tier td{padding:6px 8px}
html[data-visual-theme] .py-tier td:last-child{width:1%;white-space:nowrap}
html[data-visual-theme] .py-tier input{min-height:38px;padding:6px 10px;text-align:right;font-variant-numeric:tabular-nums}
html[data-visual-theme] .py-entry{grid-template-columns:repeat(auto-fill,minmax(min(100%,150px),1fr));gap:8px 14px}
html[data-visual-theme] .py-field input[type=number]{text-align:right;font-variant-numeric:tabular-nums}
/* 報表列印：每一種報表一列，名稱、範圍、按鈕對齊 */
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles{grid-template-columns:minmax(0,1fr);gap:0;background:#fff;border:1px solid var(--ui-divider);border-radius:8px}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card{border:0;border-bottom:1px solid var(--ui-divider);border-radius:0;display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr) auto;gap:8px 20px;align-items:center;padding:12px 16px}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card:last-child{border-bottom:0}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card>h3{background:none;padding:0 0 0 10px;margin:0;border-radius:0;box-shadow:inset 3px 0 0 var(--ui-tab-line);font-size:16px}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card>.hint{margin:0}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card>.py-actions{justify-content:flex-end;flex-wrap:nowrap}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card>.hint:nth-of-type(2){grid-column:1/3;padding-left:10px}
/* 變更紀錄：月份／動作／操作人／時間對齊 */
html[data-visual-theme] .py-audit{gap:0;background:#fff;border:1px solid var(--ui-divider);border-radius:8px}
html[data-visual-theme] .py-audit details{border:0;border-bottom:1px solid var(--ui-divider);border-radius:0;padding:0}
html[data-visual-theme] .py-audit details:last-child{border-bottom:0}
html[data-visual-theme] .py-audit summary{display:grid;grid-template-columns:18px 130px minmax(120px,1.2fr) minmax(90px,1fr) auto;gap:12px;align-items:center;padding:10px 16px;min-height:48px;list-style:none;font-size:15px}
html[data-visual-theme] .py-audit summary::-webkit-details-marker{display:none}
html[data-visual-theme] .py-audit summary::before{content:'';width:7px;height:7px;border-right:2px solid var(--ui-text-muted);border-bottom:2px solid var(--ui-text-muted);transform:rotate(-45deg)}
html[data-visual-theme] .py-audit details[open]>summary::before{transform:rotate(45deg)}
html[data-visual-theme] .py-audit summary:hover{background:var(--ui-hover)}
html[data-visual-theme] .py-audit summary small{font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap}
html[data-visual-theme] .py-audit details>p{margin:0;padding:4px 16px 4px 46px;color:var(--ui-text)}
html[data-visual-theme] .py-audit details>p:last-child{padding-bottom:12px}
@media(max-width:720px){
html[data-visual-theme] .py-audit summary{grid-template-columns:18px minmax(0,1fr) minmax(0,1fr)}
html[data-visual-theme] .py-audit summary small{grid-column:2/-1;text-align:left}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card{grid-template-columns:minmax(0,1fr)}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card>.py-actions{justify-content:flex-start;flex-wrap:wrap}
html[data-visual-theme] .py-body[data-pv-tab=reports] .py-tiles>.py-card>.hint:nth-of-type(2){grid-column:auto}
}
@media(min-width:1100px){
/* 兩欄：不是卡片的東西（月份、說明、分類、儲存列）佔整列 */
html[data-visual-theme] .py-body[data-pv-tab=settings],html[data-visual-theme] .py-body[data-pv-tab=staff],html[data-visual-theme] .py-body[data-pv-tab=overview-slip]{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px;align-items:start}
html[data-visual-theme] .py-body[data-pv-tab=settings]>*,html[data-visual-theme] .py-body[data-pv-tab=staff]>*,html[data-visual-theme] .py-body[data-pv-tab=overview-slip]>*{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-tab=settings]>.py-card,html[data-visual-theme] .py-body[data-pv-tab=overview-slip]>.py-card{grid-column:auto}
html[data-visual-theme] .py-body[data-pv-tab=overview-slip]>.py-card:first-of-type,html[data-visual-theme] .py-body[data-pv-tab=overview-slip]>[data-pv-card=備註]{grid-column:1/-1}
/* 人員管理：左基本資料與身分時薪，右覆寫／獎金適用／分類（程式裡的順序也是先左後右） */
html[data-visual-theme] .py-body[data-pv-tab=staff]{grid-auto-flow:dense}
html[data-visual-theme] .py-body[data-pv-tab=staff]>.py-card{grid-column:2}
html[data-visual-theme] .py-body[data-pv-tab=staff]>[data-pv-card=基本資料],html[data-visual-theme] .py-body[data-pv-tab=staff]>[data-pv-card=個人身分時薪]{grid-column:1}
html[data-visual-theme] .py-body[data-pv-tab=staff]>[data-pv-card=基本資料]{grid-row:span 2}
html[data-visual-theme] .py-body[data-pv-tab=staff] .py-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
/* 制度設定各分類 */
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-items{grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-visual-theme] .py-body[data-pv-group=安親]>[data-pv-card=params],html[data-visual-theme] .py-body[data-pv-group=國中]>[data-pv-card=params]{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-group=安親]>[data-pv-card=params] .py-items{grid-template-columns:repeat(4,minmax(0,1fr))}
html[data-visual-theme] .py-body[data-pv-group=安親]>[data-pv-card=安親池]{grid-row:span 2}
html[data-visual-theme] .py-body[data-pv-group=國中]>[data-pv-card=國中科次累進]{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-group=新生]>[data-pv-card=params]{grid-row:span 2}
html[data-visual-theme] .py-body[data-pv-group=續班]>[data-pv-card=params],html[data-visual-theme] .py-body[data-pv-group=續班]>[data-pv-card=畢業排除月份]{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-group=續班]>[data-pv-card=params] .py-items{grid-template-columns:repeat(4,minmax(0,1fr))}
html[data-visual-theme] .py-body[data-pv-group=選用項目]>[data-pv-card=params]{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-group=選用項目]>[data-pv-card=params] .py-items{grid-auto-flow:dense;column-gap:40px}
html[data-visual-theme] .py-body[data-pv-group=選用項目]>[data-pv-card=params] .py-item:nth-child(-n+2){grid-column:1}
html[data-visual-theme] .py-body[data-pv-group=選用項目]>[data-pv-card=params] .py-item:nth-child(n+3){grid-column:2}
/* 每月輸入・個人資料：分區兩欄，三個備註橫排 */
html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px;align-items:start}
html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs>*{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs>.py-card{grid-column:auto}
html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs>.py-card:only-of-type,html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs>[data-pv-card=薪資單備註],html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs>[data-pv-card=新生名單]{grid-column:1/-1}
html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=person] .py-fs>.py-card .py-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr))}
html[data-visual-theme] [data-pv-card=薪資單備註]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 20px}
html[data-visual-theme] [data-pv-card=薪資單備註]>h3{grid-column:1/-1}
html[data-visual-theme] [data-pv-card=薪資單備註]>.py-wide{margin-top:0}
/* 共用資料：五個欄位 3＋2 */
html[data-visual-theme] .py-body[data-pv-tab=monthly][data-pv-section=shared] .py-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(min-width:1500px){
html[data-visual-theme] .py-body[data-pv-tab=settings][data-pv-group=美語]{grid-template-columns:repeat(3,minmax(0,1fr))}
html[data-visual-theme] .py-body[data-pv-tab=settings][data-pv-group=美語]>[data-pv-card=params]{grid-column:1/-1}
}
/* 薪資表格：文字靠左、金額與數值靠右（等寬數字） */
html[data-visual-theme] .py-table th,html[data-visual-theme] .py-table td{text-align:left}
html[data-visual-theme] .py-table td.py-num,html[data-visual-theme] .py-table th.py-num{text-align:right;font-variant-numeric:tabular-nums}
html[data-visual-theme] .py-body[data-pv-tab=overview] .py-table thead th:nth-child(n+3),html[data-visual-theme] .py-body[data-pv-tab=overview-slip] .py-table thead th:nth-child(2),html[data-visual-theme] .py-body[data-pv-tab=renew] [data-pv-card=本月已儲存的結果] thead th:nth-child(n+3){text-align:right}
html[data-visual-theme] .py-kpis strong.py-num{text-align:right}
/* 制度設定裡有固定語意的分區（要蓋過上面輪流的分區色） */
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card[data-pv-card=小班全續]>h3{background:var(--ui-section-2)}
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card[data-pv-card=大班流失單價]>h3{background:var(--ui-negative-bg)}
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card[data-pv-card=畢業排除月份]>h3{background:var(--ui-canvas)}
html[data-visual-theme] .py-body[data-pv-tab=settings] .py-card[data-pv-card=params]>h3{background:var(--ui-section-1)}
html[data-visual-theme] table.py-tier{min-width:0;table-layout:fixed;width:100%}
html[data-visual-theme] table.py-tier th:last-child,html[data-visual-theme] table.py-tier td:last-child{width:76px}
html[data-visual-theme] table.py-tier input{min-width:0;width:100%}
@media(min-width:1100px){
html[data-visual-theme] .py-body[data-pv-tab=overview-slip] .py-table{min-width:0}
}
