:root {
  color-scheme: light;
  --ink: #142c30;
  --muted: #617478;
  --canvas: #f1f5f3;
  --paper: #fff;
  --line: #dee8e4;
  --brand: #124443;
  --deep: #102e32;
  --accent: #17685a;
  --accent-soft: #e8f3eb;
  --danger: #a92c3a;
  --warning: #8d531a;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--canvas); margin: 0; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button, input[type=checkbox], input[type=radio], summary, a { cursor: pointer; }
button:disabled, input:disabled, select:disabled { opacity: .48; cursor: default; }
a { color: inherit; text-decoration: none; }
input, select, textarea { min-width: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); flex: 0 0 auto; width: 16px; height: 16px; margin: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  background: #fff; border: 1px solid #cbdad4; border-radius: 8px; padding: .68rem .78rem;
}
input::placeholder, textarea::placeholder { color: #819193; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid #168a71; outline-offset: 3px;
}
h1, h2, p { margin: 0; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0,1fr); }
.sidebar { background: var(--deep); color: #eef7f4; min-height: 100vh; padding: 30px 18px; }
.branding, .login-brand { display: flex; align-items: center; gap: 12px; letter-spacing: .07em; }
.branding { padding: 0 11px; width: max-content; }
.branding strong, .login-brand > span:last-child { font-size: 1.02rem; font-weight: 760; }
.branding small, .login-brand small { font-size: .66rem; letter-spacing: .22em; color: #9dc7be; display: block; margin-top: 4px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; font-weight: 850; border-radius: 11px; background: #dceee5; color: #154940; letter-spacing: -.06em; }
.nav-label { margin: 58px 11px 13px; color: #afcbc8; font-size: .78rem; font-weight: 700; letter-spacing: .08em; }
.workspace-nav { display: grid; gap: 5px; }
.workspace-nav a { display: flex; min-height: 43px; align-items: center; border-radius: 8px; padding: 8px 12px; gap: 11px; color: #d9e9e5; }
.workspace-nav a:hover { background: #1a4144; }
.workspace-nav a[aria-current=page] { background: #dceee5; color: #124539; font-weight: 740; }
.nav-icon { width: 17px; height: 17px; position: relative; display: inline-block; flex: 0 0 auto; }
.nav-icon.paper { border: 1.5px solid currentColor; border-radius: 3px; width: 13px; margin: 0 2px; }
.nav-icon.paper::after { content: ""; position: absolute; inset: 5px 2px 3px; border: solid currentColor; border-width: 1px 0; }
.nav-icon.plus { border: 1.5px solid currentColor; border-radius: 4px; }
.nav-icon.plus::before, .nav-icon.plus::after { content: ""; position: absolute; background: currentColor; left: 3px; right: 3px; height: 1.5px; top: 6px; }
.nav-icon.plus::after { rotate: 90deg; }
.nav-icon.check { border: 1.5px solid currentColor; border-radius: 50%; }
.nav-icon.check::before { content: ""; position: absolute; width: 6px; height: 4px; border: solid currentColor; border-width: 0 0 1.6px 1.6px; top: 3.2px; left: 3.1px; rotate: -45deg; }
.nav-icon.convert::after { content: "⇄"; position: absolute; inset: -5px 0 auto; font-size: 20px; font-weight: 800; }
.workspace { min-width: 0; }
.topbar { min-height: 59px; padding: 0 clamp(20px, 4vw, 54px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: #fbfdfc; font-size: .86rem; font-weight: 680; }
.topbar form { margin: 0; }
.main-content { width: min(100%, 1130px); margin: 0 auto; padding: 34px clamp(20px, 4vw, 54px) 55px; }
.page-heading { padding: 0 0 24px; }
.page-heading h1 { font-weight: 800; font-size: clamp(1.85rem, 4vw, 2.55rem); letter-spacing: -.055em; }
.page-heading p { margin-top: 8px; line-height: 1.65; color: var(--muted); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 15px; padding: clamp(15px, 2.5vw, 25px); box-shadow: 0 1px 2px #183e3910; }
.panel h2 { font-size: 1.05rem; font-weight: 760; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.segmented { display: flex; background: #eff4f1; border: 1px solid #e3ebe7; border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 6px 12px; font-size: .86rem; white-space: nowrap; }
.segmented button[aria-pressed=true] { color: var(--brand); box-shadow: 0 1px 3px #12333421; background: white; font-weight: 720; }
.field-label, .login-card label { display: block; font-size: .88rem; font-weight: 700; margin-bottom: 7px; }
.path-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.button { min-height: 41px; border-radius: 8px; white-space: nowrap; padding: 8px 17px; font-weight: 680; border: 1px solid transparent; }
.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.primary:not(:disabled):hover { background: #186258; }
.secondary:not(.primary) { background: #f7fbf9; border-color: #c7dbd4; color: #17483d; }
.secondary:not(.primary):not(:disabled):hover { background: #e9f2ed; }
.quiet { padding: .25rem .15rem; color: var(--accent); background: none; border: 0; font-weight: 670; font-size: .9rem; }
.quiet:not(:disabled):hover, .result-link:hover { text-decoration: underline; }
.logout { color: var(--muted); }
.file-upload { display: grid; gap: 7px; padding: 21px; background: #f7faf8; border: 1px dashed #a9c2b8; border-radius: 9px; cursor: pointer; }
.file-upload span, .support, .source-message { color: var(--muted); font-size: .83rem; line-height: 1.55; }
.file-upload input { margin-top: 5px; max-width: 100%; }
input[type=file]::file-selector-button { background: #e4f0e9; color: #17483d; border: 0; border-radius: 5px; padding: 7px 11px; font-weight: 650; margin-right: 8px; cursor: pointer; }
.folder-location { display: flex; align-items: center; gap: 10px; margin: 11px 0 0; font-size: .82rem; color: var(--muted); }
.folder-location .quiet { white-space: nowrap; }
#folder-current { overflow-wrap: anywhere; }
.file-list { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 370px; }
.file-header { padding: 10px 13px; background: #edf4f0; font-size: .82rem; }
.file-header label { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 13px; min-height: 42px; }
.file-row:not(:last-child) { border-bottom: 1px solid #e9efec; }
.file-row small { color: var(--muted); white-space: nowrap; }
.file-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.file-symbol { background: #edf6ef; width: 13px; height: 16px; border: 1px solid #9dbaaa; border-radius: 2px; flex: 0 0 auto; }
.folder-button { background: none; border: 0; padding: 1px 0; display: inline-flex; align-items: center; gap: 10px; text-align: left; font-weight: 700; font-size: .87rem; color: var(--brand); }
.folder-button::before { content: ""; display: inline-block; width: 16px; height: 12px; background: #d7e9dc; border: 1px solid #9ab9a3; border-radius: 3px; }
.folder-button:hover { text-decoration: underline; }
.classification { flex: 0 0 auto; width: min(43%, 172px); font-size: .81rem; padding: 4px 7px; }
.empty { padding: 15px; color: var(--muted); }
.source-message { margin-top: 10px; }
.source-message:empty { display: none; }
.choices { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 13px 0 0; border: 0; padding: 0; }
.choices label { display: flex; align-items: center; gap: 7px; }
.check-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.type-option { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; min-height: 37px; padding: 6px 8px; line-height: 1.3; font-size: .85rem; }
.type-option:has(:checked) { background: var(--accent-soft); border-color: #b3d2c4; }
.type-option small { margin-left: auto; color: var(--muted); font-size: .69rem; }
.draft-panel .support { padding-top: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 10px; margin-top: 15px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: .83rem; font-weight: 680; }
.form-grid input { width: 100%; font-weight: 400; }
.form-details { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
.form-details summary, .evidence summary { font-weight: 700; font-size: .88rem; color: var(--brand); }
.form-details .field-label { margin-top: 12px; }
.form-details textarea { width: 100%; resize: vertical; }
.original-row { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.original-row > input { max-width: 100%; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin: 16px 0; }
.selection-summary { margin-right: auto; color: var(--muted); font-size: .86rem; }
.alert { padding: 12px 14px; border: 1px solid #c6ddd3; color: #124938; background: #e7f3ec; border-radius: 7px; margin: 10px 0 15px; font-size: .91rem; }
.alert.error { border-color: #efc3c5; background: #fff0f0; color: var(--danger); }
.pill { border-radius: 999px; padding: .24rem .56rem; background: #eaf0ef; color: #436562; font-size: .73rem; font-weight: 750; white-space: nowrap; }
.pill.saved, .pill.ready, .pill.matched, .pill.found { color: #176048; background: #e1f0e5; }
.pill.error, .pill.mismatch { color: var(--danger); background: #fae9e9; }
.pill.pending, .pill.needs_review, .pill.missing, .pill.ambiguous { color: var(--warning); background: #fcf0df; }
.result-row, .evidence-row, .note-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.result-name { display: flex; gap: 8px; align-items: baseline; font-size: .9rem; overflow-wrap: anywhere; }
.result-description { min-width: 0; }
.result-description p { color: var(--muted); font-size: .83rem; margin-top: 6px; line-height: 1.5; }
.result-links, #result-actions { display: flex; gap: 11px; align-items: center; font-size: .84rem; }
.result-link { color: var(--accent); font-weight: 720; white-space: nowrap; }
.evidence { border-top: 1px solid var(--line); padding: 9px 0; }
.evidence summary .pill { margin: 0 6px; }
.evidence summary > span:last-child { color: var(--muted); margin-left: 9px; font-weight: 400; }
.evidence-row { flex-wrap: wrap; margin-left: 17px; font-size: .83rem; }
.evidence-row:first-of-type { margin-top: 11px; }
.evidence-row span, .note-row span { color: var(--muted); overflow-wrap: anywhere; }
.audit-notes { margin-top: 7px; }
.note-row { flex-wrap: wrap; font-size: .8rem; }
.note-row strong { overflow-wrap: anywhere; }
.login-page { min-height: 100vh; background: radial-gradient(ellipse at 75% 0%, #275451 0, #102e32 63%); display: grid; place-items: center; padding: 18px; }
.login-shell { width: min(100%, 420px); }
.login-brand { color: white; margin: 0 0 14px 2px; }
.login-card { background: white; border-radius: 14px; box-shadow: 0 24px 70px #0a25277a; padding: 29px; }
.login-card h1 { font-size: 1.64rem; margin-bottom: 8px; }
.login-card p { color: var(--muted); line-height: 1.55; font-size: .9rem; }
.login-card form { margin-top: 22px; }
.login-card input, .login-card .button { width: 100%; }
.login-card .button { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { min-height: 0; padding: 12px 12px 9px; }
  .branding { padding: 0 4px 10px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 8px; }
  .nav-label { display: none; }
  .workspace-nav { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; }
  .workspace-nav a { justify-content: center; gap: 5px; padding: 6px 3px; min-height: 35px; font-size: clamp(.73rem, 2.8vw, .9rem); white-space: nowrap; }
  .nav-icon { display: none; }
  .topbar { min-height: 39px; padding-inline: 15px; }
  .main-content { padding: 22px 13px 33px; }
}
@media (max-width: 510px) {
  .check-grid, .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel-heading { gap: 5px; }
  .segmented button { padding: 6px 7px; font-size: .76rem; }
  .actions { flex-wrap: wrap; }
  .selection-summary { flex-basis: 100%; margin: 0; text-align: right; }
  .button { padding-inline: 10px; }
  .result-row { flex-direction: column; }
  .result-links { justify-content: flex-end; }
  .evidence summary > span:last-child { display: block; margin: 5px 0 0 18px; }
  .file-row { padding-inline: 8px; gap: 5px; }
  .file-name { gap: 5px; }
}
