/* 牌房 · 百家乐运营台 — 浅色仪器面板风格 */
:root {
  --site-bg: #f5f5f3;
  --site-fg: #1b1d22;
  --site-accent: #1b1d22;
  --site-on-accent: #ffffff;
  --site-surface: #ffffff;
  --site-muted: #6c6e74;
  --site-border: #e3e3dd;
  --site-font: "Inter", "SF Pro Text", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --site-radius: 12px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;

  --gap: calc(20px * var(--site-space, 1));
  --pad: calc(18px * var(--site-space, 1));
  --fs: calc(15px * var(--site-type, 1));
  --dur: calc(160ms * var(--site-motion, 1));

  --good: #1d7a4d;
  --good-bg: #e8f3ec;
  --bad: #b4453a;
  --bad-bg: #fbece9;
  --warn: #86660f;
  --warn-bg: #f7f0db;
  --banker: #b4453a;
  --player: #2f6f9f;
  --tie: #3f7a4f;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-fg);
  font-family: var(--site-font);
  font-size: var(--fs);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -40px; z-index: 100;
  background: var(--site-fg); color: var(--site-on-accent);
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
}
.skip:focus { top: 10px; }

/* ---------- 外壳 ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }

/* ---------- 侧栏 ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #fafaf8;
  border-right: 1px solid var(--site-border);
  padding: calc(var(--pad) * 0.8) calc(var(--pad) * 0.7);
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 10px; }
.brand-mark {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  background: var(--site-fg); color: var(--site-on-accent);
  display: grid; place-items: center; font-size: 17px; line-height: 1;
}
.brand-name { font-weight: 650; font-size: calc(15px * var(--site-type, 1)); letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 11.5px; color: var(--site-muted); font-weight: 400; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--site-muted); padding: 12px 10px 5px; font-weight: 550;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px; font-size: 13.5px;
  color: #34363c; transition: background var(--dur), color var(--dur);
}
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; }
.nav-item:hover { background: #efefeb; }
.nav-item[aria-current="page"] { background: #e8e8e3; font-weight: 600; color: var(--site-fg); }
.nav-count {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--site-muted);
  background: #ececea; border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav-count[data-empty="1"] { background: var(--bad); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.side-card {
  background: var(--site-fg); color: #f2f2ef; border-radius: var(--site-radius);
  padding: var(--pad); display: grid; gap: 8px;
}
.side-card strong { font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.side-card p { font-size: 12px; color: #b9bac0; line-height: 1.55; }
.side-link {
  background: #fff; color: var(--site-fg); border: 0; border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; font-weight: 600; margin-top: 2px;
  transition: transform var(--dur);
}
.side-link:active { transform: translateY(1px); }
.side-note { font-size: 11px; color: var(--site-muted); padding: 0 6px; line-height: 1.5; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 10px calc(var(--pad) * 1.1);
  border-bottom: 1px solid var(--site-border);
  background: color-mix(in srgb, var(--site-bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.crumbs { font-size: 13px; color: var(--site-muted); display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.crumbs b { color: var(--site-fg); font-weight: 600; }
.search-wrap { position: relative; margin-left: auto; width: min(300px, 30vw); }
.search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--site-muted); fill: none; stroke-width: 1.7;
}
.search {
  width: 100%; border: 1px solid var(--site-border); background: var(--site-surface);
  border-radius: 9px; padding: 8px 40px 8px 32px; font-size: 13px;
}
.search::placeholder { color: #9a9ca2; }
.search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; color: var(--site-muted); border: 1px solid var(--site-border);
  border-radius: 5px; padding: 1px 5px; background: #fafaf8;
}
.env-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550;
  color: var(--warn); background: var(--warn-bg); border-radius: 99px; padding: 5px 11px; white-space: nowrap;
}
.env-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.env-pill.live { color: var(--good); background: var(--good-bg); }
.env-pill.live i { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--site-border);
  background: var(--site-surface); display: grid; place-items: center; position: relative;
  transition: background var(--dur);
}
.icon-btn:hover { background: #f0f0ec; }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.bell-dot {
  position: absolute; top: 5px; right: 6px; min-width: 15px; height: 15px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; padding: 0 3px; border: 2px solid var(--site-bg);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #dcd8cd; color: #4c463a;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 650; flex: none;
}

/* ---------- 内容 ---------- */
.content { padding: calc(var(--gap) * 1.2) calc(var(--pad) * 1.2) 96px; width: 100%; max-width: 1360px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: calc(var(--gap) * 1.1); }
.page-head h1 { font-size: calc(26px * var(--site-type, 1)); letter-spacing: -0.02em; line-height: 1.2; font-weight: 640; }
.page-head .sub { color: var(--site-muted); font-size: 13.5px; margin-top: 4px; }
.head-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; background: #ececea;
  border-radius: 10px; border: 1px solid var(--site-border);
}
.seg button {
  border: 0; background: transparent; border-radius: 7px; padding: 5px 12px;
  font-size: 12.5px; color: var(--site-muted); font-weight: 550;
}
.seg button[aria-pressed="true"] { background: var(--site-surface); color: var(--site-fg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.07); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border-radius: 9px; border: 1px solid var(--site-border); background: var(--site-surface);
  padding: 8px 13px; font-size: 13px; font-weight: 550; color: var(--site-fg);
  transition: background var(--dur), border-color var(--dur);
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.btn:hover { background: #f2f2ee; }
.btn-primary { background: var(--site-accent); color: var(--site-on-accent); border-color: var(--site-accent); }
.btn-primary:hover { background: #303338; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--site-muted); }
.btn-ghost:hover { background: #ececea; color: var(--site-fg); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--site-muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--site-fg); }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: var(--gap); }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.duo { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.card.health-bad { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); background: var(--bad-bg); }
.card.health-bad .card-head .t { color: var(--bad); }
.bal-none { color: var(--site-muted); font-style: italic; }
.bad { color: var(--bad); }
.card {
  background: var(--site-surface); border: 1px solid var(--site-border);
  border-radius: var(--site-radius); padding: var(--pad); min-width: 0;
}
.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.card-head .t { font-size: calc(14px * var(--site-type, 1)); font-weight: 620; letter-spacing: -0.005em; }
.card-head .d { font-size: 12px; color: var(--site-muted); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card .footnote { font-size: 12px; color: var(--site-muted); border-top: 1px solid var(--site-border); margin-top: 14px; padding-top: 12px; line-height: 1.55; }

.kpi { padding: calc(var(--pad) * 0.9) var(--pad); display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12.5px; color: var(--site-muted); display: flex; align-items: center; gap: 7px; }
.tag-mrr {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; color: #6b5a30;
  border: 1px solid #ded3b4; background: #f8f3e4; border-radius: 4px; padding: 0 4px;
}
.kpi .value { font-size: calc(27px * var(--site-type, 1)); font-weight: 640; letter-spacing: -0.025em; line-height: 1.15; margin-top: 6px; }
.kpi .value small { font-size: 0.55em; color: var(--site-muted); font-weight: 500; margin-left: 2px; }
.kpi .meta { font-size: 12px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.kpi .spark { margin-top: 10px; height: 32px; }
.up { color: var(--good); }
.down { color: var(--bad); }
.flat { color: var(--site-muted); }

/* 图表 */
.chart-wrap { position: relative; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--site-muted); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 10.5px; fill: var(--site-muted); font-family: var(--site-font); }
.chart .gridline { stroke: var(--site-border); stroke-dasharray: 3 4; }
.chart .axis { stroke: var(--site-border); }
.chart .area { fill: color-mix(in srgb, var(--site-accent) 7%, transparent); }
.chart .line-now { fill: none; stroke: var(--site-fg); stroke-width: 2; stroke-linejoin: round; }
.chart .line-prev { fill: none; stroke: #c6c6c1; stroke-width: 1.6; stroke-dasharray: 4 4; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--site-fg); color: #fff;
  font-size: 11.5px; padding: 5px 8px; border-radius: 6px; transform: translate(-50%, -130%);
  white-space: nowrap; display: none; z-index: 2;
}

/* 环形图 */
.donut-row { display: flex; align-items: center; gap: var(--pad); flex-wrap: wrap; }
.donut { flex: none; }
.donut circle { fill: none; stroke-width: 15; }
.legend { display: grid; gap: 9px; flex: 1; min-width: 130px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.legend-row b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 路单 */
.road-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(0, 1fr)); gap: 4px; }
.road-cell {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; border: 1.5px solid transparent;
}
.road-bead { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.road-bead .road-cell { font-size: 9.5px; }
.road-cell.b { color: #fff; background: var(--banker); }
.road-cell.p { color: var(--player); border-color: var(--player); background: #eef4f9; }
.road-cell.t { color: var(--tie); border-color: var(--tie); background: var(--good-bg); }
.road-cell.empty { border-color: #ececE7; }
.road-label { font-size: 11px; color: var(--site-muted); margin: 4px 0 7px; display: flex; justify-content: space-between; }
.big-road { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 4px; }

/* ---------- 列表 ---------- */
.list { display: grid; }
.list-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 2px;
  border-top: 1px solid var(--site-border);
}
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-size: 13.5px; font-weight: 520; }
.list-item .desc { font-size: 12px; color: var(--site-muted); margin-top: 2px; line-height: 1.5; }
.list-item .time { font-size: 11.5px; color: var(--site-muted); white-space: nowrap; margin-left: auto; }
.list-item.done .title { color: var(--site-muted); text-decoration: line-through; }

.empty {
  padding: 26px 10px; text-align: center; color: var(--site-muted); font-size: 13px;
  border: 1px dashed var(--site-border); border-radius: 10px;
}
.page-note { font-size: 12px; color: var(--site-muted); margin-top: 26px; display: flex; gap: 6px; align-items: flex-start; }

/* 勾选框 */
.check { position: relative; flex: none; margin-top: 2px; }
.check input { position: absolute; inset: 0; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.check span {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #c9c9c3;
  display: grid; place-items: center; background: var(--site-surface);
}
.check input:checked + span { background: var(--site-fg); border-color: var(--site-fg); }
.check span svg { width: 11px; height: 11px; stroke: #fff; fill: none; stroke-width: 2.4; opacity: 0; }
.check input:checked + span svg { opacity: 1; }
.check input:focus-visible + span { outline: 2px solid var(--site-accent); outline-offset: 2px; }

/* 徽标 / 状态 */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  border-radius: 99px; padding: 2px 9px; white-space: nowrap;
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-run { color: var(--good); background: var(--good-bg); }
.badge-watch { color: var(--warn); background: var(--warn-bg); }
.badge-maint { color: var(--site-muted); background: #eeeeea; }
.badge-live { color: #fff; background: var(--bad); }
.badge-mock { color: var(--player); background: #eaf1f8; }
.badge-idle { color: var(--site-muted); background: #efefeb; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--site-border);
  border-radius: 99px; padding: 2px 9px; font-size: 11.5px; color: var(--site-muted); white-space: nowrap;
}
.chip.b { color: var(--banker); border-color: #eccfcb; background: #fbf1ef; }
.chip.p { color: var(--player); border-color: #cbdbeb; background: #f0f5fa; }
.chip.t { color: var(--tie); border-color: #cfe3d7; background: var(--good-bg); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot-run { background: var(--good); } .dot-watch { background: #c79a20; } .dot-maint { background: #a9aaa6; }

/* 桌台行 */
.table-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 16px; align-items: center; padding: 14px 2px; border-top: 1px solid var(--site-border);
}
.table-row:first-child { border-top: 0; }
.table-row .id { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; font-weight: 600; }
.table-row .game { font-size: 12px; color: var(--site-muted); margin-top: 3px; }
.table-row .meta { font-size: 12px; color: var(--site-muted); line-height: 1.7; }
.table-row .meta b { color: var(--site-fg); font-weight: 550; }
.table-row .pnl { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 数据表 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .search-wrap { margin-left: 0; width: min(260px, 100%); }
.select {
  border: 1px solid var(--site-border); background: var(--site-surface); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; max-width: 100%;
}
.tbl-wrap { overflow-x: auto; border: 1px solid var(--site-border); border-radius: var(--site-radius); background: var(--site-surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px; }
.data th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--site-muted);
  padding: 9px 12px; border-bottom: 1px solid var(--site-border); white-space: nowrap; background: #fbfbf9;
}
.data td { padding: 9px 12px; border-bottom: 1px solid #f0f0ec; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: #fafaf7; }
.data .zone-b { color: var(--banker); font-weight: 650; }
.data .zone-p { color: var(--player); font-weight: 650; }
.data .zone-t { color: var(--tie); font-weight: 650; }
.tbl-foot {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-top: 1px solid var(--site-border); font-size: 12.5px; color: var(--site-muted);
}
.tbl-foot b { color: var(--site-fg); font-variant-numeric: tabular-nums; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 5px; }
.field > label, .field > .lab { font-size: 12px; font-weight: 600; color: #45474d; }
.field .hint { font-size: 11.5px; color: var(--site-muted); line-height: 1.5; }
.input, .field input[type="text"], .field input[type="number"], .field select {
  border: 1px solid #d6d6d0; background: var(--site-surface); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; width: 100%;
}
.field .suffix { position: relative; }
.field .suffix span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--site-muted); }
.field .suffix input { padding-right: 34px; }
.field-note { font-size: 11.5px; color: var(--warn); min-height: 17px; }
.radios { display: flex; flex-wrap: wrap; gap: 7px; }
.radio-pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--site-border);
  border-radius: 8px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; background: var(--site-surface);
}
.radio-pill:has(input:checked) { border-color: var(--site-fg); background: #f0f0ec; font-weight: 600; }
.radio-pill input { accent-color: var(--site-fg); margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; }
.switch .track {
  width: 34px; height: 19px; border-radius: 99px; background: #d3d3cd; position: relative;
  transition: background var(--dur); flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; transition: transform var(--dur);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { outline: 2px solid var(--site-accent); outline-offset: 2px; }
.odds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.odds-grid label { font-size: 11.5px; color: var(--site-muted); display: grid; gap: 4px; }
.odds-grid input { border: 1px solid #d6d6d0; border-radius: 7px; padding: 6px 8px; width: 100%; font-size: 12.5px; }
.odds-grid.disabled { opacity: 0.45; }

/* ---------- 对话框 ---------- */
dialog {
  border: 1px solid var(--site-border); border-radius: 14px; padding: 0;
  width: min(640px, calc(100vw - 32px)); background: var(--site-surface); color: var(--site-fg);
  box-shadow: 0 18px 50px rgb(20 20 20 / 0.18);
}
dialog::backdrop { background: rgb(24 24 26 / 0.36); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.dlg-head h2 { font-size: 17px; letter-spacing: -0.01em; }
.dlg-head p { font-size: 12px; color: var(--site-muted); margin-top: 3px; font-family: "SFMono-Regular", Consolas, monospace; }
.dlg-body { padding: 16px 20px; display: grid; gap: 14px; max-height: min(62vh, 560px); overflow-y: auto; }
.dlg-foot {
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--site-border); background: #fbfbf9;
  border-radius: 0 0 14px 14px;
}
.section-split { border-top: 1px solid var(--site-border); padding-top: 14px; }
.section-split h3 { font-size: 12.5px; font-weight: 650; margin-bottom: 10px; }

/* ---------- 告警 ---------- */
.alert-item { display: flex; gap: 11px; padding: 13px 2px; border-top: 1px solid var(--site-border); align-items: flex-start; }
.alert-item:first-child { border-top: 0; }
.alert-ico {
  width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center;
}
.alert-ico svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.alert-high { color: var(--bad); background: var(--bad-bg); }
.alert-mid { color: var(--warn); background: var(--warn-bg); }
.alert-low { color: var(--player); background: #eaf1f8; }
.alert-item .grow { flex: 1; min-width: 0; }
.alert-item.read .title { font-weight: 450; color: #4d4f55; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-top: 6px; flex: none; }
.alert-item.read .unread-dot { background: transparent; }

/* ---------- 回测 ---------- */
.report { display: grid; gap: 12px; }
.report-head { display: flex; gap: 10px; align-items: flex-start; }
.report-head .fixture { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px; color: var(--site-muted); word-break: break-all; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-cell { border: 1px solid var(--site-border); border-radius: 9px; padding: 8px 10px; }
.stat-cell .k { font-size: 10.5px; color: var(--site-muted); }
.stat-cell .v { font-size: 15px; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 1px; }
.gate { display: grid; gap: 5px; }
.gate .track { height: 6px; border-radius: 99px; background: #eeeeea; overflow: hidden; }
.gate .fill { height: 100%; background: var(--good); border-radius: 99px; }
.gate .lab { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--site-muted); }

/* ---------- 提示 ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; }
.toast {
  background: var(--site-fg); color: #f4f4f1; border-radius: 10px; padding: 10px 14px;
  font-size: 12.5px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
  animation: toast-in calc(220ms * var(--site-motion, 1)) ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 移动端 ---------- */
.mobile-bar { display: none; }
.side-scrim { display: none; }
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 60;
    transform: translateX(-102%); transition: transform var(--dur); height: 100dvh;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / 0.18); }
  .side-scrim.open { display: block; position: fixed; inset: 0; background: rgb(20 20 20 / 0.3); z-index: 55; }
  .mobile-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    border-bottom: 1px solid var(--site-border); background: var(--site-bg);
  }
  .mobile-bar .brand { padding: 0; }
  .hamburger { margin-left: auto; }
  .topbar { position: static; padding-top: 8px; }
  .crumbs { display: none; }
  .search-wrap { margin-left: 0; flex: 1; width: auto; }
  .env-pill { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .trio, .duo { grid-template-columns: 1fr; }
  .content { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .odds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-row { grid-template-columns: 1fr; gap: 8px; }
  .table-row .pnl { text-align: left; }
  .head-actions { width: 100%; margin-left: 0; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

.btn:disabled{opacity:.45;cursor:not-allowed}
textarea:disabled{opacity:.75;cursor:default}

/* ---------- 采集总开关 ---------- */
.capture-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border: 1px solid var(--site-border); border-radius: 12px; background: var(--site-surface);
  padding: 11px 14px; margin-bottom: calc(var(--gap) * .8);
}
.capture-bar .cap-dot { width: 9px; height: 9px; border-radius: 50%; background: #c9c9c3; flex: none; }
.capture-bar.on .cap-dot { background: var(--good); animation: pulse 2s ease-in-out infinite; }
.capture-bar .cap-txt { font-size: 13px; font-weight: 600; }
.capture-bar .cap-sub { font-size: 12px; color: var(--site-muted); }
.capture-bar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.capture-bar .switch { font-weight: 600; }
