:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --border: #dfe4e8;
  --border-strong: #cbd3da;
  --text: #17212b;
  --text-muted: #68737d;
  --primary: #409eff;
  --primary-dark: #337ecc;
  --primary-soft: #ecf5ff;
  --blue: #409eff;
  --blue-soft: #f0f7ff;
  --warning: #9b5e13;
  --warning-soft: #fff5e5;
  --danger: #a13f3f;
  --danger-soft: #fbeeee;
  --sidebar: #17252a;
  --sidebar-muted: #9fb0b5;
  --shadow: 0 10px 30px rgba(31, 44, 52, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !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; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #409eff; outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: #fff; display: flex; flex-direction: column; }
.brand { height: 68px; padding: 0 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; background: #409eff; color: #fff; font-size: 14px; font-weight: 800; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { color: var(--sidebar-muted); font-size: 11px; }
.primary-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.nav-item { width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: #c7d2d5; display: flex; align-items: center; gap: 11px; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #203a59; color: #fff; box-shadow: inset 3px 0 #409eff; }
.nav-icon { width: 21px; color: #83a59e; font-size: 12px; font-weight: 800; text-align: center; }
.nav-item.active .nav-icon { color: #69a7ff; }
.sidebar-footer { margin-top: auto; min-height: 64px; padding: 13px 18px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3eb894; box-shadow: 0 0 0 3px rgba(62,184,148,.14); flex: 0 0 auto; }
.sidebar-footer-copy { display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer-copy strong { font-size: 12px; }
.sidebar-footer-copy small { color: var(--sidebar-muted); font-size: 11px; }

.workspace { min-width: 0; }
.topbar { height: 68px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.breadcrumb { color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 9px; }
.breadcrumb b { color: #b2bac0; font-weight: 400; }
.breadcrumb strong { color: var(--text); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.compact-field { height: 36px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-muted); display: flex; align-items: center; gap: 6px; padding-left: 9px; }
.compact-field span { color: var(--text-muted); font-size: 11px; }
.compact-field select { height: 34px; border: 0; background: transparent; color: var(--text); font-size: 12px; padding: 0 24px 0 2px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: #50606b; display: grid; place-items: center; font-size: 19px; }
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.account-button { height: 44px; padding: 3px 8px 3px 4px; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; border-radius: 6px; }
.account-button:hover { background: var(--surface-muted); }
.avatar { width: 34px; height: 34px; border-radius: 6px; background: #ecf5ff; color: var(--primary-dark); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.account-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.account-copy strong { font-size: 12px; }
.account-copy small { font-size: 11px; color: var(--text-muted); }
.chevron { color: var(--text-muted); }

.main-content { width: min(1540px, 100%); margin: 0 auto; padding: 24px 28px 40px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-heading h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; }
.page-heading p { margin: 0; color: var(--text-muted); font-size: 13px; }
.freshness { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.notice-banner { margin-bottom: 12px; min-height: 44px; padding: 10px 14px; background: var(--warning-soft); border: 1px solid #f0d6ad; border-left: 3px solid #c88228; border-radius: 5px; display: flex; align-items: center; gap: 12px; color: #775023; font-size: 12px; }

.filter-band { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.quick-range { height: 36px; border: 1px solid var(--border-strong); border-radius: 5px; overflow: hidden; display: flex; }
.segment { min-width: 58px; height: 34px; border: 0; border-right: 1px solid var(--border); background: #fff; color: #56636d; font-size: 12px; }
.segment:last-child { border-right: 0; }
.segment.active { background: var(--primary); color: #fff; }
.filter-row, .date-fields, .search-row { display: flex; align-items: flex-end; gap: 10px; }
.filter-band label { display: flex; flex-direction: column; gap: 5px; }
.filter-band label > span { color: var(--text-muted); font-size: 11px; }
.filter-band select, .filter-band input { height: 36px; min-width: 124px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; color: var(--text); padding: 0 10px; font-size: 12px; }
.filter-band input[type="date"] { width: 138px; }
.date-separator { padding-bottom: 10px; color: var(--text-muted); font-size: 11px; }
.search-field input { width: 230px; }
.primary-button, .secondary-button { height: 36px; padding: 0 17px; border-radius: 5px; font-weight: 700; font-size: 12px; }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { border: 1px solid var(--border-strong); background: #fff; color: #4f5d66; }
.secondary-button:hover { background: var(--surface-muted); }

.summary-strip { margin: 12px 0; min-height: 72px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.summary-item { padding: 13px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.summary-item:last-child { border-right: 0; }
.summary-item span { color: var(--text-muted); font-size: 11px; }
.summary-item strong { font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-item small { color: var(--text-muted); font-size: 10px; }

.records-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.panel-toolbar { min-height: 53px; padding: 0 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.panel-toolbar h2 { margin: 0; font-size: 15px; }
.panel-toolbar span { color: var(--text-muted); font-size: 11px; }
.publication-view-actions { display: flex; align-items: center !important; gap: 10px !important; }
.publication-view-actions .quick-range { height: 32px; }
.publication-view-actions .segment { min-width: 78px; height: 30px; }
.match-nav { display: flex; gap: 5px; }
.readonly-badge { padding: 4px 7px; border-radius: 4px; background: var(--surface-muted); border: 1px solid var(--border); color: var(--text-muted) !important; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { height: 40px; padding: 0 12px; background: #f7f9fa; border-bottom: 1px solid var(--border); color: #5e6a73; font-size: 11px; font-weight: 700; text-align: left; white-space: nowrap; }
td { height: 52px; padding: 7px 12px; border-bottom: 1px solid #edf0f2; color: #2f3a43; font-size: 12px; vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f3f8ff; }
tbody tr:last-child td { border-bottom: 0; }
.time-cell { font-variant-numeric: tabular-nums; }
.time-cell strong, .time-cell span { display: block; }
.time-cell strong { font-size: 12px; }
.time-cell span { margin-top: 2px; color: var(--text-muted); font-size: 10px; }
.task-cell { overflow: hidden; }
.task-cell strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 17px; font-weight: 600; word-break: break-all; }
.customer-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.number-cell { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.resizable-table th { position: relative; }
.column-resize-handle { position: absolute; top: 0; right: -6px; z-index: 3; width: 12px; height: 100%; cursor: col-resize; touch-action: none; }
.column-resize-handle::after { content: ""; position: absolute; top: 8px; right: 5px; bottom: 8px; width: 1px; background: var(--border); }
.column-resize-handle:hover::after, .column-resize-handle.active::after, .column-resize-handle:focus-visible::after { width: 2px; background: var(--primary); }
.column-resize-handle:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
body.column-resizing { cursor: col-resize; user-select: none; }
.tag { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 7px; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.tag-normal { background: #eef2f4; color: #4f5d66; }
.tag-reprint, .tag-rerun, .tag-reprint_or_additional { background: var(--warning-soft); color: var(--warning); }
.tag-additional { background: var(--blue-soft); color: var(--blue); }
.tag-unknown { background: var(--danger-soft); color: var(--danger); }
.quality { color: var(--text-muted); font-size: 10px; }
.pagination { min-height: 53px; padding: 9px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.page-button { min-width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: #52606a; font-size: 11px; }
.page-button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-button:disabled { cursor: default; opacity: .45; }
.publication-sequence { display: grid; grid-template-columns: repeat(var(--machine-columns, 2), minmax(0, 1fr)); gap: 1px; background: var(--border); min-height: 520px; }
.sequence-column { min-width: 0; background: var(--surface); display: flex; flex-direction: column; }
.sequence-column-head { position: sticky; top: 0; z-index: 2; min-height: 48px; padding: 9px 13px; border-bottom: 1px solid var(--border); background: #f8fafc; display: flex; align-items: center; justify-content: space-between; }
.sequence-column-head strong { font-size: 13px; }
.sequence-column-head span { color: var(--text-muted); font-size: 10px; }
.sequence-scroll { height: min(66vh, 720px); overflow-y: auto; overscroll-behavior: contain; }
.sequence-row { min-height: 66px; padding: 8px 12px; border-bottom: 1px solid #edf0f2; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 10px; align-items: start; }
.sequence-row:hover { background: #f3f8ff; }
.sequence-row.highlight { background: #ecf5ff; box-shadow: inset 3px 0 var(--primary); }
.sequence-time { font-variant-numeric: tabular-nums; color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.sequence-time small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 9px; font-weight: 400; }
.sequence-content { min-width: 0; }
.sequence-content strong { display: block; font-size: 11px; line-height: 1.45; word-break: break-all; }
.sequence-content span { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.sequence-reprint { display: inline-flex !important; width: fit-content; padding: 2px 5px; border-radius: 3px; background: var(--warning-soft); color: var(--warning) !important; }
.sequence-more { min-height: 45px; padding: 8px; display: grid; place-items: center; }
.sequence-empty { min-height: 180px; display: grid; place-items: center; color: var(--text-muted); font-size: 12px; }
@media (max-width: 900px) {
  .publication-sequence { grid-template-columns: 1fr; }
  .sequence-scroll { height: 56vh; }
}

.content-state { min-height: 320px; padding: 60px 20px; display: grid; place-items: center; text-align: center; }
.state-box { max-width: 400px; }
.state-symbol { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-muted); border: 1px solid var(--border); color: var(--text-muted); font-size: 20px; font-weight: 700; }
.state-box h3 { margin: 0 0 7px; font-size: 15px; }
.state-box p { margin: 0 0 16px; color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.loading-lines { width: min(720px, 86vw); display: grid; gap: 12px; }
.loading-line { height: 16px; border-radius: 3px; background: linear-gradient(90deg, #eef1f3 20%, #f8f9fa 45%, #eef1f3 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(18, 29, 34, .28); z-index: 20; }
.detail-drawer { position: fixed; top: 0; right: 0; z-index: 21; width: min(540px, 94vw); height: 100vh; background: #fff; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { min-height: 106px; padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.drawer-header > div { min-width: 0; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; }
.drawer-header h2 { margin: 7px 0 0; font-size: 16px; line-height: 1.55; word-break: break-all; }
.drawer-content { padding: 20px 22px 34px; overflow-y: auto; }
.detail-section { margin-bottom: 24px; }
.detail-section h3 { margin: 0 0 11px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.detail-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.detail-field span { color: var(--text-muted); font-size: 10px; }
.detail-field strong { font-size: 12px; line-height: 1.55; word-break: break-all; }
.detail-field.full { grid-column: 1 / -1; }
.artifact-preprocess-error { background: var(--danger-soft); color: var(--danger); }
.artifact-preprocess-error strong { color: var(--danger); }

[hidden] { display: none !important; }
body:not(.demo-mode) .demo-only { display: none !important; }

.account-summary { margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.account-summary > div { min-height: 76px; padding: 14px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
.account-summary > div:last-child { border-right: 0; }
.account-summary span { color: var(--text-muted); font-size: 11px; }
.account-summary strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.account-toolbar { margin-bottom: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); display: flex; gap: 12px; align-items: end; }
.account-toolbar label, .account-dialog-fields label { display: grid; gap: 6px; color: var(--text-muted); font-size: 11px; }
.account-toolbar input, .account-toolbar select, .account-dialog-fields input, .account-dialog-fields select { height: 38px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; color: var(--text); padding: 0 10px; font-size: 12px; }
.account-search { width: min(360px, 100%); }
.account-table { min-width: 820px; }
.account-table th:nth-child(1) { width: 25%; }
.account-table th:nth-child(2) { width: 13%; }
.account-table th:nth-child(3) { width: 20%; }
.account-table th:nth-child(4) { width: 17%; }
.account-table th:nth-child(5) { width: 25%; }
.account-table tbody tr { cursor: default; }
.account-table td:first-child strong, .account-table td:first-child small { display: block; }
.account-table td:first-child small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.account-status { min-height: 24px; padding: 3px 8px; border-radius: 4px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; }
.account-status-active { background: #eaf7f1; color: #267757; }
.account-status-disabled { background: var(--danger-soft); color: var(--danger); }
.account-status-unopened { background: #eef2f4; color: #56636d; }
.muted-text { color: var(--text-muted); }
.account-row-actions { min-height: 36px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.account-row-actions button { height: 32px; padding: 0 10px; }
.danger-button { height: 36px; padding: 0 14px; border: 1px solid var(--danger); border-radius: 5px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; }
.danger-button:hover { background: #873333; }
.danger-button:disabled, .primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .55; }
.account-dialog { width: min(480px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); box-shadow: var(--shadow); }
.account-dialog::backdrop { background: rgba(18, 29, 34, .48); }
.account-dialog form > header { min-height: 76px; padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.account-dialog h2 { margin: 0 0 5px; font-size: 16px; }
.account-dialog header p { margin: 0; color: var(--text-muted); font-size: 11px; }
.account-dialog-fields { padding: 18px; display: grid; gap: 14px; }
.account-dialog-fields input, .account-dialog-fields select { width: 100%; }
.account-form-note, .account-confirm-copy { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; }
.account-confirm-copy { padding: 4px 0; color: var(--text); font-size: 12px; }
.account-dialog .auth-error { margin: 0 18px 14px; }
.account-dialog footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.account-menu { position: absolute; top: 48px; right: 0; z-index: 30; min-width: 150px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: var(--shadow); display: none; }
.account-menu.open { display: grid; gap: 3px; }
.account-menu a, .account-menu button { width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text); font-size: 12px; text-align: left; text-decoration: none; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-muted); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: min(420px, 100%); padding: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card .brand { height: auto; padding: 0 0 26px; border: 0; }
.auth-card h1 { margin: 0 0 8px; font-size: 22px; }
.auth-muted { margin: 0 0 22px; color: var(--text-muted); font-size: 12px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: var(--text-muted); font-size: 12px; }
.auth-form input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; color: var(--text); }
.auth-switch { margin: 18px 0 0; text-align: center; font-size: 13px; }
.auth-switch a { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-switch a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.auth-error { margin: 0; padding: 9px 10px; border: 1px solid #f0c3c3; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.5; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .brand { padding: 0; justify-content: center; }
  .brand-copy, .nav-label, .sidebar-footer-copy { display: none; }
  .primary-nav { padding: 14px 8px; }
  .nav-item { padding: 0; justify-content: center; }
  .nav-icon { width: auto; }
  .sidebar-footer { justify-content: center; padding: 13px 0; }
  .main-content { padding-left: 20px; padding-right: 20px; }
  .topbar { padding: 0 20px; }
  .state-field span, .role-field span, .account-copy { display: none; }
  .compact-field { padding-left: 0; }
  .compact-field select { padding-left: 8px; }
  .filter-band { align-items: flex-end; }
  .search-field input { width: 190px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; }
  .brand { height: 54px; justify-content: flex-start; padding: 0 14px; }
  .brand-copy { display: flex; }
  .primary-nav { padding: 6px 8px; flex-direction: row; overflow-x: auto; }
  .nav-item { width: auto; min-width: max-content; height: 38px; padding: 0 12px; }
  .nav-label { display: inline; white-space: nowrap; }
  .nav-icon { display: none; }
  .nav-item.active { box-shadow: inset 0 -3px #409eff; }
  .sidebar-footer { display: none; }
  .topbar { height: 58px; padding: 0 12px; }
  .breadcrumb { display: none; }
  .top-actions { width: 100%; justify-content: flex-end; }
  .account-button { padding-right: 0; }
  .main-content { padding: 18px 12px 28px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 21px; }
  .freshness { max-width: 150px; justify-content: flex-end; text-align: right; }
  .notice-banner { align-items: flex-start; flex-direction: column; gap: 4px; }
  .filter-band { padding: 12px; display: block; }
  .quick-range { width: 100%; }
  .segment { min-width: 0; flex: 1; }
  .date-fields, .filter-row, .search-row { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .date-separator { display: none; }
  .filter-band select, .filter-band input, .filter-band input[type="date"], .search-field input { width: 100%; min-width: 0; }
  .search-field { grid-column: 1 / -1; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  table { min-width: 860px; }
  .panel-toolbar { padding: 0 12px; }
  .pagination { justify-content: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field.full { grid-column: auto; }
  .account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-summary > div:nth-child(2) { border-right: 0; }
  .account-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .account-toolbar { display: grid; grid-template-columns: 1fr; }
  .account-search { width: 100%; }
}

.exception-table { min-width: 1180px; }
.exception-table th:nth-child(1) { width: 13%; }
.exception-table th:nth-child(2) { width: 10%; }
.exception-table th:nth-child(3) { width: 24%; }
.exception-table th:nth-child(4) { width: 9%; }
.exception-table th:nth-child(5) { width: 7%; }
.exception-table th:nth-child(6) { width: 9%; }
.exception-table th:nth-child(7) { width: 18%; }
.exception-table th:nth-child(8) { width: 10%; }
.exception-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.exception-tag { display: inline-flex; min-height: 22px; align-items: center; padding: 2px 6px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-size: 10px; white-space: nowrap; }
.exception-other_source_exception, .exception-source_exception_inconsistent { background: var(--warning-soft); color: var(--warning); }
.exception-reason { line-height: 17px; color: #4e5b64; }
.exception-panel { margin-top: 12px; }

.yesterday-notice { width:100%; min-height:52px; margin-bottom:12px; padding:9px 14px; border:1px solid #f0d6ad; border-left:3px solid #c88228; border-radius:5px; background:var(--warning-soft); color:#775023; display:flex; align-items:center; gap:14px; text-align:left; }
.yesterday-notice > span:first-child { display:flex; flex:1; flex-direction:column; gap:3px; }
.yesterday-notice strong { font-size:12px; }
.yesterday-notice small { font-size:10px; }
.yesterday-notice b { font-size:17px; }
.notice-arrow { font-size:22px; }
.plate-overview { position:relative; min-height:132px; display:grid; grid-template-columns:1.5fr 1fr 1fr; background:#fff; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.plate-primary,.plate-metric { padding:20px; display:flex; flex-direction:column; gap:7px; border-right:1px solid var(--border); }
.plate-metric:last-of-type { border-right:0; }
.plate-overview span { color:var(--text-muted); font-size:11px; }
.plate-overview strong { font-size:34px; line-height:1; font-variant-numeric:tabular-nums; }
.plate-metric strong { font-size:28px; }
.plate-overview small { color:var(--text-muted); font-size:10px; }
.plate-metric.done strong { color:var(--primary-dark); }
.plate-metric.pending strong { color:var(--warning); }
.plate-progress { position:absolute; left:0; right:0; bottom:0; height:5px; background:#e5e9eb; }
.plate-progress span { display:block; height:100%; background:var(--primary); }
.overview-task-strip { margin:12px 0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--border); border-radius:6px; overflow:hidden; background:#fff; }
.overview-task-strip button { min-height:72px; padding:12px 16px; border:0; border-right:1px solid var(--border); background:#fff; display:grid; grid-template-columns:1fr auto; align-items:center; gap:4px 10px; text-align:left; }
.overview-task-strip button:last-child { border-right:0; }
.overview-task-strip button:hover { background:#f7fbfa; }
.overview-task-strip button:disabled { cursor:default; background:#fafbfc; }
.overview-task-strip span,.overview-task-strip small { color:var(--text-muted); font-size:10px; }
.overview-task-strip strong { font-size:21px; grid-row:1/3; grid-column:2; }
.overview-grid { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(280px,.8fr); gap:12px; }
.overview-section { background:#fff; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.overview-section-head { min-height:58px; padding:11px 15px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:15px; }
.overview-section-head h2 { margin:0 0 4px; font-size:14px; }
.overview-section-head p { margin:0; color:var(--text-muted); font-size:10px; }
.overview-section-head > span { color:var(--text-muted); font-size:10px; }
.overview-machines { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.overview-machine { min-height:106px; padding:16px; border:0; border-right:1px solid var(--border); background:#fff; display:flex; align-items:flex-start; gap:11px; text-align:left; }
button.overview-machine:hover { background:#f7fbfa; }
.overview-machine:last-child { border-right:0; }
.overview-machine div { display:flex; flex-direction:column; gap:7px; min-width:0; }
.overview-machine div span,.overview-machine small { color:var(--text-muted); font-size:10px; }
.overview-machine strong { font-size:20px; }
.overview-machine.unassigned .machine-code { background:#eef2f4; color:#5e6a73; }
.sync-facts { margin:0; padding:8px 15px; }
.sync-facts div { min-height:38px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #edf0f2; }
.sync-facts div:last-child { border-bottom:0; }
.sync-facts dt { color:var(--text-muted); font-size:10px; }
.sync-facts dd { margin:0; display:flex; align-items:center; gap:7px; font-size:11px; font-weight:700; }
.status-good { color:var(--primary-dark); }
.customer-overview-section { margin-top:12px; }
.customer-overview-table { min-width:720px; }
.customer-overview-head,.customer-overview-row { display:grid; grid-template-columns:minmax(180px,1.7fr) repeat(4,minmax(70px,.6fr)) minmax(100px,.8fr); align-items:center; }
.customer-overview-head { min-height:38px; padding:0 15px; background:#f7f9fa; border-bottom:1px solid var(--border); color:var(--text-muted); font-size:10px; }
.customer-overview-row { width:100%; min-height:48px; padding:0 15px; border:0; border-bottom:1px solid #edf0f2; background:#fff; text-align:left; color:var(--text); }
.customer-overview-row:last-child { border-bottom:0; }
.customer-overview-row:hover { background:#f7fbfa; }
.customer-overview-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.customer-overview-row span,.customer-overview-row b,.customer-overview-row small { font-size:11px; font-variant-numeric:tabular-nums; }
.customer-overview-row b { color:var(--warning); }
.customer-overview-row small { color:var(--text-muted); }
.overview-content-state { background:#fff; border:1px solid var(--border); border-radius:6px; }

@media (max-width:980px){.overview-grid{grid-template-columns:1fr}.overview-machines{grid-template-columns:1fr}.overview-machine{border-right:0;border-bottom:1px solid var(--border)}.overview-machine:last-child{border-bottom:0}.customer-overview-section{overflow-x:auto}}
@media (max-width:760px){.plate-overview{grid-template-columns:1fr 1fr}.plate-primary{grid-column:1/-1;border-right:0;border-bottom:1px solid var(--border)}.plate-metric{padding:16px}.overview-task-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-task-strip button:nth-child(2){border-right:0}.overview-task-strip button:nth-child(-n+2){border-bottom:1px solid var(--border)}}

.task-page { max-width: 1540px; }
.pgf-table-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.pgf-table { min-width: 1180px; }
.pgf-table th:nth-child(1) { width: 13%; }.pgf-table th:nth-child(2) { width: 7%; }.pgf-table th:nth-child(3) { width: 28%; }.pgf-table th:nth-child(4) { width: 10%; }.pgf-table th:nth-child(5) { width: 13%; }.pgf-table th:nth-child(6) { width: 10%; }.pgf-table th:nth-child(7) { width: 11%; }.pgf-table th:nth-child(8) { width: 8%; }
.pgf-table td { vertical-align: middle; }
.pgf-table td small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; line-height: 14px; }
.pgf-name-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pgf-binding-cell strong, .pgf-count-cell strong { font-variant-numeric: tabular-nums; }
.pgf-unassigned { color: var(--warning); }
.pgf-status { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 7px; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.pgf-status-loading { color: var(--warning); background: var(--warning-soft); }
.pgf-status-exception { color: var(--danger); background: var(--danger-soft); }
.pgf-status-printing { color: var(--primary-dark); background: var(--primary-soft); }
.pgf-status-queued { color: var(--blue); background: var(--blue-soft); }
.pgf-status-published { color: #5e6a73; background: #eef2f4; }
.pgf-bind-button { min-height: 30px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; color: var(--primary-dark); font-size: 10px; font-weight: 700; }
.pgf-bind-button:hover { background: var(--primary-soft); }
.pgf-table-footer { min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 11px; }
.pgf-progress-footer { min-height: 48px; margin-top: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 11px; }
.pgf-binding-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.pgf-binding-dialog::backdrop { background: rgba(18, 29, 34, .38); }
.pgf-binding-dialog form > header { min-height: 70px; padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pgf-binding-dialog h2 { max-width: 400px; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pgf-binding-body { padding: 16px; display: grid; gap: 14px; }
.pgf-binding-body > label:not(.checkbox-row) { display: grid; gap: 6px; color: var(--text-muted); font-size: 11px; }
.pgf-binding-body select, .pgf-binding-body input:not([type="checkbox"]) { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; color: var(--text); }
.pgf-binding-modes { width: 100%; }
.pgf-binding-modes .segment { flex: 1; }
.pgf-binding-fields { display: grid; gap: 14px; }
.pgf-binding-fields > label { display: grid; gap: 6px; color: var(--text-muted); font-size: 11px; }
.binding-prefix { margin: 0; padding: 9px 10px; background: var(--surface-muted); color: var(--text-muted); font-size: 11px; word-break: break-all; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; color: var(--text); font-size: 11px; }
.checkbox-row input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.form-error { padding: 9px 10px; background: var(--danger-soft); color: var(--danger); font-size: 11px; }
.pgf-binding-dialog form > footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.task-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.machine-panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.unassigned-panel { grid-column: 1 / -1; }
.machine-panel-header { min-height: 55px; padding: 0 14px; background: #f7f9fa; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.machine-heading { min-width: 0; display: flex; align-items: center; gap: 10px; }
.machine-code { width: 32px; height: 32px; border-radius: 5px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; font-size: 12px; }
.machine-heading h2 { margin: 0 0 2px; font-size: 14px; }
.machine-heading p { margin: 0; color: var(--text-muted); font-size: 10px; }
.machine-totals { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.machine-totals span { color: var(--text-muted); font-size: 10px; }
.machine-totals strong { margin-left: 4px; color: var(--text); font-size: 13px; }
.task-list { padding: 8px; display: grid; gap: 7px; }
.unassigned-panel .task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-card { min-height: 112px; padding: 11px 12px; border: 1px solid var(--border); border-left: 3px solid #b9c3c9; border-radius: 5px; background: #fff; cursor: pointer; display: grid; gap: 8px; }
.task-card:hover { border-color: #b8d3cd; background: #fbfefd; }
.task-card.status-printing { border-left-color: var(--primary); }
.task-card.status-exception { border-left-color: var(--danger); background: #fffdfd; }
.task-card.status-queued { border-left-color: var(--blue); }
.task-card.status-processed { border-left-color: #8b98a1; }
.task-card.status-loading { border-left-color: #9aa5ac; background: #fff; }
.task-card.status-published { border-left-color: #7b8a92; background: #fafbfc; }
.pgf-progress-card { cursor: default; }
.task-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-title-group { min-width: 0; flex: 1; }
.task-customer { margin-bottom: 4px; color: var(--primary-dark); font-size: 10px; font-weight: 800; }
.task-title { margin: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 17px; font-size: 12px; word-break: break-all; }
.task-card-tags { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.task-status-tag { min-height: 22px; padding: 2px 7px; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.status-printing .task-status-tag { color: var(--primary-dark); background: var(--primary-soft); }
.status-exception .task-status-tag { color: var(--danger); background: var(--danger-soft); }
.status-queued .task-status-tag { color: var(--blue); background: var(--blue-soft); }
.status-processed .task-status-tag { color: #5e6a73; background: #eef2f4; }
.status-loading .task-status-tag { color: #5e6a73; background: #eef2f4; }
.status-published .task-status-tag { color: #5e6a73; background: #eef2f4; }
.cross-day-tag { min-height: 22px; padding: 2px 6px; border-radius: 4px; color: var(--warning); background: var(--warning-soft); font-size: 10px; white-space: nowrap; }
.pgf-spec-lines { margin-top: 3px; display: grid; gap: 1px; color: var(--text-muted); font-size: 10px; line-height: 14px; }
.pgf-spec-lines > div { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pgf-spec-lines b { color: #4b5861; font-weight: 700; font-variant-numeric: tabular-nums; }
.pgf-card-exception { padding: 6px 8px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-size: 10px; font-weight: 700; }
.pgf-progress-card .pgf-bind-button { min-height: 32px; }
.task-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.task-meta span { min-width: 0; color: var(--text-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta b { color: #4b5861; font-weight: 700; }
.task-progress-row { display: flex; align-items: center; gap: 10px; }
.task-progress { height: 5px; flex: 1; overflow: hidden; border-radius: 3px; background: #e7ebee; }
.task-progress > span { height: 100%; display: block; background: var(--primary); }
.status-exception .task-progress > span { background: var(--danger); }
.status-loading .task-progress > span { background: #7b8a92; }
.status-published .task-progress > span { background: #7b8a92; }
.task-progress-text { color: #4d5962; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-empty-group { min-height: 130px; display: grid; place-items: center; color: var(--text-muted); font-size: 11px; }
.task-content-state { margin-top: 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.match-nav { min-height: 44px; margin-top: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.match-nav span { margin-right: auto; color: var(--text-muted); font-size: 11px; }

@media (max-width: 980px) {
  .task-board { grid-template-columns: 1fr; }
  .unassigned-panel { grid-column: auto; }
  .unassigned-panel .task-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .machine-panel-header { align-items: flex-start; padding: 11px 12px; }
  .machine-totals { flex-direction: column; align-items: flex-end; gap: 3px; }
  .task-card { min-height: 122px; }
  .task-card-head { display: block; }
  .task-card-tags { margin-top: 7px; }
  .pgf-progress-card .task-card-tags { align-items: flex-start; justify-content: space-between; }
  .match-nav { flex-wrap: wrap; justify-content: flex-start; }
  .match-nav span { width: 100%; margin-right: 0; }
  .task-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 实时任务：紧凑的双机生产流 */
.task-page .page-heading { min-height: 48px; margin-bottom: 8px; align-items: center; }
.task-page .page-heading h1 { font-size: 22px; }
.task-page .page-heading p { margin-top: 1px; }
.task-page .filter-band { min-height: 0; margin-bottom: 8px; padding: 8px 10px; gap: 8px 12px; }
.task-page .filter-band select,
.task-page .filter-band input,
.task-page .filter-band .primary-button,
.task-page .filter-band .secondary-button { min-height: 36px; }
.task-page .summary-strip { min-height: 52px; margin: 8px 0; }
.task-page .summary-item { min-height: 50px; padding: 6px 12px; display: grid; grid-template-columns: minmax(72px, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 8px; }
.task-page .summary-item span { align-self: end; }
.task-page .summary-item strong { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 21px; font-variant-numeric: tabular-nums; }
.task-page .summary-item small { align-self: start; }
.task-page .task-board { gap: 8px; }
.task-page .machine-panel-header { min-height: 44px; padding: 0 10px; }
.task-page .machine-heading { gap: 8px; }
.task-page .machine-code { width: 28px; height: 28px; }
.task-page .machine-heading h2 { margin: 0; font-size: 13px; }
.task-page .machine-totals { gap: 10px; }
.task-page .machine-totals strong { margin: 0 2px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.task-page .task-list { max-height: calc(100vh - 300px); min-height: 180px; padding: 6px; gap: 5px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.task-page .task-card { min-height: 82px; padding: 8px 9px; gap: 5px; }
.task-page .task-card-head { gap: 8px; }
.task-page .task-customer { margin-bottom: 1px; }
.task-page .task-title { line-height: 16px; -webkit-line-clamp: 1; }
.task-page .task-status-tag { min-height: 20px; padding: 1px 6px; }
.task-page .pgf-progress-card .pgf-bind-button { min-height: 28px; padding: 0 7px; }
.task-page .task-progress-row { gap: 8px; }
.task-page .task-progress { height: 4px; }
.task-page .pgf-progress-footer { min-height: 42px; margin-top: 8px; }

@media (max-width: 760px) {
  .task-page .page-heading { align-items: flex-start; }
  .task-page .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-page .summary-item { min-height: 56px; }
  .task-page .machine-panel-header { align-items: center; padding: 8px 10px; }
  .task-page .machine-totals { flex-direction: row; gap: 8px; }
  .task-page .task-list { max-height: none; min-height: 0; overflow: visible; scrollbar-gutter: auto; }
  .task-page .task-card { min-height: 0; }
  .task-page .task-card-head { display: flex; }
  .task-page .task-card-tags { margin-top: 0; }
}

.stats-page { max-width: 1540px; }
.stats-filter-band { align-items: flex-end; }
.stats-filter-actions { display: flex; gap: 8px; }
.stats-summary { margin: 12px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.stats-summary > div { min-height: 94px; padding: 15px 17px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
.stats-summary > div:last-child { border-right: 0; }
.stats-summary span, .stats-summary small { color: var(--text-muted); font-size: 10px; }
.stats-summary strong { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats-summary .stats-date-value { font-size: 20px; }
.stats-panel { margin-bottom: 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.stats-panel-head { min-height: 58px; padding: 11px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.stats-panel-head h2 { margin: 0 0 4px; font-size: 14px; }
.stats-panel-head p, .stats-panel-head > span { margin: 0; color: var(--text-muted); font-size: 10px; }
.stats-chart-wrap { position: relative; padding: 8px 12px 5px; overflow: hidden; }
.stats-echart { width: 100%; height: 270px; }
.stats-chart-error { display: grid; place-items: center; color: var(--danger); font-size: 12px; }
.stats-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stats-ranking { padding: 7px 15px 11px; }
.stats-rank-row { min-height: 43px; display: grid; grid-template-columns: 24px minmax(105px, .8fr) minmax(100px, 1.8fr) 54px 47px; align-items: center; gap: 9px; border-bottom: 1px solid #edf0f2; }
.stats-rank-row:last-child { border-bottom: 0; }
.stats-rank-index { color: var(--text-muted); font-size: 10px; }
.stats-rank-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.stats-rank-row b { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.stats-rank-row small { color: var(--text-muted); text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.stats-rank-bar { height: 8px; overflow: hidden; border-radius: 3px; background: #e9edef; }
.stats-rank-bar span { display: block; height: 100%; background: var(--primary); }
.stats-size-ranking { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; }
.stats-content-state { margin-top: 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }

@media (max-width: 980px) {
  .stats-two-column { grid-template-columns: 1fr; }
  .stats-size-ranking { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .stats-filter-band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats-filter-band label:first-child, .stats-filter-actions { grid-column: 1 / -1; }
  .stats-filter-actions > button { flex: 1; }
  .stats-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-summary > div:nth-child(2) { border-right: 0; }
  .stats-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .stats-rank-row { grid-template-columns: 20px minmax(92px, 1fr) minmax(70px, 1.3fr) 45px; gap: 7px; }
  .stats-rank-row small { display: none; }
  .stats-chart-wrap { padding: 6px 6px 3px; }
  .stats-echart { height: 235px; }
}

.finance-page { max-width: 1540px; }
.finance-tabs { margin-bottom: 12px; display: flex; overflow-x: auto; border-bottom: 1px solid var(--border-strong); }
.finance-tabs button { min-width: max-content; height: 42px; padding: 0 17px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text-muted); font-size: 12px; }
.finance-tabs button.active { border-bottom-color: var(--primary); color: var(--primary-dark); font-weight: 800; }
.finance-filter-band { align-items: flex-end; }
.finance-filter-actions { display: flex; gap: 8px; }
.finance-summary { margin: 12px 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.finance-summary > div { min-height: 98px; padding: 15px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
.finance-summary > div:last-child { border-right: 0; }
.finance-summary span, .finance-summary small { color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.finance-summary strong { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.finance-panel, .finance-table-panel { margin-bottom: 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.finance-panel-head { min-height: 58px; padding: 11px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.finance-panel-head h2 { margin: 0 0 4px; font-size: 14px; }
.finance-panel-head p, .finance-panel-head > span { margin: 0; color: var(--text-muted); font-size: 10px; }
.finance-chart-wrap { padding: 12px 15px 4px; overflow-x: auto; }
.finance-chart-legend { display: flex; align-items: center; gap: 16px; color: var(--text-muted); font-size: 10px; }
.finance-chart-legend span::before { content: ""; width: 16px; height: 3px; margin-right: 5px; display: inline-block; vertical-align: middle; background: var(--primary); }
.finance-chart-legend .profit::before { background: var(--blue); }
.finance-chart-legend small { margin-left: auto; }
.finance-line-chart { width: 100%; min-width: 700px; height: 230px; display: block; }
.finance-line-chart line { stroke: #e3e7ea; stroke-width: 1; }
.finance-line-chart text { fill: var(--text-muted); font-size: 10px; }
.finance-line-chart polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.finance-line-chart .amount-line { stroke: var(--primary); }
.finance-line-chart .profit-line { stroke: var(--blue); }
.finance-line-chart .finance-pending-dot { fill: #fff; stroke: var(--warning); stroke-width: 2; }
.finance-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.finance-customer-ranking { padding: 7px 14px 10px; }
.finance-customer-ranking button { width: 100%; min-height: 46px; padding: 0 4px; border: 0; border-bottom: 1px solid #edf0f2; background: #fff; display: grid; grid-template-columns: 24px minmax(120px, 1fr) 92px 82px; align-items: center; gap: 8px; text-align: left; }
.finance-customer-ranking button:last-child { border-bottom: 0; }
.finance-customer-ranking button:hover { background: #f7fbfa; }
.finance-customer-ranking span, .finance-customer-ranking small { color: var(--text-muted); font-size: 10px; }
.finance-customer-ranking strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.finance-customer-ranking b { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.finance-price-actions { margin-bottom: 12px; display: flex; justify-content: flex-end; }
.finance-table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; }
.finance-pagination { min-height: 54px; padding: 9px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.finance-pagination span { min-width: 58px; color: var(--text-muted); font-size: 10px; text-align: center; }
.finance-lines-table { min-width: 1260px; }
.finance-lines-table th:nth-child(1) { width: 9%; }.finance-lines-table th:nth-child(2) { width: 8%; }.finance-lines-table th:nth-child(3) { width: 24%; }.finance-lines-table th:nth-child(4) { width: 7%; }
.finance-lines-table td small, .customer-statement-table td small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 9px; }
.finance-task-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-status { display: inline-flex; min-height: 23px; align-items: center; padding: 2px 7px; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.finance-status.complete { color: var(--primary-dark); background: var(--primary-soft); }.finance-status.pending { color: var(--warning); background: var(--warning-soft); }.finance-status.excluded { color: #5e6a73; background: #eef2f4; }.finance-status.review { color: var(--danger); background: var(--danger-soft); }
.statement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.statement-grid > button { min-height: 145px; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: #fff; text-align: left; }
.statement-grid > button:hover { border-color: #a9c9c2; background: #fbfefd; }
.statement-grid > button > div { display: flex; flex-direction: column; gap: 4px; }.statement-grid span { font-size: 12px; font-weight: 800; }.statement-grid small { color: var(--text-muted); font-size: 10px; }.statement-grid > button > strong { margin-top: 16px; display: block; font-size: 24px; }
.statement-grid dl { margin: 15px 0 0; padding-top: 10px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; }.statement-grid dl div { display: flex; justify-content: space-between; }.statement-grid dt { color: var(--text-muted); font-size: 10px; }.statement-grid dd { margin: 0; font-size: 11px; font-weight: 800; }
.statement-summary { margin-bottom: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.statement-summary > div { min-height: 112px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }.statement-summary > div:first-child { border-right: 1px solid var(--border); }.statement-summary span, .statement-summary small { color: var(--text-muted); font-size: 11px; }.statement-summary strong { font-size: 30px; }
.finance-notice { margin-bottom: 12px; min-height: 50px; padding: 10px 14px; border: 1px solid #f0d6ad; border-left: 3px solid #c88228; border-radius: 5px; background: var(--warning-soft); color: #775023; display: flex; align-items: center; gap: 12px; font-size: 11px; }
.customer-statement-table { min-width: 1045px; }
.price-catalog-grid { padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.price-catalog-grid button { min-height: 112px; padding: 14px; border: 1px solid var(--border); border-radius: 5px; background: #fff; text-align: left; }.price-catalog-grid button:hover { border-color: #a9c9c2; background: #fbfefd; }.price-catalog-grid button div { display: flex; justify-content: space-between; gap: 10px; }.price-catalog-grid button span { color: var(--text-muted); font-size: 10px; }.price-catalog-grid button b { margin: 17px 0 8px; display: block; font-size: 23px; }.price-catalog-grid button small { color: var(--text-muted); font-size: 10px; }
.cost-current { min-height: 150px; margin-bottom: 12px; padding: 22px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: flex; flex-direction: column; gap: 10px; }.cost-current > span { color: var(--text-muted); font-size: 11px; }.cost-current > strong { font-size: 34px; }.cost-current > strong small { margin-left: 5px; color: var(--text-muted); font-size: 13px; }.cost-current p { margin: 0; color: var(--text-muted); font-size: 10px; }
.cost-history-table { min-width: 620px; }
.finance-formula { display: grid; gap: 8px; }.finance-formula code { color: var(--text-muted); font-size: 10px; }.finance-formula strong { margin-bottom: 8px; font-size: 13px; }.finance-effective { color: var(--text-muted); font-size: 11px; line-height: 1.8; }
.price-history-list { display: grid; }.price-history-list div { min-height: 50px; padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 10px; }.price-history-list span, .price-history-list small { color: var(--text-muted); font-size: 10px; }.price-history-list strong { font-size: 13px; }
.finance-content-state { margin-top: 12px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }

.artifact-tree { display: grid; gap: 12px; }
.artifact-source, .artifact-batch { border: 1px solid var(--border); border-radius: 6px; background: #fbfdfc; overflow: hidden; }
.artifact-source h4, .artifact-batch h4 { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.artifact-batch h4 small { max-width: 65%; overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.artifact-tree ul { margin: 0; padding: 0; list-style: none; }
.artifact-row { padding: 9px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.artifact-row:last-child { border-bottom: 0; }
.artifact-row span, .artifact-row small { color: var(--text-muted); font-size: 10px; }
.artifact-row strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.artifact-empty { padding: 14px; border: 1px dashed var(--border); border-radius: 6px; color: var(--text-muted); font-size: 11px; }

@media (max-width: 640px) {
  .artifact-row { grid-template-columns: minmax(0, 1fr); gap: 4px; align-items: start; }
  .artifact-row strong { overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
}

/* 第六轮统一可读性与页面合同 */
body { font-size: 15px; line-height: 1.55; }
.brand-copy strong, .panel-toolbar h2, .stats-panel-head h2, .finance-panel-head h2, .overview-section-head h2 { font-size: 16px; }
.brand-copy small, .sidebar-footer-copy small, .account-copy small, .breadcrumb, .page-heading p, .freshness, .notice-banner, .filter-band select, .filter-band input, .primary-button, .secondary-button, td, .auth-form label, .auth-muted { font-size: 13px; }
.nav-item, .compact-field select, .account-copy strong, .summary-item span, .panel-toolbar span, .detail-field strong { font-size: 13px; }
.compact-field span, .filter-band label > span, th, .summary-item small, .quality, .tag, .detail-field span { font-size: 12px; }
.topbar, .brand { height: 72px; }
.nav-item { height: 46px; }
.filter-band select, .filter-band input, .primary-button, .secondary-button { min-height: 40px; }
th { height: 44px; }
td { height: 58px; line-height: 1.5; }
.main-content { padding-bottom: 24px; }

.workspace { min-height: 100vh; display: flex; flex-direction: column; }
.workspace > .main-content { flex: 1 0 auto; }
.site-filing { min-height: 48px; padding: 12px 24px 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; color: var(--text-muted); font-size: 12px; text-align: center; }
.site-filing a { color: inherit; text-decoration: none; }
.site-filing a:hover { color: var(--primary-dark); text-decoration: underline; }
.auth-page { grid-template-rows: 1fr auto; align-items: center; }
.auth-filing { align-self: end; }

.sequence-scroll { height: min(80vh, 920px); }
.sequence-row { min-height: 49px; padding: 7px 12px; align-items: center; }
.sequence-content { display: flex; align-items: center; gap: 8px; }
.sequence-content strong { min-width: 0; overflow: hidden; font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.sequence-content .sequence-reprint { flex: 0 0 auto; margin: 0; font-size: 11px; }

.customer-overview-head, .customer-overview-row { grid-template-columns: minmax(150px, 1.6fr) repeat(5, minmax(72px, .65fr)) minmax(108px, .9fr); }
.customer-folded { border-top: 1px solid var(--border); }
.customer-folded summary { min-height: 46px; padding: 0 16px; display: flex; align-items: center; color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.customer-folded[open] summary { border-bottom: 1px solid var(--border); }
.pending-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(78vh, 760px); padding: 0; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.pending-dialog::backdrop { background: rgba(18, 29, 34, .34); }
.pending-dialog header { min-height: 72px; padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pending-dialog h2, .pending-dialog p { margin: 0; }
.pending-dialog p { color: var(--text-muted); font-size: 12px; }
.pending-dialog header button { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 5px; background: #fff; font-size: 20px; }
.pending-source-list { max-height: calc(78vh - 72px); overflow-y: auto; }
.pending-source-list > div { min-height: 62px; padding: 10px 18px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) 130px 100px; gap: 12px; align-items: center; }
.pending-source-list strong { overflow-wrap: anywhere; }
.pending-source-list span, .pending-source-list small { color: var(--text-muted); }

.stats-column-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.stats-column-chart { width: max(100%, calc(var(--column-count) * 76px)); height: 330px; padding: 28px 18px 14px; display: grid; grid-template-columns: repeat(var(--column-count), minmax(64px, 1fr)); gap: 12px; align-items: end; }
.stats-column-item { height: 286px; min-width: 64px; display: grid; grid-template-rows: 24px 210px 44px; align-items: end; text-align: center; }
.stats-column-item > b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.stats-column-track { width: 34px; height: 210px; margin: 0 auto; border-bottom: 1px solid var(--border-strong); display: flex; align-items: end; }
.stats-column-track span { width: 100%; min-height: 3px; background: var(--primary); border-radius: 3px 3px 0 0; }
.stats-column-item > strong { max-height: 40px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 20px; word-break: break-all; }
.stats-two-column:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }

.exception-panel .table-wrap { max-height: min(72vh, 820px); overflow: auto; overscroll-behavior: contain; }
.exception-panel thead { position: sticky; top: 0; z-index: 2; }
.exception-panel thead th { background: #f7f9fa; }

.price-customer-card { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; overflow: hidden; }
.price-customer-card > header { min-height: 62px; padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.price-customer-card h2, .price-customer-card p { margin: 0; }
.price-customer-card h2 { font-size: 16px; }
.price-customer-card p { color: var(--text-muted); font-size: 12px; }
.price-spec-table { width: 100%; min-width: 0; overflow-x: auto; }
.price-spec-head, .price-spec-row { min-height: 54px; padding: 7px 12px; display: grid; grid-template-columns: minmax(110px, .9fr) minmax(110px, .9fr) minmax(130px, 1.2fr) minmax(110px, .8fr) 145px 78px; gap: 10px; align-items: center; }
.price-spec-head, .price-spec-row { min-width: 940px; }
.price-spec-head { min-height: 42px; background: var(--surface-muted); color: var(--text-muted); font-size: 12px; font-weight: 700; }
.price-spec-row { border-top: 1px solid #edf0f2; }
.price-spec-row > div { display: flex; flex-direction: column; }
.price-spec-row small { color: var(--text-muted); font-size: 11px; }
.price-spec-row input { width: 100%; min-width: 0; height: 38px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 5px; }
.price-spark { height: 34px; padding: 4px 6px; border: 0; background: transparent; display: flex; align-items: end; justify-content: center; gap: 4px; }
.price-spark > span { width: 8px; height: calc(var(--price-level) * 3px); max-height: 30px; background: var(--primary); border-radius: 2px 2px 0 0; }
.price-spark small { align-self: center; }
.price-new-spec { background: #fbfcfd; }

@media (max-width: 900px) {
  .sequence-scroll { height: 58vh; }
  .customer-overview-table { overflow-x: auto; }
  .customer-overview-head, .customer-overview-row { min-width: 900px; }
  .site-filing { padding-left: 14px; padding-right: 14px; }
  .pending-source-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 1200px) {
  .finance-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-summary > div:nth-child(3) { border-right: 0; }.finance-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
  .price-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .finance-two-column { grid-template-columns: 1fr; }
  .statement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .finance-tabs { margin-left: -12px; margin-right: -12px; padding: 0 8px; }
  .finance-filter-band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .finance-filter-band label:first-child, .finance-filter-actions { grid-column: 1 / -1; }
  .finance-filter-actions > button { flex: 1; }
  .finance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-summary > div:nth-child(3) { border-right: 1px solid var(--border); }.finance-summary > div:nth-child(2n) { border-right: 0; }.finance-summary > div:nth-child(-n+4) { border-bottom: 1px solid var(--border); }
  .statement-grid, .price-catalog-grid { grid-template-columns: 1fr; }
  .finance-customer-ranking button { grid-template-columns: 20px minmax(105px, 1fr) 86px; }.finance-customer-ranking small { display: none; }
  .statement-summary { grid-template-columns: 1fr; }.statement-summary > div:first-child { border-right: 0; border-bottom: 1px solid var(--border); }
  .finance-notice { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* CTP客户文件中心 */
.customer-files-page { max-width: 1320px; }
.customer-files-filter { align-items: flex-end; }
.customer-files-search { margin-left: auto; }
.customer-files-table { min-width: 560px; table-layout: fixed; }
.customer-files-table th:nth-child(1) { width: 18%; }
.customer-files-table th:nth-child(2) { width: 82%; }
.customer-files-table tbody tr { cursor: default; }
.customer-file-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-files-pagination { color: var(--text-muted); font-size: 12px; }
.customer-files-panel-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.customer-files-mobile-sort { display: none; }
.customer-files-sort-button { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 6px; font: inherit; font-weight: inherit; text-align: left; }
.customer-files-sort-button:hover, .customer-files-sort-button.active { color: var(--text); }
.customer-files-sort-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.customer-files-sort-indicator { width: 14px; flex: 0 0 14px; color: var(--primary-dark); font-size: 13px; text-align: center; }

@media (max-width: 980px) {
  .customer-files-search { width: 100%; margin-left: 0; }
}

@media (max-width: 760px) {
  .column-resize-handle { display: none; }
  .customer-files-page .page-heading { gap: 12px; }
  .customer-files-filter .date-fields,
  .customer-files-filter .search-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-files-panel .table-wrap { overflow: visible; }
  .customer-files-table { min-width: 0; display: block; }
  .customer-files-table thead { display: none; }
  .customer-files-table tbody { padding: 8px; display: grid; gap: 8px; background: var(--surface-muted); }
  .customer-files-table tr { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: grid; }
  .customer-files-table tr:hover { background: #fff; }
  .customer-files-table td { min-height: 42px; height: auto; padding: 8px 0; border-bottom: 1px solid #edf0f2; display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; align-items: center; overflow-wrap: anywhere; }
  .customer-files-table td:last-child { border-bottom: 0; }
  .customer-files-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; }
  .customer-files-table .time-cell strong,
  .customer-files-table .time-cell span { grid-column: 2; }
  .customer-files-table .time-cell strong { grid-row: 1; }
  .customer-files-table .time-cell span { grid-row: 2; margin-top: -9px; }
  .customer-file-name strong { overflow: visible; text-overflow: clip; white-space: normal; word-break: break-all; }
  .customer-files-panel .panel-toolbar { min-height: 66px; padding: 9px 12px; gap: 10px; align-items: flex-end; }
  .customer-files-panel-actions { gap: 8px; }
  .customer-files-panel-actions .readonly-badge { display: none; }
  .customer-files-mobile-sort { display: flex; align-items: flex-end; gap: 6px; }
  .customer-files-mobile-sort label { display: grid; gap: 3px; color: var(--text-muted); font-size: 11px; }
  .customer-files-mobile-sort select { width: 112px; height: 40px; padding: 0 28px 0 9px; border: 1px solid var(--border-strong); border-radius: 5px; background: #fff; color: var(--text); }
  .customer-files-mobile-sort .icon-button { width: 44px; height: 40px; }
  .customer-statement-table .finance-task-cell { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
}
