:root {
  --bg: #f4f7f5;
  --surface: #fff;
  --ink: #18231e;
  --muted: #6b7972;
  --line: #dbe4df;
  --green: #1d7552;
  --green-soft: #e5f1ea;
  --amber: #9a6618;
  --amber-soft: #fff2d8;
  --red: #a44e47;
  --shadow: 0 12px 30px rgba(22, 51, 38, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--line); background: #eef3f0; padding: 26px 16px 18px; display: flex; flex-direction: column; }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 2px 9px 26px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--green); color: white; font-weight: 800; border-radius: 8px; letter-spacing: 0; }
.brand strong { display: block; font-size: 16px; letter-spacing: .01em; }
.brand small, .sidebar-foot small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.side-nav { display: grid; gap: 5px; }
.nav-item { color: #536159; text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 6px; }
.nav-item:hover, .nav-item.active { background: #dcebe3; color: var(--green); }
.nav-item.active { font-weight: 700; }
.nav-icon { width: 18px; text-align: center; font-size: 17px; line-height: 1; }
.nav-icon svg { width: 16px; height: 16px; vertical-align: middle; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 9px 2px; display: flex; align-items: center; gap: 9px; color: #536159; }
.sidebar-foot strong { font-size: 12px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; background: #3d9c6d; border-radius: 50%; box-shadow: 0 0 0 4px #d3eadc; }
.main-content { max-width: 1450px; width: 100%; margin: 0 auto; padding: 30px clamp(20px, 4vw, 58px) 60px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
h1, h2, p { margin: 0; }
h1 { margin-top: 8px; font-size: clamp(24px, 3vw, 35px); line-height: 1.2; letter-spacing: 0; }
h2 { margin-top: 5px; font-size: 17px; letter-spacing: 0; }
.topbar-meta { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.badge { border: 1px solid var(--line); border-radius: 99px; background: var(--surface); padding: 5px 10px; color: var(--green); font-weight: 700; }
.badge.running { background: var(--green-soft); border-color: #c0dccd; }
.workspace-grid { display: grid; grid-template-columns: minmax(300px, 410px) minmax(0, 1fr); gap: 20px; align-items: start; }
.input-column, .result-column { display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.input-panel, .pipeline-panel, .result-panel, .event-panel { padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.result-heading { align-items: center; }
.result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.result-actions .secondary-button { white-space: nowrap; }
.result-actions svg, .proposal-commit-button svg { width: 14px; height: 14px; }
.muted { color: var(--muted); font-size: 11px; }
.dropzone { min-height: 158px; border: 1px dashed #a7bbb0; border-radius: 7px; background: #f7faf8; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; text-align: center; position: relative; overflow: hidden; color: var(--muted); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover, .dropzone.paste-active { border-color: var(--green); background: var(--green-soft); outline: none; box-shadow: 0 0 0 3px rgba(40, 125, 83, .1); }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.dropzone strong { color: var(--ink); font-size: 13px; }
.upload-icon { color: var(--green); font-size: 27px; line-height: 1; }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #f7faf8; }
.dropzone kbd { border: 1px solid #bdcbc4; border-bottom-width: 2px; border-radius: 4px; background: white; color: #4d5e55; padding: 1px 5px; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.paste-status { position: absolute; z-index: 2; right: 8px; bottom: 8px; border-radius: 4px; background: rgba(24, 35, 30, .84); color: white; padding: 5px 8px; font-size: 10px; }
.field-group { margin-top: 17px; }
.keyword-group { margin-top: 0; margin-bottom: 17px; }
.keyword-hint { color: var(--muted); font-size: 10px; white-space: nowrap; }
.field-group label, .field-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.field-group label span, .field-label-row label span { color: var(--muted); font-weight: 400; font-size: 10px; }
.field-label-row label { margin: 0; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: #fbfcfb; color: var(--ink); border-radius: 5px; padding: 10px; line-height: 1.55; outline: none; }
textarea:focus { border-color: #77aa91; box-shadow: 0 0 0 3px rgba(40, 125, 83, .1); }
.text-button { border: 0; padding: 0; color: var(--green); background: none; font-size: 11px; }
.primary-button, .secondary-button { border-radius: 5px; padding: 10px 14px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; }
.primary-button { width: 100%; margin-top: 18px; color: white; background: var(--green); }
.primary-button:hover { background: #165d41; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { color: var(--green); border-color: #bdd5c7; background: var(--green-soft); font-size: 11px; }
.secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.privacy-note { color: var(--muted); font-size: 10px; margin-top: 11px; text-align: center; }
.stage-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.stage-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 27px; align-items: center; gap: 9px; padding: 11px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfb; }
.stage-item.running { background: #f1f8f3; border-color: #b9d9c7; }
.stage-item.done { border-color: #cfe3d6; }
.stage-item.failed { border-color: #e8c4c0; background: #fff7f6; }
.stage-number { color: var(--muted); font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.stage-copy { min-width: 0; }
.stage-copy strong, .stage-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-copy strong { font-size: 12px; }
.stage-copy small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.stage-status { color: var(--muted); font-size: 10px; }
.stage-item.running .stage-status, .stage-item.done .stage-status { color: var(--green); font-weight: 700; }
.stage-item.failed .stage-status { color: var(--red); font-weight: 700; }
.retry-button { border: 0; background: none; color: var(--red); font-size: 17px; padding: 0; }
.empty-state { min-height: 480px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; color: var(--muted); text-align: center; padding: 30px; }
.empty-state strong { color: #425149; font-size: 13px; }
.empty-state span { max-width: 300px; font-size: 11px; line-height: 1.6; }
.empty-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #b8d4c3; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 23px; margin-bottom: 5px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; margin-bottom: 18px; }
.summary-strip > div { padding: 11px 13px; border-right: 1px solid var(--line); min-width: 0; }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .summary-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip span { color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.summary-strip strong { font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 9px 12px; font-size: 11px; white-space: nowrap; }
.tab.active { border-bottom-color: var(--green); color: var(--green); font-weight: 700; }
.tab-panel { display: none; padding-top: 16px; }
.tab-panel.active { display: block; }
.markdown-preview, .result-block pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; color: #2d3c34; }
.markdown-preview { min-height: 408px; max-height: 640px; overflow: auto; padding: 17px; background: #f8faf8; border: 1px solid var(--line); border-radius: 5px; }
.note-proposal { margin: 0 0 18px; padding: 15px; border: 1px solid #b9d9c7; border-radius: 6px; background: #f4faf6; }
.note-proposal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-proposal-heading h3 { margin: 4px 0 0; font-size: 14px; }
.proposal-status { padding: 4px 7px; border: 1px solid #b9d9c7; border-radius: 4px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.proposal-status.committed { border-color: #b9d9c7; color: var(--green); }
.proposal-status.failed { border-color: #e8c4c0; color: var(--red); background: #fff7f6; }
.note-proposal-meta { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.proposal-preview { max-height: 270px; margin: 12px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: #2d3c34; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.note-proposal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.proposal-commit-button { width: auto; margin-top: 0; padding: 8px 11px; font-size: 11px; }
.note-proposal.is-committed { border-color: #b9d9c7; background: #f7fbf8; }
.result-block { border: 1px solid var(--line); border-radius: 5px; padding: 16px; min-height: 340px; }
.ocr-review-block { min-height: 0; }
.ocr-original-preview { max-height: 220px; min-height: 92px; overflow: auto; padding: 12px; background: #f8faf8; border: 1px solid var(--line); border-radius: 5px; color: #425149; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ocr-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; margin-bottom: 7px; }
.ocr-editor-heading label { color: var(--ink); font-size: 12px; font-weight: 700; }
.ocr-editor-heading span { color: var(--muted); font-size: 10px; }
#ocrCorrectedText { min-height: 170px; background: #fff; }
.ocr-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.ocr-editor-actions .secondary-button { width: auto; flex: 0 0 auto; }
.ocr-confidence-panel { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); }
.ocr-confidence-panel .block-meta { margin-bottom: 8px; }
.confidence-list { display: flex; flex-wrap: wrap; gap: 6px; }
.confidence-item { display: inline-block; max-width: 100%; padding: 5px 8px; border: 1px solid #f0d79f; border-radius: 4px; background: var(--amber-soft); color: #7d581d; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.block-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; margin-bottom: 11px; }
.label-line { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.label-line:last-child { border-bottom: 0; }
.label-line > span { color: var(--muted); font-size: 11px; }
.label-line p { line-height: 1.6; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 7px; background: var(--green-soft); color: var(--green); border-radius: 4px; font-size: 10px; }
.key-sentences { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 13px; }
.block-title { color: var(--muted); font-size: 10px; }
.key-sentences ul { margin: 9px 0 0; padding-left: 17px; line-height: 1.7; font-size: 11px; }
.retrieval-block { min-height: 340px; }
.retrieval-query { color: #425149; font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.retrieval-warning { color: var(--amber); background: var(--amber-soft); border: 1px solid #f0d79f; border-radius: 4px; padding: 8px 10px; font-size: 11px; line-height: 1.5; margin: 0 0 12px; }
.source-list { display: grid; gap: 10px; }
.source-item { border: 1px solid var(--line); border-radius: 5px; padding: 11px 12px; background: #fbfcfb; }
.source-heading { display: flex; align-items: flex-start; gap: 9px; }
.source-number { color: var(--green); font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace; padding-top: 2px; }
.source-title { color: var(--green); font-size: 12px; line-height: 1.45; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.source-title:hover { text-decoration: underline; }
.source-snippet { color: #506058; font-size: 11px; line-height: 1.6; margin: 7px 0 9px 21px; }
.source-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; margin-left: 21px; }
.source-meta time { font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-empty { margin: 8px 0 0 21px; line-height: 1.6; }
.event-list { min-height: 62px; display: grid; gap: 6px; }
.event-row { display: flex; align-items: center; gap: 9px; color: #506058; font-size: 11px; }
.event-row time { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; margin-left: auto; }
.event-icon { width: 7px; height: 7px; border-radius: 50%; background: #9eb0a6; }
.event-icon.done { background: var(--green); }
.event-icon.failed { background: var(--red); }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(360px, calc(100vw - 44px)); padding: 11px 14px; background: #22342b; color: white; border-radius: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 900px) { .app-shell { grid-template-columns: 1fr; } .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 13px 18px; display: block; } .brand { padding: 0 0 12px; } .side-nav { display: flex; gap: 3px; } .nav-item { padding: 7px 9px; font-size: 12px; } .sidebar-foot { display: none; } .main-content { padding: 24px 18px 40px; } }
@media (max-width: 680px) { .topbar { display: block; } .topbar-meta { margin-top: 13px; } .workspace-grid { grid-template-columns: 1fr; } .empty-state { min-height: 260px; } .result-heading { display: block; } .result-actions { width: 100%; justify-content: flex-start; margin-top: 12px; } .secondary-button { padding: 8px 9px; } .summary-strip > div { padding: 9px; } .note-proposal-actions { align-items: stretch; flex-direction: column-reverse; } .proposal-commit-button { width: 100%; } .ocr-editor-actions { align-items: stretch; flex-direction: column; } .ocr-editor-actions .secondary-button { width: 100%; } }
