:root {
  color-scheme: light;
  --canvas: #f4f7fb;
  --surface: #fff;
  --ink: #1c2a43;
  --muted: #59677c;
  --border: #dce5f0;
  --rule: #e9eef5;
  --accent: #3458cc;
  --accent-dark: #2846a9;
  --accent-bg: #eaf0ff;
  --green: #206247;
  --green-bg: #e7f2ec;
  --amber: #835018;
  --amber-bg: #fff1da;
  --red: #a33339;
  --red-bg: #fbeaea;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.55 "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3.1vw, 36px); line-height: 1.25; letter-spacing: -.045em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid #526cda; outline-offset: 2px; }
[hidden] { display: none !important; }
.muted, .subtle { color: var(--muted); }
.subtle { font-size: 12px; }
.nowrap { white-space: nowrap; }
.break-anywhere { overflow-wrap: anywhere; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 9px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 15px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pad { padding: 17px; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 3; padding: 10px 14px; border-radius: 7px; background: var(--ink); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.action { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 650; text-align: center; }
.action:hover { text-decoration: none; background: #f4f7fb; border-color: #b8c8df; }
.action.primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.action.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.action.small { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.action:disabled { cursor: wait; opacity: .75; }
.action-inline { display: inline-flex; align-items: center; min-height: 32px; font-weight: 650; }
.pill { display: inline-flex; flex: none; align-items: center; gap: 6px; border-radius: 6px; padding: 3px 8px; background: #edf1f7; color: #43516a; font-size: 12px; font-weight: 650; }
.pill.status { border-radius: 24px; white-space: nowrap; }
.pill.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.pill.ready, .pill.completed, .pill.success { background: var(--green-bg); color: var(--green); }
.pill.review, .pill.needs_review, .pill.warning { background: var(--amber-bg); color: var(--amber); }
.pill.failed, .pill.error { background: var(--red-bg); color: var(--red); }
.pill.queued, .pill.waiting, .pill.pending, .pill.running { background: var(--accent-bg); color: var(--accent-dark); }
.ico { width: 16px; height: 16px; position: relative; display: inline-block; flex: none; vertical-align: middle; }
.ico.doc { border: 1.5px solid; border-radius: 3px; width: 14px; height: 17px; }
.ico.doc::after, .logo span::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1.3px; background: currentColor; box-shadow: 0 4px currentColor; }
.ico.grid { border: 1.5px solid; border-radius: 3px; }
.ico.grid::before { content: ""; display: block; height: 100%; width: 50%; border-right: 1.5px solid; }
.ico.grid::after { content: ""; position: absolute; inset: 0 0 50%; border-bottom: 1.5px solid; }
.ico.check { border: 1.5px solid; border-radius: 100%; }
.ico.check::after { content: ""; width: 6px; height: 3px; transform: rotate(-47deg); border-left: 1.5px solid; border-bottom: 1.5px solid; position: absolute; top: 3px; left: 3px; }
.ico.upload { border: solid; border-width: 0 1.5px 1.5px; height: 10px; border-radius: 0 0 3px 3px; margin-top: 5px; }
.ico.upload::after { content: ""; display: block; width: 6px; height: 6px; border-left: 1.5px solid; border-top: 1.5px solid; transform: rotate(45deg); position: absolute; left: 3px; top: -5px; }
.ico.upload::before { content: ""; position: absolute; left: 6px; top: -5px; height: 8px; width: 1.5px; background: currentColor; }
.ico.search { width: 13px; height: 13px; border: 1.5px solid; border-radius: 100%; margin-right: 4px; }
.ico.search::after { content: ""; position: absolute; width: 5px; height: 1.5px; transform: rotate(45deg); right: -4px; bottom: -2px; background: currentColor; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; font-weight: 800; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: #fff; border-radius: 9px; }
.logo span { width: 15px; height: 18px; border: 1.6px solid; border-radius: 3px; position: relative; }
.shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; align-self: start; height: 100vh; padding: 23px 16px 15px; background: var(--surface); border-right: 1px solid var(--border); }
.sidebar .brand { margin: 0 7px 25px; }
.nav-label { padding: 4px 12px; margin-bottom: 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 43px; margin-bottom: 4px; padding: 7px 11px; border-radius: 8px; color: #45546e; font-weight: 650; white-space: nowrap; }
.nav-item:hover { background: #f4f7fb; text-decoration: none; }
.nav-item.active { background: var(--accent-bg); color: var(--accent-dark); }
.nav-count { display: inline-grid; place-items: center; margin-left: auto; min-width: 20px; padding: 0 4px; border-radius: 4px; background: #e9edf5; color: #46536c; font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 14px 3px 0; }
.sidebar-foot form { margin-left: auto; }
.sidebar-foot .identity { min-width: 0; flex: 1; }
.sidebar-foot .identity strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--accent-bg); color: var(--accent-dark); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 800; }
.avatar.account { background: #e7f0ee; color: #2c5959; }
.content { min-width: 0; padding: 0 clamp(14px, 2.2vw, 32px) 26px; }
.topbar { min-height: 66px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); }
.page-head { align-items: flex-end; margin-bottom: 20px; }
.page-head p { margin-top: 7px; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.messages { display: grid; gap: 8px; padding: 0; margin: 0 0 17px; list-style: none; }
.message { padding: 9px 12px; border: 1px solid #cbd9f6; border-radius: 8px; color: var(--accent-dark); background: var(--accent-bg); }
.message.success { color: var(--green); background: var(--green-bg); border-color: #c5dfcf; }
.message.error { color: var(--red); background: var(--red-bg); border-color: #e8c5c8; }
.message.warning { color: var(--amber); background: var(--amber-bg); border-color: #edd8b7; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metric { padding: 12px 14px; }
.metric-label { display: flex; align-items: center; gap: 7px; color: #4b5b72; font-weight: 650; }
.metric-label::before { width: 7px; height: 7px; border-radius: 50%; background: var(--metric-dot, #526dd2); content: ""; }
.metric.green { --metric-dot: #2b795e; }
.metric.amber { --metric-dot: #a56629; }
.metric-value { color: var(--ink); font: 650 35px/1.15 "Bahnschrift", "Segoe UI", sans-serif; margin: 5px 0 3px; }
.batch { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(135px, 210px); align-items: center; gap: 13px; padding: 11px 14px; margin-bottom: 15px; border-color: #dce6fe; background: #edf3ff; }
.batch .subtle { margin-top: 2px; }
.batch progress { display: block; width: 100%; height: 6px; margin-top: 5px; appearance: none; accent-color: var(--accent); border: none; border-radius: 8px; background: #dbe5fc; }
.batch progress::-webkit-progress-bar { background: #dbe5fc; border-radius: 8px; }
.batch progress::-webkit-progress-value { background: #526fd4; border-radius: 8px; }
.batch progress::-moz-progress-bar { background: #526fd4; border-radius: 8px; }
.panel.upload { margin-bottom: 15px; padding: 0 14px; scroll-margin-top: 14px; }
.panel.upload summary { min-height: 42px; padding: 10px 0; cursor: pointer; font-weight: 700; }
.panel.upload[open] { border-color: #c2d2fa; }
.panel.upload[open] summary { border-bottom: 1px solid var(--rule); }
.upload-form { padding: 13px 0 15px; }
.file-selection { overflow-wrap: anywhere; margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field, .field label { min-width: 0; }
.field label, .field-label { display: block; margin-bottom: 4px; color: #394964; font-size: 13px; font-weight: 650; }
.field input, .field select, .field textarea, .filter-form input, .filter-form select {
  width: 100%; padding: 7px 10px; min-height: 40px; border: 1px solid #cdd8e8; border-radius: 7px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 92px; resize: vertical; }
.field input[type="file"] { padding: 4px 7px 4px 4px; }
.field input[type="file"]::file-selector-button { padding: 5px 9px; margin-right: 6px; background: var(--accent-bg); color: var(--accent-dark); font: inherit; border: 0; border-radius: 4px; cursor: pointer;}
.full { grid-column: 1 / -1; }
.form-actions { margin-top: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.table-head { padding: 14px 15px 10px; }
.filter-form { display: grid; grid-template-columns: minmax(145px, 1.4fr) repeat(4, minmax(90px, .75fr)) auto; align-items: end; gap: 8px; padding: 0 15px 13px; }
.filter-form input, .filter-form select { font-size: 13px; }
.filter-form .search { position: relative; }
.filter-form .search .ico { position: absolute; top: 13px; left: 11px; color: var(--muted); pointer-events: none; }
.filter-form .search input { padding-left: 33px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th { padding: 9px 12px; border-block: 1px solid var(--border); background: #f4f7fb; color: #52627c; text-align: left; font-size: 12px; font-weight: 700; }
td { padding: 9px 12px; border-bottom: 1px solid var(--rule); font-size: 13px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 15px; }
tbody tr:hover { background: #f8faff; }
.record { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.record .avatar { width: 31px; height: 32px; }
.record:hover strong { color: var(--accent-dark); text-decoration: underline; }
.record-text { min-width: 0; }
.record-text .subtle { display: block; max-width: 245px; margin-top: 2px; overflow-wrap: anywhere; }
.record-text strong { overflow-wrap: anywhere; }
.tag-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; max-width: 285px; }
.tag-group .pill { overflow-wrap: anywhere; max-width: 100%; flex: 0 1 auto; }
.table-foot { padding: 9px 15px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination .action { min-height: 30px; padding: 3px 9px; font-size: 12px; }
.empty { padding: 38px 22px; text-align: center; }
.empty .avatar { margin: 0 auto 10px; }
.empty p { margin: 4px 0 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(245px, .85fr) minmax(0, 1.35fr); align-items: start; gap: 14px; }
.detail-grid section { min-width: 0; }
.detail-grid h2 { margin-bottom: 10px; }
.detail-status { margin-bottom: 7px; }
.detail-feedback { margin-top: 12px; }
.detail-entry { margin: 0; display: grid; gap: 11px; }
.detail-entry dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.detail-entry dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-editor h2 { margin-bottom: 4px; }
.detail-editor .section-heading { margin-bottom: 13px; }
.source-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0 0; margin-top: 11px; border-top: 1px solid var(--rule); }
.record-notes { width: 100%; padding-left: 18px; margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login .panel { width: min(100%, 420px); padding: 25px; }
.login h1 { margin: 21px 0 6px; font-size: 28px; }
.login form { display: grid; gap: 13px; margin-top: 14px; }
.login .action { margin-top: 4px; }
.login .messages { margin: 12px 0 0; }
.form-help ul { padding-left: 16px; margin: 5px 0 0; }
.form-errors { margin: 0; padding-left: 20px; color: var(--red); font-size: 13px; }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 182px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .sidebar .brand { margin-left: 4px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 840px) {
  .filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-query { grid-column: span 2; }
}
@media (max-width: 690px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 13px 5px; border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .sidebar .brand { margin: 0; }
  .sidebar .brand .logo { width: 30px; height: 30px; }
  .nav-label { display: none; }
  .sidebar nav { grid-area: 2 / 1 / 3 / 3; display: flex; overflow-x: auto; margin-top: 7px; gap: 3px; }
  .nav-item { min-height: 36px; font-size: 12px; padding: 5px 8px; margin-bottom: 0; }
  .nav-item .ico { display: none; }
  .sidebar-foot { grid-area: 1 / 2; margin: 0; padding: 0; border: none; }
  .sidebar-foot .identity, .sidebar-foot .avatar { display: none; }
  .topbar { min-height: 47px; margin-bottom: 17px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .page-actions { justify-content: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric { padding: 9px; }
  .metric-value { font-size: 29px; }
  .batch { grid-template-columns: auto minmax(0, 1fr); }
  .batch .progress { grid-column: 2; max-width: 240px; }
  .filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-form .filter-actions { grid-column: span 2; }
  .resume-table { min-width: 0; table-layout: fixed; }
  .resume-table .compact-optional { display: none; }
  .resume-table .status-column { width: 112px; }
}
@media (max-width: 390px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .table-head { flex-wrap: wrap; align-items: flex-start; }
}

