/* 球多多运营台 · 夜间赛事编辑台
   暖纸底、深墨绿、单一品牌绿；状态用点，数字用等宽。 */

:root {
  --bg: #f3f1ec;
  --surface: #fffdf9;
  --surface-2: #f8f5ef;
  --surface-3: #efebe3;
  --ink: #1c211e;
  --ink-2: #5d655f;
  --muted: #686f69;
  --line: rgba(28, 33, 30, .10);
  --line-strong: rgba(28, 33, 30, .16);
  --brand: #0b6b4f;
  --brand-hover: #07533d;
  --brand-soft: #e7f0eb;
  --amber: #966000;
  --amber-soft: #f7ecd9;
  --red: #b3262d;
  --red-soft: #f8e7e7;
  --blue: #355b85;
  --blue-soft: #e9eef5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(28, 33, 30, .05);
  --shadow: 0 12px 32px rgba(28, 33, 30, .09);
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar: #111815;
  --sidebar-text: #c6d1ca;
  --sidebar-muted: #7f9087;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: rgba(11, 107, 79, .18); }

/* ---------- 登录：左侧赛事编辑台，右侧表单 ---------- */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  background: var(--bg);
}

.login-story {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px clamp(28px, 4vw, 64px);
  background: var(--sidebar);
  color: #edf2ee;
}

.login-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
}

.login-wordmark .brand-mark {
  width: 30px;
  height: 30px;
  margin: 0;
  font-size: 15px;
  border-radius: 7px;
}

.login-kicker {
  margin: 0 0 12px;
  color: #94a69b;
  font-size: 12px;
}

.login-story h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.login-lead {
  max-width: 34rem;
  margin: 0;
  color: #aab8b0;
  font-size: 15px;
  line-height: 1.65;
}

.login-flow {
  max-width: 28rem;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.login-flow li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.login-flow li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.login-flow .idx { padding-top: 2px; color: #7f9389; font-family: var(--mono); font-size: 11px; }
.login-flow b { display: block; font-size: 14px; font-weight: 500; }
.login-flow small { color: #93a49a; font-size: 12px; }

.login-foot {
  margin: 32px 0 0;
  color: #75877d;
  font-family: var(--mono);
  font-size: 11px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card { width: min(380px, 100%); }
.login-form-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.login-form-head p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }

#login-form label {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

#login-form input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

#login-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 79, .12);
}

#login-form .field + .field { margin-top: 16px; }

.login-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
}

/* ---------- 应用外壳 ---------- */

.app[hidden] { display: none !important; }

.app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--sidebar);
  color: var(--sidebar-text);
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 2px 8px 24px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.sidebar-brand .brand-mark { width: 32px; height: 32px; margin: 0; font-size: 15px; }
.sidebar-brand strong { display: block; font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.sidebar-brand span { color: var(--sidebar-muted); font-size: 11px; }

.nav { display: flex; flex: 1; flex-direction: column; gap: 2px; }

.nav-label {
  margin: 18px 10px 6px;
  color: #6e7e75;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
}

.nav-label:first-child { margin-top: 0; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 14px;
  text-align: left;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}

.nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }

.nav-item.active {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #4fae8c;
}

.sidebar-foot {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.env-pill {
  padding: 0 2px;
  color: var(--sidebar-muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  word-break: break-all;
}

.sidebar-foot .btn.ghost { justify-self: start; color: var(--sidebar-muted); padding: 0 2px; }
.sidebar-foot .btn.ghost:hover { color: #fff; background: transparent; }

.main { min-width: 0; padding: 24px clamp(20px, 3.2vw, 40px) 64px; }
.topbar, .view { width: 100%; max-width: 1440px; margin-right: auto; margin-left: auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  min-height: 60px;
  margin-bottom: 24px;
}

.topbar-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.15;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.date-pill {
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.date-pill + .date-pill { padding-left: 12px; border-left: 1px solid var(--line); }

.view { display: none; }
.view.active { display: block; animation: rise .24s var(--ease); }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 基础组件 ---------- */

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card + .card, .grid + .card, .card + .grid, .kpi-grid + .card, .card + .kpi-grid { margin-top: 16px; }

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.card-sub { margin: -8px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.card-head .card-title { margin: 0; }
.card-head .card-sub { margin: 4px 0 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); align-items: start; }
.grid.side > .span-2 { grid-column: 1 / -1; }

/* 数字带：一张面板里的四个指标，而不是四张漂浮卡片 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.kpi-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* 接入中心：按“能力”分卡片，而不是按模型厂商堆列表 */
.section-title {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.integration-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.integration-meta {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px 12px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}

.integration-meta b {
  color: var(--muted);
  font-weight: 500;
}

.integration-meta .mono { overflow-wrap: anywhere; }

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .integration-grid { grid-template-columns: 1fr; }
}

.kpi {
  position: static;
  overflow: visible;
  padding: 18px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi::after { display: none; }

.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.kpi.green .kpi-label::before,
.kpi.amber .kpi-label::before,
.kpi.red .kpi-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.kpi.green .kpi-label { color: var(--brand); }
.kpi.amber .kpi-label { color: var(--amber); }
.kpi.red .kpi-label { color: var(--red); }

.kpi-value {
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.kpi.accent .kpi-value { color: var(--brand); }
.kpi-foot { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease),
              color .16s var(--ease), transform .12s var(--ease);
}

.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }

.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #922027; }
.btn.warn { background: var(--amber); color: #fff; }
.btn.warn:hover { background: #7d5000; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn.full { width: 100%; margin-top: 16px; }

/* 状态：小圆点 + 文字，不再整颗彩色胶囊 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.green { color: var(--brand); }
.pill.amber { color: var(--amber); }
.pill.red { color: var(--red); }
.pill.blue { color: var(--blue); }
.pill.muted { color: var(--muted); }

/* 签名细节：价/市/模三闸门，方形刻度和状态字 */
.gate-row { display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }

.gate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.gate::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  background: currentColor;
}

.gate .gate-key { color: var(--ink-2); }
.gate.pass { color: var(--brand); }
.gate.fail { color: var(--red); }
.gate.pending { color: var(--amber); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.ellipsis { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 12px; font-weight: 500; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 79, .12);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .actions { flex-wrap: nowrap; }
.toolbar .actions input[type="search"] { width: 150px; min-width: 0; }
.toolbar .actions input[type="date"] { width: 140px; min-width: 0; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

.empty {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  background: transparent;
}

.notice { border-left: 3px solid var(--red); background: var(--red-soft); }
.notice > b { color: var(--red); font-weight: 500; }
.notice .card-sub { color: var(--ink-2); }

.skeleton {
  height: 110px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: min(430px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  background: #17211d;
  color: #f1f5f2;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }

.modal-backdrop[hidden] { display: none !important; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 15, .45);
}

.modal {
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal h3 { margin: 0 0 16px; font-size: 18px; font-weight: 500; }

/* ---------- 总览主链 ---------- */

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pipeline-step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 6px 12px;
  padding: 16px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  transition: background-color .16s var(--ease);
}

.pipeline-step:first-child { border-left: 0; }
.pipeline-step:hover { background: var(--surface-2); }
.pipeline-index { grid-row: 1 / 3; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.pipeline-name { color: var(--ink-2); font-size: 12px; }
.pipeline-count {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.pipeline-step.published .pipeline-count { color: var(--brand); }

.pipeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.pipeline-meta b { color: var(--ink); font-weight: 500; }

/* ---------- 数据供给流 ---------- */

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.flow-step { padding: 16px 18px; border-left: 1px solid var(--line); }
.flow-step:first-child { border-left: 0; padding-left: 0; }
.flow-index { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.flow-label { margin-top: 8px; color: var(--ink-2); font-size: 12px; }
.flow-value {
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.flow-step:last-child .flow-value { color: var(--brand); }
.flow-meta { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* ---------- 行式状态 ---------- */

.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }

.status-grid.tight { grid-template-columns: 1fr; }

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.status-item:last-child { border-bottom: 0; }
.status-label { color: var(--muted); font-size: 12px; line-height: 1.5; }
.status-item > div { min-width: 0; }
.status-item b { font-weight: 500; text-align: right; }
.status-item > .mono { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; text-align: right; }

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 64px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.bar-track { height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.bar-fill { height: 100%; border-radius: 2px; background: var(--brand); }

.review-layer {
  display: grid;
  grid-template-columns: 110px 80px 1fr;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.review-layer:last-child { border-bottom: 0; }
.review-name { font-weight: 500; }

.event-list { max-height: 360px; overflow-y: auto; padding-right: 4px; }

.event-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.event-item:last-child { border-bottom: 0; }
.event-item > :nth-child(1) { grid-column: 1; grid-row: 1; color: var(--muted); }
.event-item > :nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
.event-item > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.event-item > :nth-child(4) { grid-column: 1 / -1; grid-row: 3; color: var(--ink-2); }

.terminal {
  min-height: 380px;
  max-height: 62vh;
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: #111815;
  color: #d7e2db;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.model-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.model-row:last-child { border-bottom: 0; }
.model-actions { margin-top: 12px; flex-wrap: wrap; }
.model-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.model-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 18px; margin-top: 8px; color: var(--ink-2); font-size: 12px; }
.model-error.warn { border-left-color: var(--amber); background: var(--amber-soft); color: var(--amber); }

.model-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 2px solid var(--red);
  border-radius: 0 6px 6px 0;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.persona-card { border-top: 2px solid var(--brand); }
.persona-slot { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; }

.reco-card {
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  background: var(--surface);
}
.reco-card.published { border-left-color: var(--brand); }
.reco-card.approved { border-left-color: var(--blue); }
.reco-card.review_failed { border-left-color: var(--red); }
.reco-card.draft, .reco-card.reviewing { border-left-color: var(--amber); }
.reco-card.settled { border-left-color: var(--brand); }
.reco-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.reco-title { font-size: 15px; font-weight: 500; }
.reco-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
.reco-list { margin: 12px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12px; }

.plan-bet { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.plan-bet:first-child { padding-top: 0; border-top: 0; }
.plan-bet-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.plan-bet-head > span:not(.pill) { color: var(--muted); font-size: 12px; }
.plan-leg { display: grid; gap: 3px; margin-left: 10px; padding: 8px 10px; border-left: 2px solid var(--line); border-radius: 0 6px 6px 0; background: var(--surface-2); }
.plan-leg-match { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--ink); font-size: 12px; }
.plan-leg-match b { font-weight: 500; }
.plan-leg-league { color: var(--muted); font-size: 11px; }
.plan-leg-meta { color: var(--ink-2); font-size: 12px; line-height: 1.55; }

.member-filters { align-items: center; gap: 4px; margin: 12px 0; }
.member-filters #app-users-count { margin-left: auto; font-size: 11px; }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.engine-config-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.engine-field { display: grid; gap: 5px; color: var(--ink-2); }
.engine-field > label { margin: 0; color: var(--ink); font-size: 12px; font-weight: 500; }
.engine-field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.engine-field input { width: 100%; min-width: 0; }
#app-users-search { width: 260px; min-width: 0; }
.severity { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.severity.mid { background: var(--amber-soft); color: var(--amber); }
.severity.high { background: var(--red-soft); color: var(--red); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters > select, .filters > input { width: auto; min-width: 150px; }
.filters > label { width: auto; margin: 0; white-space: nowrap; }
.reco-toolbar { flex-direction: column; align-items: stretch; }
.reco-toolbar .filters { width: 100%; }
.reco-toolbar .actions { width: 100%; justify-content: flex-end; }
.filter {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.filter:hover { background: var(--surface-2); color: var(--ink-2); }
.filter.active { border-color: var(--line); background: var(--surface-2); color: var(--ink); }

.detail-list { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.detail-list b { color: var(--ink); font-weight: 500; }

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
  .grid.cols-3, .grid.cols-4, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid > .kpi:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi-grid > .kpi:nth-child(4) { border-top: 1px solid var(--line); }
  .kpi-grid.cols-3 > .kpi:nth-child(3) { border-left: 1px solid var(--line); border-top: 0; }
}

@media (max-width: 900px) {
  .grid.side { grid-template-columns: 1fr; }
  .engine-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-screen { grid-template-columns: 1fr; }
  .login-story { min-height: auto; padding: 32px 24px; }
  .login-story h1 { font-size: 40px; }
  .login-flow { display: none; }
  .login-foot { display: none; }
  .login-panel { padding: 32px 24px 48px; }
}

@media (max-width: 1200px) {
  .toolbar .actions { flex-wrap: wrap; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; }
  .sidebar-brand { padding-bottom: 16px; }
  .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
  .nav-label { grid-column: 1 / -1; margin-top: 12px; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
  .main { padding: 20px 16px 48px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: 1fr; }
  .kpi + .kpi, .kpi-grid > .kpi:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .kpi-grid.cols-3 > .kpi:nth-child(3) { border-left: 0; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; gap: 8px; }
  .topbar-actions .btn { padding: 0 10px; }
  .date-pill { font-size: 11px; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline-step { border-top: 1px solid var(--line); }
  .pipeline-step:nth-child(odd) { border-left: 0; }
  .pipeline-step:nth-child(-n+2) { border-top: 0; }
  .flow { grid-template-columns: 1fr; border-top: 1px solid var(--line); }
  .flow-step { padding: 12px 0; border-top: 1px solid var(--line); border-left: 0; }
  .flow-step:first-child { border-top: 0; padding-left: 0; }
  .status-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar input, .toolbar select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .engine-config-grid { grid-template-columns: 1fr; }
  .member-filters #app-users-count { width: 100%; margin-left: 0; }
  #app-users-search { width: 100%; }
  .review-layer { grid-template-columns: 1fr; gap: 6px; }
  .event-list { max-height: 360px; overflow-y: auto; padding-right: 4px; }

.event-item { grid-template-columns: 1fr auto; }
  .toolbar .actions { width: 100%; }
  .toolbar .actions input[type="search"],
  .toolbar .actions input[type="date"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 工作台：链路优先，不是 KPI 陈列 */
.wb-hero { border-left: 4px solid var(--brand); }
.wb-headline { margin: 12px 0 4px; font-size: 22px; line-height: 1.35; letter-spacing: -.01em; }
.wb-stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.wb-stage { border-top: 3px solid var(--line); }
.wb-stage.ok { border-top-color: var(--brand); }
.wb-stage.warn { border-top-color: var(--amber); }
.wb-stage.blocked { border-top-color: var(--red); }
.wb-stage.idle { border-top-color: var(--line-strong); }
.wb-stage-headline { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.wb-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-top: 4px; }
.wb-metric { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wb-metric span { color: var(--muted); font-size: 11px; }
.wb-metric b { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.wb-evidence { color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.wb-next { color: var(--ink-2); font-size: 12px; line-height: 1.6; padding: 6px 0; }
.wb-next b { color: var(--muted); font-weight: 500; margin-right: 6px; }
.wb-definition { border-top: 1px dashed var(--line); padding-top: 8px; color: var(--muted); font-size: 12px; }
.wb-definition summary { cursor: pointer; }
.wb-definition > div { margin-top: 6px; line-height: 1.6; }
.wb-blocker { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wb-blocker b { color: var(--red); font-weight: 500; }
.wb-glossary { margin-top: 16px; }
.wb-glossary summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.wb-def { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.wb-def b { color: var(--green); font-weight: 500; }
.wb-ai { margin-top: 16px; border-left: 3px solid var(--brand); }
.wb-ai-headline { font-size: 16px; line-height: 1.5; margin: 4px 0 10px; }
.wb-causes { display: grid; gap: 8px; }
.wb-cause { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.55; }
.wb-cause b { font-weight: 500; }

/* 数据矩阵 */
.sm-matrix table { min-width: 1080px; }
.sm-matrix td.teams b { display: block; font-weight: 500; }
.sm-matrix td.teams span { color: var(--ink-2); font-size: 12px; }
.sm-matrix .triple { display: flex; gap: 8px; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-matrix .row-actions { min-width: 150px; }
.sm-matrix .row-actions .btn { margin: 0 4px 4px 0; }
.sm-matrix .ellipsis { max-width: 180px; }
.sm-matrix .btn.danger { color: var(--red); }

/* P0 稳定性：错误详情堆栈与告警表单 */
.engine-field.full { grid-column: 1 / -1; }
.stack {
  margin: 0;
  padding: 14px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2, #f7f5ef);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
