:root {
  color-scheme: light;
  --ink: #17202d;
  --muted: #657083;
  --line: #dfe4eb;
  --paper: #ffffff;
  --canvas: #f3f6f9;
  --navy: #173b5f;
  --navy-2: #0f2d49;
  --teal: #147d75;
  --teal-soft: #e7f5f2;
  --amber: #9a6400;
  --amber-soft: #fff5dc;
  --red: #ae3c3c;
  --red-soft: #fff0f0;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
.visually-hidden { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 86px; padding: 18px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; gap: 14px; color: white; background: linear-gradient(115deg, var(--navy-2), var(--navy)); box-shadow: 0 2px 12px #173b5f33; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #ffffff55; border-radius: 14px; background: #ffffff14; font-size: 1.35rem; font-weight: 800; }
h1 { margin: 0; font-size: 1.38rem; letter-spacing: .04em; }
.topbar p { margin: 5px 0 0; color: #d9e5ef; font-size: .88rem; }
.shell { width: min(1240px, calc(100% - 32px)); margin: 28px auto 48px; }
.upload-card { min-height: 120px; padding: 24px 28px; display: flex; align-items: center; gap: 18px; border: 1.5px dashed #9aaabd; border-radius: 18px; background: var(--paper); transition: .2s ease; }
.upload-card.dragging { border-color: var(--teal); background: #f3fbf9; transform: translateY(-1px); }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: var(--teal); background: var(--teal-soft); }
.upload-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-copy { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.upload-copy strong { font-size: 1.08rem; }
.upload-copy span, .panel p { color: var(--muted); font-size: .88rem; }
.primary, .ghost { min-height: 42px; border-radius: 10px; padding: 0 17px; border: 0; font-weight: 700; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: white; background: var(--teal); box-shadow: 0 5px 14px #147d7529; }
.primary:hover { background: #0f6b64; }
.primary:disabled { cursor: not-allowed; opacity: .45; }
.primary svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ghost { color: var(--navy); background: #edf2f7; }
.secondary { min-height: 42px; padding: 0 17px; border: 1px solid #b7c8d8; border-radius: 10px; color: var(--navy); background: white; font-weight: 700; }
.secondary:hover { border-color: var(--teal); color: var(--teal); background: #f5fbfa; }
.panel-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.adjunct-import { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-left: 4px solid var(--teal); }
.adjunct-copy { display: flex; align-items: center; gap: 14px; min-width: 0; }
.adjunct-copy h2 { margin-bottom: 4px; }
.adjunct-copy p { margin: 0; line-height: 1.5; }
.file-kind { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #087168; background: var(--teal-soft); font-size: .68rem; font-weight: 900; letter-spacing: .04em; }
.file-kind.blue { color: var(--navy); background: #e8f0f7; }
.supplement-import { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1.5px dashed #9fb1c4; transition: .2s ease; }
.supplement-import:hover, .supplement-import:focus-visible, .supplement-import.dragging { border-color: var(--teal); background: #f4fbfa; outline: none; }
.supplement-import.dragging { transform: translateY(-1px); box-shadow: 0 8px 22px #147d7517; }
.supplement-copy { display: flex; align-items: center; gap: 14px; min-width: 0; }
.supplement-copy h2 { margin-bottom: 4px; }
.supplement-copy p { margin: 0; line-height: 1.5; }
.adjunct-import > .secondary, .supplement-import > .secondary { width: 196px; min-height: 44px; flex: 0 0 196px; padding-inline: 12px; }
.notice { margin: 16px 0; padding: 14px 17px; border: 1px solid #eed59c; border-radius: 12px; color: #714d09; background: var(--amber-soft); line-height: 1.55; }
.summary-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.summary-grid article { padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 3px 12px #15243b0a; }
.summary-grid span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .82rem; }
.summary-grid strong { font-size: 1.65rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 4px 18px #15243b0b; }
.filters { padding: 20px; }
.panel-head, .table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { margin: 0; font-size: 1.08rem; }
.panel p { margin: 5px 0 0; }
.filter-row { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 14px; }
label > span { display: block; margin: 0 0 7px 2px; color: #465263; font-size: .84rem; font-weight: 700; }
select, input[type="search"] { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #cfd7e2; border-radius: 10px; color: var(--ink); background: white; outline: none; }
select:focus, input[type="search"]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #147d7520; }
.table-panel { overflow: hidden; }
.table-toolbar { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.result-copy { display: flex; align-items: baseline; gap: 10px; }
.result-copy span { color: var(--muted); font-size: .83rem; }
.table-scroll { overflow: auto; max-height: 560px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; text-align: left; color: #536073; background: #f6f8fa; border-bottom: 1px solid var(--line); font-size: .79rem; letter-spacing: .03em; }
td { padding: 13px 14px; border-bottom: 1px solid #ebeff4; font-size: .9rem; vertical-align: middle; }
tbody tr:hover { background: #f8fbfc; }
.check { width: 44px; text-align: center; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--teal); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .87rem; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge.teal { color: #08665f; background: var(--teal-soft); }
.badge.navy { color: var(--navy); background: #e8f0f7; }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.gray { color: #596576; background: #edf0f4; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .81rem; }
.status::before { width: 7px; height: 7px; content: ""; border-radius: 50%; background: #24a16f; }
.status.issue::before { background: #d48a17; }
.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
footer { padding: 0 16px 28px; text-align: center; color: #7b8696; font-size: .78rem; }
@media (max-width: 760px) {
  .topbar { padding: 16px; }
  .topbar p { display: none; }
  .shell { width: min(100% - 20px, 1240px); margin-top: 16px; }
  .upload-card { padding: 20px; flex-wrap: wrap; }
  .upload-copy { min-width: calc(100% - 75px); }
  .upload-card .primary { width: 100%; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-grid article { padding: 14px; }
  .filter-row { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; }
  .panel-actions { width: 100%; justify-content: stretch; }
  .panel-actions button { flex: 1; }
  .adjunct-import { align-items: stretch; flex-direction: column; }
  .adjunct-import .secondary { width: 100%; }
  .adjunct-import > .secondary { flex: 0 0 auto; }
  .supplement-import { align-items: stretch; flex-direction: column; }
  .supplement-import .secondary { width: 100%; }
  .supplement-import > .secondary { flex: 0 0 auto; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-toolbar .primary { width: 100%; }
}
