* { box-sizing: border-box; }

body {
  zoom: .9;
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: #eef2f6;
  color: #111827;
}

/* Keep the available width after page scaling, including desktop grids. */
body .shell { width: calc(100% - 32px); }
.orderSoundButton { margin-top: 5px; min-height: 28px; font-size: 12px; }

button, a {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid #1f6fd1;
  border-radius: 6px;
  padding: 0 14px;
  background: #1f6fd1;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #fff;
  color: #1f2937;
  border-color: #cbd5e1;
}

button.danger {
  background: #b4232a;
  border-color: #b4232a;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.voicePanel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #f7fbff;
}

.modeConfigButton {
  min-width: 108px;
  background: #eff6ff;
  border-color: #9cc5f4;
  color: #1f6fd1;
}

.runtimeConfigPanel { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid #cfe0f5; border-radius: 8px; background: #f7fbff; }
.runtimeConfigRow { display: grid; grid-template-columns: minmax(150px, auto) minmax(220px, 1fr) auto; align-items: center; gap: 10px; }
.runtimeConfigRow label { color: #334155; font-size: 13px; font-weight: 700; }
.runtimeConfigRow input { min-height: 38px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; color: #0f172a; background: #fff; }
.runtimeConfigHint { color: #64748b; font-size: 12px; }

.workstationStatus {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin: 0 0 10px;
}

.workstationStatus > div {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.workstationStatus span { color: #64748b; font-size: 12px; }
.workstationStatus strong { color: #0f172a; font-size: 15px; }

.modeConfigDialog { width: min(660px, calc(100vw - 36px)); }
.modeConfigBox { display: grid; gap: 16px; }
.modeConfigList { display: grid; gap: 10px; }
.modeConfigList .modeToggle {
  width: 100%;
  min-height: 46px;
  justify-content: flex-start;
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1f2937;
}
.modeConfigList .modeToggle.live {
  background: #fff3df;
  border-color: #e2a84b;
  color: #9a5b00;
}
.modeConfigList #deviceSafety.live {
  background: #fff1f2;
  border-color: #ee9ba0;
  color: #b4232a;
}
.runtimeLogsButton { display: block; }
.runtimeLogsDialog { width: min(1080px, calc(100vw - 32px)); }
.runtimeLogsBox { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 12px; height: min(760px, calc(100vh - 48px)); }
.runtimeLogsTitle { display: flex; align-items: center; justify-content: space-between; }
.runtimeLogSummary { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 12px; border: 1px solid #dbe4ef; border-radius: 8px; background: #f8fafc; color: #64748b; font-size: 13px; }
.runtimeLogSummary strong { color: #0f172a; font-size: 16px; }
.runtimeLogSummary .dangerText, .runtimeLogSummary .dangerText strong { color: #b4232a; }
.runtimeLogToolbar { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); align-items: end; gap: 12px; }
.runtimeLogToolbar label { display: grid; gap: 5px; color: #475569; font-size: 12px; font-weight: 700; }
.runtimeLogToolbar select, .runtimeLogToolbar input[type="search"] { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #0f172a; font: inherit; }
.runtimeLogToolbar .runtimeLogAutoRefresh { display: flex; align-items: center; height: 38px; gap: 7px; white-space: nowrap; }
.runtimeLogAutoRefresh input { width: 17px; height: 17px; accent-color: #1f6fd1; }
.runtimeLogState { padding: 26px; border: 1px dashed #cbd5e1; border-radius: 8px; color: #64748b; text-align: center; }
.runtimeLogList { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 8px; }
.runtimeLogItem { display: grid; grid-template-columns: 76px 162px minmax(170px, .8fr) minmax(280px, 1.6fr); gap: 10px; padding: 11px 12px; border: 1px solid #dbe4ef; border-left: 4px solid #94a3b8; border-radius: 8px; background: #fff; font-size: 13px; }
.runtimeLogItem.error { border-left-color: #dc2626; background: #fffafa; }
.runtimeLogItem.warn { border-left-color: #d97706; background: #fffcf5; }
.runtimeLogLevel { font-weight: 900; color: #475569; }
.runtimeLogItem.error .runtimeLogLevel { color: #b4232a; }
.runtimeLogItem.warn .runtimeLogLevel { color: #a15c00; }
.runtimeLogTime { color: #64748b; white-space: nowrap; }
.runtimeLogEvent { color: #0f172a; font-weight: 700; overflow-wrap: anywhere; }
.runtimeLogMessage { color: #334155; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 760px) {
  .runtimeLogToolbar { grid-template-columns: 1fr; }
  .runtimeLogItem { grid-template-columns: 70px 1fr; }
  .runtimeLogEvent, .runtimeLogMessage { grid-column: 1 / -1; }
}
.modeSectionTitle { color: #1f2937; font-size: 14px; font-weight: 900; }

.voicePanelHeader,
.voiceSettings {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voicePanelHeader { justify-content: space-between; }
.voicePanelHeader span { color: #64748b; font-size: 12px; }
.voiceSwitch { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.voiceSwitch input { width: 18px; height: 18px; accent-color: #1f6fd1; }
.voiceSettings { align-items: end; }
.voiceSettings label { display: grid; flex: 1; gap: 4px; color: #475569; font-size: 12px; }
.voiceSettings select {
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
}
.voiceSettings button { min-width: 58px; }

.panelTitle { position: relative; }
.orderMessageCenter { position: relative; }
.orderMessageButton {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 11px;
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}
.orderMessageButton.hasUnread {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fff7f7;
}
.orderMessageIcon { font-size: 16px; line-height: 1; }
.orderMessageBadge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(190, 24, 93, .3);
}
.orderMessagePopover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
}
.orderMessagePopoverHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid #e8edf4;
}
.orderMessagePopoverHeader button {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: #1f6fd1;
  font-size: 13px;
}
.orderMessageList { max-height: 280px; overflow: auto; }
.orderMessageItem {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f6;
  border-radius: 0;
  background: #fff;
  color: #0f172a;
  text-align: left;
}
.orderMessageItem:hover { background: #f8fafc; }
.orderMessageItem.unread { background: #fff7f7; }
.orderMessageDot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.orderMessageItem.unread .orderMessageDot { background: #ef4444; }
.orderMessageMain { display: grid; gap: 3px; min-width: 0; }
.orderMessageMain strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.orderMessageMain span, .orderMessagePlay { color: #64748b; font-size: 12px; }
.orderMessagePlay { color: #1f6fd1; font-weight: 700; }
.orderMessageEmpty { padding: 24px 12px; color: #94a3b8; text-align: center; font-size: 13px; }

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 18px;
}

.topbar,
.panel {
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, auto);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 12px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 22px; }

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.orderQrDialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid #d4dfec;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.orderQrDialog::backdrop { background: rgb(15 23 42 / 55%); }
.orderQrDialog .orderQrAddress { display: block; width: 100%; padding: 4px 0; border: 0; background: transparent; color: #175cd3; text-decoration: underline; overflow-wrap: anywhere; cursor: text; }
.orderQrDialog #orderQrEdit { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #b8c9dd; border-radius: 8px; }
.orderQrDialog .orderQrAddress[hidden], .orderQrDialog #orderQrEdit[hidden] { display: none; }
.orderQrDialog img { display: block; margin: 12px auto; max-width: 100%; height: auto; }
.orderQrDialog .dialogActions { justify-content: center; margin-top: 16px; }

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #334155;
  text-decoration: none;
  font-weight: 700;
}

.topnav a.active,
.topnav a:hover {
  border-color: #bfd5f2;
  background: #eff6ff;
  color: #1f6fd1;
}

.topStatus {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topStatus span,
.topStatus button,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.topStatus span {
  min-width: 116px;
  justify-content: center;
}

.topStatus button {
  min-width: 116px;
  justify-content: center;
  font-family: inherit;
}

.topStatus .modeToggle {
  appearance: none;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

#deviceSafety,
#mesSafety,
#stationSafety {
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

#deviceSafety:hover,
#deviceSafety:focus-visible,
#mesSafety:hover,
#mesSafety:focus-visible,
#stationSafety:hover,
#stationSafety:focus-visible {
  outline: none;
  background: #e8f2ff;
  border-color: #9cc5f4;
  color: #1f6fd1;
}

#deviceSafety.live {
  background: #b4232a;
  border-color: #7f1d1d;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(180, 35, 42, .12);
}

#stationSafety.live {
  background: #fff3df;
  border-color: #e2a84b;
  color: #9a5b00;
}

.topStatus span[aria-disabled="true"],
.topStatus button:disabled {
  cursor: not-allowed;
  opacity: .72;
}

.badge {
  background: #e8f2ff;
  color: #1f6fd1;
}

.activeOrderSummary {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 1px solid #9cc5f4;
  border-left: 5px solid #1f6fd1;
  border-radius: 8px;
  background: #eff6ff;
}

.summaryMain {
  display: grid;
  gap: 4px;
}

.summaryMain span,
.summaryMeta b {
  color: #475569;
  font-size: 12px;
}

.summaryMain strong {
  font-size: 24px;
  overflow-wrap: anywhere;
}

.summaryMain em {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.summaryMeta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: center;
}

.summaryRow {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.summaryRow.twoCols {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
}

.summaryRow.threeCols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summaryMeta b {
  font-weight: 700;
  color: #475569;
}

.summaryMeta span {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.summaryDocumentRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 4px;
}

.summaryDocumentRow > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.summaryDocumentRow > em {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.summaryDocumentRow > strong {
  grid-column: 1 / -1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
}

.summaryDocumentRow.empty > em {
  color: #64748b;
}

.heroGrid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 420px;
  gap: 14px;
  margin-bottom: 12px;
  align-items: stretch;
}

.panel {
  padding: 14px;
  min-width: 0;
}

.panelTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li,
.flowNodes li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.timeline li span,
.flowNodes li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.timeline li strong,
.flowNodes li strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.timeline li em,
.flowNodes li em,
.documentItem em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.timeline li em {
  grid-column: 2;
  margin-top: -3px;
}

.ok { color: #0f7a4f; }
.run { color: #1f6fd1; }
.warn { color: #9a6200; }
.bad { color: #b4232a; }

.timeline li.ok,
.flowNodes li.ok {
  border-color: #93d3b2;
  background: #f0fbf5;
}

.timeline li.run,
.flowNodes li.run {
  border-color: #8bb9ee;
  background: #eff6ff;
}

.timeline li.warn,
.flowNodes li.warn {
  border-color: #e8c170;
  background: #fffbeb;
}

.timeline li.bad,
.flowNodes li.bad {
  border-color: #ee9ba0;
  background: #fff1f2;
}

.actionGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.backgroundClosureNotice:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #f2d7a6;
  border-radius: 8px;
  background: #fffaf0;
  color: #805516;
  font-size: 12px;
  line-height: 1.4;
}

.backgroundClosureNotice button { flex: none; }

.exceptionActions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #d8e0ea;
}

.exceptionActionsTitle,
.exceptionActionsHint {
  margin: 0;
}

.exceptionActionsTitle {
  color: #b42318;
  font-size: 14px;
  font-weight: 900;
}

.exceptionActionsHint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.exceptionActions button {
  width: 100%;
}

.selectedSalesOrder,
.controlStatus,
.currentExecution {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.selectedSalesOrder {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.selectedSalesOrder span {
  grid-column: 1 / -1;
  gap: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.selectedSalesOrder strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.controlStatus {
  margin: 12px 0 0;
}

.controlStatus h3,
.currentExecution h3 {
  overflow-wrap: anywhere;
}

.controlStatus span,
.currentExecution span {
  color: #64748b;
  font-size: 13px;
  overflow-wrap: anywhere;
}

#flowError {
  color: #b42318;
  font-weight: 800;
  line-height: 1.5;
}

#flowError[hidden] {
  display: none;
}

.currentExecution {
  margin: 12px 0 0;
  min-height: 190px;
  padding: 14px 16px;
  gap: 0;
  align-content: center;
  overflow: visible;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48%, #f4f8ff 100%);
}

.executionLyric {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 9px 4px;
}

.executionLyric + .executionLyric {
  border-top: 1px solid #e8edf4;
}

.executionLabel {
  align-self: start;
  padding-top: 3px;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}

.executionLyric p,
.executionLyric h3 {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: pretty;
}

.executionLyric p {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.executionCurrent {
  min-height: 68px;
  padding-top: 11px;
  padding-bottom: 11px;
}

.executionCurrent .executionLabel { color: #1f6fd1; }

.executionCurrent h3 {
  color: #0f172a;
  font-size: clamp(20px, 1.55vw, 24px);
  line-height: 1.42;
}

.executionPrevious { opacity: .72; }

.flowWait { color: #9a6700; background: #fff7df; border-radius: 6px; padding: 8px 10px; font-size: 13px; font-weight: 700; }
.flowTimingsPanel { border-top: 1px solid #e8edf4; padding: 8px 4px 0; font-size: 13px; }
.flowTimingsPanel summary { cursor: pointer; color: #1f6fd1; font-weight: 700; }
.flowTimingsPanel ol { margin: 8px 0 0; padding-left: 20px; max-height: 240px; overflow: auto; }
.flowTimingsPanel li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: #475569; }
.flowTimingsPanel strong { color: #0f172a; white-space: nowrap; }

.executionNext .executionLabel,
.executionNext p { color: #b46a00; }

.executionNext p { font-weight: 800; }

.currentExecution #flowError {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0c5c8;
}

.miniButton {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.wideButton {
  grid-column: 1 / -1;
}

.selectedBox {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.selectedBox span {
  color: #64748b;
  font-size: 12px;
}

.selectedBox strong {
  overflow-wrap: anywhere;
}

.statusGrid,
.contentGrid {
  display: grid;
  gap: 14px;
}

.statusGrid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.statusGrid .panel span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.safetyCard h3 {
  color: #0f7a4f;
}

.contentGrid {
  grid-template-columns: 1fr;
}

.flowPanel {
  display: none;
}

.businessDocsPanel {
  grid-column: 1 / -1;
}

.actionPanel,
.scenarioPanel,
.stationPanel {
  min-height: 494px;
}

.actionPanel {
  display: flex;
  flex-direction: column;
}

.actionPanel .actionGrid {
  margin-top: auto;
}

.scenarioPanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.scenarioPanel .currentExecution {
  align-self: end;
  width: 100%;
}

.stationPanel,
.floorDevicePanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.stationPanel {
  grid-column: auto;
}

.stationPanel .documentList {
  grid-template-columns: 1fr;
  grid-template-rows: none;
  gap: 8px;
  align-content: start;
}

.stationPanel .stationCard {
  display: grid;
  grid-template-rows: auto auto;
}

.stationPanel .stationCardBody {
  grid-auto-rows: auto;
}

.stationPanel .stationCardHeader {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 9px;
}

.stationPanel .stationCardHeader .stationIcon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 15px;
  flex-basis: 32px;
}
.stationPanel .stationCardHeader .stationSimulatedIcon { font-size: 11px; }

.stationPanel .stationCardHeader h3 { font-size: 16px; }

.stationPanel .stationDataRow {
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 42px;
  padding: 8px 10px;
}

.stationPanel .stationDataRow span { font-size: 14px; }
.stationPanel .stationDataRow strong { font-size: 15px; }
.stationPanel .stationDataRow:has(strong.primaryResult) {
  min-height: 58px;
  padding-block: 11px;
}
.stationPanel .stationDataRow strong.primaryResult { font-size: 23px; }

.stationPanel .documentGroup {
  gap: 6px;
  padding: 9px;
  background: #fff;
}

.stationPanel .documentGroup h3 {
  color: #175cd3;
  font-size: 15px;
}

.stationPanel .documentGroupItems {
  gap: 6px;
}

.stationPanel .documentItem {
  grid-template-columns: 84px minmax(0, 1fr) auto;
  min-height: 38px;
  padding: 7px 9px;
}

.stationPanel .documentItem strong {
  font-size: 13px;
}

.orderList,
.documentList,
.deviceList {
  display: grid;
  gap: 8px;
}

.documentList {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.documentGroup {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.documentGroup h3 {
  font-size: 14px;
  color: #334155;
}

.documentGroupItems {
  display: grid;
  gap: 7px;
  align-content: start;
}

.orderCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  width: 100%;
  height: auto;
  padding: 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  text-align: left;
}

.orderCard.selected {
  border-color: #1f6fd1;
  background: #eff6ff;
}

.orderCard span,
.orderCard small {
  color: #64748b;
  font-size: 12px;
}

.orderPrimary, .orderMeta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; min-width: 0; }
.orderPrimary strong { overflow-wrap: anywhere; }
.orderCard .orderSourceTag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.orderCard .orderSourceTag.bossbuddy { color: #175cd3; background: #eaf2ff; }
.orderCard .orderSourceTag.direct { color: #475467; background: #e9eef4; }
.orderMeta { grid-column: 1 / -1; }
.orderMeta small { min-width: 0; }
.orderMeta .productionOrderNumber { color: #111827; font-weight: 800; }

.orderCard strong,
.orderCard em {
  overflow-wrap: anywhere;
  font-style: normal;
}

.orderCard small { grid-column: auto; }

.orderList.compact {
  max-height: 220px;
  overflow: auto;
}

.orderList.compact .orderCard {
  grid-template-columns: 1fr auto;
}

.orderList.compact .orderCard span {
  grid-column: 1 / -1;
}

.orderList.compact .orderCard small {
  grid-column: 1 / -1;
}

.orderDialog {
  width: min(880px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.orderDialog::backdrop {
  background: rgba(15, 23, 42, .38);
}

.orderDialogBox {
  margin: 0;
  padding: 18px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .26);
}

.dialogActions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logisticsParamsDialog { width: min(1440px, calc(100vw - 28px)); max-width: calc(100vw - 28px); }
.logisticsParamsBox { width: 100%; max-width: none; max-height: none; overflow: visible; box-sizing: border-box; }
.logisticsParamsGrid { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(430px, 1.25fr) minmax(260px, .75fr); gap: 14px; align-items: stretch; }
.logisticsParamsGrid section { padding: 14px; border: 1px solid #dbe5f0; border-radius: 12px; background: #f8fbff; }
.logisticsParamsGrid h3 { margin: 0 0 12px; color: #18324f; }
.deviceParamsList { display: grid; gap: 7px; }
.deviceParamRow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 170px); align-items: center; gap: 8px; }
.deviceParamRow label { color: #52677e; font-size: 13px; }
.deviceParamRow input { width: 100%; box-sizing: border-box; }
.logisticsParamsButton { color: #1262b3; border-color: #9bc5ee; background: #eef7ff; }
.visionLiftConfig { grid-column: auto; }
.visionLiftToggle { display: flex; gap: 8px; align-items: center; font-weight: 700; color: #18324f; }
.visionLiftConfig p { margin: 10px 0 0; color: #6b7f94; font-size: 13px; }
@media (max-width: 1100px) { .logisticsParamsGrid { grid-template-columns: 1fr 1fr; } .visionLiftConfig { grid-column: 1 / -1; } }
@media (max-width: 760px) { .logisticsParamsDialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); } .logisticsParamsGrid { grid-template-columns: 1fr; } .visionLiftConfig { grid-column: auto; } }

.dialogOrderList {
  max-height: min(590px, calc(100vh - 170px));
  overflow: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manualStateBox {
  display: grid;
  gap: 12px;
}

.manualHint {
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  line-height: 1.6;
}

.manualStateGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.manualStateGrid label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.manualStateGrid select,
.manualStateGrid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
}

.manualStateGrid label.visionLiftToggle { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.manualStateGrid input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; flex: 0 0 18px; accent-color: #1f6fd1; }

.visionConfirmBox { max-width: 620px; }
.visionDeviceResult {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff7f7;
  line-height: 1.8;
}
.visionConfirmGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.visionConfirmGrid label:last-child { grid-column: 1 / -1; }
.visionConfirmGrid label.confirmed select {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}
.visionConfirmGrid label.needsConfirm select {
  border-color: #f87171;
  background: #fff7f7;
}
.visionConfirmActions { margin-top: 16px; justify-content: flex-end; }
@media (max-width: 720px) { .visionConfirmGrid { grid-template-columns: 1fr; } }

.documentItem,
.deviceItem {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.documentGroup .documentItem {
  grid-template-columns: 86px minmax(0, 1fr) auto;
  background: #fff;
  min-height: 40px;
  padding: 8px 10px;
}

.documentItem.empty {
  background: #fff;
  border-style: dashed;
}

.documentItem.empty strong:empty::before {
  content: " ";
}

.documentItem span,
.deviceItem span,
.deviceItem em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.documentItem strong,
.deviceItem strong {
  overflow-wrap: anywhere;
}

.compactDeviceBlock {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.compactDeviceTitle {
  display: grid;
  align-content: center;
}

.compactDeviceTitle h2 {
  font-size: 16px;
}

.deviceList {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.deviceItem {
  grid-template-columns: 1fr;
  gap: 3px;
  min-height: 66px;
  padding: 8px;
  background: #fff;
}

.deviceItem strong {
  font-size: 14px;
}

.deviceItem span,
.deviceItem em {
  line-height: 1.25;
}

.devicePanel .deviceList {
  grid-template-columns: 1fr;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.devicePanel .deviceItem {
  min-height: 0;
  padding: 11px 12px;
}

.deviceLine {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.deviceLine span {
  justify-self: end;
  white-space: nowrap;
}

.deviceLine .deviceOnline.is-online {
  color: #059669;
  font-weight: 800;
}

.deviceLine .deviceOnline.is-offline {
  color: #94a3b8;
  font-weight: 800;
}

.devicePanel .deviceItem strong {
  font-size: 17px;
}

.devicePanel .deviceLine span {
  font-size: 13px;
}

.deviceDetails {
  display: grid;
  gap: 4px;
}

.deviceDetails .deviceMetric {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: #475569;
  font-size: 14px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.45;
}

.deviceMetric b {
  color: #475569;
  font-size: inherit;
  font-weight: 650;
}

.deviceMetric .deviceValue {
  color: #334155;
  font-size: inherit;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.deviceMetric .deviceValue.is-running {
  color: #d97706;
}

.deviceMetric .deviceValue.is-active {
  color: #2563eb;
}

.deviceMetric .deviceValue.is-success {
  color: #059669;
}

.deviceMetric .deviceValue.is-danger {
  color: #dc2626;
}

.deviceMetric .deviceValue.is-muted {
  color: #64748b;
}

.warehouseSlotsCard {
  gap: 9px;
}

.warehouseSlotGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 32px;
  gap: 8px 6px;
}

.warehouseSlot,
.warehousePort {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.warehouseSlot:hover,
.warehouseSlot:focus-visible,
.warehousePort:hover,
.warehousePort:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 111, 209, .18);
}

.warehouseSlot span,
.warehousePort span {
  min-width: 0;
  white-space: nowrap;
  text-align: center;
}

.warehouseSlot b,
.warehousePort b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.warehouseSlot.green { color: #067647; background: #ecfdf3; }
.warehouseSlot.red { color: #b42318; background: #fef3f2; }
.warehousePort.green { color: #067647; background: #ecfdf3; }
.warehousePort.red { color: #b42318; background: #fef3f2; }
.warehousePort { cursor: pointer; }
.warehouseSlot.blink {
  color: #b54708;
  background: #fffaeb;
  animation: warehouseSlotPulse 1s steps(1, end) infinite;
}

.orderCard .inboundStateTag {
  justify-self: end;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.orderCard .inboundStateTag.ready {
  background: #ecfdf3;
  color: #067647;
}

.slotLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #64748b;
  font-size: 12px;
}

.slotLegend span { display: inline-flex; align-items: center; gap: 5px; }
.slotLegend i { width: 9px; height: 9px; border-radius: 50%; }
.slotLegend i.green { background: #12b76a; }
.slotLegend i.red { background: #f04438; }
.slotLegend i.blink { background: #f79009; animation: warehouseSlotPulse 1s steps(1, end) infinite; }

@keyframes warehouseSlotPulse {
  50% { opacity: .25; }
}

.slotDetailDialog {
  width: min(560px, calc(100vw - 36px));
}

.orderStatusFilter {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
}
.orderStatusFilter select {
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: #111827;
}

.warehouseSlotDetailBody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.warehouseSlotDetailBody div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.warehouseSlotDetailBody label {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.warehouseSlotDetailBody input,
.warehouseSlotDetailBody select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  color: #111827;
  background: #fff;
  font: inherit;
}

.warehouseSlotDetailBody span { color: #64748b; font-size: 12px; }
.warehouseSlotDetailBody strong { overflow-wrap: anywhere; }
.warehouseSlotDetailBody .slotOrderSwitch {
  width: fit-content;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1264d8;
  font: inherit;
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.warehouseSlotDetailBody .slotOrderSwitch:hover { text-decoration: underline; }
.warehouseSlotDetailBody .slotOrderSwitch:disabled { opacity: .55; cursor: wait; }
.warehouseSlotDetailBody p { grid-column: 1 / -1; color: #64748b; }

.flowNodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .25);
  z-index: 10;
}

.toast.ok { background: #0f7a4f; color: #fff; }
.toast.bad { background: #b4232a; color: #fff; }
.toast.order {
  padding: 15px 18px;
  border: 1px solid #fb7185;
  background: #be123c;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 16px 38px rgba(190, 18, 60, .32);
}

@media (max-width: 1120px) {
  .topbar,
  .heroGrid,
  .statusGrid,
  .contentGrid,
  .activeOrderSummary,
  .summaryMeta {
    grid-template-columns: 1fr;
  }

  .timeline,
  .flowNodes,
  .documentList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 20px, 1480px);
  }

  .timeline,
  .flowNodes,
  .actionGrid {
    grid-template-columns: 1fr;
  }

  .orderCard,
  .documentItem,
  .deviceItem,
  .orderList.compact .orderCard {
    grid-template-columns: 1fr;
  }

  .documentList {
    grid-template-columns: 1fr;
  }

  .orderCard small {
    grid-column: auto;
  }
}

/* 1080 × 1920 竖屏工位机布局 */
.actionPanel .activeOrderSummary {
  grid-template-columns: 1fr;
  margin: 0 0 12px;
  padding: 12px;
}

.actionPanel .summaryMeta,
.actionPanel .summaryRow.twoCols,
.actionPanel .summaryRow.threeCols {
  grid-template-columns: 1fr;
}

.actionPanel .summaryMain strong { font-size: 19px; }

.stationCard {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #f8fafc;
}

.stationCardHeader {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.stationCardHeader .stationIcon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #e8f2ff;
  color: #1f6fd1;
  font-size: 17px;
  font-weight: 900;
  flex: 0 0 38px;
}

.stationCardHeader .stationSimulatedIcon { background: #fff3da; color: #a96700; font-size: 12px; }
.stationCardHeader h3 { font-size: 16px; flex: 1; min-width: 0; }
.stationCardHeader em { font-size: 12px; font-style: normal; font-weight: 800; }
.stationCardStatus { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.stationCardBody {
  display: grid;
  gap: 1px;
  background: #e2e8f0;
}

.stationDataRow {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px 12px;
  background: #fff;
}

.stationDataRow span { color: #64748b; font-size: 13px; }
.stationDataRow strong { overflow-wrap: anywhere; font-size: 14px; }

.stationDataRow strong.primaryResult {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: .2px;
}

.stationDataRow strong.markResult { color: #175cd3; }
.stationDataRow strong.resultPass { color: #067647; }
.stationDataRow strong.resultFail { color: #b42318; }
.stationDataRow strong.resultPending { color: #9a6200; }
.stationDataRow strong.resultGradeOne { color: #067647; }
.stationDataRow strong.resultGradeTwo { color: #76a900; }
.stationDataRow strong.resultGradeThree { color: #d49a00; }

.modelColorDot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  vertical-align: -1px;
  background: var(--model-color);
  box-shadow: 0 0 0 1px #cbd5e1;
}

.floorWorkspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.floorPlanPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.floorPlanFrame {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
}

.floorPlanFrame iframe {
  display: block;
  width: 100%;
  height: 780px;
  border: 0;
  background: #fff;
}

.floorDevicePanel {
  min-height: 0;
}

.floorConsoleDialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.floorConsoleBox { padding: 12px; }

.floorConsoleBox iframe {
  display: block;
  width: 100%;
  height: min(1480px, calc(100vh - 110px));
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #061727;
}

@media (min-width: 681px) and (max-width: 1120px) {
  .shell { width: calc(100vw - 32px); }

  .topbar {
    grid-template-columns: minmax(180px, 1fr) auto;
  }

  .topStatus { grid-column: 1 / -1; justify-content: flex-start; }

  .heroGrid {
    grid-template-columns: 360px minmax(0, 1fr);
    align-items: start;
  }

  .actionPanel { grid-column: 1; grid-row: 1; }
  .scenarioPanel { grid-column: 2; grid-row: 1; }
  .stationPanel { grid-column: 1 / -1; grid-row: 2; min-height: auto; }
  .stationPanel .documentList { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .scenarioPanel { grid-template-rows: auto minmax(0, 1fr) auto; }
  .documentList { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scenarioPanel { grid-template-rows: auto auto auto; }

  .floorWorkspace { grid-template-columns: 1fr; }
  .floorDevicePanel .deviceList { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
}

@media (max-width: 680px) {
  .floorWorkspace { grid-template-columns: 1fr; }
  .floorPlanFrame iframe { height: 560px; }
}

/* 横屏操作端：以 1920 × 1080 展示终端为基准，首屏同时保留流程、工位和现场信息。 */
@media (min-width: 1280px) and (orientation: landscape) {
  .shell {
    width: calc(100vw - 48px);
    max-width: none;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar {
    margin-bottom: 10px;
    padding: 11px 16px;
  }

  .heroGrid {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1.1fr);
    gap: 12px;
    margin-bottom: 10px;
    align-items: stretch;
  }

  .panel { padding: 12px; }
  .panelTitle { margin-bottom: 9px; }
  .actionPanel,
  .scenarioPanel,
  .floorPlanPanel,
  .stationPanel { min-height: 390px; }

  .timeline { gap: 7px; }
  .timeline li { min-height: 50px; padding: 7px 8px; }
  .timeline li strong { font-size: 13px; }
  .timeline li em { font-size: 11px; }

  .floorWorkspace { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .floorPlanFrame { min-height: 520px; }
  .floorPlanFrame iframe { height: 560px; }
  .floorDevicePanel { min-height: 0; }
  .floorDevicePanel .deviceList {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }
  .floorDevicePanel .deviceItem {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    height: 170px;
    min-height: 170px;
    padding: 10px;
  }
  .floorDevicePanel .deviceLine {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .floorDevicePanel .deviceLine strong { font-size: 16px; }
  .floorDevicePanel .deviceLine span { justify-self: auto; font-size: 13px; }
  .floorDevicePanel .deviceDetails {
    grid-column: 2;
    padding-top: 5px;
    gap: 6px;
    align-content: start;
  }
  .floorDevicePanel .deviceDetails .deviceMetric {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 4px;
    align-items: baseline;
    font-size: 13px;
    line-height: 1.4;
  }
  .floorDevicePanel .warehouseSlotsCard {
    position: relative;
    grid-column: span 2;
    grid-template-columns: 86px minmax(0, 1fr);
  }
  .floorDevicePanel .warehouseSlotsCard .deviceLine { gap: 8px; }
  .floorDevicePanel .warehouseSlotGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 31px;
    gap: 5px;
  }
  .floorDevicePanel .warehouseSlot,
  .floorDevicePanel .warehousePort { grid-template-columns: 18px minmax(0, 1fr); padding: 3px; font-size: 12px; }
  .floorDevicePanel .warehouseSlot b,
  .floorDevicePanel .warehousePort b { width: 18px; height: 18px; font-size: 13px; }
  .floorDevicePanel .slotLegend { gap: 4px 8px; font-size: 11px; }
}

@media (min-width: 1600px) and (orientation: landscape) {
  .heroGrid {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.2fr) minmax(0, 1.7fr) minmax(0, .8fr);
  }

  .stationPanel .stationDataRow { grid-template-columns: 86px minmax(0, 1fr); }
  .stationPanel .stationDataRow strong { overflow-wrap: normal; word-break: keep-all; white-space: nowrap; }

  .floorPlanFrame {
    position: relative;
    min-height: 590px;
  }

  .floorPlanFrame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: scale(1.06);
    transform-origin: center;
  }

  .floorDevicePanel .deviceLine { justify-content: flex-start; }
  .floorDevicePanel .deviceLine span { margin-top: 2px; }
  .floorDevicePanel .warehouseSlotsCard .deviceLine span { display: none; }
  .floorDevicePanel .slotLegend {
    position: absolute;
    left: 10px;
    top: 42px;
    width: 78px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: 92px;
    gap: 7px;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }
  .floorDevicePanel .slotLegend i { width: 8px; height: 8px; }
}

/* Device headers and metrics share a left edge; warehouse slots keep their layout. */
@media (min-width: 1280px) and (orientation: landscape) {
  .floorDevicePanel .deviceItem:not(.warehouseSlotsCard) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 32px minmax(0, 1fr);
    row-gap: 8px;
  }

  .floorDevicePanel .deviceItem:not(.warehouseSlotsCard) .deviceLine {
    grid-column: 1;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .floorDevicePanel .deviceItem:not(.warehouseSlotsCard) .deviceOnline {
    margin-top: 8px;
  }

  .floorDevicePanel .deviceItem:not(.warehouseSlotsCard) .deviceDetails {
    grid-column: 1;
    padding-top: 0;
    grid-auto-rows: 20px;
    gap: 4px;
    align-content: start;
  }

  .floorDevicePanel .deviceItem:not(.warehouseSlotsCard) .deviceMetric {
    grid-template-columns: 70px minmax(0, 1fr);
    line-height: 20px;
  }

  .floorDevicePanel .deviceItem:not(.warehouseSlotsCard) .deviceMetric b {
    white-space: nowrap;
  }
}

/* 竖屏独立版：不沿用横屏的四模块并排与设备单行布局。 */
@media (orientation: portrait) {
  .shell { width: min(100vw - 32px, 920px); }

  .topbar,
  .heroGrid,
  .floorWorkspace { grid-template-columns: 1fr; }

  .heroGrid > .actionPanel { order: 1; }
  .heroGrid > .scenarioPanel { order: 2; }
  .heroGrid > .stationPanel { order: 3; }
  .heroGrid > .floorPlanPanel { order: 4; }

  .stationPanel { min-height: 0; }
  .stationPanel .documentList { grid-template-columns: 1fr; }
  .floorPlanFrame { min-height: 500px; }
  .floorPlanFrame iframe { height: 560px; }

  .floorDevicePanel .deviceList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .floorDevicePanel .warehouseSlotsCard { grid-column: 1 / -1; }
}

.visionConfirmConfig { margin-top:20px; padding-top:18px; border-top:1px solid #dbe5f0; }
