:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #101827;
  --muted: #5e6878;
  --line: #d9e0ea;
  --soft: #f8fafc;
  --accent: #245edb;
  --ok: #22845f;
  --warn: #b97718;
  --danger: #c94c4c;
  --shadow: 0 10px 24px rgba(20, 31, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.intake-topbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  background: #fbfcfe;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 900;
}

h1 {
  font-size: 26px;
}

.intake-nav,
.boundary-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.intake-nav a,
.boundary-strip span,
.small-badge {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.intake-nav a {
  color: var(--accent);
}

.intake-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(360px, 1fr) minmax(320px, 0.95fr);
  grid-template-rows: auto minmax(330px, 1fr);
  gap: 12px;
  padding: 12px;
}

.gate-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.primary-panel {
  grid-column: 1 / 3;
}

.component-panel {
  grid-column: 1 / 3;
}

.component-subhead {
  display: block;
  margin: 16px 0 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.component-subhead h2 {
  font-size: 15px;
  line-height: 1.25;
}

.candidate-panel {
  grid-column: 1 / 2;
}

.runbook-panel {
  grid-column: 2 / 3;
}

.coverage-panel {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
}

.audit-panel {
  grid-column: 1 / 3;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.icon-button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}

.kpi-grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.intake-kpi,
.status-card,
.candidate-row,
.empty-candidates,
.runbook-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.intake-kpi {
  padding: 10px;
}

.intake-kpi dt,
.status-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.intake-kpi dd,
.status-card strong {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.gate-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.gate-status strong {
  color: var(--danger);
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.gate-status span,
.gate-status em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.candidate-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.candidate-row,
.empty-candidates {
  padding: 0;
  border: 0;
  background: transparent;
}

.candidate-row > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.candidate-row strong,
.empty-candidates strong {
  font-size: 15px;
  font-weight: 900;
}

.candidate-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.candidate-row dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.candidate-row p,
.empty-candidates p,
.audit-panel p,
.status-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.runbook-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.runbook-step {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.runbook-step b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.runbook-step span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.status-grid {
  grid-template-columns: 1fr;
}

.status-card {
  padding: 10px;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .intake-topbar,
  .intake-shell {
    display: block;
  }

  .intake-topbar > *,
  .intake-shell > * {
    margin-bottom: 12px;
  }

  .kpi-grid,
  .candidate-row dl,
  .gate-status {
    grid-template-columns: 1fr;
  }

  .runbook-step {
    grid-template-columns: 1fr;
  }
}
