
:root{font-family:"Microsoft JhengHei","微軟正黑體",Arial,sans-serif;--navy:#12384d;--teal:#0b6473;--line:#dbe5eb;--muted:#64788b;--good:#187449;background:#f3f6f9;color:#203345}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;background:var(--teal);border:1px solid transparent;border-radius:8px;color:#fff;font-size:14px;font-weight:700;padding:9px 15px}button:hover:not(:disabled){filter:brightness(1.07)}button:disabled{opacity:.45;cursor:not-allowed}button.light{background:#e8eef2;color:#30536a}button.outline{background:white;border-color:#b8d1da;color:#145b6a}button.danger{background:#fff0ed;border-color:#e3b2aa;color:#a14340}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #71b9c4;outline-offset:2px}input,select{border:1px solid #c9d9e2;border-radius:8px;color:#203345;padding:9px 11px;background:white}input[readonly],input:disabled{background:#f2f5f7;color:#596e7f}.top{background:linear-gradient(112deg,#102f43,#0c6170);color:white;padding:26px max(28px,calc((100% - 1240px)/2));box-shadow:0 4px 18px #123d5722}.kicker{font-size:12px;letter-spacing:.1em;font-weight:700;opacity:.87}.top h1{font-size:25px;line-height:1.4;margin:8px 0 6px}.top p{opacity:.88;font-size:12px;margin:0}.wrap{max-width:1280px;margin:auto;padding:20px 24px 46px}.note{padding:12px 15px;background:#fff8e8;border:1px solid #eacb88;border-radius:10px;color:#77551b;font-size:12px;line-height:1.8;margin:0 0 16px}.layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:16px;align-items:start}.box{background:#fff;border:1px solid var(--line);border-radius:14px;padding:19px 21px;box-shadow:0 3px 14px #17394e0a;min-width:0}.section-title{font-size:24px;color:var(--navy);line-height:1.4;font-weight:800;margin:0}.sidebar{position:sticky;top:12px;height:var(--aside-height,500px);min-height:340px;display:flex;flex-direction:column;overflow:hidden}.sidebar-head{display:flex;gap:9px;align-items:center;justify-content:space-between;flex:none}.sidebar-head .group{display:flex;align-items:center;gap:5px}.sidebar-head button{white-space:nowrap}.sidebar-head #newBatch{font-size:16px;padding:7px 13px}.sidebar-head #sortBatch{font-size:12px;padding:8px 9px}.small{font-size:12px;color:var(--muted);line-height:1.6}.sidebar .small{margin:7px 0 10px;flex:none}#list{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1 1 auto;overflow-y:auto;padding-right:5px;scrollbar-color:#b4cbd4 #f5f8fa;overscroll-behavior:contain}.item{border:1px solid #e7edf0;border-radius:10px;background:#fff;padding:12px 13px;cursor:pointer}.item.draft{background:#fffbf2;border-color:#f1e1c4}.item.published{background:#f2faf6;border-color:#d2eadd}.item.ended{background:#f4f6f8;border-color:#dce4ec}.item.selected{background:#eaf5f7;border-color:#7fb8c2;box-shadow:inset 0 0 0 1px #7fb8c2}.item:hover{box-shadow:0 2px 9px #17394e18}.item:focus-visible{outline:3px solid #d4a74b;outline-offset:2px}.item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:7px}.item-name{font-size:14px;font-weight:750;color:#183c50;overflow-wrap:anywhere}.pill{font-size:11px;border-radius:999px;padding:4px 8px;white-space:nowrap;font-weight:750;flex:none}.pill.draft{background:#fff0d0;color:#82540c}.pill.published{background:#dbf1e5;color:#156b44}.pill.ended{background:#e4eaf0;color:#506277}.item small{display:block;font-size:11px;color:#667b8c;margin-top:5px;line-height:1.55}.item-progress{margin-top:7px;font-size:12px;color:#365d67}.item-progress .sep{margin:0 6px;color:#96a9b6}.sidebar-actions{flex:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;border-top:1px solid #e2e9ee;margin-top:12px;padding-top:12px}.sidebar-actions button{font-size:12.5px;padding:10px 3px;min-width:0;white-space:nowrap}.row-head{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-bottom:18px}.field-head{display:flex;align-items:center;justify-content:space-between;gap:9px;margin:5px 0 7px}.field-title{font-size:18px;font-weight:780;color:#213e51}.field-head #editName{font-size:15px}.name-field{width:100%;font-size:18px;padding:10px 12px;margin-bottom:3px}.info-line{margin:4px 0 18px;font-size:12px;color:#5c7688}.mode-options{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.mode-option{position:relative;display:inline-flex;cursor:pointer}.mode-option input{position:absolute;opacity:0;width:1px;height:1px;margin:0}.mode-option span{padding:9px 15px;border-radius:8px;border:1px solid #c9d9df;background:#edf3f6;color:#2b5064;font-size:16px;font-weight:700;display:block}.mode-option input:checked+span{background:#0b6473;color:white;border-color:#0b6473}.mode-option input:disabled+span{opacity:.8;cursor:default}.mode-option input:focus-visible+span{outline:3px solid #d8a648}.target-box{background:#f5f9fb;border:1px solid #dbe8ed;border-radius:9px;padding:13px;margin:11px 0}.target-box[hidden]{display:none!important}.target-box strong{font-size:18px}.target-box p{font-size:12px;color:#64788b;margin:5px 0 9px}.dept-toolbar{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:9px 0}.dept-toolbar button{font-size:12px;padding:6px 10px}.dept-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:8px}.dept-check{display:flex;align-items:center;gap:9px;padding:9px;border:1px solid #d9e7ed;border-radius:7px;background:#fff;font-size:18px;cursor:pointer}.dept-check input{width:19px;height:19px;margin:0;accent-color:#116478}.dept-check:has(input:checked){background:#e7f5f1;border-color:#83b5ab}.dept-check:has(input:disabled){cursor:default}.id-field{display:block;width:100%;font-size:18px;margin:7px 0 9px}.xlsx-import{border:1px solid #d4e8e8;background:#f1f8f8;border-radius:8px;padding:12px}.xlsx-import input[type=file]{width:100%;font-size:13px;background:white}.xlsx-import[hidden]{display:none!important}#xlsxSelected{font-weight:700;color:#126079}.cutoff-row{display:flex;align-items:center;gap:13px;flex-wrap:wrap}.cutoff-row input{font-size:17px;max-width:205px}.helper{font-size:12px;color:#536d7d;line-height:1.7}.footer-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding-top:15px;margin-top:15px;border-top:1px solid #e6eef1}.footer-actions button{font-size:15px;padding:10px 15px}.status{padding:12px;background:#f0f6f8;border-left:3px solid #83aab8;border-radius:7px;color:#365466;font-size:12px;line-height:1.7;margin:14px 0;min-height:44px}.detail{margin-top:17px}.detail-header{display:flex;justify-content:space-between;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:10px}.detail-title{font-size:20px;color:var(--navy);font-weight:800;margin:0}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:nowrap;margin:11px 0 8px}.tabs{display:flex;gap:6px;flex:none}.tab{font-size:12px;border:1px solid #cbdce4;background:#fff;color:#376273;border-radius:18px;padding:7px 11px}.tab.active{background:#0d6573;color:white;border-color:#0d6573}.divider{width:1px;flex:none;height:33px;background:#cfdbe1}.filters{display:flex;gap:7px;align-items:center;min-width:0;flex:1 1 auto}.filters label{white-space:nowrap;font-size:12px;font-weight:700}.filters input{width:100px;min-width:85px;flex:1 1 auto;height:36px;font-size:12px}.filters select{width:110px;max-width:110px;min-width:85px;height:36px;font-size:12px}.filters button{font-size:12px;padding:8px 10px;white-space:nowrap}.export-button{background:#087967;font-size:12px;height:36px;white-space:nowrap;flex:none;padding:8px 10px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:9px}table{width:100%;border-collapse:collapse;min-width:720px;font-size:12px}th{background:#edf3f7;color:#39556b;padding:10px 11px;text-align:left;white-space:nowrap}td{padding:10px 11px;border-top:1px solid #e6eef1;color:#334b5d}tbody tr:nth-child(even){background:#fcfdfe}.yes{color:#187449;font-weight:700}.no{color:#a06936;font-weight:700}.warning{color:#996037;font-weight:700}#detailCount{margin:10px 0;color:#64788b;font-size:12px}.foot{margin:17px 0;color:#64788b;font-size:11px}.dialog{border:1px solid #b6ccd5;border-radius:14px;padding:22px 24px;max-width:450px;width:calc(100% - 40px);box-shadow:0 16px 60px #12384d42}.dialog::backdrop{background:#09263588}.dialog h3{font-size:20px;margin:0 0 11px;color:var(--navy)}.dialog p{font-size:13px;line-height:1.6;color:#546b7b}.dialog-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}
@media(max-width:1070px){.toolbar{flex-wrap:wrap}.filters{flex:1 1 100%;order:2}.toolbar .divider{display:none}.export-button{margin-left:auto}}
@media(max-width:850px){.layout{grid-template-columns:1fr}.sidebar{position:static;height:min(56dvh,480px);min-height:320px}.wrap{padding:15px 12px}.top{padding:22px 15px}.section-title{font-size:22px}}
@media(max-width:600px){.sidebar-head{flex-wrap:wrap}.tabs{flex-wrap:wrap}.filters{flex-wrap:wrap}.filters input{min-width:100px}.top h1{font-size:22px}}

/* v0.2.9: preserve B1 visual baseline while clarifying name-only editing. */
.mode-description{font-size:18px!important;color:#314f62!important;line-height:1.7;margin:6px 0 2px}
.number-highlight{display:inline-block;padding:2px 11px;background:#d9f0e5;color:#145b45;border-radius:7px;font-size:19px;white-space:nowrap}
.table-wrap table{font-size:16px}.table-wrap th,.table-wrap td{font-size:16px;line-height:1.5;padding:10px 12px}
.name-field:disabled{background:#f0f4f6;border-color:#dae3e8;color:#53687a;opacity:1;cursor:not-allowed}
#editName:focus-visible{outline:3px solid #d7b057}
/* v0.2.11 acceptance controls */
.summary-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:12px 0 10px}
.summary-cell{border:1px solid #d4e4eb;background:#edf6fa;border-radius:9px;padding:8px 3px;text-align:center;min-width:0}
.summary-cell:nth-child(2){background:#eef7f0;border-color:#cde7d9}.summary-cell:nth-child(3){background:#f4f0fb;border-color:#e3d9f2}
.summary-cell strong{font-size:clamp(13px,1.3vw,18px);display:block;white-space:nowrap;color:#0c5262}
.summary-cell span{display:block;font-size:11px;font-weight:700;color:#5e7384;white-space:nowrap}
.only-incomplete{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:700;color:#315166;margin:3px 0 7px;cursor:pointer}
.only-incomplete input{width:17px;height:17px;accent-color:#0b6473}
.sidebar .only-incomplete{flex:none}.sidebar .summary-strip{flex:none}
.name-head{justify-content:flex-start}.name-head #editName{font-size:15px;padding:6px 11px}
.selection-summary{margin:12px 0 0;padding:8px 12px;border-radius:8px;background:#f4f8fa;color:#315266;font-size:15px;font-weight:700}
.selection-summary .number-highlight{font-size:16px;padding:1px 8px}
.create-batch-button{background:#e4f3ee!important;color:#096251!important;border-color:#b6d9ca!important;font-size:12px!important;height:36px;white-space:nowrap;flex:none;padding:7px 11px!important}
.dialog-actions button{font-size:13px}.dialog-actions button.danger{color:#a14340}
@media(max-width:900px){.sidebar .summary-strip{gap:4px}.summary-cell span{font-size:10px}}

/* v0.2.11: consistent compact layout; do not change the accepted B1 reference. */
.sidebar-head #newBatch,.sidebar-head #sortBatch{font-size:12px;padding:8px 9px;line-height:1.35;min-height:34px}
.name-head{display:flex;align-items:center;gap:9px;margin-bottom:8px;flex-wrap:wrap}
.name-head .info-line{margin:0 0 0 auto;text-align:right;flex:1 1 auto;font-size:12px;line-height:1.5}
.name-field{margin-bottom:12px}
.dept-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.dept-heading .dept-toolbar{display:flex;gap:6px;align-items:center;margin:0 0 0 auto}
.dept-description{margin:5px 0 10px!important;font-size:12px!important;color:#64788b}
.dept-description #deptCount{font-weight:700;color:#305f70}
.ids-heading{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.ids-heading .helper{flex:1 1 160px;line-height:1.5}
.ids-heading .xlsx-import{background:transparent;padding:0;border:0;display:inline-flex;flex:none}
.ids-heading .xlsx-import button{font-size:14px;padding:8px 12px}
.xlsx-feedback{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.xlsx-feedback .helper:empty{display:none}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
/* v0.2.12: keep department actions beside the count without adding an extra toolbar row. */
.dept-description{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:nowrap;min-height:24px;margin:5px 0 10px!important}
.dept-description .dept-details{min-width:0;flex:1 1 auto;line-height:1.45}
.dept-description .dept-toolbar{display:flex;align-items:center;gap:5px;flex:0 0 auto;margin:0}
.dept-description .dept-toolbar button{padding:4px 8px;font-size:12px;line-height:1.2;min-height:24px;white-space:nowrap}
@media(max-width:540px){.dept-description{flex-wrap:wrap}.dept-description .dept-toolbar{margin-left:auto}}
.excel-preview{display:block;width:100%;height:154px;margin-top:8px;resize:vertical;font-family:Consolas,Arial,sans-serif;font-size:13px;line-height:1.7;white-space:pre-wrap;background:#f8fbfc}
.excel-dialog .dialog-actions{justify-content:flex-end}
.excel-dialog .dialog-actions #excelCancel{order:2}
.excel-dialog .dialog-actions #excelApply{order:1}

[hidden]{display:none!important}
.auth-gate{max-width:1160px;margin:20px auto 0;padding:14px 18px;background:#fff;border:1px solid #cfe0e7;border-radius:12px;box-shadow:0 4px 18px #0e2f4112}
.auth-gate .auth-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:9px}
.auth-gate .auth-link{display:inline-block;background:#0b6473;color:white;text-decoration:none;border-radius:8px;padding:9px 14px;font-weight:700}
.auth-gate .auth-status{color:#344f60;font-size:15px}
.auth-gate .sub-token{font-size:12px;overflow-wrap:anywhere;color:#61778b}
