:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #172033;
  --muted: #6b7485;
  --line: #e4e9f0;
  --primary: #1768e5;
  --primary-dark: #0f53bb;
  --safe: #078754;
  --safe-bg: #eaf8f1;
  --warn: #a85b00;
  --warn-bg: #fff5e6;
  --danger: #b42318;
  --shadow: 0 8px 28px rgba(28, 47, 78, .055);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); }
.shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 54px; }
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; gap: 20px; }
.workspace { min-width: 0; }
.workspace > .hero { margin-bottom: 12px; padding: 4px 2px 16px; border-bottom: 1px solid var(--line); }
.sidebar { position: sticky; top: 20px; display: flex; min-height: calc(100vh - 46px); flex-direction: column; padding: 18px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 7px 20px; border-bottom: 1px solid #eef1f5; }
.sidebar-logo { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: var(--primary); color: #fff; font-size: 18px; font-weight: 800; }
.sidebar-brand div { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 15px; }
.sidebar-brand small { color: var(--muted); font-size: 11px; }
.sidebar-nav { display: grid; gap: 5px; margin-top: 18px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 10px; color: #526078; font-size: 13px; font-weight: 650; text-decoration: none; transition: background .15s ease, color .15s ease; }
.sidebar-link:hover { background: #f3f7fd; color: var(--primary); }
.sidebar-link.active { background: #eaf2ff; color: var(--primary); }
.sidebar-mark { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: #f1f4f8; color: #8290a4; font-size: 10px; font-weight: 800; }
.sidebar-link.active .sidebar-mark { background: var(--primary); color: #fff; }
.sidebar-note { display: grid; gap: 5px; margin: auto 7px 4px; padding: 12px; border-radius: 11px; background: #f6f9fd; color: var(--muted); font-size: 11px; line-height: 1.45; }
.sidebar-note strong { color: #315a90; font-size: 12px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 14px; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.035em; }
h2 { margin: 3px 0 5px; font-size: 20px; letter-spacing: -.01em; }
h3 { color: #354258; }
p { color: var(--muted); }
.subtitle { margin: 7px 0 0; font-size: 14px; }
.badge { border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.badge.safe { color: var(--safe); background: var(--safe-bg); }
.badge.live { color: #a53b00; background: #fff0e7; }
.notice { padding: 11px 15px; margin-bottom: 12px; border: 1px solid #cce8da; border-radius: 12px; background: #f0faf5; color: #176742; font-size: 13px; }

.connection-strip { display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: stretch; gap: 1px; margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); box-shadow: var(--shadow); }
.connection-item { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; min-width: 0; padding: 12px 14px; background: #fff; }
.connection-item div { min-width: 0; }
.connection-item div > span { display: block; color: var(--muted); font-size: 11px; }
.connection-item strong { display: block; margin: 2px 0; font-size: 14px; }
.connection-item small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #aab3c2; box-shadow: 0 0 0 4px #eef1f5; }
.connection-item:has(strong.ok) .status-dot { background: var(--safe); box-shadow: 0 0 0 4px var(--safe-bg); }
.connection-item:has(strong.waiting) .status-dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.connection-item:has(strong.bad) .status-dot { background: var(--danger); box-shadow: 0 0 0 4px #fdeceb; }
.connection-item strong.waiting { color: var(--warn); }
.text-button { border-radius: 0; background: #f8fafc; color: #315a90; font-size: 13px; }
.system-recovery-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0; padding: 13px 16px; border: 1px solid #cfe0f5; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.system-recovery-panel > div { display: grid; gap: 3px; min-width: 0; }
.system-recovery-panel strong { color: #26364e; font-size: 14px; }
.system-recovery-panel small { color: var(--muted); line-height: 1.45; }
.system-recovery-panel.ready { border-color: #b9e4cf; background: #f7fcf9; }
.system-recovery-panel.ready strong { color: var(--safe); }
.system-recovery-panel.waiting, .system-recovery-panel.busy { border-color: #edc98d; background: var(--warn-bg); }
.system-recovery-panel.waiting strong, .system-recovery-panel.busy strong { color: #7e4b00; }
.system-recovery-panel.failed { border-color: #efc4bf; background: #fff8f7; }
.system-recovery-panel.failed strong { color: var(--danger); }

.task-center { margin: 14px 0; padding: 16px 18px; border: 1px solid #cfe0f5; border-radius: 14px; background: linear-gradient(135deg, #fff 0%, #f5f9ff 100%); box-shadow: var(--shadow); }
.task-center-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.task-center-heading h2 { margin-top: 3px; }
.task-center-heading small { color: var(--muted); font-size: 11px; }
.task-center-queue-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #f7f9fc; color: var(--muted); font-size: 12px; line-height: 1.45; }
.task-center-list { display: grid; gap: 9px; margin-top: 12px; }
.task-center-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 12px; border: 1px solid #e1e8f2; border-radius: 10px; background: #fff; }
.task-center-item > i { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #9aa7b8; box-shadow: 0 0 0 4px #eef2f7; }
.task-center-item.running > i { background: var(--primary); box-shadow: 0 0 0 4px #eaf2ff; animation: task-pulse 1.5s ease-in-out infinite; }
.task-center-item.queued > i, .task-center-item.waiting > i { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.task-center-item.success > i { background: var(--safe); box-shadow: 0 0 0 4px var(--safe-bg); }
.task-center-item.failed > i, .task-center-item.unknown > i { background: var(--danger); box-shadow: 0 0 0 4px #fdeceb; }
.task-center-main { min-width: 0; }
.task-center-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.task-center-title strong { color: #26364e; font-size: 13px; }
.task-center-title span { color: var(--primary); font-size: 12px; font-weight: 750; }
.task-center-detail { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.task-center-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.task-center-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.task-center-progress-track { flex: 1; height: 7px; overflow: hidden; border-radius: 999px; background: #e8eef6; }
.task-center-progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1768e5, #64a0f4); transition: width .25s ease; }
.task-center-progress-label { color: #58708e; font-size: 11px; font-weight: 750; }
.task-center-item.failed .task-center-detail, .task-center-item.unknown .task-center-detail { color: var(--danger); font-weight: 650; }
@keyframes task-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.overview-card { margin-top: 14px; padding: 18px 20px; border: 1px solid #cfe0f5; border-radius: 16px; background: linear-gradient(135deg, #fff 0%, #f4f8ff 100%); box-shadow: var(--shadow); }
.overview-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.overview-heading h2 { margin-top: 3px; }
.overview-heading p { margin: 4px 0 0; font-size: 13px; }
.overview-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 14px; }
.overview-action { display: grid; gap: 4px; min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.overview-action:hover { border-color: #9ebbe6; background: #f9fbff; transform: translateY(-1px); }
.overview-action.primary { border-color: #a9c9f5; background: #eef5ff; }
.overview-action.has-work { border-color: #f0cf9c; background: #fffbf4; }
.overview-action strong { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.overview-action strong b { color: var(--warn); }
.overview-action small { color: var(--muted); font-size: 12px; }

.flow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0; color: #7a8494; font-size: 13px; }
.flow span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.flow b { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #e8edf5; color: #647084; font-size: 12px; }
.flow .active { color: var(--primary); font-weight: 700; }
.flow .active b { background: var(--primary); color: #fff; }
.flow i { width: 34px; height: 1px; background: #d9e0ea; }

.card { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.command-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 22px 24px; }
.command-copy p { margin: 0; }
.section-kicker { color: var(--primary); font-size: 12px; font-weight: 800; }
.section-kicker.warning { color: var(--warn); }
.primary-large { min-width: 170px; padding: 14px 20px; font-size: 16px; }
.resume-run-panel { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid #edc98d; border-radius: 11px; background: var(--warn-bg); }
.resume-run-panel div { display: grid; gap: 4px; }
.resume-run-panel strong { color: #7e4b00; font-size: 14px; }
.resume-run-panel small { color: #80623b; line-height: 1.45; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.compact-metrics { grid-column: 1 / -1; }
.metric { display: flex; align-items: baseline; gap: 7px; padding: 10px 13px; border: 1px solid #edf0f4; border-radius: 11px; background: #f9fafc; }
.metric strong { font-size: 22px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric.attention strong { color: var(--warn); }
.progress { grid-column: 1 / -1; padding: 11px 13px; border-radius: 10px; background: #eef5ff; color: #225a9d; }
.range-panel { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 11px; background: #fafbfd; }
.range-panel > summary { display: flex; align-items: center; gap: 10px; padding: 11px 13px; list-style: none; color: #315a90; cursor: pointer; }
.range-panel > summary::-webkit-details-marker { display: none; }
.range-panel > summary::before { content: "+"; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: #e8f0fb; font-weight: 800; }
.range-panel[open] > summary::before { content: "−"; }
.range-panel > summary span { font-size: 13px; font-weight: 750; }
.range-panel > summary small { color: var(--muted); }
.range-body { padding: 0 13px 13px; border-top: 1px solid var(--line); }
.preset-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 0 10px; color: var(--muted); font-size: 12px; }
.small-button { padding: 7px 10px; font-size: 12px; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; }
.range-fields input { min-height: 41px; }
.range-body > p { margin: 9px 0 0; font-size: 12px; }
.hidden { display: none !important; }

.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.section-head p { margin: 0 0 13px; font-size: 13px; }
.section-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.count-badge, .state-pill { display: inline-flex; vertical-align: 2px; margin-left: 6px; padding: 3px 8px; border-radius: 999px; background: #eef3fa; color: #51627a; font-size: 12px; font-weight: 700; }
.state-pill.ready { background: var(--safe-bg); color: var(--safe); }
.state-pill.waiting { background: var(--warn-bg); color: var(--warn); }
.state-pill.muted { background: #eef1f4; color: #65727d; }
.state-pill.running { background: #eaf2ff; color: #1768e5; }
.state-pill.queued { background: #fff7e8; color: #9a5d00; }
.state-pill.success { background: var(--safe-bg); color: var(--safe); }
.state-pill.failed, .state-pill.unknown { background: #fdeceb; color: var(--danger); }
.priority-card { border-color: #f0cf9c; background: #fffcf7; }

.order-workspace-card { border-color: #cfe0f5; background: linear-gradient(135deg, #fff 0%, #f8fbff 100%); }
.order-toolbar { display: grid; grid-template-columns: minmax(260px, 1.7fr) minmax(170px, .8fr) minmax(170px, .8fr); gap: 10px; margin: 13px 0; }
.order-toolbar input, .order-toolbar select { min-height: 41px; }
.order-time-presets { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.order-time-presets > span { color: var(--muted); font-size: 12px; }
.order-time-presets button { min-height: 32px; padding: 5px 11px; }
.order-time-presets button.selected { border-color: var(--primary); background: #e8f1ff; color: var(--primary); }
.order-status-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 2px 0 11px; color: var(--muted); font-size: 12px; }
.order-summary-chip { padding: 5px 8px; border: 1px solid #dce5f1; border-radius: 999px; background: #fff; color: #52647b; }
.order-table-wrap { max-height: 620px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.order-table { min-width: 940px; }
.order-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; }
.order-table td { vertical-align: middle; }
.order-table th:first-child, .order-table td:first-child { width: 46px; min-width: 46px; text-align: center; }
.order-table td:first-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.order-table td:nth-child(2) { min-width: 170px; }
.order-table td:nth-child(4) { min-width: 235px; }
.order-table td:nth-child(5) { min-width: 135px; }
.order-table td:last-child { min-width: 175px; }
.order-table strong, .order-table .order-customer, .order-table small { display: block; }
.order-table strong { color: #24344c; font-size: 13px; }
.order-customer { margin-top: 3px; color: #334b6b; font-weight: 700; }
.order-table small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.order-source-cell { display: grid; grid-template-columns: 46px 1fr; gap: 7px; align-items: center; min-width: 125px; }
.order-thumb { width: 46px; height: 54px; border: 1px solid #d9e1eb; border-radius: 7px; background: #f5f7fa; object-fit: cover; }
.empty-thumb { display: grid; place-items: center; padding: 4px; color: var(--muted); font-size: 10px; text-align: center; }
.order-product-text { display: block; color: #33445d; line-height: 1.5; overflow-wrap: anywhere; }
.order-error { color: var(--danger) !important; }
.order-next-step { display: block; margin-bottom: 7px; color: #56657a; font-size: 12px; line-height: 1.45; }
.order-detail-button { padding: 7px 10px; font-size: 12px; }
.order-detail-panel { margin-top: 14px; padding: 15px; border: 1px solid #cfe0f5; border-radius: 12px; background: #fff; }
.order-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.order-detail-heading h3 { margin: 3px 0 4px; font-size: 17px; }
.order-detail-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.order-flow-wrap { margin-top: 14px; padding: 12px 13px 10px; border: 1px solid #dce5f1; border-radius: 10px; background: #f8fbff; }
.order-flow-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.order-flow-heading strong { color: #315a90; font-size: 13px; }
.order-flow-heading span { color: var(--muted); font-size: 11px; }
.order-status-flow-scroll { overflow-x: auto; padding: 2px 0 4px; }
.order-status-flow { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); min-width: 690px; }
.order-flow-step { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 0; color: #9aa5b5; text-align: center; }
.order-flow-step::after { position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: #dfe6ef; content: ""; }
.order-flow-step:last-child::after { display: none; }
.order-flow-node { position: relative; z-index: 1; display: grid; width: 27px; height: 27px; place-items: center; border: 2px solid #d6dee9; border-radius: 50%; background: #fff; color: #9aa5b5; font-size: 13px; font-weight: 800; }
.order-flow-step strong { color: #6c7889; font-size: 11px; white-space: nowrap; }
.order-flow-step small { max-width: 112px; color: #8b96a5; font-size: 10px; line-height: 1.35; }
.order-flow-step.done { color: var(--safe); }
.order-flow-step.done::after { background: #a9d9c3; }
.order-flow-step.done .order-flow-node { border-color: #71c096; background: var(--safe-bg); color: var(--safe); }
.order-flow-step.done strong { color: #287454; }
.order-flow-step.active .order-flow-node { border-color: #e2a044; background: #fff4df; color: #a85b00; box-shadow: 0 0 0 4px rgba(226, 160, 68, .12); }
.order-flow-step.active strong, .order-flow-step.active small { color: #a85b00; font-weight: 750; }
.order-flow-step.unknown .order-flow-node { border-color: #c46a61; background: #fff0ee; color: var(--danger); box-shadow: 0 0 0 4px rgba(196, 106, 97, .1); }
.order-flow-step.unknown strong, .order-flow-step.unknown small { color: var(--danger); font-weight: 750; }
.order-flow-step.skipped .order-flow-node { border-color: #cfd6df; background: #eef1f4; color: #788493; }
.order-flow-step.skipped strong { color: #65727d; }
.order-flow-step.skipped small { color: #8b96a5; }
.order-flow-step.waiting .order-flow-node { background: #fff; }
.order-detail-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr); gap: 15px; margin-top: 15px; }
.order-evidence-panel { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.order-evidence-panel h3 { margin: 0 0 9px; font-size: 14px; }
.order-detail-image { display: block; width: 100%; max-height: 520px; min-height: 130px; object-fit: contain; border: 1px solid #dce3ec; border-radius: 9px; background: #f3f6fa; }
.order-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.order-fact { min-width: 0; padding: 8px 9px; border-radius: 8px; background: #f1f5fa; }
.order-fact span, .order-fact strong { display: block; }
.order-fact span { color: var(--muted); font-size: 11px; }
.order-fact strong { margin-top: 3px; color: #33445d; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.order-raw-text { margin-top: 11px; }
.order-raw-text summary { color: #315a90; font-size: 12px; cursor: pointer; }
.order-raw-text .review-summary { max-height: 190px; margin-top: 8px; overflow: auto; font-size: 11px; }
.qisemi-order-lines { margin-top: 11px; overflow: hidden; border: 1px solid #dce3ec; border-radius: 9px; background: #fff; }
.qisemi-lines-head, .qisemi-line { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(110px, 1fr) 70px; gap: 9px; align-items: center; padding: 9px 10px; }
.qisemi-lines-head { color: var(--muted); background: #f3f6fa; font-size: 11px; }
.qisemi-line { border-top: 1px solid #edf0f4; color: #3a4a61; font-size: 12px; }
.qisemi-line strong { overflow-wrap: anywhere; }
.qisemi-line span { color: var(--muted); overflow-wrap: anywhere; }
.qisemi-line b { color: #243c62; text-align: right; }

button { appearance: none; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--primary); color: white; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s ease, transform .15s ease, opacity .15s ease; }
button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .48; }
button.secondary { background: #edf3fb; color: #285589; }
button.secondary:hover { background: #e1ebf8; }
button.codex-action { background: #5b4bc4; white-space: nowrap; }
button.codex-action:hover { background: #493ca7; }
button.warning-action { background: #d97706; }
button.warning-action:hover { background: #b85f00; }
button.danger { background: var(--danger); }
button.danger:hover { background: #8f1c13; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.audit-list { display: grid; gap: 8px; }
.audit-item { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(260px, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.audit-identity strong { display: block; margin-bottom: 3px; font-size: 15px; }
.audit-identity small, .audit-address { color: var(--muted); font-size: 12px; }
.audit-details { min-width: 0; }
.audit-details summary { color: #315a90; font-size: 13px; cursor: pointer; }
.audit-detail-lines { margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: #f6f8fb; color: #3e4a5f; font-size: 13px; line-height: 1.55; }
.state-chip { padding: 5px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 12px; white-space: nowrap; }
.audit-error { margin-top: 6px; color: var(--danger); font-size: 12px; }
.audit-button { white-space: nowrap; background: #fff1dd; color: #9a5100; }
.audit-button:hover { background: #ffe5bf; }
.audit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.correction-button { white-space: nowrap; padding-inline: 11px; }
.manual-handled-button { white-space: nowrap; color: #536170; }
.order-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.current-choice { background: #eef2f7; color: #687386; }
.inline-status { margin: 12px 0 0; padding-top: 11px; border-top: 1px solid var(--line); font-size: 13px; transition: background .2s ease, color .2s ease, padding .2s ease; }
.inline-status.attention { padding: 11px 10px; border-radius: 8px; background: #fff3d6; color: #8a4b00; font-weight: 700; }
.empty-state { padding: 22px; border-radius: 11px; background: #f8fafc; color: var(--muted); text-align: center; }

.send-grid { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 10px; align-items: end; }
.field { display: grid; gap: 7px; color: #596579; font-size: 13px; font-weight: 650; }
.field input, .field textarea { width: 100%; border: 1px solid #cfd8e6; border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-weight: 400; padding: 10px 11px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 104, 229, .1); }
.preview-field { margin-top: 13px; }
.preview-field textarea { min-height: 160px; max-height: 360px; resize: vertical; line-height: 1.55; background: #f8fafc; }
.confirm-row { display: flex; gap: 9px; align-items: center; margin-top: 12px; color: var(--text); font-size: 13px; }
.confirm-row input { width: 18px; height: 18px; }
.send-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 11px; flex-wrap: wrap; }
.send-footer p { margin: 0; font-size: 13px; }

.production-card { border-color: #c7d9f3; background: linear-gradient(135deg, #fff 0%, #f8fbff 100%); }
.production-stage-categories { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.production-stage-category { display: grid; gap: 4px; min-width: 0; padding: 11px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); text-align: left; }
.production-stage-category:hover, .production-stage-category.active { border-color: #9ebbe6; background: #eef5ff; color: #225a9d; }
.production-stage-category strong { font-size: 13px; }
.production-stage-category small { color: var(--muted); font-size: 11px; }
.stage-category-workspace { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stage-category-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.stage-category-head span { color: var(--muted); font-size: 12px; }
.stage-category-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid #edf0f4; }
.stage-category-row:last-child { border-bottom: 0; }
.stage-category-row strong { display: block; font-size: 14px; }
.stage-category-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.reconciliation-group { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #dce5f1; }
.reconciliation-group > .flow { margin: 0; }
.reconciliation-group > .card { margin-top: 0; }
.reconciliation-heading { padding: 13px 14px; border: 1px solid #cfe0f5; border-radius: 12px; background: #f8fbff; }
.reconciliation-heading h3 { margin: 3px 0 4px; font-size: 17px; }
.reconciliation-heading p { margin: 0; font-size: 12px; }
.reconciliation-entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fbff; }
.reconciliation-entry strong { display: block; color: #225a9d; font-size: 14px; }
.reconciliation-entry small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.procurement-summary { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.production-filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid #dce5f1; border-radius: 12px; background: #f8fbff; }
.production-filter-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding-bottom: 1px; }
.procurement-summary-card { display: grid; gap: 4px; min-width: 0; padding: 13px 12px; border: 1px solid #dce5f1; border-radius: 12px; background: #fff; color: var(--text); text-align: left; }
.procurement-summary-card:hover, .procurement-summary-card.active { border-color: #9ebbe6; background: #eef5ff; color: #225a9d; }
.procurement-summary-card strong { font-size: 15px; }
.procurement-summary-card span, .procurement-summary-card small { color: var(--muted); font-size: 11px; }
.procurement-summary-card.active span, .procurement-summary-card.active small { color: #4776ad; }
.procurement-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.procurement-filter { padding: 7px 12px; border: 1px solid #d7e1ee; border-radius: 999px; background: #fff; color: #5d6c80; font-size: 12px; }
.procurement-filter:hover, .procurement-filter.active { background: #eaf2ff; color: var(--primary); }
.procurement-sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.procurement-sort-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.procurement-sort { padding: 6px 10px; border: 1px solid #d7e1ee; border-radius: 999px; background: #fff; color: #5d6c80; font-size: 12px; }
.procurement-sort:hover, .procurement-sort.active { background: #eaf2ff; color: var(--primary); }
.data-sort-slot { margin: 10px 0; }
.data-sort-slot.compact { margin: 6px 0 10px; }
.data-sort-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.data-sort-more { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.data-sort-more select { min-width: 118px; padding: 6px 28px 6px 9px; border: 1px solid #d7e1ee; border-radius: 999px; background-color: #fff; color: #5d6c80; font-size: 12px; }
.glue-purchase-rows > .data-sort-toolbar { margin-bottom: 10px; }
.procurement-workspace { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.procurement-workspace-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.procurement-workspace-head span { color: var(--muted); font-size: 12px; }
.procurement-row { display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(120px, auto); align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #edf0f4; }
.procurement-row:last-child { border-bottom: 0; }
.procurement-row > div { min-width: 0; }
.procurement-row strong { display: block; font-size: 14px; }
.procurement-row small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.procurement-row small.procurement-source { color: #60758d; white-space: normal; }
.procurement-completed-group { border-top: 1px solid var(--line); background: #fbfcfe; }
.procurement-completed-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; background: #f8fafc; cursor: pointer; list-style: none; }
.procurement-completed-group > summary::-webkit-details-marker { display: none; }
.procurement-completed-group > summary strong { display: block; font-size: 13px; }
.procurement-completed-group > summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.procurement-completed-group > summary:hover { background: #f0f5fb; }
.procurement-completed-toggle { flex: 0 0 auto; color: var(--primary); font-size: 12px; font-weight: 700; }
.procurement-completed-group > summary .expanded-label { display: none; }
.procurement-completed-group[open] > summary { border-bottom: 1px solid var(--line); }
.procurement-completed-group[open] > summary .collapsed-label { display: none; }
.procurement-completed-group[open] > summary .expanded-label { display: inline; }
.procurement-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.production-model-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.production-date-badge { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid #f0d39d; border-radius: 999px; background: #fff7e8; color: #9a5d00; font-size: 11px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.production-date-badge.missing { border-color: #dfe5ed; background: #f5f7fa; color: #7b8796; }
.production-order-badge { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid #cfe0f5; border-radius: 999px; background: #eef5ff; color: #315f98; font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.procurement-locked { min-width: 68px; color: var(--safe); font-size: 12px; font-weight: 700; text-align: center; }
.procurement-secondary { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .7); }
.procurement-secondary > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px; list-style: none; cursor: pointer; }
.procurement-secondary > summary::-webkit-details-marker { display: none; }
.procurement-secondary > summary span { display: grid; gap: 3px; }
.procurement-secondary > summary small { color: var(--muted); }
.procurement-secondary > summary em { color: #315a90; font-size: 12px; font-style: normal; }
.procurement-secondary[open] > summary em { font-size: 0; }
.procurement-secondary[open] > summary em::after { content: "收起"; font-size: 12px; }
.procurement-secondary .production-toolbar, .procurement-secondary .production-list { margin: 0 14px 14px; }
.production-toolbar { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(220px, 1.2fr) auto; align-items: end; gap: 10px; margin-top: 14px; }
.production-toolbar select, .production-item-edit select, .production-item-edit input { min-height: 41px; width: 100%; border: 1px solid #cfd8e6; border-radius: 10px; background: #fff; color: var(--text); font: inherit; padding: 10px 11px; outline: none; }
.production-toolbar select:focus, .production-item-edit select:focus, .production-item-edit input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 104, 229, .1); }
.production-list { display: grid; gap: 10px; margin-top: 14px; }
.production-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.production-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.production-item-head strong { font-size: 16px; }
.production-chain { display: flex; align-items: center; gap: 5px; overflow-x: auto; padding: 2px 0 5px; }
.production-stage { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; color: #9aa5b5; font-size: 12px; white-space: nowrap; }
.production-stage i { color: #c7cfda; font-size: 17px; font-style: normal; line-height: 1; }
.production-stage.done { color: var(--safe); font-weight: 700; }
.production-stage.current { padding: 5px 8px; border-radius: 999px; background: #eaf2ff; color: var(--primary); font-weight: 800; }
.production-stage.current i { color: #a4bee5; }
.procurement-box { display: grid; gap: 8px; padding: 10px 11px; border-radius: 10px; background: #fffaf0; }
.procurement-box.compact { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: #f4faf7; }
.procurement-title { color: #8b5a13; font-size: 12px; font-weight: 800; white-space: nowrap; }
.procurement-complete { color: var(--safe); font-size: 12px; font-weight: 700; }
.procurement-list { display: flex; flex-wrap: wrap; gap: 7px; }
.procurement-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid #ecd9b0; border-radius: 999px; background: #fff; color: #856323; font-size: 12px; cursor: pointer; }
.procurement-chip input { width: 15px; height: 15px; margin: 0; accent-color: var(--safe); }
.procurement-chip.done { border-color: #a9d9c3; background: var(--safe-bg); color: var(--safe); font-weight: 700; }
.procurement-chip.no-material { border-color: #d6dce2; background: #f1f3f5; color: #65727d; font-weight: 700; cursor: default; }
.procurement-chip.pending { border-color: #f0d39d; background: #fff9ef; color: #9a5d00; cursor: default; }
.backup-panel { display: grid; gap: 12px; padding: 0 18px 18px; }
.backup-heading, .backup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.backup-heading > div, .backup-row > div { display: grid; gap: 4px; min-width: 0; }
.backup-row-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.backup-heading small, .backup-row small { color: var(--muted); font-size: 12px; }
.backup-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.backup-row { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.backup-row:last-child { border-bottom: 0; }
.backup-row strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.production-item-edit { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.2fr) auto; gap: 8px; align-items: center; }
.production-item-edit button { white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 650; }
.ok { color: var(--safe); }
.bad { color: var(--danger); }
.manual { color: var(--warn); }
.review-button { white-space: nowrap; }
.exception-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.candidate-preview { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.candidate-preview strong { color: var(--text); }
.candidate-preview-item { margin-top: 3px; padding-left: 8px; border-left: 2px solid #d7e3f5; }
.candidate-preview-item b { color: var(--primary); }
.candidate-preview.no-candidate { padding: 7px 9px; border-radius: 8px; background: #fff7ed; color: #9a3412; }
.ignore-button { white-space: nowrap; background: #f3f4f6 !important; color: #667085 !important; }
.ignore-button:hover { background: #e7e9ed !important; }

.review-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(360px, 1.2fr); gap: 18px; }
.review-layout h3 { margin: 11px 0 8px; font-size: 14px; }
.review-image { width: 100%; max-height: 480px; object-fit: contain; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; }
.review-summary { margin: 0; padding: 11px; border-radius: 9px; background: #f5f7fa; white-space: pre-wrap; line-height: 1.5; color: var(--text); }
.candidate-list { display: grid; gap: 9px; max-height: 680px; overflow-y: auto; padding-right: 3px; }
.manual-order-number-lookup { margin: 9px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.manual-order-number-lookup > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
.manual-order-number-controls { display: flex; align-items: center; gap: 8px; }
.manual-order-number-controls input { flex: 1; min-width: 0; }
.manual-order-number-lookup p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.manual-exact-badge { color: #075985; background: #e0f2fe; border-radius: 999px; padding: 3px 8px; font-size: 11px; white-space: nowrap; }
.candidate-card { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: #fff; }
.candidate-card:hover { border-color: #9ebbe6; }
.candidate-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 104, 229, .09); }
.candidate-card input { width: 18px; height: 18px; margin-top: 3px; }
.candidate-title { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.purchase-target-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.purchase-target-actions small { color: var(--muted); font-weight: 500; }
.candidate-meta { display: block; margin: 5px 0; color: var(--muted); font-size: 12px; }
.candidate-lines { line-height: 1.5; font-size: 13px; }
.recommend { color: #086b45; background: var(--safe-bg); border-radius: 999px; padding: 3px 8px; font-size: 11px; white-space: nowrap; }

.disclosure { padding: 0; overflow: hidden; }
.disclosure > summary { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; list-style: none; cursor: pointer; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary span { display: grid; gap: 3px; }
.disclosure > summary b { font-size: 16px; }
.disclosure > summary small { color: var(--muted); }
.disclosure > summary em { color: #315a90; font-size: 12px; font-style: normal; }
.disclosure[open] > summary em { font-size: 0; }
.disclosure[open] > summary em::after { content: "收起"; font-size: 12px; }
.result-box { max-height: 520px; min-height: 100px; margin: 0 20px 20px; padding: 15px; overflow: auto; border-radius: 10px; background: #101827; color: #dce8ff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.history-table { max-height: 520px; margin: 0 20px 20px; overflow: auto; border-top: 1px solid var(--line); }

.purchase-card { border-color: #b9d3f5; }
.feature-disclosure { margin-top: 14px; }
.feature-summary { padding: 16px 20px !important; }
.feature-summary > span:first-child { display: grid; gap: 3px; }
.feature-summary small { color: var(--muted); }
.feature-summary-right { display: flex; align-items: center; gap: 10px; }
.feature-body { margin: 0; padding: 0 20px 20px; border: 0; border-radius: 0; box-shadow: none; }
.feature-description { margin: 0 0 14px; font-size: 13px; }
.purchase-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: end; gap: 10px; margin-top: 14px; }
.purchase-range input { min-height: 41px; }
.material-range-presets { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.material-range-presets > span { color: var(--muted); font-size: 12px; }
.material-range-presets button { min-height: 32px; padding: 5px 11px; }
.material-range-presets button.selected { border-color: var(--primary); background: #e8f1ff; color: var(--primary); }
.purchase-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.purchase-workspace h3, .purchase-editor h3 { margin: 0 0 9px; font-size: 14px; }
.purchase-source-list, .purchase-draft-list { display: grid; gap: 9px; max-height: 580px; overflow-y: auto; }
.purchase-source-card { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.purchase-source-card img { grid-row: 1 / span 2; width: 76px; height: 88px; border-radius: 8px; background: #f4f6f9; object-fit: cover; }
.purchase-source-card > div:nth-child(2) { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; }
.purchase-source-card > div:nth-child(2) strong { font-size: 14px; }
.purchase-source-card > div:nth-child(2) small { color: var(--muted); font-size: 11px; }
.purchase-source-card .state-chip { grid-column: 1 / -1; justify-self: start; }
.purchase-source-card .actions { grid-column: 2; }
.purchase-ai-status { color: #315a90 !important; font-weight: 650; }
.purchase-source-card .error-text { grid-column: 1 / -1; color: #a9422c !important; }
.muted-card { opacity: .58; }
.purchase-draft-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.purchase-draft-heading h3 { margin: 0 0 9px; }
.purchase-draft-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.purchase-draft-card small { color: var(--muted); }
.purchase-draft-card p { margin: 0; color: #3e4a5f; font-size: 13px; line-height: 1.5; }
.purchase-editor { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.purchase-editor-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr); gap: 18px; }
.manual-purchase-editor .purchase-editor-grid { grid-template-columns: minmax(0, 1fr); }
.purchase-form { display: grid; gap: 11px; align-content: start; }
.purchase-form textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.purchase-form input[readonly] { background: #f3f6fa; color: #49576d; }
.form-help { margin: 0; padding: 9px 11px; border-radius: 9px; background: #eef5ff; color: #315a90; font-size: 12px; }
.ocr-disclosure { margin-top: 10px; }
.ocr-disclosure summary { color: #315a90; font-size: 12px; cursor: pointer; }
.ocr-disclosure .review-summary { max-height: 180px; margin-top: 8px; overflow-y: auto; font-size: 11px; }
.glue-purchase-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.glue-purchase-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.glue-purchase-heading h3 { margin: 0 0 8px; font-size: 14px; }
.glue-purchase-heading .form-help { max-width: 760px; }
#useMaterialPurchasePanel .glue-purchase-heading > .state-pill,
#plasticBucketPurchasePanel .glue-purchase-heading > .state-pill { flex-shrink: 0; white-space: nowrap; }
.glue-purchase-range { margin-top: 12px; }
.glue-purchase-rows { display: grid; gap: 8px; margin-top: 14px; }
.glue-purchase-row { display: grid; grid-template-columns: minmax(90px, .55fr) 110px minmax(220px, 1.2fr) 90px 92px auto; gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.glue-purchase-row input { min-height: 36px; }
.glue-purchase-row .purchase-history-note { color: #9a5b00; font-size: 11px; }
.glue-purchase-row .purchase-history-note { color: #9a5b00; font-size: 11px; }
.glue-purchase-row small { color: var(--muted); }
.glue-purchase-row.needs-review { border-color: #e9b66e; background: #fffaf0; }
.glue-purchase-row.production-processed { border-color: #b9d8c0; background: #f5fbf6; }
.manual-purchase-row { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(90px, .55fr) minmax(420px, 2fr); gap: 8px 12px; align-items: center; }
.manual-row-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.manual-row-heading strong { overflow-wrap: anywhere; }
.manual-row-need { color: #536278; font-size: 12px; }
.manual-fixed-field { display: grid; gap: 4px; min-width: 0; }
.manual-fixed-field span { color: var(--muted); font-size: 11px; }
.manual-fixed-field strong { min-height: 36px; padding: 9px; border: 1px solid #e2e7ee; border-radius: 8px; background: #f4f6f9; color: #536278; font-size: 12px; overflow-wrap: anywhere; }
.manual-row-editor { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(85px, .65fr) minmax(300px, 2.8fr) minmax(62px, .35fr) minmax(110px, .7fr) auto; gap: 8px; align-items: end; padding-top: 5px; border-top: 1px dashed #dfe5ec; }
.manual-row-editor label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.manual-row-editor input, .manual-row-editor select { width: 100%; min-height: 36px; padding: 8px 9px; border: 1px solid #cbd5e2; border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.manual-row-editor .manual-default-spec { white-space: nowrap; }
.ledger-purchase-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.ledger-purchase-meta span { padding: 6px 9px; border: 1px solid #dbe5f1; border-radius: 7px; background: #f7faff; color: #536278; font-size: 12px; }
.ledger-material-row { grid-template-columns: minmax(110px, .55fr) minmax(180px, .9fr) minmax(300px, 2.8fr) minmax(80px, .45fr) minmax(62px, .35fr); align-items: stretch; }
.ledger-material-cell { display: grid; min-width: 0; gap: 4px; align-content: start; }
.ledger-material-cell > span { color: var(--muted); font-size: 11px; }
.ledger-material-cell > strong { min-height: 36px; padding: 9px; border: 1px solid #e2e7ee; border-radius: 8px; background: #f4f6f9; color: #536278; font-size: 12px; overflow-wrap: anywhere; }
.ledger-material-row .manual-row-heading { align-content: start; }
.ledger-material-spec > strong { white-space: pre-wrap; }
.ledger-purchase-history { margin-top: 12px; }
.ledger-purchase-history > div { display: grid; gap: 7px; margin-top: 8px; }
.ledger-purchase-history-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; color: #536278; font-size: 12px; }
.ledger-purchase-history-row strong { color: var(--text); }
.ledger-purchase-history-row small { color: var(--muted); }
.manual-purchase-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 10px; border: 1px dashed #b9cbe2; border-radius: 9px; background: #f7faff; }
.manual-purchase-toolbar small { color: var(--muted); font-size: 11px; }
.glue-purchase-preview { margin-top: 14px; padding: 12px; border-radius: 10px; background: #f5f8fc; }
.glue-purchase-preview .candidate-title { margin-bottom: 8px; }
.glue-purchase-preview .review-summary { min-height: 86px; margin: 0; white-space: pre-wrap; }
.preview-edit-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.preview-edit-state { color: var(--muted); font-size: 12px; margin-right: auto; }
.preview-edit-state.edited { color: var(--warn); }
.purchase-preview-editor { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 150px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; line-height: 1.55; color: var(--ink); background: #fff; }
.purchase-preview-editor[readonly] { background: #f8fafc; }
.purchase-preview-editor:not([readonly]) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.glue-purchase-panel .confirm-line { margin: 0; }
.glue-purchase-panel .send-footer { align-items: center; }
.unknown-send-recovery { display: flex; flex-basis: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #f0c36d; border-radius: 9px; background: #fff3d6; color: #7a4300; }
.purchase-management-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 16px; }
.purchase-management-heading h2 { margin: 4px 0 6px; }
.purchase-management-heading p { margin: 0; color: var(--muted); }
.fixed-group-launcher { display: grid; grid-template-columns: minmax(180px, .4fr) minmax(0, 1fr); gap: 14px; align-items: center; margin: 12px 0 16px; padding: 12px 14px; border: 1px solid #cfe0f5; border-radius: 12px; background: #f8fbff; }
.fixed-group-launcher > div:first-child { display: grid; gap: 3px; }
.fixed-group-launcher strong { color: #225a9d; font-size: 13px; }
.fixed-group-launcher small { color: var(--muted); font-size: 11px; }
.fixed-group-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.fixed-group-button { padding: 8px 10px; font-size: 12px; }
.purchase-batch-send-panel { margin: 14px 0 18px; padding: 16px; border: 1px solid #cfe0f5; border-radius: 12px; background: linear-gradient(180deg, #f8fbff, #fff); }
.purchase-batch-send-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.purchase-batch-send-heading h3 { margin: 4px 0 6px; font-size: 16px; }
.purchase-batch-send-heading p { max-width: 820px; margin: 0; }
.purchase-batch-send-rows { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.purchase-batch-send-row { position: relative; display: grid; align-content: start; min-width: 0; min-height: 50px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.purchase-batch-send-row.selectable { border-color: #b9d2ef; cursor: pointer; }
.purchase-batch-send-row.selectable:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(36, 62, 88, .08); }
.purchase-batch-send-row.selected { border-color: var(--accent); background: #eef5ff; box-shadow: inset 0 0 0 1px rgba(23, 104, 229, .14); }
.purchase-batch-send-row.blocked { background: #fafbfc; color: var(--muted); }
.purchase-batch-send-row input { position: absolute; top: 12px; left: 10px; width: 16px; height: 16px; margin: 0; }
.purchase-batch-send-main { display: grid; min-width: 0; gap: 6px; }
.purchase-batch-send-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; min-height: 20px; padding-left: 23px; }
.purchase-batch-send-main strong { color: var(--text); font-size: 13px; white-space: nowrap; }
.purchase-batch-send-title .state-pill { max-width: 100%; margin: 0; padding: 2px 6px; font-size: 10px; line-height: 1.5; }
.purchase-batch-send-rows > .empty-state { grid-column: 1 / -1; }
.purchase-batch-send-footer { margin-top: 14px; }
.purchase-batch-send-footer .confirm-line { margin: 0; }
.reference-library-status-panel { margin-top: 14px; padding-top: 12px; border-top: 1px solid #dfe6f0; }
.reference-library-status-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reference-library-status-heading > div { display: grid; gap: 4px; }
.reference-library-status-heading strong { color: #315a90; font-size: 13px; }
.reference-library-status-heading small { color: var(--muted); line-height: 1.5; }
.reference-library-category-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.reference-library-category-card { display: grid; min-width: 0; gap: 6px; padding: 10px; border: 1px solid #dbe5f1; border-radius: 9px; background: #fff; }
.reference-library-category-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.reference-library-category-title strong { min-width: 0; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.reference-library-category-title .state-pill { flex-shrink: 0; margin-left: 0; padding: 2px 6px; font-size: 10px; }
.reference-library-category-card small, .reference-library-category-card > span { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.purchase-category-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; margin: 14px 0 24px; }
.purchase-category-card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.purchase-category-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(36, 62, 88, .09); transform: translateY(-1px); }
.purchase-category-card strong { font-size: 17px; }
.purchase-category-card small { color: var(--muted); line-height: 1.35; }
.purchase-category-card em { margin-top: auto; color: var(--accent); font-size: 12px; font-style: normal; }
.purchase-category-index { color: var(--accent); font-size: 11px; letter-spacing: .08em; }
.purchase-subsection-heading { margin: 2px 0 10px; padding: 14px 16px; border-radius: 10px; background: #f5f8fc; }
.purchase-subsection-heading h3 { margin: 4px 0; }
.purchase-subsection-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.purchase-operation-record { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.purchase-operation-record summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.purchase-operation-record .review-summary { max-height: 180px; margin-top: 8px; overflow-y: auto; background: #fff; font-size: 12px; }
@media (max-width: 1100px) { .purchase-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ledger-material-row { grid-template-columns: minmax(100px, .6fr) minmax(140px, 1fr) minmax(220px, 2fr) minmax(80px, .45fr) minmax(62px, .35fr); } }
@media (max-width: 1100px) { .reference-library-category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1400px) { .purchase-batch-send-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .purchase-batch-send-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .purchase-management-heading { flex-direction: column; } .fixed-group-launcher { grid-template-columns: 1fr; } .purchase-batch-send-heading { flex-direction: column; } .purchase-batch-send-main small { white-space: normal; } .purchase-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .reference-library-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  #cuttingShopPurchasePanel .glue-purchase-heading { flex-direction: column; align-items: flex-start; gap: 8px; }
  #cuttingShopPurchasePanel .glue-purchase-heading > div { width: 100%; }
  #cuttingShopPurchasePanel .glue-purchase-heading .state-pill { white-space: nowrap; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; min-height: 0; flex-direction: row; align-items: center; gap: 14px; padding: 12px; }
  .sidebar-brand { flex: 0 0 auto; padding: 0 10px 0 2px; border: 0; }
  .sidebar-nav { display: flex; min-width: 0; margin: 0; overflow-x: auto; }
  .sidebar-link { flex: 0 0 auto; }
  .sidebar-note { display: none; }
  .production-stage-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .connection-strip { grid-template-columns: 1fr; }
  .text-button { border-radius: 0; }
  .overview-heading { flex-direction: column; }
  .overview-actions { grid-template-columns: 1fr 1fr; }
  .flow i { width: 15px; }
  .flow span { font-size: 12px; }
  .flow b { width: 21px; height: 21px; }
  .order-toolbar { grid-template-columns: 1fr 1fr; }
  .order-toolbar .field:first-child { grid-column: 1 / -1; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .procurement-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .production-filter-bar { grid-template-columns: 1fr; }
  .production-filter-buttons { justify-content: flex-start; }
  .production-toolbar { grid-template-columns: 1fr 1fr; }
  .production-toolbar .field:nth-child(3) { grid-column: 1 / -1; }
  .production-toolbar > button { width: 100%; }
  .audit-item { grid-template-columns: 1fr auto; }
  .audit-details { grid-column: 1 / -1; grid-row: 2; }
  .audit-item .audit-button { grid-column: 2; grid-row: 1; }
  .review-layout { grid-template-columns: 1fr; }
  .purchase-workspace, .purchase-editor-grid { grid-template-columns: 1fr; }
  .glue-purchase-row, .manual-purchase-row { grid-template-columns: 1fr 1fr; }
  .manual-row-editor { grid-template-columns: 1fr 1fr; }
  .manual-row-editor .manual-row-spec, .manual-row-editor .manual-default-spec { grid-column: 1 / -1; }
  .ledger-material-row { grid-template-columns: 1fr 1fr; }
  .ledger-material-row .ledger-material-spec { grid-column: 1 / -1; }
  .glue-purchase-row button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  #useMaterialPurchasePanel .glue-purchase-heading,
  #plasticBucketPurchasePanel .glue-purchase-heading { flex-direction: column; }
  .shell { width: min(100% - 20px, 1080px); padding-top: 18px; }
  .sidebar { align-items: stretch; flex-direction: column; gap: 10px; }
  .sidebar-brand { padding-right: 0; }
  .sidebar-nav { margin: 0 -2px; }
  .hero { align-items: flex-start; }
  .subtitle, .flow { display: none; }
  .overview-actions { grid-template-columns: 1fr; }
  .procurement-summary { grid-template-columns: 1fr 1fr; }
  .procurement-row { grid-template-columns: 1fr auto; }
  .procurement-row > button, .procurement-row > .procurement-locked, .procurement-row > .procurement-actions { grid-column: 2; }
  .production-stage-categories { grid-template-columns: 1fr 1fr; }
  .stage-category-row { grid-template-columns: 1fr; }
  .reconciliation-entry { align-items: stretch; flex-direction: column; }
  .feature-summary { padding: 14px !important; }
  .feature-body { padding: 0 14px 14px; }
  .command-card { grid-template-columns: 1fr; }
  .primary-large { width: 100%; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; }
  .section-head > button, .send-grid, .send-grid button { width: 100%; }
  .section-head-actions, .section-head-actions button { width: 100%; }
  .send-grid { grid-template-columns: 1fr; }
  .range-fields { grid-template-columns: 1fr; }
  .order-toolbar { grid-template-columns: 1fr; }
  .order-toolbar .field:first-child { grid-column: auto; }
  .order-detail-heading { flex-direction: column; }
  .order-detail-heading button { width: 100%; }
  .order-flow-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .order-facts { grid-template-columns: 1fr; }
  .purchase-range { grid-template-columns: 1fr; }
  .range-fields button { width: 100%; }
  .production-toolbar, .production-item-edit { grid-template-columns: 1fr; }
  .production-toolbar .field:nth-child(3) { grid-column: auto; }
  .production-item-edit button { width: 100%; }
  .audit-item { grid-template-columns: 1fr; }
  .audit-item .audit-button, .audit-details { grid-column: 1; grid-row: auto; width: 100%; }
}

/* 2026-08-11：七色米式简洁工作台。仅调整布局和信息层级，不改变业务功能。 */
body { overflow-x: hidden; background: #f3f5f8; }
.shell { width: 100%; margin: 0; padding: 0; }
.app-shell { grid-template-columns: 112px minmax(0, 1fr); gap: 0; min-height: 100vh; align-items: stretch; }
.sidebar {
  position: sticky; top: 0; z-index: 20; height: 100vh; min-height: 100vh;
  padding: 14px 10px; border-width: 0 1px 0 0; border-radius: 0;
  box-shadow: none;
}
.sidebar-brand { flex-direction: column; gap: 7px; padding: 2px 0 14px; text-align: center; }
.sidebar-logo { width: 34px; height: 34px; border-radius: 7px; }
.sidebar-brand div { gap: 0; }
.sidebar-brand strong { font-size: 13px; }
.sidebar-brand small { font-size: 10px; }
.sidebar-nav { gap: 4px; margin-top: 12px; }
.sidebar-link { flex-direction: column; gap: 4px; min-height: 60px; justify-content: center; padding: 7px 4px; border-radius: 6px; font-size: 12px; }
.sidebar-mark { width: 23px; height: 23px; border-radius: 5px; }
.sidebar-note { margin: auto 0 0; padding: 9px 6px; border-radius: 6px; text-align: center; }
.sidebar-note span { display: none; }

.workspace { min-width: 0; padding: 0 18px 36px; }
.workspace-topbar {
  position: sticky; top: 0; z-index: 15; display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr) auto; align-items: center; gap: 18px;
  min-height: 58px; margin: 0 -18px 18px; padding: 0 18px;
  border-bottom: 1px solid #dfe4eb; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}
.topbar-title { display: grid; gap: 1px; }
.topbar-title span { color: #7b8797; font-size: 10px; }
.topbar-title strong { color: #243248; font-size: 15px; }
.workspace-tabs { display: flex; align-self: stretch; gap: 2px; overflow-x: auto; }
.workspace-tab {
  position: relative; flex: 0 0 auto; padding: 0 14px; border: 0; border-radius: 0;
  background: transparent; color: #617086; font-size: 13px; font-weight: 650;
}
.workspace-tab:hover { background: #f6f8fb; color: #205da8; }
.workspace-tab.active { background: transparent; color: #1768e5; }
.workspace-tab.active::after { position: absolute; right: 10px; bottom: 0; left: 10px; height: 2px; background: #1768e5; content: ""; }
.topbar-status { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.top-system-state { display: inline-flex; align-items: center; gap: 4px; color: #748094; font-size: 11px; }
.top-system-state i { width: 7px; height: 7px; border-radius: 50%; background: #aab3c2; }
.top-system-state.ok i { background: #0b9a61; }
.top-system-state.bad i { background: #c7463c; }
.top-mode-badge { padding: 4px 7px; border-radius: 4px; background: #edf1f5; color: #65727d; font-size: 10px; }
.top-mode-badge.safe { background: #eaf8f1; color: #078754; }
.top-mode-badge.live { background: #fff0e7; color: #a53b00; }

.workspace[data-active-view] > #productionSection,
.workspace[data-active-view] > #productInfoFeature,
.workspace[data-active-view] > #purchaseOrderFeature,
.workspace[data-active-view] > #purchaseManagementFeature,
.workspace[data-active-view] > #dataProtectionSection,
.workspace[data-active-view] > #historySection,
.workspace[data-active-view] > #resultSection { display: none; }
.workspace[data-active-view="home"] > #resultSection,
.workspace[data-active-view="production"] > #productionSection,
.workspace[data-active-view="reconciliation"] > #productionSection,
.workspace[data-active-view="product-info"] > #productInfoFeature,
.workspace[data-active-view="purchase-management"] > #purchaseManagementFeature,
.workspace[data-active-view="purchase-order"] > #purchaseOrderFeature,
.workspace[data-active-view="protection"] > #dataProtectionSection,
.workspace[data-active-view="history"] > #historySection { display: block; }
.workspace:not([data-active-view="home"]) > .home-only { display: none !important; }

.workspace > .hero { margin: 0 0 10px; padding: 4px 2px 12px; }
.hero h1 { font-size: 26px; }
.overview-card { margin-top: 10px; padding: 15px 16px; border-radius: 7px; background: #fff; box-shadow: none; }
.overview-actions { gap: 8px; margin-top: 11px; }
.overview-action { padding: 10px 11px; border-radius: 6px; }
.notice { margin-bottom: 10px; padding: 9px 12px; border-radius: 6px; }
.connection-strip { margin-bottom: 10px; border-radius: 7px; box-shadow: none; }
.connection-item { padding: 10px 12px; }
.home-module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.home-module-card {
  display: grid; gap: 4px; min-height: 104px; padding: 13px; border: 1px solid #dde4ed;
  border-radius: 7px; background: #fff; color: #243248; text-align: left;
}
.home-module-card:hover { border-color: #9ebbe6; background: #f8fbff; }
.home-module-card.primary { border-color: #b8d1f3; background: #f4f8ff; }
.home-module-card span { color: #1768e5; font-size: 11px; font-weight: 750; }
.home-module-card strong { font-size: 14px; }
.home-module-card small { color: #748094; font-size: 11px; line-height: 1.45; }

.card { border-radius: 7px; box-shadow: none; }
.workspace[data-active-view]:not([data-active-view="home"]) > details.card { margin-top: 0; padding: 0; border: 0; background: transparent; }
.workspace[data-active-view]:not([data-active-view="home"]) > details.card > summary:first-child { display: none; }
.workspace[data-active-view]:not([data-active-view="home"]) > details.card > .feature-body { padding: 0; }
.workspace[data-active-view="protection"] > #dataProtectionSection > .backup-panel { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.workspace[data-active-view="history"] > #historySection > .task-history-panel,
.workspace[data-active-view="history"] > #historySection > .history-table { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.task-history-panel { padding: 15px; }
.task-history-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.task-history-heading strong { display: block; color: #26364e; font-size: 14px; }
.task-history-heading small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.task-history-table { max-height: 360px; overflow: auto; }
.task-history-table table { min-width: 760px; }
.task-history-table td { vertical-align: top; }

.production-card { padding: 16px !important; border: 1px solid #dce3ec !important; border-radius: 7px !important; background: #fff; }
.production-card > .section-head { align-items: center; }
.production-card > .section-head p { margin-bottom: 0; }
.production-stage-categories { gap: 7px; margin-top: 12px; }
.production-stage-category { min-height: 56px; padding: 9px 10px; border-radius: 6px; }
.production-filter-bar { grid-template-columns: minmax(260px, .7fr) 1fr; gap: 9px; margin-top: 11px; padding: 9px; border-radius: 6px; }
.production-filter-buttons { justify-content: flex-end; }
.procurement-summary { gap: 7px; margin-top: 9px; }
.procurement-summary-card { padding: 9px 10px; border-radius: 6px; }
.procurement-filters, .procurement-sorts { gap: 5px; margin-top: 8px; }
.procurement-filter, .procurement-sort { border-radius: 4px; }
.procurement-workspace { margin-top: 8px; border-radius: 6px; }
.procurement-workspace-head { padding: 9px 12px; }
.procurement-row { min-height: 58px; padding: 8px 12px; }
.procurement-row small.source-automatic { display: none; }
.procurement-row:hover small.source-automatic { display: block; }
.procurement-source.source-manual { color: #9a5b00; }
.procurement-secondary { margin-top: 10px; border-radius: 6px; }

.reconciliation-group { gap: 10px; margin-top: 0; padding-top: 0; border: 0; }
.workspace[data-active-view="reconciliation"] .production-card > .section-head,
.workspace[data-active-view="reconciliation"] .production-stage-categories,
.workspace[data-active-view="reconciliation"] #productionStatus,
.workspace[data-active-view="reconciliation"] .procurement-secondary { display: none; }
.workspace[data-active-view="reconciliation"] .production-card { padding: 0 !important; border: 0 !important; background: transparent; }
.reconciliation-heading { padding: 12px 14px 0; border-radius: 7px; background: #fff; }
.reconciliation-heading > .section-kicker,
.reconciliation-heading > h3,
.reconciliation-heading > p { display: none; }
.reconciliation-step-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid #dfe4eb; }
.reconciliation-step-tab { flex: 0 0 auto; padding: 10px 14px; border: 0; border-radius: 0; background: transparent; color: #68768a; font-size: 13px; }
.reconciliation-step-tab.active { border-bottom: 2px solid #1768e5; background: #f6f9fe; color: #1768e5; }
.reconciliation-step-hidden { display: none !important; }
.reconciliation-group > .flow { padding: 8px 0 0; }
.reconciliation-group > .card { border-radius: 7px; }
.order-workspace-card { background: #fff; }

.purchase-management-heading { align-items: center; margin: 0 0 10px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.purchase-management-heading p { display: none; }
.reference-library-panel { margin: 10px 0; padding: 14px 16px; border: 1px solid #cfe0f5; border-radius: 7px; background: #f6f9fe; }
.reference-library-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reference-library-heading > div { display: grid; gap: 4px; }
.reference-library-heading small { color: var(--muted); line-height: 1.5; }
.reference-library-heading button { flex-shrink: 0; }
#referenceLibraryStatus { margin: 10px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
#referenceLibraryStatus[data-state="success"] { color: var(--safe); }
#referenceLibraryStatus[data-state="error"] { color: var(--danger); }
#referenceLibraryStatus[data-state="waiting"] { color: var(--warn); }
#referenceLibraryStatus[data-state="running"] { color: var(--primary); }
.reference-library-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.reference-library-dialog { width: min(480px, calc(100vw - 48px)); border: 1px solid #d7dfeb; border-radius: 16px; padding: 24px; color: #25314b; background: #fff; }
.reference-library-dialog::backdrop { background: rgb(15 23 42 / 40%); }
.reference-library-dialog p { line-height: 1.7; }
.fixed-group-launcher { margin: 8px 0; padding: 9px 12px; border-radius: 6px; }
#wecomFixedGroupStatus { margin: 6px 0; }
.purchase-category-grid { display: flex; gap: 0; margin: 10px 0; overflow-x: auto; border-bottom: 1px solid #dfe4eb; }
.purchase-category-card { flex: 0 0 auto; min-height: 0; padding: 10px 18px; border-width: 0 0 2px; border-color: transparent; border-radius: 0; background: transparent; }
.purchase-category-card:hover { border-color: #9ebbe6; box-shadow: none; transform: none; }
.purchase-category-card.active { border-color: #1768e5; background: #f5f9ff; color: #1768e5; }
.purchase-category-card strong { font-size: 14px; }
.purchase-category-card small, .purchase-category-card em, .purchase-category-index { display: none; }
.purchase-subsection-heading { display: none; }
.purchase-category-hidden { display: none !important; }
.glue-purchase-panel { margin-top: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.glue-purchase-panel .form-help { max-width: 900px; }
.glue-purchase-range { margin-top: 10px; }
.glue-purchase-preview { border-radius: 6px; }
.purchase-card { padding: 16px !important; border: 1px solid var(--line) !important; border-radius: 7px !important; background: #fff; }
.feature-description { margin-top: 0; font-size: 12px; }
.purchase-workspace { gap: 12px; margin-top: 12px; }

table th { background: #f6f8fb; }
.table-wrap { border-radius: 6px; }
input, select, textarea, button { border-radius: 5px; }

@media (max-width: 1100px) {
  .workspace-topbar { grid-template-columns: auto minmax(0, 1fr); }
  .topbar-status { display: none; }
  .home-module-grid { grid-template-columns: 1fr 1fr; }
  .procurement-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { position: sticky; min-height: 100vh; height: 100vh; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 6px; }
  .sidebar-brand { flex: 0 0 auto; padding: 0 0 10px; }
  .sidebar-nav { display: grid; margin-top: 10px; overflow: visible; }
  .sidebar-link { flex: none; }
  .workspace { padding: 0 10px 24px; }
.workspace-topbar { margin: 0 -10px 12px; padding: 0 10px; grid-template-columns: 92px minmax(0, 1fr); gap: 6px; }
  .workspace-tab { padding: 0 9px; }
  .task-center { margin: 10px 0; padding: 13px 14px; border-radius: 7px; box-shadow: none; }
  .production-filter-bar { grid-template-columns: 1fr; }
  .production-filter-buttons { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .shell { width: 100%; padding: 0; }
  .app-shell { grid-template-columns: 66px minmax(0, 1fr); }
  .sidebar-brand div { display: none; }
  .sidebar-link { min-height: 54px; font-size: 11px; }
  .sidebar-mark { width: 20px; height: 20px; }
  .workspace-topbar { grid-template-columns: minmax(0, 1fr); min-height: 52px; }
  .topbar-title { display: none; }
  .workspace-tabs { width: 100%; }
  .workspace-tab { padding: 0 8px; font-size: 12px; }
  .task-center-item { grid-template-columns: 9px minmax(0, 1fr); }
  .task-center-meta { grid-column: 2; white-space: normal; }
  .home-module-grid, .overview-actions { grid-template-columns: 1fr; }
  .production-stage-categories { grid-template-columns: 1fr 1fr; }
  .procurement-summary { grid-template-columns: 1fr 1fr; }
  .purchase-category-card { padding: 9px 13px; }
  .reconciliation-step-tab { padding: 9px 10px; font-size: 12px; }
}

.purchase-reading-history { grid-column: 1 / -1; min-width: 0; font-size: 12px; }
.purchase-reading-history details { margin-top: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; }
.purchase-reading-history summary { cursor: pointer; line-height: 1.6; }
.purchase-reading-history pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
.reading-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 10px 0; }
.reading-comparison > div { padding: 8px; background: #f5f7fa; border-radius: 6px; }
@media (max-width: 600px) { .reading-comparison { grid-template-columns: 1fr; } }

.product-info-feature { display: none; }
.product-info-card { padding: 16px; border: 1px solid #dce3ec; border-radius: 7px; background: #fff; }
.product-info-card > .section-head { align-items: center; }
.product-info-card > .section-head p { margin: 4px 0 0; }
.product-info-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: end; gap: 8px; margin-top: 13px; }
.product-info-toolbar .field { margin: 0; }
#productInfoStatus { margin: 10px 0; }
.product-info-layout { display: grid; grid-template-columns: minmax(200px, .28fr) minmax(0, 1fr); gap: 12px; min-height: 440px; }
.product-info-directory, .product-info-detail { min-width: 0; padding: 12px; border: 1px solid #e0e6ee; border-radius: 7px; background: #fff; }
.product-info-directory { background: #f8fafc; }
.product-info-subheading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; color: #35445a; font-size: 13px; }
.product-info-subheading span { color: var(--muted); font-size: 11px; }
.product-info-filter { display: grid; gap: 4px; margin-bottom: 8px; color: #7b8797; font-size: 10px; }
.product-info-filter select { width: 100%; padding: 7px; font-size: 11px; }
.product-info-list { display: grid; gap: 6px; max-height: 640px; overflow: auto; }
.product-info-list-item { display: grid; gap: 4px; width: 100%; padding: 9px 10px; border: 1px solid #e0e6ee; border-radius: 6px; background: #fff; color: #253249; text-align: left; }
.product-info-list-item:hover { border-color: #9ebbe6; background: #f8fbff; }
.product-info-list-item.active { border-color: #78a8eb; background: #eef5ff; }
.product-info-list-item strong { overflow-wrap: anywhere; font-size: 13px; }
.product-info-list-item small { color: var(--muted); font-size: 11px; }
.product-info-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.product-info-detail-head h3 { margin: 0; color: #243248; font-size: 18px; overflow-wrap: anywhere; }
.product-info-detail-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.product-info-category-tabs { display: flex; gap: 3px; overflow: auto; border-bottom: 1px solid #dfe4eb; }
.product-info-category-tab { flex: 0 0 auto; padding: 9px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #637187; font-size: 12px; }
.product-info-category-tab.active { border-bottom-color: #1768e5; color: #1768e5; }
.product-info-category-tab small { margin-left: 4px; color: #8a96a5; font-size: 10px; }
.product-info-category-panel { padding-top: 12px; }
.product-info-category-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.product-info-category-heading strong { color: #27364d; font-size: 14px; }
.product-info-category-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.product-info-source, .product-info-reference { margin: 8px 0; padding: 9px 10px; border-radius: 5px; background: #f4f7fb; color: #627187; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-info-reference { border-left: 3px solid #a5bfdc; }
.product-info-status-pill { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; background: #fff5dc; color: #976700; font-size: 10px; white-space: nowrap; }
.product-info-status-pill.ready { background: #e8f7ef; color: #16764d; }
.product-info-status-pill.unused { background: #eef1f5; color: #687486; }
.product-info-rows { display: grid; gap: 7px; }
.product-info-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 9px; border: 1px solid #e6eaf0; border-radius: 6px; }
.product-info-row span { min-width: 0; color: #34445c; font-size: 12px; overflow-wrap: anywhere; }
.product-info-row small { display: block; margin-bottom: 2px; color: #8a96a5; font-size: 10px; }
.product-info-note { margin: 8px 0 0; color: #69778a; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.product-info-editor { display: grid; gap: 10px; }
.product-info-editor-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 9px; flex-wrap: wrap; }
.product-info-editor-toolbar .field { min-width: 170px; margin: 0; }
.product-info-editor-list { display: grid; gap: 8px; }
.product-info-editor-row { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)) auto; gap: 7px; padding: 9px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fafbfd; }
.product-info-editor-row .field { margin: 0; }
.product-info-editor-row .field span { font-size: 10px; }
.product-info-editor-actions { display: flex; justify-content: flex-end; gap: 7px; }
.product-info-footer-note { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-info-history { display: grid; gap: 7px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #e5e9ef; }
.product-info-history > strong { color: #39485c; font-size: 12px; }
.product-info-history-item { display: grid; grid-template-columns: minmax(125px, auto) auto minmax(0, 1fr); align-items: start; gap: 8px; padding: 7px 8px; border-radius: 5px; background: #f7f9fc; font-size: 11px; }
.product-info-history-item span { color: #627187; }
.product-info-history-item small { color: #8792a1; line-height: 1.5; overflow-wrap: anywhere; }
.product-reference-item { margin: 9px 0; padding: 10px; border: 1px solid #dfe6ef; border-radius: 6px; background: #f9fbfe; color: #34445c; font-size: 12px; }
.product-reference-item label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.product-reference-item small { color: #748398; }
.product-reference-item div { margin-top: 6px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-reference-item p { margin: 6px 0 0; color: #a35d00; }
@media (max-width: 820px) {
  .product-info-toolbar { grid-template-columns: minmax(160px, 1fr) auto auto; }
  .product-info-toolbar #productInfoCreateButton { grid-column: 3; }
  .product-info-layout { grid-template-columns: minmax(160px, .34fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .product-info-card { padding: 11px; }
  .product-info-toolbar { grid-template-columns: 1fr 1fr; }
  .product-info-toolbar .field { grid-column: 1 / -1; }
  .product-info-toolbar #productInfoCreateButton { grid-column: auto; }
  .product-info-layout { grid-template-columns: 1fr; }
  .product-info-list { max-height: 180px; }
  .product-info-editor-row { grid-template-columns: 1fr 1fr; }
  .product-info-editor-row button { grid-column: 1 / -1; justify-self: end; }
  .product-info-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-info-history-item { grid-template-columns: 1fr; gap: 3px; }
}
/* 逐单用料核算 */
.usage-order { display: block; padding: 18px; }
.usage-order [hidden] { display: none !important; }
.usage-pairing { display: grid; gap: 12px; margin: 16px 0; }
.usage-color-line { display: grid; grid-template-columns: 80px 80px minmax(120px, 1fr); gap: 10px; align-items: center; margin: 8px 0; }
.usage-dimensions, .usage-formulas, .usage-defaults { margin: 16px 0; }
.usage-dimensions summary, .usage-formulas summary, .usage-defaults summary { cursor: pointer; font-weight: 600; }
.usage-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 10px; margin: 10px 0; }
.usage-dimensions fieldset { border: 1px solid #dce5e3; border-radius: 10px; margin: 12px 0; padding: 12px; }
.usage-table-scroll { overflow-x: auto; margin-top: 12px; }
.usage-table { width: 100%; border-collapse: collapse; text-align: left; }
.usage-table th, .usage-table td { padding: 9px 12px; border-bottom: 1px solid #e0e8e5; white-space: nowrap; }
.usage-table th { background: #f3f7f5; }
.usage-table td.usage-color-summary { min-width: 300px; white-space: normal; line-height: 1.8; }
.usage-color-item { display: inline-block; margin: 2px 10px 2px 0; white-space: nowrap; }
.usage-error { color: #a23c24; background: #fff1e9; padding: 8px 12px; border-radius: 6px; }
.usage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.usage-summary { padding: 18px; background: #f1f8f4; border-radius: 12px; }
.usage-defaults > .field { margin-top: 12px; }

.usage-material-group { margin: 16px 0; }
.usage-material-group h4 { margin: 0 0 8px; color: #26334d; font-size: 15px; }

/* 手动进货颜色表 */
#manualPurchasePanel [hidden], #purchaseLegacyPanel[hidden] { display:none !important; }
.manual-form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0;}
.manual-purchase-form {padding:20px;border:1px solid var(--border, #dce3ec);border-radius:12px;background:#f8faff;margin:18px 0;}
#manualColorTable input {width:100%;max-width:320px;}
#manualColorTable small {display:block;color:#6b7280;}
#manualPurchasePanel .actions {flex-wrap:wrap;}
#manualPurchasePanel pre {white-space:pre-wrap;overflow-wrap:anywhere;}
#manualPurchasePanel summary {margin:18px 0;cursor:pointer;}
@media(max-width:640px){.manual-form-grid{grid-template-columns:1fr}.manual-purchase-form{padding:12px;}#manualPurchasePanel .purchase-draft-heading{flex-wrap:wrap;}}

#manualColorTable input { border:1px solid #cbd5e1; border-radius:8px; padding:10px 12px; height:42px; font:inherit; background:#fff; }

/* Cloud-only availability layer. Original layout and cascading overrides above are preserved. */
.owner-scope-banner,.owner-session-panel,.readonly-purchase-panel{border:1px solid #dce3ec;background:#fff;border-radius:7px;padding:12px 14px;margin-bottom:12px}
.owner-scope-banner{display:grid;gap:4px;border-left:3px solid #bd841e;background:#fffaf0;color:#66532c;font-size:12px}
.owner-scope-banner p{margin:0}.owner-scope-banner strong{font-size:13px}
.owner-status{font-size:12px;color:#5e6e82;white-space:pre-wrap;margin:0 0 10px}
.owner-session-panel summary{cursor:pointer;font-size:13px;font-weight:650}.owner-session-body{padding-top:12px}
#login,.readonly-query-toolbar{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
#login label,.readonly-query-toolbar label{display:grid;gap:4px;font-size:12px}#login label:has(input[type="checkbox"]){display:flex;align-items:center}
#login input:not([type="checkbox"]){min-width:150px}.readonly-query-toolbar #batch{min-width:290px}
.owner-session-body>p,.owner-session-body section p{font-size:12px;color:#738095}#devices{padding-left:18px}#devices li{margin:8px 0}#devices button{margin-left:8px}
.readonly-purchase-panel{margin:12px 0;border-left:3px solid #1768e5}.readonly-purchase-panel h3{margin:4px 0}.readonly-purchase-panel .section-head p{font-size:12px}
#result{white-space:pre-wrap;overflow-wrap:anywhere;max-height:500px;overflow:auto;background:#f7f9fb;padding:12px;border:1px solid #e1e6ee;border-radius:5px;min-height:50px;user-select:text}
#result-label{font-weight:700;font-size:13px}#result-note,#copy-status{font-size:12px;line-height:1.6;color:#74591e}
.disconnected-banner{margin:10px 0;padding:9px 12px;background:#fff8e8;border:1px solid #ead7b3;border-radius:5px;font-size:12px;color:#7a5e27}
[data-disconnected]{cursor:not-allowed!important;opacity:.6}[data-disconnected][type="checkbox"]{opacity:.5}
.disconnected-dot{background:#98a3b0!important}.connection-item strong{color:#748094}.disconnected-empty{color:#7d8796}
.layout-reconciliation>.feature-body>.section-head,.layout-reconciliation #productionStageCategories,.layout-reconciliation #procurementArea,.layout-reconciliation #stageCategoryWorkspace,.layout-reconciliation #productionStatus,.layout-reconciliation .procurement-secondary{display:none!important}
.layout-reconciliation>.feature-body>.disconnected-banner{display:none}.layout-reconciliation #reconciliationGroup{display:block!important}
.workspace:not([data-active-view="reconciliation"]) #reconciliationGroup{display:none!important}
#manualEditor{margin:12px 0}#manualDetail{margin-top:16px}#manualDetail .actions{margin-top:10px}
.purchase-batch-send-row p{font-size:11px}.purchase-batch-send-row small{font-size:10px;color:#9a7026}
#layoutUsageDefaults{margin-top:14px;padding-top:10px;border-top:1px solid #e1e6ee}
[hidden]{display:none!important}
@media(max-width:820px){#login,.readonly-query-toolbar{align-items:stretch;flex-direction:column}.readonly-query-toolbar #batch{min-width:0;width:100%}.owner-scope-banner,.owner-session-panel,.readonly-purchase-panel{padding:10px}.workspace{overflow-wrap:anywhere}}
