:root { --ink:#18201d; --muted:#758079; --line:#d9dfd8; --paper:#f4f6f1; --panel:#ffffff; --olive:#9baa3d; --olive-dark:#536020; --teal:#0f5a55; --soft:#e9eee6; --shadow:0 18px 45px rgba(39,55,37,.08); }
body:not([data-workspace-role="admin"]) .workspace > .sidebar { display:none; }
body:not([data-workspace-role="admin"]) .workspace { grid-template-columns:minmax(0, 1fr); }
.user-task-history { margin-top:14px; padding:16px; background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.user-task-history[hidden] { display:none; }
#automaticDelivery { display:grid; gap:10px; margin-top:16px; }
#automaticDelivery p { margin:0; line-height:1.6; overflow-wrap:anywhere; }
#automaticDeliveryStatus { font-size:12px; color:var(--teal); }
.automatic-history { margin-top:12px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fbfcfa; }
.automatic-history summary { cursor:pointer; color:var(--teal); font:500 11px 'DM Mono', monospace; }
.automatic-history ol { max-height:240px; margin:8px 0 0; padding-left:18px; overflow:auto; font-size:11px; }
.automatic-history li { margin:0 0 7px; color:var(--muted); }
.automatic-history-head { display:block; color:var(--ink); }
.automatic-history-reason { display:block; margin-top:2px; word-break:break-word; }
.automatic-history-blocked .automatic-history-head { color:#a5341f; }
.automatic-history-blocked .automatic-history-reason { color:#a5341f; }
#automaticDeliveryPreview { width:100%; max-height:340px; object-fit:contain; }
#automaticTextAttention:not([hidden]) { display:grid; gap:10px; }
#automaticTextAttention figure { margin:0; padding:10px; border:1px solid var(--border, #d8deda); border-radius:8px; min-width:0; }
#automaticTextAttention canvas { display:block; width:100%; height:auto; max-height:100px; object-fit:contain; background:#fff; }
#automaticTextAttention figcaption { margin-top:6px; font-size:12px; line-height:1.5; }
#automaticTextAttention label { display:grid; gap:6px; margin-top:10px; font-size:12px; }
#automaticTextAttention textarea { width:100%; min-width:0; box-sizing:border-box; resize:vertical; padding:8px; font:inherit; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:#e8ece6; font-family:Manrope, "Microsoft YaHei", sans-serif; }
button, input { font:inherit; }
button, label { cursor:pointer; }
.app-shell { min-height:100vh; padding:18px; }
.topbar { height:74px; display:flex; align-items:center; justify-content:space-between; padding:0 22px; background:var(--panel); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); }
.brand-lockup, .topbar-actions, .project-title-row, .canvas-toolbar, .canvas-footer, .inspector-header, .section-heading, .toolbar-actions { display:flex; align-items:center; }
.brand-lockup { gap:12px; }
.brand-mark { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; color:#fff; background:var(--teal); font:500 12px 'DM Mono', monospace; letter-spacing:-.08em; }
.brand-name { font-size:14px; font-weight:800; letter-spacing:-.02em; }
.brand-subtitle, .project-title-row p, .canvas-name, .canvas-footer, .metric small, .stage-item small, .sidebar-footnote, .log-entry { color:var(--muted); }
.brand-subtitle { margin-top:3px; font-size:10px; }
#inventoryLayerHelp { color:#536159; font-size:12px; line-height:1.6; }
#inventoryTextStyle { margin:12px 0; padding:0; border:0; min-width:0; }
#inventoryTextStyle legend { margin-bottom:8px; font-size:13px; font-weight:700; }
#inventoryTextStyle .brand-subtitle { color:#536159; font-size:12px; line-height:1.6; }
#inventoryTextFill { height:42px; padding:4px; }
.topbar-actions { gap:10px; }
.status-badge, .score-chip { display:inline-flex; align-items:center; gap:7px; padding:8px 10px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:#fbfcfa; font:500 10px 'DM Mono', monospace; }
.status-badge i { width:7px; height:7px; border-radius:50%; background:#e2a738; }
.status-badge.is-ok i { background:#58a26e; }
.button { display:inline-flex; justify-content:center; align-items:center; min-height:36px; padding:0 14px; border-radius:9px; border:1px solid transparent; font-size:11px; font-weight:700; transition:.18s ease; }
.button:hover { transform:translateY(-1px); }
.button-primary { color:#fff; background:var(--teal); }
.button-quiet { color:var(--teal); background:#eef4ef; border-color:#d9e5dc; }
.button-outline { color:var(--teal); background:#fff; border-color:#a9bbb0; }
.workspace { display:grid; grid-template-columns:248px minmax(500px,1fr) 310px; gap:14px; margin-top:14px; min-height:calc(100vh - 120px); }
.sidebar, .canvas-column { min-height:0; background:var(--panel); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); }
.sidebar { padding:22px 18px; }
.eyebrow { color:var(--muted); font:500 9px 'DM Mono', monospace; letter-spacing:.14em; }
.project-title-row { justify-content:space-between; margin-top:18px; align-items:flex-start; }
h1, h2 { margin:0; letter-spacing:-.05em; }
h1 { max-width:160px; font-size:20px; line-height:1.1; }
h2 { font-size:19px; }
.project-title-row p { margin:8px 0 0; font-size:10px; }
.live-dot { width:8px; height:8px; border-radius:50%; background:#7c9e4b; box-shadow:0 0 0 5px #edf3e8; }
.section-rule { height:1px; margin:22px 0; background:var(--line); }
.section-heading { justify-content:space-between; color:#53605a; font-size:10px; font-weight:800; }
.progress-track { height:5px; margin:10px 0 16px; overflow:hidden; border-radius:99px; background:#edf0ec; }
.progress-track span { display:block; width:18%; height:100%; border-radius:99px; background:var(--olive); transition:.3s ease; }
.stage-list { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.stage-item { display:grid; grid-template-columns:25px 1fr 18px; gap:7px; align-items:start; padding:10px 7px; border-radius:10px; color:#88918b; }
.stage-item.is-active { color:var(--ink); background:#f1f5ee; }
.stage-item > span { color:var(--olive-dark); font:500 10px 'DM Mono', monospace; }
.stage-item strong { display:block; font-size:11px; }
.stage-item small { display:block; margin-top:3px; font-size:9px; line-height:1.35; }
.stage-item b { color:#91a090; font-size:11px; font-weight:500; text-align:right; }
.sidebar-footnote { margin-top:auto; padding-top:22px; font-size:9px; line-height:1.6; }
.footnote-label { display:block; margin-bottom:4px; color:var(--olive-dark); font:500 9px 'DM Mono', monospace; }
.canvas-column { display:grid; grid-template-rows:60px minmax(0,1fr) 38px; overflow:hidden; }
.canvas-toolbar, .canvas-footer { justify-content:space-between; padding:0 18px; }
.canvas-name { margin-left:12px; font-size:10px; }
.toolbar-actions { gap:7px; font:500 10px 'DM Mono', monospace; }
.icon-button { width:26px; height:26px; border:1px solid var(--line); border-radius:7px; color:var(--teal); background:#fff; }
.canvas-stage { position:relative; display:grid; place-items:center; margin:0 12px; overflow:hidden; border:1px dashed #c3ccc3; border-radius:12px; background:repeating-conic-gradient(#f3f5f1 0 25%, #eef1ed 0 50%) 50% / 22px 22px; }
.empty-state { display:grid; place-items:center; gap:8px; text-align:center; }
.empty-glyph { display:grid; place-items:center; width:54px; height:54px; border:1px solid #bdc9be; border-radius:16px; color:var(--teal); font-size:26px; font-weight:300; background:#fff; }
.empty-state h2 { font-size:17px; }
.empty-state p { margin:0 0 8px; color:var(--muted); font-size:11px; }
.preview-wrap { width:100%; height:100%; display:grid; place-items:center; padding:28px; overflow:auto; }
.preview-wrap.is-compare { grid-template-columns:1fr 1fr; align-items:center; gap:18px; }
.svg-preview, .source-preview { transform-origin:center; transition:transform .2s ease; filter:drop-shadow(0 15px 25px rgba(40,50,38,.12)); min-width:0; }
.svg-preview svg, .source-preview img { display:block; max-width:min(100%, 720px); max-height:calc(100vh - 240px); width:auto; height:auto; background:#fff; }
.preview-wrap.is-compare .svg-preview svg, .preview-wrap.is-compare .source-preview img { max-width:100%; }
.preview-wrap { touch-action:none; }
.preview-wrap.is-panning { cursor:grabbing; }
.preview-wrap.is-panning .svg-preview, .preview-wrap.is-panning .source-preview { transition:none; }
.preview-wrap img, .preview-wrap svg { user-select:none; -webkit-user-drag:none; }
.svg-preview { will-change:transform; }
@media (max-width:760px) { .preview-wrap { padding:12px; overflow:hidden; } .preview-wrap svg { max-width:100%; } }
.canvas-footer { font:500 9px 'DM Mono', monospace; }
.inspector-header { justify-content:space-between; }
.score-chip { color:var(--olive-dark); background:#f2f5e7; border-color:#dce5bf; }
.metric-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:20px 0; }
.metric { padding:12px; border:1px solid var(--line); border-radius:11px; background:#fbfcfa; }
.metric span, .metric small { display:block; font-size:9px; }
.metric strong { display:block; margin:7px 0 4px; color:var(--teal); font:500 22px 'DM Mono', monospace; }
.metric small { font-size:8px; }
.inspector-section { padding-top:16px; border-top:1px solid var(--line); }
.inspector-section + .inspector-section { margin-top:16px; }
.node-list, .layer-list, .log-list { margin-top:10px; }
.empty-list { color:#a1aaa3; font-size:10px; }
.node-list { display:grid; gap:6px; max-height:150px; overflow:auto; }
.node-row, .layer-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 9px; border-radius:8px; background:#f4f7f2; font-size:10px; }
.node-row code, .layer-row code { color:var(--teal); font:500 9px 'DM Mono', monospace; }
.text-edit-row input, .text-edit-row textarea { min-width:0; flex:1; border:1px solid var(--line); border-radius:8px; padding:6px 8px; background:var(--paper); color:var(--ink); font:inherit; }
.text-edit-row textarea { resize:vertical; font-size:14px; line-height:1.5; }
.text-edit-row .secondary-button { padding:6px 9px; white-space:nowrap; }
.ocr-compose-button { width:100%; margin:8px 0; }
.layer-list { display:flex; flex-wrap:wrap; gap:5px; }
.layer-row { display:block; padding:6px 8px; color:#5f6d62; font:500 9px 'DM Mono', monospace; }
.log-section { min-height:160px; }
.text-button { padding:0; border:0; color:var(--muted); background:transparent; font-size:9px; }
.log-list { display:grid; gap:7px; max-height:180px; overflow:auto; }
.log-entry { display:grid; grid-template-columns:38px 1fr; gap:6px; font-size:9px; line-height:1.35; }
.log-entry time { color:var(--olive-dark); font:500 8px 'DM Mono', monospace; }
@media (max-width:1100px) { .workspace { grid-template-columns:210px minmax(400px,1fr); } .right-sidebar { grid-column:1 / -1; display:grid; grid-template-columns:1fr 1fr 1fr; gap:18px; } .inspector-header, .metric-grid { grid-column:1 / -1; } .log-section { min-height:0; } }
@media (max-width:760px) { .app-shell { padding:8px; } .topbar { height:auto; gap:12px; padding:14px; align-items:flex-start; flex-direction:column; } .topbar-actions { width:100%; flex-wrap:wrap; } .workspace { display:flex; flex-direction:column; } .left-sidebar { min-height:auto; } .stage-list { grid-template-columns:1fr 1fr; } .right-sidebar { display:block; } .canvas-column { min-height:600px; } }

.ocr-filter { display:flex; gap:6px; margin-top:10px; }
.filter-button { border:1px solid var(--line); background:transparent; color:var(--muted); border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; }
.filter-button.is-active { border-color:var(--accent); color:var(--accent); }
.filter-button:hover { color:var(--text); }

.layer-row[role="button"], .node-row[role="button"] { cursor:pointer; }
.layer-row[role="button"]:hover, .node-row[role="button"]:hover { background:#e9f1ea; }
.layer-row[role="button"]:focus-visible, .node-row[role="button"]:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.pv-node-selected { filter:drop-shadow(0 0 3px rgba(217,79,43,.65)); }

.node-row.ocr-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:3px 8px; }
.node-row.ocr-row:hover { background:#e9f1ea; }
.ocr-row .ocr-text { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ocr-row code { white-space:nowrap; }
.ocr-row .ocr-actions { display:flex; gap:4px; white-space:nowrap; }
.ocr-row .ocr-actions button { padding:0 2px; font-size:9px; }
.ocr-row .ocr-detail { grid-column:1 / -1; color:var(--muted); font-size:9px; line-height:1.55; }
.ocr-row.ocr-row-review { box-shadow:inset 2px 0 0 var(--accent); }
.ocr-row.ocr-row-edited { box-shadow:inset 2px 0 0 var(--teal); }
.ocr-edit-row { display:flex; align-items:center; gap:6px; padding:8px 9px; border-radius:8px; background:#eef4ee; }
.ocr-edit-row input { min-width:0; flex:1; border:1px solid var(--line); border-radius:8px; padding:6px 8px; background:var(--paper); color:var(--ink); font:inherit; }
.ocr-edit-row .secondary-button { padding:6px 9px; white-space:nowrap; }
.ocr-error-list { align-content:start; justify-items:start; }
.model-asset-section { display:grid; gap:8px; }
.asset-region-selection { position:fixed; z-index:1000; pointer-events:none; border:2px solid var(--teal); background:rgba(15,90,85,.12); }
.source-preview.is-selecting { cursor:crosshair; user-select:none; touch-action:none; }
#selectAssetRegion[aria-pressed="true"] { background:var(--teal); color:#fff; }
.text-input { width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:8px; padding:9px 10px; background:var(--panel); color:var(--ink); font:inherit; }
.inventory-row { width:100%; border:0; text-align:left; background:transparent; color:var(--ink); font:inherit; cursor:pointer; white-space:normal; overflow-wrap:anywhere; }
.inventory-row:hover { background:#e9f1ea; }
.inventory-row:focus-visible { outline:2px solid var(--teal); outline-offset:-2px; }
.pipeline-section { font-size: 12px; line-height: 1.65; color: var(--ink, #173b35); }
.pipeline-section p { margin: 8px 0; overflow-wrap: anywhere; }
.pipeline-section .section-heading { font-size: 12px; color: var(--ink); }
.pipeline-section .button { min-height: 44px; width: 100%; margin: 4px 0; white-space: normal; font-size: 12px; }
.pipeline-section .button:focus-visible { outline: 2px solid #176f62; outline-offset: 3px; }
.pipeline-section .button:disabled { opacity: .55; cursor: wait; }
#workspaceUnitPreview, #workspaceUnitDetailPreview, #workspaceCompositionPreview { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; background: var(--paper); }
#workspaceUnitPreview[hidden], #workspaceUnitDetailPreview[hidden], #workspaceCompositionPreview[hidden] { display: none; }
.batch-unit-fieldset { min-width: 0; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.batch-unit-option { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); }
.batch-unit-option input { flex: 0 0 auto; accent-color: var(--teal); }
.batch-unit-option span { overflow-wrap: anywhere; }
#workspacePipelineJobs { padding: 0; margin: 12px 0; list-style: none; max-height: 280px; overflow: auto; }
#workspacePipelineJobs li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
#workspacePipelineJobs strong, #workspacePipelineJobs span { display: block; }
.text-candidate-panel { color: var(--ink); font-size: 14px; line-height: 1.6; margin-block: 12px; }
.text-candidate-panel p { margin-block: 8px; overflow-wrap: anywhere; }
.text-candidate-panel .button { width: 100%; min-height: 44px; margin-block: 4px; white-space: normal; font-size: 14px; }
.text-candidate-panel .button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.text-candidate-panel .button:disabled { opacity: .6; cursor: not-allowed; }
.text-candidate-panel figure { margin: 12px 0 0; }
.text-candidate-panel img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; background: var(--paper); }
.text-candidate-panel figcaption { margin-block: 8px; }
#inventoryText { min-height: 76px; resize: vertical; line-height: 1.6; font-size: 16px; }

.kind-candidate-panel { color: var(--ink); font-size: 14px; line-height: 1.6; margin-block: 12px; }
.kind-candidate-panel p { margin-block: 8px; overflow-wrap: anywhere; }
.kind-candidate-panel ul { margin: 8px 0 8px 18px; padding: 0; overflow-wrap: anywhere; }
.kind-candidate-panel li { margin-block: 4px; }
.kind-candidate-panel .button { width: 100%; min-height: 44px; margin-block: 4px; white-space: normal; font-size: 14px; }
.kind-candidate-panel .button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.kind-candidate-panel .button:disabled { opacity: .6; cursor: not-allowed; }
.kind-candidate-panel figure { margin: 12px 0 0; }
.kind-candidate-panel img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; background: var(--paper); }
.kind-candidate-panel figcaption { margin-block: 8px; }
.delivery-tier-section, .advanced-workspace-tools { grid-column: 1 / -1; }
[hidden] { display:none !important; }
:root { --muted:#536159; }
.brand-subtitle, .project-title-row p, .canvas-name, .section-heading, .sidebar-footnote,
.stage-item small, .log-entry, .log-entry time, .canvas-footer, .text-button { font-size:12px; }
.stage-item { color:#536159; }
.processing-dock { margin-top:14px; padding:18px 22px; background:var(--panel); border:1px solid var(--line); border-radius:14px; }
.processing-dock > label { display:block; margin-block:12px 6px; font-size:14px; }
.processing-dock select { max-width:650px; }
.processing-dock .brand-subtitle { color:#536159; font-size:13px; line-height:1.6; }
#automaticDelivery { grid-template-columns:auto auto minmax(180px,1fr); align-items:center; }
#automaticDeliveryStatus { font-size:14px; }
#automaticDelivery > .brand-subtitle, #automaticTextAttention, #automaticDeliveryPreview { grid-column:1 / -1; }
#automaticDelivery .button { min-height:44px; font-size:14px; }
#taskHistory { margin-top:24px; font-size:14px; }
#taskHistory > summary { cursor:pointer; padding-block:12px; font-weight:700; }
#taskHistoryStatus { font-size:13px; line-height:1.6; color:#536159; }
#taskHistoryList { list-style:none; padding:0; margin:12px 0; max-height:400px; overflow:auto; }
.history-open { display:grid; gap:6px; width:100%; padding:12px 0; border:0; border-bottom:1px solid var(--line); text-align:left; background:transparent; color:var(--ink); overflow-wrap:anywhere; }
.history-open span { font-size:12px; color:#536159; }
.task-number { font-family:Consolas,monospace; font-size:12px; line-height:1.6; overflow-wrap:anywhere; user-select:text; }
.button:disabled, .history-open:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.history-records { margin:8px 8px 8px 0; padding:7px 10px; min-height:36px; border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--ink); cursor:pointer; font:inherit; font-size:13px; }
.history-records:hover { background:#edf2ee; }
.history-records:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.history-records:disabled { opacity:.6; cursor:wait; }
.history-delete { margin:8px 0 8px 8px; padding:7px 10px; min-height:36px; border:1px solid #a5341f; border-radius:6px; background:var(--panel); color:#a5341f; cursor:pointer; font:inherit; font-size:13px; }
.history-delete:hover { background:#f7ece9; }
.history-delete:focus-visible { outline:2px solid #a5341f; outline-offset:2px; }
.history-delete:disabled { opacity:.6; cursor:wait; }
.history-timeline { padding:0 0 12px; color:var(--ink); font-size:13px; overflow-wrap:anywhere; }
.history-timeline[hidden] { display:none; }
.history-timeline p { margin:6px 0; line-height:1.6; }
.history-current { font-weight:600; }
.history-timeline ol { list-style:none; padding:0; margin:12px 0 0; }
.history-timeline li { padding:10px 0; border-top:1px solid var(--line); line-height:1.6; }
.history-timeline .history-detail { margin:4px 0 0; font-family:'DM Mono', Consolas, monospace; font-size:11.5px; line-height:1.55; color:#54655c; word-break:break-all; }
.history-timeline time { display:block; font-size:12px; color:#536159; font-variant-numeric:tabular-nums; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--teal); outline-offset:3px; }
.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; }
.login-panel { width:min(100%,420px); background:var(--panel); padding:32px; border-radius:16px; }
.login-panel h1 { max-width:none; font-size:25px; letter-spacing:-.02em; line-height:1.4; }
.login-panel p { font-size:14px; line-height:1.7; color:#536159; }
#loginForm { display:grid; gap:12px; margin-top:24px; }
#loginForm input { width:100%; min-height:44px; border:1px solid #9aaba0; border-radius:8px; padding:10px; }
#loginForm button { min-height:44px; font-size:15px; margin-top:8px; }
@media (max-width:1100px) { .canvas-column { min-height:600px; } }
@media (max-width:760px) {
  #automaticDelivery { grid-template-columns:1fr 1fr; }
  #automaticDeliveryStatus { grid-column:1 / -1; }
  .processing-dock { padding:16px; }
}
.advanced-workspace-tools { margin-block: 16px; min-width: 0; }
.advanced-workspace-tools > summary { cursor: pointer; min-height: 44px; padding-block: 12px; color: var(--ink); font-size: 14px; line-height: 1.5; }
.advanced-workspace-tools > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.advanced-tools-note { font-size: 14px; line-height: 1.6; color: var(--ink); }

/* 画布与日常操作分列，技术检查仅管理员可见。 */
.workspace, body:not([data-workspace-role="admin"]) .workspace { grid-template-columns:minmax(0,1fr) 360px; align-items:start; }
.workspace > .canvas-column { grid-column:1; grid-row:1; min-height:calc(100dvh - 118px); position:sticky; top:14px; }
/* 管理员有后续整行面板，画布不能吸顶越过首行遮住这些面板。 */
body[data-workspace-role="admin"] .workspace > .canvas-column { position:static; }
.workbench-controls { grid-column:2; grid-row:1; min-width:0; }
.workbench-upload { display:flex; }
.workbench-upload .button { width:100%; min-height:44px; font-size:14px; }
.workbench-controls .processing-dock { margin-top:12px; padding:18px; }
.workbench-controls #automaticDelivery { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.workbench-controls #automaticDelivery > p, .workbench-controls #automaticDelivery > section, .workbench-controls #automaticDeliveryPreview { flex-basis:100%; min-width:0; overflow-wrap:anywhere; }
.workbench-controls #automaticDelivery .button { flex:1 1 130px; white-space:normal; }
.workbench-controls #automaticDeliveryPreview { width:100%; max-height:280px; object-fit:contain; }
.workbench-controls #taskHistory { margin-top:12px; padding:14px 18px; }
.workbench-controls .context-text-option { display:flex; align-items:flex-start; gap:8px; min-height:44px; padding-top:8px; line-height:1.6; }
.context-text-option input { flex-shrink:0; width:18px; height:18px; margin-top:3px; accent-color:var(--teal); }
.workspace > .left-sidebar, .workspace > .right-sidebar { grid-column:1 / -1; grid-row:auto; }
@media (max-width:900px) {
  .workspace, body:not([data-workspace-role="admin"]) .workspace { display:flex; flex-direction:column; }
  .workspace > .canvas-column { position:static; width:100%; min-height:55dvh; }
  .workbench-controls { width:100%; }
  .workspace > .left-sidebar, .workspace > .right-sidebar { width:100%; }
}

/* ===== 791 三栏工作台：左任务与输入 · 中画布与结果 · 右处理进度 ===== */
body { --pane-gap:14px; }
body .workspace,
body[data-workspace-role="admin"] .workspace,
body:not([data-workspace-role="admin"]) .workspace {
  display:grid;
  grid-template-columns:var(--pane-left-width,320px) var(--pane-gap) minmax(340px,1fr) var(--pane-gap) var(--pane-right-width,364px);
  align-items:stretch;
  gap:0;
  height:calc(100dvh - 124px);
  min-height:520px;
  margin-top:14px;
}
body[data-left-collapsed="true"] .workspace,
body:not([data-workspace-role="admin"])[data-left-collapsed="true"] .workspace {
  grid-template-columns:0px var(--pane-gap) minmax(340px,1fr) var(--pane-gap) var(--pane-right-width,364px);
}
body[data-right-collapsed="true"] .workspace,
body:not([data-workspace-role="admin"])[data-right-collapsed="true"] .workspace {
  grid-template-columns:var(--pane-left-width,320px) var(--pane-gap) minmax(340px,1fr) var(--pane-gap) 0px;
}
body[data-left-collapsed="true"][data-right-collapsed="true"] .workspace {
  grid-template-columns:0px var(--pane-gap) minmax(340px,1fr) var(--pane-gap) 0px;
}
.pane {
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  min-width:0;
  min-height:0;
  overflow:hidden;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:var(--shadow);
}
.pane[hidden] { display:none !important; }
.pane-center { grid-template-rows:auto minmax(0,1fr) auto auto; }
.pane-head {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:48px;
  padding:0 14px;
  border-bottom:1px solid var(--line);
  background:#fbfcf9;
  border-radius:16px 16px 0 0;
}
.pane-title { flex:1 1 auto; color:var(--ink); font-size:13px; font-weight:800; letter-spacing:.02em; }
.pane-toggle {
  flex:0 0 auto;
  min-height:30px;
  padding:0 9px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:var(--teal);
  font-size:12px;
}
.pane-toggle:hover { background:#eef4ef; }
.pane-body { min-height:0; padding:14px; overflow-y:auto; overscroll-behavior:contain; }
.pane-body > * + * { margin-top:14px; }
.pane-resizer { position:relative; width:var(--pane-gap); cursor:col-resize; touch-action:none; }
.pane-resizer::after {
  content:'';
  position:absolute;
  top:12px;
  bottom:12px;
  left:50%;
  width:2px;
  transform:translateX(-50%);
  border-radius:99px;
  background:transparent;
  transition:background .16s ease;
}
.pane-resizer:hover::after, .pane-resizer:focus-visible::after, .pane-resizer.is-dragging::after { background:#b9c7bc; }
.pane-resizer:focus-visible { outline:none; }

/* 左栏：任务与输入 */
.workbench-upload { display:flex; gap:8px; }
.workbench-upload .button { flex:1 1 0; min-height:42px; font-size:13px; white-space:nowrap; }
.source-card {
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8faf7;
}
.source-card img {
  flex:0 0 auto;
  width:64px;
  height:64px;
  object-fit:contain;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23eef1ee'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23eef1ee'/%3E%3C/svg%3E") repeat;
}
.source-card-meta { min-width:0; display:grid; gap:4px; }
.source-card-meta strong { font-size:13px; overflow-wrap:anywhere; }
.source-card-meta span { color:var(--muted); font:500 11px 'DM Mono', monospace; }
.hint-line { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.pane-left .processing-dock {
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  border-radius:0;
}
.pane-left .processing-dock > * + * { margin-top:10px; }
.pane-left .processing-dock > label { display:block; margin:10px 0 6px; font-size:12px; font-weight:700; color:#46534c; }
.pane-left .processing-dock select { max-width:none; }
.pane-left .context-text-option { display:flex; align-items:flex-start; gap:8px; min-height:36px; font-size:12px; line-height:1.6; }
.pane-left .context-text-option input { flex:0 0 auto; width:16px; height:16px; margin-top:3px; accent-color:var(--teal); }
.task-actions { padding-top:14px; border-top:1px solid var(--line); }
.section-heading-note { color:var(--muted); font:500 10px 'DM Mono', monospace; }
.task-number { margin:8px 0 0; padding:8px 10px; border:1px dashed #cdd8cf; border-radius:8px; background:#f7faf6; }
.task-copy { width:100%; min-height:34px; margin-top:8px; font-size:12px; }
.task-copy[hidden] { display:none !important; }
#currentTaskNumber[hidden] + #copyTaskNumber { display:none; }
.task-action-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.task-action-row .button { min-height:42px; font-size:13px; white-space:normal; }
#automaticDelivery {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:8px;
  margin-top:0;
}
#automaticDelivery > p { margin:0; line-height:1.6; overflow-wrap:anywhere; }
#automaticDeliveryStatus { color:var(--teal); font-size:13px; }
#automaticDeliveryActivity { font-size:12px; }
#automaticDelivery .button { min-height:40px; font-size:13px; }
.danger-zone { margin-top:6px; padding:10px 12px; border:1px solid #f0d5cf; border-radius:10px; background:#fdf7f5; }
.danger-zone > summary { cursor:pointer; color:#a5341f; font-size:12px; font-weight:700; }
.danger-zone .brand-subtitle { color:#8a5449; font-size:12px; }
.button-danger { width:100%; margin-top:8px; border-color:#e0b6ac; background:#fff; color:#a5341f; }
.button-danger:hover { background:#f9ece8; }
.secondary-panel { padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fbfcfa; }
.secondary-panel > summary { cursor:pointer; padding:2px 0; color:#46534c; font-size:12px; font-weight:700; }
.secondary-body { display:grid; gap:8px; padding-top:8px; }
.secondary-body .button { min-height:38px; font-size:12px; }
.user-task-history { margin:0; padding:10px 12px; }
#taskHistory > summary { padding:2px 0 8px; font-size:13px; }
.history-tools { display:grid; grid-template-columns:1fr auto; gap:6px; }
.history-tools input { grid-column:1 / -1; min-height:34px; font-size:12px; }
.history-tools select { min-height:34px; font-size:12px; }
.history-tools .button { min-height:34px; font-size:12px; }
#taskHistoryStatus { margin:8px 0; font-size:12px; line-height:1.6; color:var(--muted); }
#taskHistoryList { display:grid; gap:8px; margin:0; padding:0; max-height:none; list-style:none; }

/* 中栏：画布与结果 */
.pane-center .canvas-toolbar {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  min-height:54px;
  padding:8px 14px;
  border-bottom:1px solid var(--line);
}
.toolbar-left { display:flex; align-items:center; gap:10px; min-width:0; }
.toolbar-left .canvas-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:42ch; }
.toolbar-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.view-switch { display:inline-flex; padding:2px; border:1px solid var(--line); border-radius:9px; background:#f4f7f2; }
.view-tab {
  min-height:28px;
  padding:0 12px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#536159;
  font-size:12px;
  font-weight:700;
}
.view-tab:hover { color:var(--teal); }
.view-tab.is-active { background:#fff; color:var(--teal); box-shadow:0 1px 2px rgba(30,50,40,.12); }
.toolbar-separator { width:1px; height:20px; margin:0 2px; background:var(--line); }
.zoom-label {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:48px;
  height:28px;
  border-radius:7px;
  color:var(--teal);
  font:600 11px 'DM Mono', monospace;
  font-variant-numeric:tabular-nums;
}
.zoom-label:hover { background:#eef4ef; }
.icon-button { width:28px; height:28px; font-size:14px; }
.pane-center .canvas-stage { margin:12px 14px 10px; min-height:0; }
.pane-center .preview-wrap { padding:16px; }
.pane-center .svg-preview svg, .pane-center .source-preview img { max-width:100%; max-height:100%; }
.preview-wrap.is-source-only .svg-preview { display:none; }
.preview-wrap.is-source-only .source-preview { display:block !important; }
.result-bar {
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  border-top:1px solid var(--line);
  background:#fbfcf9;
}
.version-strip { display:flex; gap:10px; min-width:0; }
.version-item {
  display:grid;
  gap:4px;
  margin:0;
  padding:0;
  width:76px;
  text-align:center;
}
.version-item img, .version-placeholder {
  width:76px;
  height:56px;
  object-fit:contain;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23eef1ee'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23eef1ee'/%3E%3C/svg%3E") repeat;
}
.version-placeholder { display:grid; place-items:center; color:#9aa6a0; font-size:11px; }
.version-item figcaption { color:var(--muted); font-size:11px; line-height:1.35; }
.version-item.is-active img, .version-item.is-active .version-placeholder { border-color:var(--teal); box-shadow:0 0 0 2px rgba(15,90,85,.14); }
.result-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.result-actions .button { min-height:40px; font-size:13px; white-space:normal; }
.pane-center .canvas-footer { padding:8px 14px; border-top:1px solid var(--line); }

/* 右栏：处理进度与问题 */
.project-block { padding-bottom:12px; border-bottom:1px solid var(--line); }
.project-block h1 { max-width:none; font-size:16px; }
.project-block .project-title-row { margin-top:0; }
.progress-badge {
  flex:0 0 auto;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid var(--line);
  background:#f5f7f3;
  color:#536159;
}
.progress-badge[data-state="running"] { border-color:#bcd6e6; background:#eef6fb; color:#175a7c; }
.progress-badge[data-state="waiting"] { border-color:#e3d3ab; background:#fdf6e7; color:#7a5a12; }
.progress-badge[data-state="attention"] { border-color:#e6bdb3; background:#fdf1ee; color:#a5341f; }
.progress-badge[data-state="done"] { border-color:#c3dbc9; background:#eff7f1; color:#2f6b46; }
.progress-detail {
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfcfa;
}
.progress-detail dl { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 10px; margin:0; }
.progress-detail dt { color:var(--muted); font-size:12px; white-space:nowrap; }
.progress-detail dd { margin:0; font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
.progress-detail .next-step { padding-top:8px; border-top:1px dashed #d7e0d8; color:var(--ink); font-size:12px; line-height:1.6; }
.progress-empty { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.issue-panel { display:grid; gap:8px; padding:12px; border:1px solid #efdcc4; border-radius:12px; background:#fdfaf3; }
.issue-panel > strong { font-size:12px; color:#8a5a13; }
.issue-panel p, .issue-panel li { font-size:12px; line-height:1.6; }
.issue-panel ul { display:grid; gap:6px; margin:0; padding-left:16px; }
.text-attention { display:grid; gap:10px; }
.admin-panel { margin-top:16px; border-top:1px solid var(--line); padding-top:12px; }
.admin-panel > summary { cursor:pointer; padding:6px 0; color:#46534c; font-size:12px; font-weight:700; }
.admin-panel .inspector-header { margin:10px 0 12px; }
body:not([data-workspace-role="admin"]) #adminPanel { display:none !important; }
.pane-right .metric-grid { grid-template-columns:1fr 1fr; margin:12px 0; }

/* 历史任务卡片与缩略图 */
.history-card {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.history-card:hover { border-color:#c2d0c5; }
.history-thumb-wrap { position:relative; display:grid; gap:4px; }
.history-thumb {
  width:64px;
  height:64px;
  padding:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23eef1ee'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23eef1ee'/%3E%3C/svg%3E") repeat;
}
.history-thumb img { display:block; width:100%; height:100%; object-fit:contain; }
.history-thumb-empty { display:grid; place-items:center; width:100%; height:100%; color:#9aa6a0; font-size:11px; }
.history-thumb-source { display:flex; gap:4px; font-size:10px; }
.history-thumb-source button {
  flex:1 1 0;
  min-height:22px;
  padding:0;
  border:1px solid var(--line);
  border-radius:6px;
  background:#f7faf6;
  color:#536159;
  font-size:10px;
}
.history-thumb-source button.is-active { border-color:var(--teal); color:var(--teal); background:#eef4ef; }
.history-card-body { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; min-width:0; }
.history-card-title { display:flex; gap:6px; align-items:baseline; min-width:0; }
.history-card-title strong { flex:1 1 auto; min-width:0; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.history-badge { flex:0 0 auto; padding:2px 7px; border-radius:999px; border:1px solid var(--line); background:#f5f7f3; color:#536159; font-size:10px; white-space:nowrap; }
.history-badge[data-state="running"] { border-color:#bcd6e6; background:#eef6fb; color:#175a7c; }
.history-badge[data-state="waiting"] { border-color:#e3d3ab; background:#fdf6e7; color:#7a5a12; }
.history-badge[data-state="attention"] { border-color:#e6bdb3; background:#fdf1ee; color:#a5341f; }
.history-badge[data-state="done"] { border-color:#c3dbc9; background:#eff7f1; color:#2f6b46; }
.history-card-time { color:var(--muted); font-size:11px; }
.history-card-id { display:flex; gap:6px; align-items:center; }
.history-card-id code { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#536159; font:500 10px 'DM Mono', monospace; }
.history-copy { flex:0 0 auto; min-height:24px; padding:0 8px; border:1px solid var(--line); border-radius:6px; background:#f7faf6; color:var(--teal); font-size:10px; }
.history-card-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:2px; }
.history-card-actions button { margin:0; min-height:30px; padding:0 10px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--teal); font-size:11px; }
.history-card-actions .history-open { display:inline-flex; gap:0; align-items:center; flex:1 1 100%; justify-content:center; padding:0 10px; border:1px solid #b2c6b8; border-bottom:1px solid #b2c6b8; font-weight:700; }
.history-card-actions .history-delete { margin:0; border-color:#e6bdb3; color:#a5341f; }
.history-card-actions button:disabled { opacity:.55; cursor:not-allowed; }
.history-card.is-disabled { opacity:.7; }
.history-timeline { grid-column:1 / -1; }

/* 缩略图放大查看 */
.thumb-viewer {
  position:fixed;
  inset:0;
  z-index:2000;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(20,28,24,.66);
}
.thumb-viewer figure { display:grid; gap:10px; margin:0; max-width:min(92vw,860px); max-height:90vh; }
.thumb-viewer img {
  max-width:100%;
  max-height:78vh;
  object-fit:contain;
  border-radius:10px;
  background:#fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23eef1ee'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23eef1ee'/%3E%3C/svg%3E") repeat;
}
.thumb-viewer figcaption { color:#eef2ee; font-size:12px; text-align:center; }
.thumb-viewer-close {
  position:absolute;
  top:18px;
  right:18px;
  min-height:36px;
  padding:0 14px;
  border:1px solid #cfd8d1;
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font-size:12px;
  font-weight:700;
}

@media (max-width:1400px) {
  body { --pane-left-width:288px; --pane-right-width:330px; }
}
@media (max-width:1180px) {
  body { --pane-left-width:264px; --pane-right-width:300px; }
  .result-bar { flex-wrap:wrap; }
  .result-actions { width:100%; justify-content:flex-start; }
}
@media (max-width:980px) {
  body .workspace, body[data-workspace-role="admin"] .workspace,
  body:not([data-workspace-role="admin"]) .workspace {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(420px,62dvh) auto auto;
    height:auto;
    min-height:0;
  }
  .pane-resizer { display:none; }
  .pane { border-radius:14px; }
  .pane-left, .pane-right { max-height:none; }
  .pane-center { grid-row:1; }
  .pane-left { grid-row:2; }
  .pane-right { grid-row:3; }
  .pane-body { overflow:visible; }
  body[data-left-collapsed="true"] .pane-left,
  body[data-right-collapsed="true"] .pane-right { display:grid; }
  .pane-toggle { display:none; }
}
@media (max-width:640px) {
  .app-shell { padding:10px; }
  body .workspace { min-height:0; }
  .pane-center { grid-template-rows:auto minmax(320px,58dvh) auto auto; }
  .task-action-row { grid-template-columns:1fr; }
  .history-tools { grid-template-columns:1fr; }
  .version-item { width:64px; }
  .version-item img, .version-placeholder { width:64px; height:48px; }
  .thumb-viewer { padding:12px; }
}

.ai-canvas-dialog {
  width:calc(100vw - 32px);
  max-width:none;
  height:calc(100dvh - 32px);
  max-height:none;
  padding:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  box-shadow:0 24px 80px rgba(15,28,20,.28);
}
.ai-canvas-dialog::backdrop { background:rgba(20,28,24,.66); }
.ai-canvas-shell { display:grid; grid-template-rows:auto minmax(0,1fr); height:100%; }
.ai-canvas-head { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:40px; padding:4px 12px; border-bottom:1px solid var(--line); }
.ai-canvas-head > div { display:flex; align-items:center; gap:12px; min-width:0; }
.ai-canvas-head strong { flex-shrink:0; font-size:14px; }
.ai-canvas-head p { overflow:hidden; margin:0; color:var(--muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.ai-canvas-head .button { flex-shrink:0; min-height:30px; padding:4px 10px; font-size:12px; }
.ai-canvas-dialog iframe { width:100%; height:100%; min-height:0; border:0; background:#fff; }
@media (max-width:640px) {
  .ai-canvas-dialog { width:100vw; height:100dvh; max-height:none; border:0; border-radius:0; }
  .ai-canvas-head { padding:4px 8px; }
  .ai-canvas-head p { display:none; }
}
