:root {
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #d8dee8;
  --text: #162033;
  --muted: #647085;
  --nav: #0f4c5a;
  --blue: #0891b2;
  --green: #047857;
  --amber: #b45309;
  --red: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
}

button {
  cursor: pointer;
}

button:hover,
button:focus-visible,
select:focus-visible,
.clickable-row:hover,
.clickable-row:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: -2px;
}

button.primary,
.status-tabs button.active {
  background: var(--nav);
  border-color: var(--nav);
  color: #fff;
}

button.ghost {
  background: #ffffff;
  color: #1747a6;
  border-color: #bfdbfe;
}

button.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 16px;
}

h4 {
  font-size: 13px;
  margin-bottom: 7px;
}

p {
  line-height: 1.5;
}

.app-header {
  min-height: 64px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(230px, 310px) 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--nav);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.eyebrow {
  color: #a9b4c6;
  font-size: 12px;
  margin-bottom: 3px;
}

.header-meta,
.token-row,
.button-row,
.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-meta span,
.mock-banner,
.token-row span {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.mock-banner {
  background: #7f1d1d;
  font-weight: 800;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.side-nav {
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 12px;
}

.nav-item {
  width: 100%;
  border: 0;
  margin-bottom: 4px;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active,
.metric:hover,
.metric:focus-visible {
  background: #eaf0ff;
  color: #1747a6;
  font-weight: 800;
}

main {
  padding: 14px;
}

.mock-console {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #eff6ff;
  padding: 10px 12px;
  margin-bottom: 12px;
}

#mockFeedback {
  color: #17345f;
  font-size: 14px;
  line-height: 1.45;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 10px;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
}

.subtle.mono,
.danger-text {
  display: block;
  margin-top: 3px;
}

.danger-text {
  color: var(--danger);
}

.layer-grid,
.metric-strip,
.business-strip,
.performance-grid,
.process-grid,
.process-steps,
.summary-grid,
.readback-grid,
.report-grid,
.master-grid,
.technical-grid,
.deep-grid,
.analysis-grid {
  display: grid;
  gap: 10px;
}

.layer-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.metric-strip {
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  margin-bottom: 10px;
}

.business-strip {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.process-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.process-steps {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.performance-grid,
.summary-grid,
.readback-grid,
.report-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.master-grid,
.technical-grid,
.deep-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.analysis-grid,
.two-col,
.execution-layout,
.today-grid {
  display: grid;
  gap: 12px;
}

.analysis-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.today-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.65fr);
}

.execution-layout {
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  align-items: start;
}

.lane,
.metric,
.panel,
.action-card,
.alert-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lane,
.metric {
  padding: 12px;
}

.panel,
.action-card,
.alert-panel {
  padding: 12px;
  margin-bottom: 10px;
}

.alert-panel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-left: 4px solid var(--amber);
  background: #fffbeb;
}

.lane-title,
.panel-title,
.metric span,
.business-strip span,
.performance-grid span,
.summary-grid span,
.readback-grid span,
.report-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel-title,
.lane-title,
.metric span {
  letter-spacing: 0;
}

.lane-value,
.metric strong,
.business-strip strong,
.performance-grid strong,
.summary-grid strong,
.readback-grid strong,
.report-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.25;
}

.metric {
  width: 100%;
  min-height: 76px;
  text-align: left;
}

.metric em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.business-strip div,
.performance-grid div,
.process-card,
.step-card,
.summary-grid div,
.readback-grid div,
.report-grid div,
.master-grid div,
.technical-grid div,
.deep-grid div,
.analysis-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 9px;
}

.sku-header-panel {
  position: sticky;
  top: 64px;
  z-index: 4;
}

.process-card,
.step-card {
  display: grid;
  gap: 5px;
}

.process-card span,
.step-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.process-card em,
.step-card em,
.token-note span,
.alert-meta span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.step-card b {
  justify-self: start;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
}

.step-card.done b {
  color: #065f46;
  background: #d1fae5;
}

.step-card.active b,
.step-card.pending b {
  color: #92400e;
  background: #fef3c7;
}

.step-card.error b {
  color: #991b1b;
  background: #fee2e2;
}

.step-card.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.step-card.error {
  border-color: #fecaca;
  background: #fff1f2;
}

.token-note,
.alert-meta {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  margin-top: 10px;
}

.token-note strong,
.alert-meta strong {
  margin-right: 6px;
}

.alert-meta {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.compact-table {
  margin-top: 10px;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin: 12px 0 8px;
  text-transform: uppercase;
}

.memory-item {
  background: #f8fafc;
}

.master-grid p,
.technical-grid span,
.deep-grid span,
.analysis-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.lane-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

tr:last-child td {
  border-bottom: 0;
}

.mono,
.token-row span,
.action-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.token-row {
  margin: 10px 0;
}

.token-row span {
  border-color: var(--line);
  background: #eef2f7;
  color: #394457;
}

.status-pill,
.data-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.ok,
.data-tag.fact {
  color: #065f46;
  background: #d1fae5;
}

.status-pill.warn,
.data-tag.calculation,
.data-tag.inference {
  color: #92400e;
  background: #fef3c7;
}

.status-pill.danger {
  color: #991b1b;
  background: #fee2e2;
}

.status-pill.neutral,
.data-tag.unknown {
  color: #334155;
  background: #e2e8f0;
}

.queue-list,
.stack-list {
  display: grid;
  gap: 8px;
}

.queue-group {
  display: grid;
  gap: 6px;
}

.queue-group > strong {
  color: var(--text);
  font-size: 13px;
}

.queue-item,
.stack-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  color: var(--text);
  text-align: left;
}

.stack-item span,
.queue-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.queue-item.danger {
  border-left: 4px solid var(--red);
}

.queue-item.warn {
  border-left: 4px solid var(--amber);
}

.queue-item.ok {
  border-left: 4px solid var(--green);
}

.queue-item.selected {
  background: #eff6ff;
  border-color: #93c5fd;
}

.status-action {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-action.ok {
  color: #065f46;
  background: #d1fae5;
}

.status-action.warn {
  color: #92400e;
  background: #fef3c7;
}

.status-action.danger {
  color: #991b1b;
  background: #fee2e2;
}

.status-action.neutral {
  color: #334155;
  background: #e2e8f0;
}

.action-card {
  max-width: 1180px;
}

.action-top,
.master-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.action-id {
  color: var(--muted);
  font-size: 12px;
}

.guardrail {
  border: 1px solid #f1c27d;
  border-radius: 8px;
  background: #fffbeb;
  color: #663c00;
  padding: 10px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
}

.detail-box,
.technical-panel,
.report-panel {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
  margin-top: 10px;
  color: #334155;
  font-size: 13px;
}

.detail-box span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  padding: 10px;
  margin-top: 10px;
}

details {
  margin-top: 6px;
}

summary {
  color: #1747a6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.confirm-panel strong,
.confirm-panel span,
.confirm-panel label {
  display: block;
}

.confirm-panel span,
.confirm-panel label {
  color: #334155;
  font-size: 13px;
}

.confirm-panel input {
  width: min(100%, 360px);
  min-height: 34px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}

.status-tabs {
  margin-bottom: 12px;
}

.status-tabs button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.status-tabs span {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(100, 112, 133, 0.18);
  font-size: 12px;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.flow span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.flow span.done {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.flow span.active {
  color: #fff;
  background: var(--nav);
  border-color: var(--nav);
}

.action-table-wrap {
  overflow-x: auto;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.compact {
  gap: 5px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .layer-grid,
  .metric-strip,
  .business-strip,
.process-grid,
.process-steps,
  .performance-grid,
  .summary-grid,
  .readback-grid,
  .report-grid,
  .master-grid,
  .technical-grid,
  .deep-grid,
  .analysis-grid,
  .two-col,
  .execution-layout,
  .today-grid {
    grid-template-columns: 1fr;
  }

  .alert-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .app-header,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-header {
    position: static;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
  }

  main {
    padding: 14px;
  }

  .mock-console,
  .section-head,
  .alert-panel,
  .action-top,
  .master-header {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 第三轮紧凑化生产界面 */
h2 {
  font-size: 20px;
}

button,
select {
  min-height: 34px;
  padding: 6px 10px;
}

button.small {
  min-height: 32px;
}

main {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.table-toolbar input,
.table-toolbar select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}

.table-toolbar input {
  min-width: 240px;
}

.table-scroll {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-scroll table {
  border-collapse: separate;
  border-spacing: 0;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}

th,
td {
  min-height: 36px;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-sku-table td,
.compact-sku-table th {
  vertical-align: middle;
}

#skuMasterRows td:first-child {
  min-width: 280px;
}

#sku-master table th:first-child,
#sku-master table td:first-child,
.inspection-list-panel table th:first-child,
.inspection-list-panel table td:first-child {
  width: 30%;
  min-width: 260px;
  white-space: normal;
}

#sku-master table th:nth-child(3),
#sku-master table td:nth-child(3),
#sku-master table th:nth-child(4),
#sku-master table td:nth-child(4),
#sku-master table th:nth-child(8),
#sku-master table td:nth-child(8) {
  width: 9%;
}

.campaign-table-panel table th:first-child,
.campaign-table-panel table td:first-child {
  width: 32%;
}

.campaign-table-panel table th:nth-child(2),
.campaign-table-panel table td:nth-child(2) {
  width: 14%;
}

.campaign-table-panel table th:nth-child(3),
.campaign-table-panel table td:nth-child(3),
.campaign-table-panel table th:nth-child(4),
.campaign-table-panel table td:nth-child(4) {
  width: 16%;
}

.pagination-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.sku-one-line {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.business-paragraph {
  display: grid;
  gap: 8px;
}

.recommendation-summary {
  display: grid;
  gap: 8px;
}

.recommendation-summary.structured {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  align-items: start;
}

.recommendation-summary.structured div {
  display: grid;
  gap: 4px;
}

.recommendation-summary.structured b {
  color: var(--muted);
  font-size: 12px;
}

.recommendation-summary.structured span {
  line-height: 1.45;
}

.wide-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.recommendation-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px;
}

.state-banner {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  margin-top: 10px;
  font-weight: 800;
}

.state-banner.ok {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.state-banner.warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.state-banner.danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.progress-line,
.result-head {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 8px;
}

.record-groups {
  display: grid;
  gap: 14px;
}

.record-day {
  display: grid;
  gap: 8px;
}

.record-day h3 {
  font-size: 15px;
}

.record-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.inline-input {
  width: 100%;
  min-width: 94px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  background: #fff;
}

.inline-input.wide {
  min-width: 240px;
}

.reason-input {
  min-height: 68px;
  resize: vertical;
}

.reason-text,
.readonly-value {
  display: block;
  min-width: 0;
  line-height: 1.45;
}

.selected-row {
  background: #eff6ff;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ellipsis {
  display: block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.drill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.drill-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.drill-grid b,
.drill-grid span {
  display: block;
}

.drill-grid span {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.wide-drill {
  grid-column: span 2;
}

.inline-details {
  margin-top: 4px;
}

.inline-details summary {
  cursor: pointer;
  color: #075985;
  font-weight: 800;
  line-height: 1.45;
}

.inline-details .mini-table {
  margin-top: 8px;
}

.strategy-card {
  display: grid;
  gap: 10px;
}

.strategy-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.strategy-kpis div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.strategy-kpis span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 3px;
}

.strategy-kpis strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.strategy-body {
  display: grid;
  gap: 6px;
  color: #334155;
}

.strategy-body b {
  margin-right: 6px;
}

.strategy-line {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 9px 12px;
  margin-bottom: 10px;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.panel,
.action-table-wrap,
.table-scroll,
.record-day,
.modal-panel {
  min-width: 0;
}

.panel-title {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.modal-open {
  overflow: hidden;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  margin: 22px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.22);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.modal-body {
  min-width: 0;
  overflow: auto;
  padding: 14px;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: #fff;
  font-weight: 400;
}

.form-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.wide-field {
  grid-column: 1 / -1;
}

.full-title {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-summary,
.review-readonly-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.review-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.review-summary span,
.review-readonly-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.review-readonly-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-readonly-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px;
}

.review-readonly-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.info-line {
  margin-top: 10px;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.mini-table {
  margin-top: 6px;
}

.segmented {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.modal-record-detail b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
}

.status-pill.ok,
.data-tag.fact {
  color: #1747a6;
  background: #eaf0ff;
}

.status-pill.warn,
.data-tag.calculation,
.data-tag.inference {
  color: #334155;
  background: #eef2f7;
}

.status-action.ok {
  color: #1747a6;
  background: #eaf0ff;
}

.status-action.warn {
  color: #334155;
  background: #eef2f7;
}

.state-banner.ok {
  color: #1747a6;
  background: #eaf0ff;
  border-color: #bfdbfe;
}

.state-banner.warn {
  color: #334155;
  background: #eef2f7;
  border-color: var(--line);
}

@media (max-width: 1180px) {
  .three-col,
  .drill-grid,
  .record-detail,
  .strategy-kpis {
    grid-template-columns: 1fr;
  }
}

/* 第四轮业务化验收界面：紧凑、中文、青色工作台风格 */
:root {
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #dbe4ee;
  --text: #27364a;
  --muted: #7a8798;
  --nav: #0f4858;
  --blue: #0899b8;
  --green: #0f9f75;
  --amber: #c47a22;
  --red: #d14b54;
  --danger: #d14b54;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app-header {
  min-height: 58px;
  padding: 10px 18px 10px 252px;
  grid-template-columns: minmax(220px, 360px) 1fr auto;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(15, 72, 88, 0.05);
}

.app-header h1 {
  font-size: 21px;
  line-height: 1.2;
}

.eyebrow {
  color: #8da0b3;
}

.header-meta span,
.mock-banner,
.token-row span {
  color: #526173;
  background: #f8fafc;
  border-color: var(--line);
}

.mock-banner {
  color: #9b2f37;
  background: #fff0f1;
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}

.side-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 220px;
  z-index: 20;
  padding: 74px 12px 14px;
  background: var(--nav);
  border-right: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.side-nav::before {
  content: "AMZ  人工工作台";
  position: absolute;
  top: 18px;
  left: 14px;
  right: 14px;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
}

.nav-item {
  min-height: 42px;
  color: #c7d6df;
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 #18b7d4;
}

main {
  padding: 16px 18px;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 16px;
}

.section-head {
  align-items: center;
  margin-bottom: 12px;
}

.mock-console,
.panel,
.alert-panel,
.detail-box,
.report-panel,
.technical-panel,
.record-detail,
.modal-panel {
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(15, 72, 88, 0.08);
}

.mock-console {
  border-color: #c9e7f0;
  border-left-color: var(--blue);
  background: #eaf8fb;
}

.panel,
.action-card,
.alert-panel {
  padding: 12px 14px;
}

.panel-title {
  color: #27364a;
  font-size: 16px;
}

.panel-note {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

button,
select,
.table-toolbar input,
.table-toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 34px;
  border-radius: 6px;
}

button.primary,
.status-tabs button.active {
  background: var(--blue);
  border-color: var(--blue);
}

button.ghost {
  color: #087f9b;
  border-color: #b9dde7;
}

table {
  table-layout: fixed;
  font-size: 13px;
}

th,
td {
  height: 36px;
  padding: 7px 8px;
  overflow-wrap: anywhere;
  word-break: normal;
}

th {
  color: #697789;
  background: #f8fafc;
}

.today-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.today-stat {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.today-stat span,
.today-stat em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.today-stat strong {
  display: block;
  margin: 2px 0;
  font-size: 22px;
  line-height: 1.15;
  color: var(--text);
}

.today-workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.growth-panel {
  grid-column: 1 / -1;
}

.radio-group {
  display: grid;
  gap: 5px;
  min-width: 86px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.radio-group input {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.placement-editor {
  display: grid;
  gap: 5px;
  min-width: 210px;
}

.placement-editor label {
  display: grid;
  grid-template-columns: 74px minmax(74px, 1fr);
  gap: 6px;
  align-items: center;
}

.placement-editor span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.placement-editor em,
.placement-editor small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.25;
}

.placement-editor input,
.inline-input {
  min-height: 32px;
  border-radius: 6px;
}

.placement-editor input:disabled,
.inline-input:disabled,
.radio-group input:disabled {
  cursor: not-allowed;
  color: #8c98a8;
  background: #f3f6f9;
}

.value-pair {
  display: grid;
  gap: 6px;
  min-width: 130px;
}

.value-pair span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.value-pair strong,
.readonly-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.reason-text {
  max-width: 36rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.reason-text.readonly {
  color: #334155;
  font-size: 13px;
}

.source-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #087f9b;
  background: #e6f7fb;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.safety-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.safety-card,
.sequence-signal {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.safety-card span,
.sequence-signal span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.safety-card strong,
.sequence-signal strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.safety-card em,
.sequence-signal em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.state-diff-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  margin: 0 0 10px;
  overflow-x: auto;
}

.state-diff-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

.state-diff-head strong {
  display: block;
  font-size: 15px;
}

.state-diff-head span,
.state-diff-head em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.mini-status-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.mini-status-table th,
.mini-status-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.sequence-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.action-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.action-table-wrap table {
  min-width: 1040px;
}

.drill-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.strategy-kpis div,
.drill-grid div,
.business-strip div,
.master-grid div {
  border-radius: 8px;
}

@media (max-width: 1440px) {
  .safety-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-table-wrap table {
    min-width: 1000px;
  }

  .placement-editor {
    min-width: 190px;
  }
}

@media (max-width: 1366px) {
  main {
    padding: 14px;
  }

  .action-table-wrap table {
    min-width: 980px;
  }

  .placement-editor {
    min-width: 180px;
  }

  th,
  td {
    padding: 6px 7px;
  }
}

@media (max-width: 1180px) {
  .today-stat-grid,
  .today-workbench,
  .drill-grid,
  .sequence-signal-grid {
    grid-template-columns: 1fr;
  }

  .growth-panel {
    grid-column: auto;
  }

  .safety-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .app-header {
    padding: 10px 14px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    width: auto;
    padding: 8px 12px;
  }

  .side-nav::before {
    display: none;
  }
}

/* 发布兜底：避免 fixed 侧栏和 grid 自动布局在外部浏览器里把正文压到左侧或显示为空。 */
@media (min-width: 881px) {
  .app-shell {
    display: block;
    min-height: calc(100vh - 58px);
  }

  main {
    display: block;
    margin-left: 220px;
    width: calc(100% - 220px);
    min-height: calc(100vh - 58px);
  }

  .page.active {
    display: block !important;
    min-height: 240px;
  }
}

.render-fallback {
  margin-bottom: 10px;
  border-left: 4px solid var(--red);
}
