:root {
  color-scheme: dark;
  --bg: #061823;
  --panel: #0a2633;
  --panel-2: #0c2d3b;
  --line: rgba(103, 196, 211, .16);
  --text: #dcecf1;
  --muted: #6f929d;
  --cyan: #22d3c5;
  --blue: #48a9ff;
  --amber: #ffb347;
  --red: #ff5f6d;
  --green: #31d49b;
}

* { box-sizing: border-box; }
html, body { min-width: 0; min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% -10%, rgba(25, 111, 137, .14), transparent 32%),
    linear-gradient(180deg, #061a26 0%, var(--bg) 100%);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
}

button, input { font: inherit; }
button { cursor: pointer; }
.app { display: grid; grid-template-columns: 166px 1fr; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 166px; z-index: 3;
  border-right: 1px solid var(--line); background: rgba(4, 23, 34, .93);
}
.brand { height: 58px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #042128; background: linear-gradient(145deg, #30e4d3, #17b5b7); font-weight: 900; font-size: 15px; }
.brand strong { display: block; font-size: 14px; }
.brand small { color: var(--muted); font-size: 9px; }
.brand.showroom-brand { height: 100px; flex-direction: column; justify-content: center; gap: 5px; padding: 10px 14px; }
.showroom-brand img { display: block; width: 96px; height: auto; border-radius: 4px; }
.showroom-brand strong { color: var(--cyan); font-size: 21px; line-height: 1.3; font-weight: 800; letter-spacing: 2px; }
.side-group { padding: 15px 9px 4px; color: #496f7b; font-size: 10px; }
.side-link { display: flex; align-items: center; gap: 9px; height: 38px; margin: 2px 8px; padding: 0 10px; color: #88a8b2; text-decoration: none; border: 1px solid transparent; border-radius: 6px; }
.side-link .ico { width: 18px; color: #4e7f8c; font-size: 10px; }
.side-link.active { color: var(--cyan); background: rgba(35, 211, 197, .1); border-color: rgba(35, 211, 197, .25); }
.side-link .count { margin-left: auto; min-width: 25px; padding: 2px 6px; text-align: center; color: #f4bd6e; background: #583e24; border-radius: 10px; font-size: 10px; }
.side-foot { position: absolute; inset: auto 9px 12px; padding: 10px; border: 1px solid var(--line); background: #0a2835; border-radius: 7px; }
.side-foot small { color: var(--muted); }
.side-foot strong { display: block; margin-top: 4px; font-size: 12px; }
.side-foot span { color: var(--green); font-size: 10px; }

.main { grid-column: 2; min-width: 0; }
.topbar { height: 58px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(5, 25, 36, .72); }
.breadcrumb { font-weight: 700; }
.breadcrumb span { margin: 0 11px; color: #416674; }
.top-actions { display: flex; align-items: stretch; height: 100%; margin-left: auto; }
.top-stat { display: flex; align-items: center; gap: 8px; padding: 0 15px; color: #8ca9b2; border-left: 1px solid rgba(103,196,211,.08); }
.pill { min-width: 26px; padding: 2px 7px; text-align: center; color: #ffb1b8; background: #63353d; border-radius: 12px; font-size: 10px; }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #103847; color: var(--cyan); }
.user { padding-left: 10px; line-height: 1.25; }
.user small { display: block; color: var(--muted); font-size: 9px; }

.content { padding: 18px 18px 24px; }
.welcome { display: grid; grid-template-columns: 390px 1fr 190px; gap: 16px; align-items: center; margin-bottom: 16px; }
.welcome h1 { margin: 0 0 5px; font-size: 22px; letter-spacing: .5px; }
.welcome p { margin: 0; color: var(--muted); }
.ai-bar { height: 46px; display: flex; align-items: center; padding: 0 14px; gap: 14px; background: #0a2b39; border: 1px solid var(--line); border-radius: 7px; }
.ai-bar b { color: var(--cyan); white-space: nowrap; }
.ai-bar span { color: #88a8b2; }
.ai-bar button, .solid-btn { margin-left: auto; border: 0; border-radius: 5px; padding: 7px 14px; color: #03242a; background: var(--cyan); font-weight: 700; }
.clock { text-align: right; color: #97b1b9; }
.clock b { display: block; color: var(--text); font-size: 14px; }

body:is([data-screen="documents"], [data-screen="execution"]) .welcome { grid-template-columns: 330px minmax(0, 1fr); }
body:is([data-screen="documents"], [data-screen="execution"]) .welcome .ai-bar { justify-self: start; width: fit-content; max-width: 100%; height: auto; min-height: 46px; padding: 10px 14px; }
body:is([data-screen="documents"], [data-screen="execution"]) .welcome .ai-bar span { color: #dcecf1; font-weight: 700; text-shadow: 0 0 10px rgba(34,211,197,.2); }
body:is([data-screen="documents"], [data-screen="execution"]) .top-actions { align-items: center; }
body:is([data-screen="documents"], [data-screen="execution"]) .topbar .clock { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
#docChain .step { appearance: none; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
#docChain .step:last-child { border-right: 0; }
#docChain .step:hover { background: rgba(35,211,197,.06); }
#docChain .step.selected { background: rgba(35,211,197,.12); box-shadow: inset 0 -3px var(--cyan); }
#docChain .step.selected .step-num { color: #03282c; background: var(--cyan); }
#docChain .step:focus-visible { outline: 2px solid var(--cyan); outline-offset: -3px; }
.side-link.selected { color: var(--cyan); background: rgba(35,211,197,.1); }
.object-link {
  width: calc(100% - 16px);
  appearance: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.object-link:hover { color: #b4d3db; background: rgba(35,211,197,.05); }
.object-link.selected { color: var(--cyan); background: rgba(35,211,197,.1); border-color: rgba(35,211,197,.25); }
.empty-documents { text-align: center; color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.metric { min-height: 113px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.metric-head { display: flex; justify-content: space-between; color: #83a0aa; }
.metric-head small { font-size: 9px; color: var(--muted); }
.value { display: flex; align-items: baseline; gap: 4px; margin: 5px 0; font-size: 29px; font-weight: 800; letter-spacing: -1px; }
.value small { font-size: 11px; color: #9fb6bd; }
.value.cyan { color: var(--cyan); } .value.blue { color: var(--blue); } .value.amber { color: var(--amber); } .value.red { color: var(--red); }
.value .flow-complete { color: var(--green); }
.value .flow-error { color: var(--red); }
.value .flow-normal { color: var(--cyan); }
.metric-note { color: var(--muted); font-size: 10px; }
.document-metrics .metric { display: grid; grid-template-columns: auto 1fr; align-content: center; align-items: baseline; gap: 12px 4px; min-height: 100px; }
.document-metrics .metric-head { white-space: nowrap; }
.document-metrics .value { margin: 0; font-size: 26px; }
.document-metrics .metric-note { grid-column: 1 / -1; line-height: 1.6; }
.document-metrics .status-count { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.document-metrics .status-count.blue { color: var(--blue); }
.document-metrics .status-count.cyan { color: var(--cyan); }
.document-metrics .status-count.amber { color: var(--amber); }
.document-metrics .status-count.red { color: var(--red); }
.execution-metrics .metric { grid-template-columns: auto minmax(0, 1fr); }
.execution-metrics .metric-note { overflow-wrap: anywhere; }
#e-devices .metric-note { min-height: 16px; }
.document-number-metric .value { min-width: 0; }
.document-number { display: block; max-width: 100%; overflow: hidden; font-size: 15px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.execution-order-info { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin: -4px 0 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.execution-order-info div { min-width: 0; padding: 10px 14px; border-right: 1px solid var(--line); }
.execution-order-info div:last-child { border-right: 0; }
.execution-order-info span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.execution-order-info strong { display: block; overflow: hidden; color: #e6f8fb; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

/* 顶部业务卡片：统一文字层级，并支持拖拽调整顺序。 */
body[data-screen="execution"] :is(.execution-order-info > div, .execution-metrics > .metric) {
  position: relative;
  cursor: grab;
  transition: border-color .18s ease, background-color .18s ease, opacity .18s ease, transform .18s ease;
}
body[data-screen="execution"] :is(.execution-order-info > div, .execution-metrics > .metric):hover {
  border-color: rgba(34, 211, 197, .42);
  background-color: #0b2b39;
}
body[data-screen="execution"] :is(.execution-order-info > div, .execution-metrics > .metric):active { cursor: grabbing; }
body[data-screen="execution"] .card-dragging { opacity: .38; transform: scale(.985); }
body[data-screen="execution"] .card-drag-over { box-shadow: inset 3px 0 var(--cyan); }
body[data-screen="execution"] .execution-order-info span,
body[data-screen="execution"] .execution-metrics .metric-head {
  color: #69b9ca;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .2px;
}
body[data-screen="execution"] .execution-order-info strong,
body[data-screen="execution"] .execution-metrics .value {
  color: #f1fbfd;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: 0;
}
body[data-screen="execution"] .execution-order-info strong { font-size: 14px; }
body[data-screen="execution"] .execution-metrics .value { font-size: 25px; }
body[data-screen="execution"] .execution-metrics .value small {
  color: #9bc3cc;
  font-size: 11px;
  font-weight: 700;
}
body[data-screen="execution"] .execution-metrics .metric-note {
  color: #709aa5;
  font-size: 11px;
  line-height: 1.5;
}
body[data-screen="execution"] #e-devices .value,
body[data-screen="execution"] #e-warehouse .value { color: var(--cyan); }
body[data-screen="execution"] #e-weighing .value { color: var(--blue); }
body[data-screen="execution"] :is(#e-marking, #e-vision) .value { color: #f2c879; }
body[data-screen="execution"] #e-exceptions .value { color: var(--green); }
body[data-screen="execution"] #e-exceptions:has(.metric-status.danger) .value { color: var(--red); }

/* 订单、产品、生产要求重新组合为一排摘要卡。 */
body[data-screen="execution"] .execution-order-info {
  display: contents;
  overflow: visible;
  background: transparent;
  border: 0;
}
body[data-screen="execution"] .execution-order-info > div {
  min-height: 90px;
  padding: 11px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
}
body[data-screen="execution"] .execution-order-info .info-title {
  display: block;
  margin: 0 0 10px;
  color: #69b9ca;
  font-size: 12px;
  font-weight: 700;
}
body[data-screen="execution"] .info-content {
  position: static;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  min-width: 0;
  padding-right: 0;
}
body[data-screen="execution"] .info-pair { display: block; min-width: 0; }
body[data-screen="execution"] .execution-order-info .info-pair small { display: none; }
body[data-screen="execution"] [data-card-key="sales-order"] .info-content {
  align-items: baseline;
  gap: 24px;
}
body[data-screen="execution"] [data-card-key="sales-order"] .customer-pair {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
body[data-screen="execution"] [data-card-key="sales-order"] .customer-pair small {
  display: inline;
  margin: 0;
}
body[data-screen="execution"] [data-card-key="sales-order"] .customer-pair small::after { content: "："; }
body[data-screen="execution"] [data-card-key="order-info"] .info-content {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
body[data-screen="execution"] [data-card-key="order-info"] .info-pair {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
body[data-screen="execution"] [data-card-key="order-info"] .info-pair small {
  display: inline;
  margin: 0;
}
body[data-screen="execution"] [data-card-key="order-info"] .info-pair small::after { content: "："; }
body[data-screen="execution"] .info-pair small,
body[data-screen="execution"] .execution-metrics .metric-note small {
  display: block;
  margin-bottom: 3px;
  color: #688d97;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
body[data-screen="execution"] .info-pair strong {
  max-width: 220px;
  font-size: 15px;
}
body[data-screen="execution"] .info-pair.accent-blue strong { color: var(--blue); }
body[data-screen="execution"] .info-pair.accent-cyan strong { color: var(--cyan); }
body[data-screen="execution"] .info-status {
  position: absolute;
  top: 11px;
  right: 14px;
  padding: 2px 7px;
  color: var(--green);
  background: rgba(49, 212, 155, .1);
  border-radius: 10px;
  font-size: 10px;
  font-style: normal;
}
body[data-screen="execution"] .execution-metrics {
  display: contents;
}
body[data-screen="execution"] .execution-metrics .metric {
  min-height: 90px;
  padding: 11px 14px;
  align-content: start;
  grid-template-columns: 1fr;
  gap: 6px;
}
body[data-screen="execution"] .execution-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: -4px 0 12px;
}
body[data-screen="execution"] .execution-summary {
  margin: -4px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
body[data-screen="execution"] .summary-row {
  display: grid;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}
body[data-screen="execution"] .summary-row:last-child { border-bottom: 0; }
body[data-screen="execution"] .summary-first { grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1fr; }
body[data-screen="execution"] .summary-work-orders,
body[data-screen="execution"] .summary-business-docs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body[data-screen="execution"] .summary-item {
  min-width: 0;
  padding: 10px 16px;
  border-right: 1px solid var(--line);
}
body[data-screen="execution"] .summary-item:last-child { border-right: 0; }
body[data-screen="execution"] .summary-heading { display: flex; align-items: center; gap: 8px; min-height: 21px; }
body[data-screen="execution"] .summary-heading > span { color: #69b9ca; font-size: 13px; font-weight: 700; }
body[data-screen="execution"] .summary-status { padding: 2px 7px; color: #829fa7; background: rgba(130,159,167,.09); border-radius: 10px; font-size: 10px; font-style: normal; }
body[data-screen="execution"] .summary-status.good { color: var(--green); background: rgba(49,212,155,.12); }
body[data-screen="execution"] .summary-status.warn { color: var(--amber); background: rgba(244,180,86,.12); }
body[data-screen="execution"] .summary-status.danger { color: var(--red); background: rgba(255,95,109,.12); }
body[data-screen="execution"] .summary-content { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin-top: 6px; }
body[data-screen="execution"] .summary-content > strong { min-width: 0; overflow: hidden; color: #f1fbfd; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="execution"] .summary-content > small { min-width: 0; overflow: hidden; color: #8eb2bb; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="execution"] .summary-fields { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin-top: 8px; overflow: hidden; }
body[data-screen="execution"] .summary-field { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
body[data-screen="execution"] .summary-field i { color: #7ba5af; font-size: 11px; font-style: normal; }
body[data-screen="execution"] .summary-field i::after { content: "："; }
body[data-screen="execution"] .summary-field b { color: #f1fbfd; font-size: 13px; }
body[data-screen="execution"] .execution-metrics .metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
body[data-screen="execution"] .execution-metrics .metric-status {
  padding: 2px 6px;
  color: #829fa7;
  background: rgba(130, 159, 167, .08);
  border-radius: 9px;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
}
body[data-screen="execution"] .execution-metrics .metric-status.good { color: var(--green); background: rgba(49,212,155,.1); }
body[data-screen="execution"] .execution-metrics .metric-status.danger { color: var(--red); background: rgba(255,95,109,.1); }
body[data-screen="execution"] .execution-metrics .value { margin: 1px 0; min-width: 0; }
body[data-screen="execution"] .execution-metrics .document-number {
  color: #edf9fb;
  font-size: 16px;
  font-weight: 800;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
body[data-screen="execution"] .execution-metrics .metric-note {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
body[data-screen="execution"] .execution-metrics .metric-note strong {
  overflow: visible;
  color: #55c8d1;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.progress { height: 4px; margin: 8px 0 7px; overflow: hidden; background: #123847; border-radius: 5px; }
.progress i { display: block; height: 100%; border-radius: 5px; background: var(--cyan); box-shadow: 0 0 10px rgba(35,211,197,.28); }
.progress.amber i { background: var(--amber); }
.progress.blue i { background: var(--blue); }

.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(330px, .88fr); gap: 12px; margin-bottom: 12px; }
.grid.equal { grid-template-columns: 1.35fr .95fr .8fr; }
.panel { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.panel-head { height: 44px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head small { margin-left: 10px; color: var(--muted); font-size: 9px; }
.panel-link { margin-left: auto; color: var(--cyan); font-size: 10px; }
.tabs { display: flex; height: 36px; align-items: end; padding: 0 14px; gap: 25px; border-bottom: 1px solid var(--line); }
.tab { height: 36px; border: 0; color: #7d9aa4; background: transparent; font-size: 10px; }
.tab.active { color: var(--cyan); border-bottom: 2px solid var(--cyan); }
.tab em { margin-left: 3px; font-style: normal; }

.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table th { padding: 9px 10px; color: #527783; background: rgba(7,33,45,.55); font-size: 9px; font-weight: 500; text-align: left; }
.table td { height: 58px; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 10px; }
.table td strong { display: block; color: #dcecf1; font-size: 11px; }
.table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bar { width: 86px; height: 3px; margin-top: 5px; background: #123847; }
.mini-bar i { display: block; height: 100%; background: var(--cyan); }
.tag { display: inline-flex; padding: 3px 7px; border: 1px solid #1a5260; border-radius: 4px; color: #78a5b1; background: #0c3342; font-size: 8px; }
.tag.warn { color: #f3b663; background: #49351f; border-color: #684c29; }
.tag.danger { color: #ff939e; background: #4f2830; border-color: #6b343e; }
.tag.good { color: #59dba8; background: #103c36; border-color: #165448; }

.todo { padding: 0 12px; }
.todo-item { position: relative; min-height: 76px; padding: 12px 80px 11px 9px; border-bottom: 1px solid var(--line); }
.todo-item::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--amber); }
.todo-item.danger::before { background: var(--red); }
.todo-item.info::before { background: var(--blue); }
.todo-item strong { display: block; margin: 6px 0 4px; font-size: 11px; }
.todo-item p { margin: 0; color: var(--muted); font-size: 9px; }
.todo-item .action { position: absolute; right: 0; top: 31px; padding: 5px 8px; border: 1px solid #1b5060; border-radius: 4px; color: var(--cyan); background: #0c3342; font-size: 8px; }

.steps { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 124px; }
.step { padding: 15px 10px; border-right: 1px solid var(--line); }
.step.active { background: rgba(35,211,197,.1); }
.step-num { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #69929d; background: #123d4b; font-size: 9px; }
.step.active .step-num { color: #03282c; background: var(--cyan); }
.step strong { display: block; margin: 12px 0 5px; font-size: 10px; }
.step small { color: var(--muted); font-size: 8px; }
.step .done { color: var(--green); }
#flowNodes { grid-template-columns: repeat(6,minmax(0,1fr)); height: auto; min-height: 205px; padding: 14px 22px; row-gap: 12px; }
#flowNodes .step { position: relative; min-width: 0; min-height: 58px; padding: 0 12px; border: 0; text-align: center; }
#flowNodes .step::after { content: ""; position: absolute; z-index: 0; top: 14px; left: calc(50% + 15px); width: calc(100% - 30px); height: 1px; background: #246478; }
#flowNodes .step:nth-child(6n)::after, #flowNodes .step:last-child::after { display: none; }
#flowNodes .node-status { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#flowNodes .node-index { display: none; }
#flowNodes .step-num { width: 28px; height: 28px; color: var(--cyan); background: #0a3544; border: 2px solid var(--cyan); font-size: 13px; box-shadow: 0 0 12px rgba(35,211,197,.12); }
#flowNodes .step strong { margin: 6px 0 2px; color: #e5f7fa; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
#flowNodes .step small { color: #70a4b1; font-size: 11px; }
body[data-screen="execution"] .welcome .ai-bar { border: 0; background: rgba(34,211,197,.07); box-shadow: none; }
body[data-screen="execution"] .welcome #flowNode { color: #c4fff3; font-size: 17px; font-weight: 800; line-height: 1.5; text-shadow: none; }
#flowNodes .step.active { background: transparent; box-shadow: none; }
#flowNodes .step.active .step-num { color: #03282c; background: var(--cyan); box-shadow: 0 0 18px rgba(35,211,197,.5); }
#flowNodes .step.active strong { color: #f1fffd; text-shadow: 0 0 8px rgba(34,211,197,.25); }
#flowNodes .step.active .node-index { color: var(--cyan); }
.doc-chain-panel .panel-head { justify-content: center; }
.doc-chain-panel .panel-head h2 { font-size: 17px; }
#docChain .step { text-align: center; padding: 18px 10px; }
#docChain .step-num { margin: 0 auto; width: 25px; height: 25px; font-size: 12px; }
#docChain .step strong { font-size: 14px; }
#docChain .step small { display: block; font-size: 12px; line-height: 1.7; }
#recent-documents { grid-template-columns: minmax(0, 2.22fr) minmax(0, .66fr); height: 452px; }
#recent-documents > .panel { height: 100%; }
#recent-documents .panel-head h2 { font-size: 16px; }
.recent-table-wrap { overflow-x: auto; }
#recent-documents .table { min-width: 900px; }
#recent-documents .table th { font-size: 14px; font-weight: 700; color: #9bbcc6; padding: 12px 9px; white-space: nowrap; }
#recent-documents .table td { height: 46px; font-size: 14px; padding: 7px 9px; overflow-wrap: anywhere; }
#recent-documents .table td strong { font-size: 14px; }
#recent-documents .table td small { font-size: 12px; }
#recent-documents .table .tag { font-size: 12px; }
#recent-documents .todo { height: calc(100% - 44px); overflow: hidden; }
#recent-documents .todo-item { min-height: 68px; padding: 9px 8px 8px 9px; }
#recent-documents .todo-item strong { font-size: 13px; overflow-wrap: anywhere; }
#recent-documents .todo-item .tag { font-size: 11px; }
#recent-documents .todo-meta { display: flex; align-items: center; gap: 7px; min-height: 21px; }
#recent-documents .todo-procedure { color: var(--muted); font-size: 11px; }
.constraint { min-height: 51px; padding: 11px 14px; border-top: 1px solid var(--line); }
.constraint b { color: var(--cyan); }

.diagnosis { padding: 0 14px; }
.diag-row { display: grid; grid-template-columns: 1fr auto; min-height: 66px; align-items: center; border-bottom: 1px solid var(--line); }
.diag-row strong { font-size: 11px; }
.diag-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.diag-score { font-size: 15px; font-weight: 800; color: var(--green); }
.diag-score.amber { color: var(--amber); } .diag-score.blue { color: var(--blue); }

.version { padding: 0 14px; }
.version-item { min-height: 63px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.version-item strong { font-size: 11px; }
.version-item time { float: right; color: var(--muted); font-size: 8px; }
.version-item p { margin: 6px 0 0; color: var(--muted); font-size: 8px; }

.work-item { position: relative; min-height: 78px; padding: 14px 150px 12px 16px; border-bottom: 1px solid var(--line); }
.work-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--amber); }
.work-item.red::before { background: var(--red); } .work-item.blue::before { background: var(--blue); }
.work-item strong { display: block; margin: 7px 0 4px; }
.work-item p { margin: 0; color: var(--muted); font-size: 9px; }
.work-actions { position: absolute; right: 14px; top: 29px; display: flex; gap: 6px; }
.ghost-btn { padding: 5px 8px; color: #93b0ba; background: #0d3443; border: 1px solid #1b5060; border-radius: 4px; font-size: 8px; }

.assistant-box { padding: 12px; }
.assistant-question { padding: 10px; text-align: right; color: #9ab3bb; background: #103342; border-radius: 5px; }
.assistant-answer { margin-top: 10px; padding: 11px; border: 1px solid rgba(35,211,197,.17); border-radius: 6px; background: rgba(35,211,197,.035); }
.assistant-answer b { display: block; color: var(--cyan); margin-bottom: 8px; }
.assistant-answer ol { margin: 0; padding-left: 20px; color: #9ab3bb; line-height: 1.8; font-size: 10px; }
.assistant-input { display: flex; gap: 8px; margin-top: 10px; }
.assistant-input input { flex: 1; min-width: 0; padding: 8px 10px; color: var(--text); background: #0b2c3a; border: 1px solid #1a5060; border-radius: 5px; outline: none; }

.risk-summary { display: flex; gap: 24px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.risk-summary b { font-size: 19px; margin-right: 4px; }
.risk-row { display: grid; grid-template-columns: 70px 1.5fr .7fr .8fr; align-items: center; min-height: 74px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.risk-row strong { font-size: 11px; }
.risk-row small { display: block; color: var(--muted); margin-top: 4px; font-size: 8px; }
.risk-impact { color: var(--amber); font-weight: 700; }

.overview { padding: 12px; }
.overview-card { margin-bottom: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; }
.overview-line { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; }
.overview-line b { font-size: 18px; color: var(--amber); }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.mini-card { min-height: 62px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.mini-card b { display: block; margin-top: 4px; font-size: 18px; }
.execution-details { grid-template-columns: minmax(0, 1fr) 240px; }
.station-table-wrap { overflow-x: auto; }
.station-table { min-width: 820px; }
.station-table th { color: #9bbcc6; font-size: 13px; font-weight: 700; }
.station-table td { font-size: 13px; }
.station-table tr { --station-color: var(--muted); }
.station-table .station-print { --station-color: var(--blue); }
.station-table .station-mark { --station-color: var(--amber); }
.station-table .station-vision { --station-color: var(--cyan); }
.station-table .station-weight { --station-color: #bf9bff; }
.station-table tbody td:first-child { border-left: 3px solid var(--station-color); }
.station-table .station-label, .station-table tbody td:nth-child(2) strong { color: var(--station-color); }
.station-label { font-weight: 700; }
.station-filter { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.station-filter select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; }
.station-filter-secondary { margin-left: 14px; }
.station-table-wrap { overflow: visible; }
.station-table thead { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.station-table tr[data-station-order] { cursor: pointer; }
.station-table tr[data-station-order]:hover { background: rgba(35,211,197,.05); }
.station-table tr.selected-station { background: rgba(35,211,197,.12); }
.station-order-button { border: 0; background: transparent; color: var(--station-color); font-size: 13px; font-weight: 700; padding: 4px 0; }
.station-order-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.station-table td, .station-table th { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.station-table th:nth-child(3),
.station-table th:nth-child(4),
.station-table th:nth-child(5) { font-size: 15px; }
.station-table tbody td:nth-child(3) strong,
.station-table tbody td:nth-child(4) strong { color: var(--station-color); font-size: 15px; }
.station-table tbody td:nth-child(5) .tag { padding: 4px 8px; font-size: 12px; }
#deviceCards { grid-template-columns: minmax(0, 1fr); }
#deviceCards .mini-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 8px; min-height: 56px; padding: 8px 10px; }
#deviceCards .mini-card b { margin: 0; font-size: 16px; }
#deviceCards .mini-card small { grid-column: 1 / -1; }
.device-detail { align-items: stretch !important; }
.device-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; color: #e8fbff; font-size: 14px; font-weight: 700; }
.device-online { font-size: 12px; font-weight: 700; }
.device-online.good { color: #42df9b; }
.device-online.danger { color: #ff7786; }
.device-fields { grid-column: 1 / -1; margin: 2px 0 0; }
.device-fields div { display: grid; grid-template-columns: 76px minmax(0,1fr); line-height: 1.75; }
.device-fields dt { color: #6f9eab; }
.device-fields dd { margin: 0; color: #e4f6fa; font-weight: 650; }
.device-fields dd.field-good { color: #42df9b; }
.device-fields dd.field-warn { color: #f3b663; }
.device-fields dd.field-danger { color: #ff7786; }
.device-fields dd.field-accent { color: #6db7ff; }
.station-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 42px; padding: 8px 10px 0; color: var(--muted); font-size: 11px; }
.station-pagination button { padding: 5px 12px; color: var(--cyan); background: rgba(35,211,197,.08); border: 1px solid rgba(35,211,197,.25); border-radius: 4px; cursor: pointer; }
.station-pagination button:hover:not(:disabled) { background: rgba(35,211,197,.16); }
.station-pagination button:disabled { color: #52727b; background: transparent; border-color: var(--line); cursor: default; }
#deviceCards .device-detail { display: block; padding: 10px; }
.device-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.device-online { font-size: 10px; font-weight: 700; }
.device-fields { margin: 8px 0 0; font-size: 12px; line-height: 1.7; }
.device-fields > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); }
.device-fields dt { color: var(--muted); }
.device-fields dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.storage-map { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.storage-title { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 14px; }
.storage-title span { color: var(--muted); font-size: 11px; }
.storage-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; }
.storage-slot { display: flex; align-items: center; justify-content: center; gap: 3px; height: 28px; border: 1px solid var(--muted); border-radius: 4px; font-size: 11px; }
.storage-slot i { font-style: normal; font-size: 11px; }
.storage-slot.full { color: var(--green); border-color: var(--green); background: rgba(49,212,155,.08); }
.storage-slot.empty { color: var(--red); border-color: var(--red); background: rgba(255,95,109,.06); }
.storage-slot.busy { color: var(--amber); border-color: var(--amber); background: rgba(255,179,71,.12); }
.storage-slot.unknown { color: var(--muted); }
.storage-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; font-size: 10px; }
.storage-legend .full { color: var(--green); }
.storage-legend .empty { color: var(--red); }
.storage-legend .busy { color: var(--amber); }

@media (max-width: 1450px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .grid.equal { grid-template-columns: 1.25fr 1fr; }
  .grid.equal > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 132px minmax(0, 1fr); }
  .sidebar { width: 132px; }
  .brand.showroom-brand { height: 82px; padding: 8px; }
  .showroom-brand img { width: 78px; }
  .showroom-brand strong { font-size: 17px; }
  .side-link { height: 34px; margin: 2px 5px; padding: 0 7px; gap: 5px; font-size: 12px; }
  .side-link .ico { width: 15px; font-size: 9px; }
  .side-group { padding: 11px 7px 3px; }
  .topbar { height: 50px; padding: 0 14px; }
  .content { padding: 13px; }
  body:is([data-screen="documents"], [data-screen="execution"]) .welcome { grid-template-columns: minmax(170px, .7fr) minmax(0, 1fr); gap: 10px; }
  .welcome h1 { font-size: 20px; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid, .grid.equal, .execution-details { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  body[data-screen="execution"] .execution-order-info,
  body[data-screen="execution"] .execution-metrics { grid-template-columns: 1fr 1fr; }
}

/* 大屏统一以 1600 × 1000（16:10）设计画布展示，由 screen-scale.js 等比适配平台容器。 */
html, body { width: 100%; height: 100%; overflow: hidden; }
.app {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1600px;
  height: 1000px;
  min-height: 1000px;
  transform: translate(-50%, -50%) scale(var(--screen-scale, 1));
  transform-origin: center center;
}

/* 生产执行现场：模块加宽、导航放大，工序与设备面板完整收纳于单屏。 */
body[data-screen="execution"] .side-group { font-size: 12px; }
body[data-screen="execution"] .side-link { height: 43px; font-size: 16px; }
body[data-screen="execution"] .side-link .ico { font-size: 11px; }
body[data-screen="execution"] .summary-first { grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1fr; }
body[data-screen="execution"] .execution-details { grid-template-columns: minmax(0, 1fr) 285px; }
body[data-screen="execution"] .execution-details > .panel { height: 330px; }
body[data-screen="execution"] .station-table-wrap { max-width: 100%; overflow: hidden; }
body[data-screen="execution"] .station-table { width: 100%; min-width: 0; table-layout: fixed; }
body[data-screen="execution"] .station-table th,
body[data-screen="execution"] .station-table td { overflow: hidden; text-overflow: ellipsis; }
body[data-screen="execution"] .station-table td strong,
body[data-screen="execution"] .station-order-button { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="execution"] .overview { padding: 8px; }
body[data-screen="execution"] .mini-card { min-height: 0; padding: 8px; }
body[data-screen="execution"] .summary-row { min-height: 64px; }
body[data-screen="execution"] .summary-item { padding: 7px 13px; }
body[data-screen="execution"] #flowNodes { min-height: 165px; padding-top: 10px; padding-bottom: 10px; }

/* 现场屏幕按实际视口铺满，避免 16:10 画布在 16:9 设备上出现左右留白。 */
.app { position: relative; top: auto; left: auto; width: 100%; height: 100vh; min-height: 100vh; transform: none; }
body[data-screen="documents"] #recent-documents,
body[data-screen="documents"] #recent-documents > .panel { min-height: 330px; height: calc(100vh - 520px); }
body[data-screen="execution"] .welcome { margin-bottom: 10px; }
body[data-screen="execution"] #flowNodes { grid-template-columns: repeat(8, minmax(0, 1fr)); min-height: 155px; }
body[data-screen="execution"] #flowNodes .step:nth-child(6n)::after { display: block; }
body[data-screen="execution"] #flowNodes .step:nth-child(8n)::after,
body[data-screen="execution"] #flowNodes .step:last-child::after { display: none; }

/* 为底部工序工单与设备状态预留可见区域：流程节点固定三行紧凑展示。 */
body[data-screen="execution"] .content { padding: 10px 14px 12px; }
body[data-screen="execution"] .welcome { min-height: 46px; margin-bottom: 6px; }
body[data-screen="execution"] .execution-summary { margin: 0 0 8px; }
body[data-screen="execution"] .summary-row { min-height: 54px; }
body[data-screen="execution"] .summary-item { padding: 5px 11px; }
body[data-screen="execution"] .summary-content { margin-top: 3px; }
body[data-screen="execution"] .summary-fields { margin-top: 4px; }
body[data-screen="execution"] .workflow-progress-panel { margin-bottom: 8px !important; }
body[data-screen="execution"] #flowNodes { height: 150px; min-height: 150px; padding: 7px 14px; row-gap: 4px; overflow: hidden; }
body[data-screen="execution"] #flowNodes .step { min-height: 42px; padding: 0 4px; }
body[data-screen="execution"] #flowNodes .step::after { top: 12px; }
body[data-screen="execution"] #flowNodes .step-num { width: 24px; height: 24px; font-size: 11px; }
body[data-screen="execution"] #flowNodes .step strong { margin: 3px 0 1px; font-size: 10px; line-height: 1.2; }
body[data-screen="execution"] #flowNodes .step small { font-size: 9px; }
body[data-screen="execution"] .execution-details > .panel { height: 300px; }
body[data-screen="execution"] #flowNodes { grid-template-columns: repeat(8, minmax(0, 1fr)); height: 88px; min-height: 88px; padding: 7px 14px; }
body[data-screen="execution"] #flowNodes .step { min-height: 70px; }

/* MES 单据链路：突出左侧导航，并增加底部两块单据面板的展示空间。 */
body[data-screen="documents"] .side-group { font-size: 12px; }
body[data-screen="documents"] .side-link { height: 43px; font-size: 16px; }
body[data-screen="documents"] .side-link .ico { font-size: 11px; }
body[data-screen="documents"] #recent-documents { min-height: 460px; }
body[data-screen="documents"] #recent-documents > .panel { min-height: 460px; }

/* 两个大屏统一采用同一侧栏基线，优先保证底部业务内容在单屏内可读。 */
:root { --showroom-sidebar-width: 190px; }
.app { grid-template-columns: var(--showroom-sidebar-width) minmax(0, 1fr); }
.sidebar { width: var(--showroom-sidebar-width); }

body:is([data-screen="documents"], [data-screen="execution"]) .topbar { height: 52px; padding: 0 16px; }
body:is([data-screen="documents"], [data-screen="execution"]) .content { padding: 10px 14px 12px; }
body:is([data-screen="documents"], [data-screen="execution"]) .welcome { min-height: 42px; margin-bottom: 8px; }
body:is([data-screen="documents"], [data-screen="execution"]) .welcome h1 { margin-bottom: 2px; font-size: 20px; }
body:is([data-screen="documents"], [data-screen="execution"]) .welcome p { font-size: 12px; }
body:is([data-screen="documents"], [data-screen="execution"]) .welcome .ai-bar { min-height: 38px; padding: 7px 11px; font-size: 12px; }
body:is([data-screen="documents"], [data-screen="execution"]) .side-group { padding-top: 11px; font-size: 11px; }
body:is([data-screen="documents"], [data-screen="execution"]) .side-link { height: 37px; font-size: 14px; }
body:is([data-screen="documents"], [data-screen="execution"]) .side-link .ico { font-size: 10px; }

/* 大屏 01：压缩概览、链路区，将空间交给底部单据表和关联单据。 */
body[data-screen="documents"] .document-metrics { gap: 8px; margin-bottom: 8px; }
body[data-screen="documents"] .document-metrics .metric { min-height: 76px; padding: 9px 11px; }
body[data-screen="documents"] .document-metrics .metric-head { font-size: 12px; }
body[data-screen="documents"] .document-metrics .value { font-size: 22px; }
body[data-screen="documents"] .document-metrics .metric-note { font-size: 9px; line-height: 1.35; }
body[data-screen="documents"] .doc-chain-panel { margin-bottom: 8px !important; }
body[data-screen="documents"] .doc-chain-panel .panel-head { height: 34px; }
body[data-screen="documents"] .doc-chain-panel .panel-head h2 { font-size: 14px; }
body[data-screen="documents"] #docChain { min-height: 86px; }
body[data-screen="documents"] #docChain .step { padding: 8px 6px; }
body[data-screen="documents"] #docChain .step-num { width: 21px; height: 21px; font-size: 10px; }
body[data-screen="documents"] #docChain .step strong { margin: 6px 0 2px; font-size: 12px; }
body[data-screen="documents"] #docChain .step small { font-size: 10px; line-height: 1.35; }
body[data-screen="documents"] #recent-documents,
body[data-screen="documents"] #recent-documents > .panel { height: calc(100vh - 320px); min-height: 0; }
body[data-screen="documents"] #recent-documents .panel-head { height: 38px; }
body[data-screen="documents"] #recent-documents .panel-head h2 { font-size: 14px; }
body[data-screen="documents"] #recent-documents .table th { padding: 8px 7px; font-size: 12px; }
body[data-screen="documents"] #recent-documents .table td { height: 39px; padding: 5px 7px; font-size: 12px; }
body[data-screen="documents"] #recent-documents .table td strong { font-size: 12px; }
body[data-screen="documents"] #recent-documents .todo { height: calc(100% - 38px); }
body[data-screen="documents"] #recent-documents .todo-item { min-height: 57px; padding: 7px 6px 6px 9px; }
body[data-screen="documents"] #recent-documents .todo-item strong { margin: 4px 0 3px; font-size: 11px; }

/* 大屏 02：顶部摘要采用紧凑信息密度，完整展示工序表与设备状态。 */
body[data-screen="execution"] .welcome { margin-bottom: 5px; }
body[data-screen="execution"] .welcome #flowNode { font-size: 14px; }
body[data-screen="execution"] .execution-summary { margin: 0 0 6px; }
body[data-screen="execution"] .summary-row { min-height: 44px; }
body[data-screen="execution"] .summary-item { padding: 4px 9px; }
body[data-screen="execution"] .summary-heading { min-height: 16px; gap: 5px; }
body[data-screen="execution"] .summary-heading > span { font-size: 11px; }
body[data-screen="execution"] .summary-status { padding: 1px 5px; font-size: 8px; }
body[data-screen="execution"] .summary-content { gap: 6px; margin-top: 2px; }
body[data-screen="execution"] .summary-content > strong { font-size: 12px; }
body[data-screen="execution"] .summary-content > small,
body[data-screen="execution"] .summary-field i { font-size: 9px; }
body[data-screen="execution"] .summary-fields { gap: 6px; margin-top: 2px; }
body[data-screen="execution"] .summary-field { gap: 3px; }
body[data-screen="execution"] .summary-field b { font-size: 10px; }
body[data-screen="execution"] .workflow-progress-panel { margin-bottom: 7px !important; }
body[data-screen="execution"] .workflow-progress-panel .panel-head { height: 32px; }
body[data-screen="execution"] #flowNodes { height: 72px; min-height: 72px; padding: 5px 12px; }
body[data-screen="execution"] #flowNodes .step { min-height: 60px; }
body[data-screen="execution"] #flowNodes .step::after { top: 10px; }
body[data-screen="execution"] #flowNodes .step-num { width: 20px; height: 20px; font-size: 9px; }
body[data-screen="execution"] #flowNodes .step strong { margin: 2px 0 0; font-size: 9px; }
body[data-screen="execution"] #flowNodes .step small { font-size: 8px; }
body[data-screen="execution"] .execution-details { margin-bottom: 0; }
body[data-screen="execution"] .execution-details > .panel { height: calc(100vh - 370px); min-height: 300px; }
body[data-screen="execution"] .execution-details .panel-head { height: 38px; }
body[data-screen="execution"] .station-table th,
body[data-screen="execution"] .station-table td { padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
