:root {
  --bg: #090d14;
  --surface: #101621;
  --surface-2: #141b28;
  --surface-3: #0d131d;
  --line: #243047;
  --line-soft: #1b2537;
  --text: #f5f7fb;
  --muted: #8792a6;
  --muted-2: #5f6b80;
  --green: #24d362;
  --green-2: #18b94f;
  --green-soft: rgba(36, 211, 98, .12);
  --red: #ff4d67;
  --red-soft: rgba(255, 77, 103, .12);
  --amber: #f6a72a;
  --amber-soft: rgba(246, 167, 42, .12);
  --blue: #55a7ff;
  --radius: 8px;
  /* 安全区上限：Telegram 小程序折叠态/异常状态下注入的 safe-area 值可能高达数百像素，
     导致 app-shell 顶部出现整块黑区、内容被推到屏下。这里把顶部/底部安全区各限制在 64px 内，
     同时保留真机刘海/手势条（约 24-59px）的适配。 */
  --top-safe: max(env(safe-area-inset-top), min(var(--tg-safe-area-inset-top, 0px), 64px));
  --bottom-safe: max(env(safe-area-inset-bottom), min(var(--tg-safe-area-inset-bottom, 0px), 64px));
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --surface-3: #f8fafc;
  --line: #d7dee8;
  --line-soft: #e8edf3;
  --text: #17202d;
  --muted: #667287;
  --muted-2: #8d98a8;
  --green: #14ad50;
  --green-2: #0d963f;
  --green-soft: rgba(20, 173, 80, .11);
  --red: #e83e59;
  --red-soft: rgba(232, 62, 89, .10);
  --amber: #d98b12;
  --amber-soft: rgba(217, 139, 18, .11);
  --blue: #347fd1;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
svg { width: 20px; height: 20px; stroke-width: 2; }
.is-hidden { display: none !important; }

.boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  z-index: 100;
}
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  background: var(--green);
  color: #061009;
  font-weight: 900;
}
.boot-mark { width: 64px; height: 64px; border-radius: 8px; font-size: 24px; }
.boot-copy { display: grid; gap: 5px; text-align: center; }
.boot-copy strong { font-size: 20px; }
.boot-copy span { color: var(--muted); font-size: 13px; }
.boot-retry { min-height: 40px; margin-top: 12px; padding: 0 16px; border: 1px solid var(--green); border-radius: 6px; background: var(--green-soft); color: var(--green); cursor: pointer; font-weight: 700; }
.web-bind { width: min(360px, calc(100vw - 40px)); display: grid; gap: 10px; margin-top: 14px; }
.web-bind-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border-radius: 7px; background: var(--green); color: #07110a; text-decoration: none; font-weight: 800; }
.web-bind-button svg { width: 18px; height: 18px; }
.web-bind small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.web-login-code { display: grid; gap: 8px; margin-top: 4px; }
.web-login-code input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--fg); font-size: 14px; letter-spacing: 1px; }
.web-login-code button { min-height: 42px; border: 1px solid var(--green); border-radius: 6px; background: var(--green-soft); color: var(--green); font-weight: 700; cursor: pointer; }
.share-code-output { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); }
.share-code-output strong { font-size: 12px; color: var(--muted); }
.share-code-output code { display: block; padding: 8px; border-radius: 5px; background: var(--surface-2); color: var(--green); font-size: 13px; word-break: break-all; }
.share-code-output small { color: var(--muted); font-size: 11px; }
.record-expand summary { cursor: pointer; color: var(--muted); border-bottom: 1px dashed var(--line); }
.record-expand summary:hover { color: var(--green); }
.record-expand > div { margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-3); word-break: break-all; white-space: normal; }

.app-shell { min-height: 100vh; padding-top: var(--top-safe); }
.topbar {
  position: sticky;
  top: var(--top-safe);
  z-index: 30;
  height: 62px;
  display: grid;
  grid-template-columns: 38px 38px 38px minmax(60px, auto) minmax(60px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(9, 13, 20, .97);
  backdrop-filter: blur(14px);
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .97); }
html[data-theme="light"] .last-result-bar { background: rgba(248, 250, 252, .97); }
html[data-theme="light"] .drawer { background: #fff; }
html[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, .98); }
html[data-theme="light"] .toast, html[data-theme="light"] .account-login-dialog { background: #fff; }
html[data-theme="light"] .section-note { color: #48647f; }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); border-color: var(--line); }
.countdown-area { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.issue-block, .countdown-block { display: grid; gap: 2px; min-width: 0; }
.issue-block span, .countdown-block span { color: var(--muted); font-size: 11px; }
.issue-block strong, .countdown-block strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown-block strong { color: var(--green); }
.run-button {
  min-width: 104px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #07110a;
  font-weight: 800;
  cursor: pointer;
}
.run-button svg { width: 17px; height: 17px; fill: currentColor; }
.run-button.running { background: var(--red); color: #fff; }
.run-button.busy { opacity: .55; pointer-events: none; }
.run-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.sync-run-button { min-width: 126px; border: 1px solid rgba(29, 208, 113, .42); background: var(--green-soft); color: var(--green); }
.sync-run-button.running { border-color: var(--red); background: var(--red-soft); color: var(--red); }

.dashboard-mode-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) minmax(190px, 1.35fr);
  gap: 8px;
  margin-bottom: 14px;
}
.dashboard-mode-toolbar button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); cursor: pointer; font-weight: 700; }
.dashboard-mode-toolbar button.active { border-color: rgba(29, 208, 113, .5); background: var(--green-soft); color: var(--green); }
.dashboard-mode-toolbar .sync-mode-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--green); }
.dashboard-mode-toolbar .sync-mode-button svg { width: 16px; height: 16px; }

.last-result-bar {
  position: sticky;
  top: calc(62px + var(--top-safe));
  z-index: 25;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(13, 19, 29, .96);
  font-size: 13px;
}
.last-result-bar > span:first-child { color: var(--muted); }
.last-result-bar strong { color: #b8c1d0; }
.last-result-bar #lastFormula { color: var(--text); }
.last-result-bar b { margin-left: auto; color: var(--green); font-weight: 700; }

.main-content { width: min(1180px, 100%); margin: 0 auto; padding: 22px 16px calc(84px + var(--bottom-safe)); }
.view { display: none; }
.view.active { display: block; animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.compact-heading { min-height: 46px; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-heading h1 { margin: 2px 0 0; font-size: 24px; line-height: 1.2; }
.eyebrow { display: block; color: var(--green); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.page-status { align-self: center; color: var(--muted); font-size: 12px; }
.page-status.online { color: var(--green); }

.panel, .status-banner, .metric-card, .strategy-card, .settings-section, .profile-card, .profile-grid article, .trend-metrics article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.status-banner { min-height: 72px; display: flex; align-items: center; gap: 13px; padding: 14px; margin-bottom: 14px; }
.status-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; background: var(--green-soft); color: var(--green); }
.status-banner > div:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.status-banner strong { font-size: 15px; }
.status-banner span:not(.status-dot) { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; margin-left: auto; border-radius: 50%; background: var(--muted-2); }
.status-dot.active { background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.free-mode-notice { margin: 0 0 14px; padding: 11px 14px; border: 1px solid var(--amber); border-radius: var(--radius); background: var(--amber-soft); color: var(--text); font-size: 13px; font-weight: 800; line-height: 1.4; text-align: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.metric-card { min-height: 120px; display: grid; align-content: center; gap: 5px; padding: 17px; }
.metric-card > span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 24px; }
.metric-card small { color: var(--muted-2); font-size: 11px; }
.metric-card .positive { color: var(--green); }
.metric-card .negative { color: var(--red); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { min-height: 150px; display: grid; align-content: start; gap: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-card-title { min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding-bottom: 11px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.stat-card-title svg { width: 18px; height: 18px; color: var(--green); }
.stat-card-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.stat-card-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-size: 10px; }
.stat-row { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: baseline; gap: 8px; padding-top: 10px; }
.stat-row span { color: var(--muted); font-size: 11px; }
.stat-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 16px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.balance-chart-panel { min-height: 250px; }
.chart-current { color: var(--green) !important; font-size: 13px !important; font-weight: 800; }
.balance-chart-wrap { position: relative; width: 100%; height: 210px; padding: 12px 12px 9px; }
#balanceChart { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.chart-empty.is-hidden { display: none; }
/* 余额走势悬停/触摸提示 */
.chart-hover-overlay { position: absolute; pointer-events: none; z-index: 2; }
.chart-tooltip {
  position: fixed; z-index: 999; pointer-events: none;
  min-width: 104px; padding: 8px 12px; border-radius: 10px;
  background: rgba(20, 27, 40, .92);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid; gap: 2px; font-size: 12px;
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.97);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.chart-tooltip.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.chart-tooltip strong { font-size: 11px; color: var(--muted); font-weight: 600; }
.chart-tooltip span { font-size: 15px; font-weight: 800; color: var(--text); }
.chart-tooltip b { font-size: 12px; font-weight: 800; }
.chart-tooltip b.up { color: var(--green); }
.chart-tooltip b.down { color: var(--red); }
html[data-theme="light"] .chart-tooltip { background: rgba(255, 255, 255, .95); box-shadow: 0 10px 28px rgba(15, 23, 42, .16); }

.panel { margin-bottom: 14px; overflow: hidden; }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head > div { display: grid; gap: 4px; }
.panel-head span { color: var(--muted); font-size: 11px; }
.panel-head strong { font-size: 14px; }
.mode-badge, .member-pill { padding: 5px 9px; border-radius: 5px; background: var(--green-soft); color: var(--green) !important; font-weight: 700; }
.text-button { display: inline-flex; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: transparent; color: var(--green); font-size: 12px; cursor: pointer; }
.text-button svg { width: 16px; height: 16px; }
.prediction-content { display: grid; grid-template-columns: 170px 1fr; gap: 18px; padding: 18px 16px; }
.prediction-primary { min-height: 92px; display: grid; align-content: center; gap: 8px; padding: 14px; border-radius: 7px; background: var(--green-soft); }
.prediction-primary span { color: var(--muted); font-size: 12px; }
.prediction-primary strong { color: var(--green); font-size: 24px; }
.prediction-primary small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.prediction-picks { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.prediction-picks span { min-width: 86px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-3); text-align: center; font-weight: 700; }
.strategy-chip-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
.strategy-chip-list > span:not(.empty-inline) { padding: 7px 10px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.empty-inline { color: var(--muted); font-size: 12px; }

.record-list { display: grid; }
.record-item { display: grid; grid-template-columns: 110px minmax(150px, 1fr) 92px 80px 86px; align-items: center; gap: 12px; min-height: 64px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); }
.record-item:last-child { border-bottom: 0; }
.record-item > div { min-width: 0; }
.record-item strong, .record-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-item strong { display: block; font-size: 13px; }
.record-item span, .record-item small { color: var(--muted); font-size: 11px; }
.record-item .record-game-badge { display: inline-flex; width: fit-content; margin-top: 4px; padding: 2px 6px; border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 800; }
.record-item .profit { justify-self: start; max-width: 100%; text-align: left; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.record-item .profit.win { color: var(--green); }
.record-item .profit.loss { color: var(--red); }
.record-status { justify-self: end; padding: 5px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.record-status.win { background: var(--green-soft); color: var(--green); }
.record-status.loss { background: var(--red-soft); color: var(--red); }
.record-status.sending { background: rgba(85,167,255,.12); color: var(--blue); }
.record-status.pending { background: var(--amber-soft); color: var(--amber); }
.record-status.refund { background: rgba(85,167,255,.12); color: var(--blue); }
.record-status.paused { background: rgba(151,163,180,.12); color: #a9b4c3; }
.record-status.uncertain, .record-status.unknown { background: var(--amber-soft); color: var(--amber); }
.record-status.failed, .record-status.error { background: var(--red-soft); color: var(--red); }
.empty-state { min-height: 150px; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.empty-state svg { width: 27px; height: 27px; color: var(--muted-2); }

.section-note { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-left: 3px solid var(--blue); background: rgba(85,167,255,.08); color: #b7c7da; font-size: 12px; line-height: 1.6; }
.section-note svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; color: var(--blue); }
.strategy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.strategy-card { min-height: 200px; padding: 17px; align-self: start; }
.strategy-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.strategy-card-title { display: flex; gap: 11px; min-width: 0; }
.strategy-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); color: var(--green); }
.strategy-card-title div:last-child { min-width: 0; display: grid; gap: 4px; }
.strategy-card-title strong { font-size: 15px; }
.strategy-card-title span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.switch { position: relative; flex: 0 0 auto; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui, .toggle-ui { position: absolute; inset: 0; border-radius: 12px; background: #2b3444; cursor: pointer; transition: .18s; }
.switch-ui::after, .toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .18s; }
.switch input:checked + .switch-ui, .toggle-line input:checked + .toggle-ui { background: var(--green); }
.switch input:checked + .switch-ui::after, .toggle-line input:checked + .toggle-ui::after { transform: translateX(18px); }
.strategy-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-field { display: grid; gap: 6px; }
.mini-field span { color: var(--muted); font-size: 11px; }
.mini-field input, .mini-field select, .field-label input, .field-label textarea, .filter-row input, .filter-row select, .filter-row + select, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--surface-3);
  color: var(--text);
  padding: 9px 11px;
}
.mini-field input:focus, .mini-field select:focus, .field-label input:focus, .field-label textarea:focus, .search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.strategy-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.strategy-details .detail-toggle { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; background: var(--surface-3); }
.strategy-details .switch { transform: scale(.9); transform-origin: right center; }
.detail-heading { grid-column: 1 / -1; color: var(--text); font-size: 12px; }
.abc-rule-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.abc-range-note { grid-column: 1 / -1; padding: 9px 10px; border-left: 3px solid var(--green); border-radius: 4px; background: rgba(34,197,94,.08); color: var(--muted); font-size: 11px; line-height: 1.55; }
.abc-target-preview { grid-column: 1 / -1; display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(34,197,94,.36); border-radius: 6px; background: rgba(34,197,94,.08); }
.abc-target-preview > strong { font-size: 11px; color: var(--muted); }
.abc-target-preview > div { display: flex; flex-wrap: wrap; gap: 6px; }
.abc-target-preview b { min-width: 36px; padding: 5px 8px; border-radius: 4px; background: var(--green); color: #fff; text-align: center; font-size: 12px; }
.abc-target-preview.is-empty { border-color: rgba(244,63,94,.35); background: rgba(244,63,94,.08); }
.abc-target-preview.is-empty span { color: var(--red); font-size: 12px; font-weight: 700; }
.abc-target-preview.is-legacy { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.abc-target-preview.is-legacy span { color: var(--amber); font-size: 12px; font-weight: 700; }
.abc-rule-row { display: grid; grid-template-columns: 54px minmax(92px, 1fr) minmax(70px, .7fr); align-items: center; gap: 7px; }
.abc-rule-row b { color: var(--muted); font-size: 11px; }
.abc-rule-row select, .abc-rule-row input { min-height: 36px; width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; background: var(--surface-3); color: var(--text); }
.choice-block { grid-column: 1 / -1; display: grid; gap: 7px; }
.choice-block > span { color: var(--muted); font-size: 11px; }
.pass-profit-block { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pass-profit-block > div:first-child { display: grid; gap: 3px; }
.pass-profit-block strong { font-size: 13px; }
.pass-profit-block > div:first-child span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.pass-profit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pass-profit-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.pass-profit-grid input { min-width: 0; width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; background: var(--surface-3); color: var(--text); }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.choice-grid label { min-height: 34px; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 11px; cursor: pointer; }
.choice-grid input { accent-color: var(--green); }
.strategy-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; color: var(--muted-2); font-size: 11px; }
.record-retention { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.filter-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px; gap: 10px; margin-bottom: 12px; }
.search-field { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); }
.search-field svg { width: 17px; height: 17px; color: var(--muted); }
.search-field input { min-height: 38px; padding: 0; border: 0; box-shadow: none !important; }
.table-panel { min-height: 240px; }

.primary-compact, .secondary-compact, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.primary-compact { border: 0; background: var(--green); color: #07110a; }
.secondary-compact { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 12px; }
.secondary-compact svg { width: 16px; height: 16px; }
.secondary-compact:disabled { opacity: .55; cursor: wait; }
.secondary-button { border: 1px solid var(--line); background: var(--surface-3); color: var(--text); }
.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-section { display: grid; align-content: start; gap: 14px; padding: 17px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.primary-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 7px; background: var(--green); color: #07110a; cursor: pointer; font-weight: 800; }
.primary-button:disabled { opacity: .55; pointer-events: none; }
.settings-title { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 13px; border-bottom: 1px solid var(--line-soft); }
.settings-title > svg { width: 19px; height: 19px; color: var(--green); }
.settings-title div { display: grid; gap: 3px; }
.settings-title strong { font-size: 14px; }
.settings-title span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); }
.segmented.four { grid-template-columns: repeat(4, 1fr); }
.segmented button { min-height: 38px; padding: 6px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.segmented button.active { background: var(--surface-2); color: var(--green); font-weight: 700; }
.field-label { display: grid; gap: 7px; }
.field-label > span { color: var(--muted); font-size: 11px; }
.field-label textarea { resize: vertical; line-height: 1.55; }
.toggle-line { position: relative; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.toggle-line > div { display: grid; gap: 4px; }
.toggle-line strong { font-size: 13px; }
.toggle-line div span { color: var(--muted); font-size: 11px; }
.toggle-line input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-line .toggle-ui { position: relative; inset: auto; width: 42px; height: 24px; flex: 0 0 auto; }
.refund-mode-help { min-height: 38px; padding: 9px 11px; border-left: 3px solid var(--blue); background: rgba(85,167,255,.08); color: #b7c7da; font-size: 11px; line-height: 1.55; }
.odds-summary { grid-column: 1 / -1; }
.odds-profile-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.odds-item { display: grid; gap: 5px; padding: 12px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line-soft); }
.odds-item strong { font-size: 12px; }
.odds-item span { color: var(--muted); font-size: 11px; }
.odds-item b { color: var(--green); font-size: 11px; }
.odds-item small { color: var(--muted-2); font-size: 10px; line-height: 1.5; }

.trend-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.trend-metrics article { min-height: 112px; display: grid; align-content: center; gap: 7px; padding: 16px; }
.trend-metrics span { color: var(--muted); font-size: 11px; }
.trend-metrics strong { color: var(--green); font-size: 24px; }
.trend-metrics small { color: var(--muted-2); font-size: 11px; }
.trend-metrics .amber { color: var(--amber); }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { position: relative; min-height: 44px; padding: 0 3px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.active { color: var(--green); }
.tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--green); }
.trend-tab { display: none; }
.trend-tab.active { display: block; }
.draw-item { display: grid; grid-template-columns: 110px 1fr 120px 70px 90px; gap: 10px; align-items: center; min-height: 58px; padding: 10px 15px; border-bottom: 1px solid var(--line-soft); }
.draw-item:last-child { border-bottom: 0; }
.draw-item span, .draw-item small { color: var(--muted); font-size: 11px; }
.draw-item strong { font-size: 13px; }
.draw-badge { justify-self: end; padding: 5px 8px; border-radius: 5px; background: var(--green-soft); color: var(--green) !important; }
.draw-badge.small { background: var(--red-soft); color: var(--red) !important; }
.missing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 15px; }
.missing-grid article { display: grid; gap: 6px; padding: 14px; border-radius: 6px; background: var(--surface-3); }
.missing-grid span { color: var(--muted); font-size: 11px; }
.missing-grid strong { font-size: 20px; }
.dragon-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 15px; }
.dragon-summary article { min-height: 110px; display: grid; align-content: center; gap: 7px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-3); }
.dragon-summary span { color: var(--muted); font-size: 11px; }
.dragon-summary strong { color: var(--amber); font-size: 24px; }

.profile-card { min-height: 100px; display: flex; align-items: center; gap: 14px; padding: 17px; margin-bottom: 12px; }
.profile-avatar, .avatar { display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #07110a; font-weight: 900; }
.profile-avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-card > div:nth-child(2) { display: grid; gap: 5px; min-width: 0; }
.profile-card > div:nth-child(2) span { color: var(--muted); font-size: 12px; }
.profile-card .member-pill { margin-left: auto; font-size: 11px; }
.profile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.profile-grid article { min-height: 100px; display: grid; align-content: center; gap: 8px; padding: 16px; }
.profile-grid span { color: var(--muted); font-size: 11px; }
.profile-grid strong { font-size: 14px; overflow-wrap: anywhere; }
.account-manager .panel-head > div { min-width: 0; }
.account-manager .panel-head strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-compact.attention { box-shadow: 0 0 0 3px var(--green-soft); }
.account-list { display: grid; }
.account-item { min-height: 68px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 38px; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.account-item:last-child { border-bottom: 0; }
.account-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); color: var(--green); }
.account-icon svg { width: 18px; height: 18px; }
.account-copy { min-width: 0; display: grid; gap: 4px; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-copy span { color: var(--muted); font-size: 11px; }
.account-active, .account-action { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.account-active { background: var(--green-soft); color: var(--green); }
.account-active svg, .account-action svg { width: 15px; height: 15px; }
.account-action { border: 1px solid var(--line); background: var(--surface-3); cursor: pointer; }
.account-delete { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.account-delete:hover { background: var(--red-soft); color: var(--red); }
.account-delete svg { width: 17px; height: 17px; }
.account-action:disabled, .account-delete:disabled { opacity: .45; pointer-events: none; }
.account-empty { min-height: 132px; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 18px; text-align: center; }
.account-empty svg { color: var(--muted-2); }
.account-empty span { font-size: 13px; }
.account-empty small { color: var(--muted); font-size: 11px; }
.profile-actions { display: grid; }
.profile-actions button { width: 100%; min-height: 68px; display: grid; grid-template-columns: 38px 1fr 20px; align-items: center; gap: 11px; padding: 12px 15px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; }
.profile-actions button:last-child { border-bottom: 0; }
.profile-actions > button > svg:first-child { color: var(--green); }
.profile-actions > button > svg:last-child { width: 17px; height: 17px; color: var(--muted); }
.profile-actions button span { display: grid; gap: 4px; }
.profile-actions button strong { font-size: 13px; }
.profile-actions button small { color: var(--muted); font-size: 11px; }

.referral-heading { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; }
.referral-heading .icon-button { border: 1px solid var(--line); background: var(--surface-3); }
.referral-invite-card, .referral-withdraw-card { margin-bottom: 12px; }
.referral-invite-card > .panel-head > svg, .referral-withdraw-card > .panel-head > svg { color: var(--green); }
.referral-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 0 15px 10px; }
.referral-link-row input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; }
.referral-link-row button, .referral-share, #referralWithdrawSubmit { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 6px; background: var(--green); color: #07110a; font-weight: 800; cursor: pointer; }
.referral-link-row button { min-width: 82px; padding: 0 12px; }
.referral-link-row svg, .referral-share svg, #referralWithdrawSubmit svg { width: 17px; height: 17px; }
.referral-share { width: calc(100% - 30px); margin: 0 15px 15px; background: var(--surface-3); color: var(--text); border: 1px solid var(--line); }
.referral-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.referral-metrics article { min-height: 105px; display: grid; align-content: center; gap: 6px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.referral-metrics span, .referral-metrics small { color: var(--muted); font-size: 11px; }
.referral-metrics strong { overflow-wrap: anywhere; color: var(--green); font-size: 21px; }
#referralWithdrawForm { display: grid; grid-template-columns: minmax(110px, .45fr) minmax(180px, 1fr) auto; align-items: end; gap: 10px; padding: 0 15px 15px; }
#referralWithdrawSubmit { min-width: 145px; padding: 0 15px; }
#referralWithdrawSubmit:disabled { opacity: .5; pointer-events: none; }
.referral-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.referral-record-card { min-width: 0; }
.referral-record-list { display: grid; }
.referral-record-item { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 15px; border-top: 1px solid var(--line-soft); }
.referral-record-item > div { min-width: 0; display: grid; gap: 4px; }
.referral-record-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.referral-record-item span, .referral-record-item small { color: var(--muted); font-size: 10px; }
.referral-record-item b { color: var(--green); font-size: 12px; text-align: right; }
.referral-record-item b.pending { color: var(--amber); }
.referral-record-item b.rejected { color: var(--red); }
.referral-empty { min-height: 92px; display: grid; place-items: center; padding: 18px; color: var(--muted); font-size: 12px; }

.admin-heading { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; }
.admin-heading .icon-button { border: 1px solid var(--line); background: var(--surface-3); }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.admin-metrics article { min-width: 0; min-height: 96px; display: grid; align-content: center; gap: 6px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.admin-metrics span, .admin-metrics small { color: var(--muted); font-size: 10px; }
.admin-metrics strong { overflow-wrap: anywhere; color: var(--green); font-size: 19px; }
.admin-layout, .admin-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-layout { margin-bottom: 12px; }
.admin-control-card { min-width: 0; }
.admin-control-card > .panel-head > svg { color: var(--green); }
.admin-agent-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 15px 15px; }
.admin-agent-scope-grid > div { min-width: 0; display: grid; gap: 5px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface-3); }
.admin-agent-scope-grid span { color: var(--muted); font-size: 10px; }
.admin-agent-scope-grid strong { overflow-wrap: anywhere; color: var(--green); font-size: 13px; }
.admin-agent-withdraw-form { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; align-items: end; gap: 9px; padding: 0 15px 12px; }
.admin-agent-withdraw-form button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 6px; padding: 0 14px; background: var(--green); color: #07110a; cursor: pointer; font-size: 12px; font-weight: 800; }
.admin-agent-withdraw-form button svg { width: 16px; height: 16px; }
.admin-agent-withdrawals { display: grid; gap: 7px; padding: 0 15px 15px; }
.admin-agent-withdrawal-item { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface-3); }
.admin-agent-withdrawal-item > div { min-width: 0; display: grid; gap: 3px; }
.admin-agent-withdrawal-item strong, .admin-agent-withdrawal-item span, .admin-agent-withdrawal-item small { overflow-wrap: anywhere; }
.admin-agent-withdrawal-item strong { font-size: 12px; }
.admin-agent-withdrawal-item span, .admin-agent-withdrawal-item small { color: var(--muted); font-size: 9px; }
.admin-agent-withdrawal-item b { flex: 0 0 auto; color: var(--green); font-size: 10px; }
.admin-agent-withdrawal-item b.pending { color: var(--warning); }
.admin-agent-withdrawal-item b.rejected { color: var(--red); }
.admin-default-groups-form { display: grid; gap: 10px; padding: 0 15px 15px; }
.admin-default-groups-form textarea { resize: vertical; line-height: 1.55; }
.admin-default-groups-form button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 6px; background: var(--green); color: #07110a; cursor: pointer; font-size: 12px; font-weight: 800; }
.admin-default-groups-form button svg { width: 16px; height: 16px; }
.admin-pricing-card { grid-column: 1 / -1; }
.admin-mode-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 15px 10px; }
.admin-mode-actions button, .admin-user-form button, .admin-broadcast-form button, .admin-product-item button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; }
.admin-mode-actions button.active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.admin-mode-actions button.danger-active { border-color: var(--amber); background: rgba(255, 179, 71, .1); color: var(--amber); }
.admin-mode-actions svg, .admin-user-form button svg, .admin-broadcast-form button svg, .admin-product-item button svg { width: 16px; height: 16px; }
.admin-mode-status { margin: 0 15px 15px; padding: 10px 11px; border-left: 3px solid var(--green); background: var(--green-soft); color: var(--muted); font-size: 11px; line-height: 1.5; }
.admin-user-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 0 15px 15px; }
.admin-user-id, .admin-ban-actions { grid-column: 1 / -1; }
.admin-ban-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#adminBanUser { color: var(--red); }
#adminUnbanUser { color: var(--green); }
.admin-product-list { display: grid; }
.admin-product-item { display: grid; grid-template-columns: minmax(150px, 1fr) 100px minmax(110px, .55fr) 76px; align-items: end; gap: 9px; padding: 11px 15px; border-top: 1px solid var(--line-soft); }
.admin-product-copy { min-width: 0; display: grid; gap: 4px; align-self: center; }
.admin-product-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.admin-product-copy span { color: var(--muted); font-size: 10px; }
.admin-product-item label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.admin-product-item input { min-width: 0; }
.admin-product-item button { background: var(--green); color: #07110a; border-color: transparent; }
.admin-broadcast-form { display: grid; gap: 10px; padding: 0 15px 15px; }
.admin-broadcast-form textarea { resize: vertical; line-height: 1.55; }
.admin-broadcast-form button { background: var(--green); color: #07110a; border-color: transparent; }
.admin-record-card { min-width: 0; }
.admin-record-list { display: grid; }
.admin-record-item { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 15px; border-top: 1px solid var(--line-soft); }
.admin-record-item > div { min-width: 0; display: grid; gap: 4px; }
.admin-record-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.admin-record-item span, .admin-record-item small { color: var(--muted); font-size: 10px; }
.admin-record-item b { color: var(--green); font-size: 11px; text-align: right; }
.admin-empty { min-height: 92px; display: grid; place-items: center; padding: 18px; color: var(--muted); font-size: 12px; }

.rank-caption { color: var(--green); font-size: 11px; font-weight: 700; }
.leaderboard-list { display: grid; }
.leaderboard-item { min-height: 54px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 15px; border-top: 1px solid var(--line-soft); }
.leaderboard-item > b { width: 28px; color: var(--muted); text-align: center; font-size: 12px; }
.leaderboard-item:nth-child(-n+3) > b { color: var(--amber); }
.leaderboard-item > div { min-width: 0; display: grid; gap: 3px; }
.leaderboard-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.leaderboard-item small { color: var(--muted); font-size: 10px; }
.leaderboard-item > span { color: var(--green); font-size: 12px; font-weight: 800; }
.leaderboard-empty { min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.backtest-layout { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); align-items: start; gap: 14px; }
.backtest-form { position: sticky; top: calc(122px + var(--top-safe)); }
.backtest-results { min-width: 0; display: grid; gap: 14px; }
.backtest-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.backtest-metrics article { min-width: 0; display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.backtest-metrics span { color: var(--muted); font-size: 10px; }
.backtest-metrics strong { overflow-wrap: anywhere; color: var(--green); font-size: 18px; }

.drawer { position: fixed; z-index: 80; inset: 0 auto 0 0; width: min(320px, 84vw); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0f1520; transform: translateX(-102%); transition: transform .2s ease; padding-top: var(--top-safe); }
.drawer.open { transform: translateX(0); }
.drawer-scrim { position: fixed; z-index: 75; inset: 0; background: rgba(0,0,0,.7); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.brand-row { min-height: 74px; display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 11px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 40px; height: 40px; border-radius: 6px; }
.brand-row > div:nth-child(2) { display: grid; gap: 3px; }
.brand-row strong { color: var(--green); font-size: 17px; }
.brand-row span { color: var(--muted); font-size: 11px; }
.user-strip { min-height: 94px; display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.avatar { width: 46px; height: 46px; }
.user-strip > div:last-child { min-width: 0; display: grid; gap: 5px; }
.user-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-strip span { color: var(--muted); font-size: 11px; }
.drawer-nav { display: grid; gap: 2px; padding: 12px 0; }
.drawer-nav button { position: relative; min-height: 52px; display: flex; align-items: center; gap: 13px; padding: 0 22px; border: 0; background: transparent; color: #aeb7c8; cursor: pointer; text-align: left; }
.drawer-nav button.active { background: var(--green-soft); color: var(--green); }
.drawer-nav button.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--green); }
.drawer-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 18px calc(14px + var(--bottom-safe)); }
.drawer-footer > div { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.drawer-footer > div strong { color: #bec6d4; }
.drawer-footer button { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); cursor: pointer; }

.bottom-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(64px + var(--bottom-safe)); display: none; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--bottom-safe); border-top: 1px solid var(--line); background: rgba(10,14,21,.98); backdrop-filter: blur(16px); }
.bottom-nav button { display: grid; place-content: center; justify-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.bottom-nav button svg { width: 20px; height: 20px; }
.bottom-nav button.active { color: var(--green); }

.toast-stack { position: fixed; z-index: 120; left: 50%; bottom: calc(76px + var(--bottom-safe)); width: min(420px, calc(100vw - 28px)); transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: #161e2b; box-shadow: 0 12px 30px rgba(0,0,0,.35); font-size: 12px; animation: toast-in .18s ease-out; }
.toast.success svg { color: var(--green); }
.toast.error svg { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop { position: fixed; z-index: 150; inset: 0; display: none; align-items: center; justify-content: center; padding: max(18px, var(--top-safe)) 16px max(18px, var(--bottom-safe)); background: rgba(0, 0, 0, .72); }
.modal-backdrop.open { display: flex; }
.account-login-dialog { width: min(430px, 100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .48); }
.membership-dialog { width: min(470px, 100%); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .48); }
.modal-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.modal-head > div { display: grid; gap: 4px; }
.modal-head span { color: var(--muted); font-size: 11px; }
.modal-head strong { font-size: 15px; }
.account-login-dialog form { display: grid; gap: 14px; padding: 18px 16px; }
.login-status { min-height: 38px; padding: 9px 11px; border-left: 3px solid var(--blue); background: rgba(85, 167, 255, .08); color: #b7c7da; font-size: 11px; line-height: 1.55; }
.login-submit { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 6px; background: var(--green); color: #07110a; cursor: pointer; font-weight: 800; }
.login-submit svg { width: 18px; height: 18px; }
.login-submit.busy, .login-submit:disabled { opacity: .55; pointer-events: none; }
.membership-body { display: grid; gap: 15px; padding: 16px; }
.membership-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.membership-product { min-height: 72px; display: grid; align-content: center; gap: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-3); color: var(--text); cursor: pointer; text-align: left; }
.membership-product strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.membership-product span { color: var(--muted); font-size: 11px; }
.membership-product b { color: var(--green); font-size: 14px; }
.membership-product.active { border-color: var(--green); background: var(--green-soft); }
.membership-section { display: grid; gap: 8px; }
.membership-section > span { color: var(--muted); font-size: 11px; }
.payment-providers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment-currencies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment-provider { min-height: 39px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; }
.payment-provider.active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.payment-currency { min-height: 39px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; }
.payment-currency.active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.membership-create, .membership-pay, .membership-check { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; cursor: pointer; font-weight: 800; }
.membership-create, .membership-pay { border: 0; background: var(--green); color: #07110a; }
.membership-check { border: 1px solid var(--line); background: var(--surface-3); color: var(--text); }
.membership-create:disabled, .membership-check:disabled { opacity: .5; pointer-events: none; }
.membership-create svg, .membership-pay svg, .membership-check svg { width: 18px; height: 18px; }
.membership-order { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.membership-order > div { min-width: 0; display: grid; gap: 5px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface-3); }
.membership-order > div span, .membership-order > small { color: var(--muted); font-size: 10px; }
.membership-order > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.membership-order .membership-pay, .membership-order .membership-check, .membership-order > small { grid-column: 1 / -1; }
.membership-order > small { line-height: 1.5; text-align: center; }

@media (min-width: 960px) {
  .app-shell { padding-left: 260px; }
  .drawer { width: 260px; transform: translateX(0); }
  .drawer-close, .drawer-scrim, #drawerOpen { display: none; }
  .topbar { left: 260px; grid-template-columns: 38px 38px minmax(120px, auto) minmax(120px, 1fr) auto; }
  .main-content { padding-left: 24px; padding-right: 24px; padding-bottom: 30px; }
}

@media (max-width: 720px) {
  .topbar { height: auto; grid-template-columns: 34px 34px 34px minmax(0, auto) minmax(0, 1fr); gap: 5px 6px; padding: 6px 8px; }
  .topbar .icon-button { width: 34px; height: 36px; }
  .run-controls { grid-column: 1 / -1; justify-content: stretch; gap: 6px; }
  .run-button { flex: 1; min-width: 0; padding: 0 8px; }
  .sync-run-button { flex: 1; min-width: 0; }
  .sync-run-button span { display: inline; font-size: 12px; }
  .run-button span { font-size: 12px; }
  .dashboard-mode-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .dashboard-mode-toolbar button { padding: 0 5px; font-size: 11px; white-space: nowrap; }
  .dashboard-mode-toolbar .sync-mode-button { grid-column: 1 / -1; }
  .main-content { padding: 18px 12px calc(82px + var(--bottom-safe)); }
  .bottom-nav { display: grid; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 108px; }
  .strategy-grid, .settings-layout { grid-template-columns: 1fr; }
  .backtest-layout { grid-template-columns: 1fr; }
  .backtest-form { position: static; }
  .backtest-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .odds-summary { grid-column: auto; }
  .prediction-content { grid-template-columns: 1fr; }
  .record-item { grid-template-columns: 72px minmax(96px, 1fr) 62px 96px; gap: 6px; padding: 11px 10px; }
  .record-item .record-account { display: none; }
  .record-item .profit { justify-self: start; font-size: 12px; text-align: left; }
  .record-item .record-status { grid-column: 2; justify-self: start; }
  .trend-metrics, .profile-grid, .referral-metrics, .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-agent-withdraw-form { grid-template-columns: 1fr; }
  #referralWithdrawForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #referralWithdrawSubmit { grid-column: 1 / -1; }
  .referral-record-grid { grid-template-columns: 1fr; }
  .admin-layout, .admin-record-grid { grid-template-columns: 1fr; }
  .admin-pricing-card { grid-column: auto; }
  .admin-product-item { grid-template-columns: minmax(120px, 1fr) 82px minmax(96px, .7fr) 68px; gap: 7px; padding: 10px; }
  .draw-item { grid-template-columns: 78px 1fr 55px 70px; gap: 7px; padding: 10px 11px; }
  .draw-item .draw-time { display: none; }
  .missing-grid { grid-template-columns: repeat(2, 1fr); }
  .dragon-summary { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .countdown-block span { display: none; }
  .issue-block strong, .countdown-block strong { font-size: 13px; }
  .run-button { min-width: 76px; }
  .last-result-bar { gap: 6px; font-size: 11px; }
  .strategy-details { grid-template-columns: 1fr; }
  .abc-rule-row { grid-template-columns: 46px minmax(86px, 1fr) minmax(64px, .7fr); }
  .pass-profit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading h1 { font-size: 21px; }
  .secondary-compact { min-height: 38px; padding: 0 10px; }
  .stat-card { min-height: 142px; padding: 13px 12px; }
  .stat-card-title { grid-template-columns: 20px minmax(0, 1fr); }
  .stat-card-title small { display: none; }
  .stat-row { grid-template-columns: 42px minmax(0, 1fr); }
  .stat-row strong { font-size: 14px; }
  .balance-chart-wrap { height: 190px; }
  .filter-row { grid-template-columns: 1fr 120px; }
  .membership-products { grid-template-columns: 1fr; }
  .odds-profile-list { grid-template-columns: 1fr; }
  .account-item { grid-template-columns: 34px minmax(0, 1fr) auto 34px; gap: 7px; padding-left: 11px; padding-right: 11px; }
  .account-active, .account-action { padding: 0 7px; }
  .referral-heading .page-status { display: none; }
  .referral-link-row { grid-template-columns: minmax(0, 1fr) 74px; }
  .referral-link-row button { min-width: 0; padding: 0 9px; }
  #referralWithdrawForm { grid-template-columns: 1fr; }
  #referralWithdrawSubmit { grid-column: auto; }
  .admin-heading .page-status { display: none; }
  .admin-mode-actions { grid-template-columns: 1fr; }
  .admin-user-form { grid-template-columns: 1fr; }
  .admin-user-id, .admin-ban-actions { grid-column: auto; }
  .admin-product-item { grid-template-columns: minmax(0, 1fr) 74px; }
  .admin-product-item .admin-cost-field { display: none; }
  .field-pair { grid-template-columns: 1fr; }
}

/* 手机/电脑视图切换 */
html[data-view-mode="mobile"] .app-shell {
  max-width: 460px;
  margin: 0 auto;
  padding-left: 0;
  box-shadow: 0 0 0 1px var(--line);
}
html[data-view-mode="mobile"] .topbar {
  position: relative;
  left: 0;
  height: auto;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) auto;
  grid-template-areas: "menu brand brand actions" "issue issue countdown countdown" "run run run run";
  gap: 8px;
  padding: 8px 12px 12px;
}
html[data-view-mode="mobile"] .top-expand { grid-area: menu; width: 44px; min-width: 44px; padding: 0; justify-content: center; }
html[data-view-mode="mobile"] .top-expand span { display: none; }
html[data-view-mode="mobile"] .topbar-brand { grid-area: brand; position: static; transform: none; justify-self: start; }
html[data-view-mode="mobile"] .topbar .issue-block { grid-area: issue; min-width: 0; }
html[data-view-mode="mobile"] .topbar .countdown-area { grid-area: countdown; min-width: 0; justify-self: end; }
html[data-view-mode="mobile"] .topbar .topbar-actions { grid-area: actions; }
html[data-view-mode="mobile"] .run-controls {
  grid-area: run;
  justify-content: stretch;
  gap: 8px;
}
html[data-view-mode="mobile"] .dashboard-mode-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html[data-view-mode="mobile"] .dashboard-mode-toolbar .sync-mode-button { grid-column: 1 / -1; }
html[data-view-mode="mobile"] .run-button,
html[data-view-mode="mobile"] .sync-run-button {
  flex: 1;
  min-width: 0;
}
html[data-view-mode="mobile"] .sync-run-button span {
  display: inline;
  font-size: 12px;
}
html[data-view-mode="mobile"] .run-button span {
  font-size: 12px;
}
html[data-view-mode="mobile"] .drawer {
  width: min(320px, 84vw);
  transform: translateX(-102%);
}
html[data-view-mode="mobile"] .drawer.open {
  transform: translateX(0);
}
html[data-view-mode="mobile"] #drawerOpen,
html[data-view-mode="mobile"] .drawer-close {
  display: inline-grid;
}
html[data-view-mode="mobile"] .drawer-scrim {
  display: block;
}
html[data-view-mode="mobile"] .bottom-nav {
  display: grid;
  left: 50%;
  right: auto;
  width: min(460px, 100%);
  transform: translateX(-50%);
}
html[data-view-mode="mobile"] .main-content {
  padding: 18px 12px calc(82px + var(--bottom-safe));
}
html[data-view-mode="mobile"] .strategy-grid,
html[data-view-mode="mobile"] .settings-layout,
html[data-view-mode="mobile"] .backtest-layout {
  grid-template-columns: 1fr;
}
html[data-view-mode="mobile"] .ball-task-dialog {
  width: min(100%, 460px);
  height: 100%;
  max-height: none;
  border-radius: 0;
}
html[data-view-mode="mobile"] .ball-task-body { padding: 12px; }
html[data-view-mode="mobile"] .ball-task-fields { grid-template-columns: 1fr; }
html[data-view-mode="mobile"] .ball-task-field.full { grid-column: auto; }
html[data-view-mode="mobile"] .ball-task-number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
html[data-view-mode="mobile"] .ball-task-number { justify-self: center; width: 42px; min-width: 42px; }
html[data-view-mode="mobile"] .ball-task-actions {
  position: sticky;
  bottom: 0;
  padding: 10px 12px calc(10px + var(--bottom-safe));
}

/* ========== v57 统一策略卡片节奏 ========== */
.strategy-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}
.strategy-card-head { align-items: center; margin-bottom: 13px; }
.strategy-card-title { align-items: center; gap: 10px; }
.strategy-icon { width: 36px; height: 36px; border-radius: 10px; }
.strategy-card-title strong { font-size: 14px; line-height: 1.25; }
.strategy-card-title span { font-size: 11px; line-height: 1.5; }
.strategy-fields { gap: 10px; }
.mini-field {
  gap: 6px;
  padding: 9px 10px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-3);
}
.mini-field span { font-weight: 700; }
.mini-field input, .mini-field select { min-height: 40px; border-radius: 8px; background: var(--surface-2); }
.strategy-details { gap: 8px; margin-top: 12px; padding-top: 12px; }
.strategy-details .detail-toggle { min-height: 40px; border-radius: 10px; background: var(--surface-2); }
.strategy-card .strategy-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft);
  font-size: 10px;
}
html[data-view-mode="mobile"] .strategy-grid { gap: 10px; }
html[data-view-mode="mobile"] .strategy-group { margin-bottom: 16px; }
html[data-view-mode="mobile"] .strategy-card { padding: 14px; }
html[data-view-mode="mobile"] .strategy-card-head { margin-bottom: 11px; }
html[data-view-mode="mobile"] .strategy-fields { gap: 8px; }
html[data-view-mode="mobile"] .strategy-details { grid-template-columns: 1fr; gap: 8px; }

/* ========== v58 所有策略统一为摘要卡片 ========== */
.strategy-card {
  min-height: 0;
  border-radius: 12px;
  background: var(--surface-2);
}
.strategy-card-config {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 2px; padding: 9px 12px;
  border: 1px solid var(--green); border-radius: 10px;
  background: var(--green-soft); color: var(--green);
  font-size: 14px; font-weight: 800; cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.strategy-card-config:hover { transform: translateY(-1px); }
.strategy-card-config:active { transform: translateY(0); }
.strategy-card-config svg { width: 17px; height: 17px; }
.strategy-card-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px; padding: 10px 11px;
  border-radius: 8px; background: var(--surface-3);
  color: var(--muted); font-size: 11px; line-height: 1.55;
}
.strategy-card-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--green); }
.strategy-card-editor { display: none; margin-top: 10px; }
.strategy-card.is-config-open .strategy-card-editor { display: block; }
.strategy-card.is-config-open .strategy-card-config { background: var(--green); color: #fff; }
.strategy-card-editor .strategy-details { margin-top: 0; }
.strategy-card-editor .strategy-fields { margin-bottom: 0; }
.strategy-card .strategy-meta { margin-top: 12px; }
html[data-view-mode="mobile"] .strategy-card-config { min-height: 42px; font-size: 13px; }
html[data-view-mode="mobile"] .strategy-card-note { margin-top: 9px; padding: 9px 10px; }

/* 移动端溢出修复：文字超宽时换行，避免超出可视范围 */
.main-content { min-width: 0; }
.stat-row strong,
.metric-card strong,
.record-item strong,
.draw-item strong,
.page-heading h1,
.page-heading p,
.settings-title strong,
.settings-title span,
.detail-toggle strong,
.toggle-line strong,
.odds-summary,
.prediction-primary,
.referral-link-row,
.admin-heading h1 {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 可折叠分区：用户可以手动收起/展开，选择会记住 */
.settings-title,
.panel-head.collapsible-head {
  cursor: pointer;
  user-select: none;
}
.settings-title > .collapse-chevron,
.panel-head > .collapse-chevron {
  margin-left: auto;
  flex: 0 0 auto;
  align-self: center;
  transition: transform .18s ease;
  color: var(--muted);
}
.settings-section.collapsed > *:not(.settings-title),
.panel.collapsed > *:not(.panel-head) {
  display: none;
}
.settings-section.collapsed .collapse-chevron,
.panel.collapsed .collapse-chevron {
  transform: rotate(-90deg);
}

/* 清空统计选择弹窗 */
.clear-stats-dialog {
  width: min(440px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .48);
}
.clear-stats-body { display: grid; gap: 10px; padding: 16px; }
.clear-stats-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
}
.clear-stats-tip svg { color: var(--amber); flex: 0 0 auto; }
.clear-stat-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}
.clear-stat-option input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  flex: 0 0 auto;
}
.clear-option-text { display: grid; gap: 3px; min-width: 0; }
.clear-option-text strong { font-size: 14px; }
.clear-option-text small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.clear-stats-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.danger-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.danger-button:disabled { opacity: .6; cursor: not-allowed; }

/* 自定义策略编辑器 */
.cs-editor { grid-template-columns: 1fr; }
.cs-rounds { display: grid; gap: 6px; }
.cs-round { display: grid; grid-template-columns: 48px 1fr 96px; gap: 6px; align-items: center; }
.cs-round-no { color: var(--muted); font-size: 11px; }
.cs-pick, .cs-amt {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
}
.cs-pick:focus, .cs-amt:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); outline: none; }

/* 自定义下注内容 */
.cb-rows { display: grid; gap: 6px; }
.cb-row { display: grid; grid-template-columns: 42px 1fr 96px; gap: 8px; align-items: center; }
/* v34 修复：.cb-toggle 必须像 .switch 一样是 relative 定位容器。
   否则里面的 .switch-ui（position:absolute; inset:0）会以视口为包含块，
   渲染成 9 个全屏深灰色矩形盖住整个主内容区（策略页黑屏的根因）。 */
.cb-toggle { position: relative; display: flex; align-items: center; width: 42px; height: 24px; }
.cb-toggle input { position: absolute; opacity: 0; pointer-events: none; width: 42px; height: 24px; }
.cb-toggle input:checked + .switch-ui { background: var(--green); }
.cb-toggle input:checked + .switch-ui::after { transform: translateX(18px); }
.cb-name { font-size: 12px; color: var(--text); }
.cb-amt {
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
}
.cb-amt:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); outline: none; }

/* ========== v36 布局与视觉整理 ========== */
/* 页面标题层级统一 */
.page-heading { align-items: center; gap: 16px; }
.page-heading h1 { font-size: 22px; }
.eyebrow { letter-spacing: .6px; }

/* 仪表盘分区标题 */
.block-title {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 10px;
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .4px;
}
.block-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line-soft); }
.block-title svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 auto; }

/* 策略页分组标题 */
.strategy-group { margin-bottom: 20px; }
.strategy-group-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .4px;
}
.strategy-group-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line-soft); }
.strategy-group-title svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 auto; }

/* 卡片统一圆角与内边距节奏 */
.panel, .stat-card, .strategy-card, .settings-section { border-radius: 10px; }
.strategy-card { padding: 17px 17px 15px; }
.settings-section { gap: 13px; }

/* 说明文案统一 */
.section-note { border-radius: 8px; }
.settings-title span, .section-note { line-height: 1.65; }
.strategy-card-title span { line-height: 1.45; }

/* 状态栏与统计区间距 */
.status-banner, .stat-grid { margin-bottom: 16px; }

/* 移动端分组标题紧凑 */
@media (max-width: 720px) {
  .block-title, .strategy-group-title { font-size: 11px; margin-bottom: 8px; }
}

/* ========== v40 基金定制配置（追号）========== */
.chase-fund-dialog {
  width: min(560px, 100%);
  max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.chase-fund-body { display: grid; gap: 16px; padding: 16px; }
.chase-fund-current { padding: 10px 12px; border-radius: 8px; background: var(--surface-3); color: var(--muted); font-size: 13px; }
.chase-fund-current strong { color: var(--text); }
.chase-fund-section { display: grid; gap: 9px; }
.chase-fund-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.chase-fund-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chase-fund-option { position: relative; display: grid; place-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 700; }
.chase-fund-option input { position: absolute; opacity: 0; pointer-events: none; }
.chase-fund-option.checked { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.chase-fund-threshold { display: flex; align-items: center; gap: 10px; }
.chase-fund-threshold input { width: 110px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 800; }
.chase-fund-threshold span { color: var(--muted); font-size: 12px; }
.chase-ladder { display: grid; gap: 8px; }
.chase-ladder-row { display: grid; grid-template-columns: 22px 52px 16px 52px auto 96px 34px; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-2); }
.chase-ladder-row span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.chase-ladder-row input { min-width: 0; height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; text-align: center; }
.chase-ladder-row .cf-del { height: 30px; border: 0; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 800; cursor: pointer; }
.chase-ladder-add { justify-self: start; }
.chase-fund-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
@media (max-width: 720px) {
  .chase-fund-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chase-ladder-row { grid-template-columns: 20px 46px 14px 46px auto 84px 30px; gap: 4px; }
}

/* ========== v39 追号-当前遗漏 ========== */
.chase-missing {
  margin-top: 12px; padding: 11px 12px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--surface-3);
}
.chase-missing-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.chase-missing-head span { font-size: 12px; font-weight: 800; }
.chase-missing-head small { color: var(--muted); font-size: 10px; }
.chase-missing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cm-item {
  min-width: 0; display: grid; gap: 1px; padding: 7px 6px;
  border: 1px solid var(--line-soft); border-radius: 6px;
  background: var(--surface); text-align: center;
}
.cm-item span { color: var(--muted); font-size: 11px; }
.cm-item b { font-size: 16px; }
.cm-item small { color: var(--muted-2); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-item.hit { border-color: var(--green); background: var(--green-soft); }
.cm-item.hit b { color: var(--green); }
.cm-item.hit small { color: var(--green); }
@media (max-width: 420px) {
  .chase-missing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ========== v56 球类策略配置 ========== */
.ball-task-launch {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid var(--green); border-radius: 8px;
  background: var(--green-soft); color: var(--green); font-weight: 800; cursor: pointer;
}
.ball-task-launch svg { width: 17px; height: 17px; }
.ball-task-card-note {
  display: flex; gap: 7px; align-items: flex-start; margin-top: 10px; padding: 9px 10px;
  border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 11px; line-height: 1.55;
}
.ball-task-card-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--green); }

.ball-task-backdrop { padding: max(10px, var(--top-safe)) 8px max(10px, var(--bottom-safe)); }
.ball-task-dialog {
  width: min(640px, 100%); max-height: calc(100vh - 20px); display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.ball-task-modal-head { background: var(--surface); }
.ball-task-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; }
.ball-task-tip { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.ball-task-list { display: grid; gap: 12px; }
.ball-task-item {
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
  border-radius: 10px; background: color-mix(in srgb, var(--green) 7%, var(--surface));
}
.ball-task-item-head {
  min-height: 58px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
}
.ball-task-collapse {
  width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px;
  background: var(--green-soft); color: var(--green); cursor: pointer;
}
.ball-task-collapse svg { width: 16px; height: 16px; transition: transform .18s ease; }
.ball-task-item.collapsed .ball-task-collapse svg { transform: rotate(-90deg); }
.ball-task-item-title { min-width: 0; display: grid; gap: 3px; }
.ball-task-item-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ball-task-item-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.ball-task-fold { color: var(--muted); font-size: 11px; }
.ball-task-delete { border: 0; background: transparent; color: var(--red); font-size: 12px; cursor: pointer; padding: 5px; }
.ball-task-item.collapsed .ball-task-fields { display: none; }
.ball-task-fields { display: grid; gap: 15px; padding: 14px 12px 16px; }
.ball-task-field { display: grid; gap: 7px; }
.ball-task-field > span, .ball-task-field-title { color: var(--text); font-size: 12px; font-weight: 800; }
.ball-task-field input[type="text"],
.ball-task-field input[type="number"] {
  width: 100%; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px;
}
.ball-task-field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.ball-task-segmented { display: flex; flex-wrap: wrap; align-items: center; }
.ball-task-segmented button {
  min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-right: 0;
  background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer;
}
.ball-task-segmented button:first-child { border-radius: 7px 0 0 7px; }
.ball-task-segmented button:last-child { border-right: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.ball-task-segmented button.active { border-color: var(--green); background: var(--green); color: #fff; }
.ball-task-segmented button.active + button { border-left-color: var(--green); }
.ball-task-mode-panel { display: grid; gap: 10px; }
.ball-task-number-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ball-task-number {
  aspect-ratio: 1; min-width: 36px; display: grid; place-items: center; border: 1px solid transparent;
  border-radius: 50%; background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted); font-size: 14px; font-weight: 800; cursor: pointer;
}
.ball-task-number.active { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 5px 15px color-mix(in srgb, var(--green) 28%, transparent); }
.ball-task-inline { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); align-items: center; gap: 10px; }
.ball-task-inline > span { color: var(--muted); font-size: 12px; }
.ball-task-inline input { height: 40px; }
.ball-task-hot-preview {
  display: grid; gap: 8px; padding: 11px; border: 1px solid color-mix(in srgb, var(--green) 45%, var(--line));
  border-radius: 9px; background: color-mix(in srgb, var(--green) 5%, var(--surface));
}
.ball-task-hot-preview > span { color: var(--muted); font-size: 11px; }
.ball-task-hot-numbers { display: flex; flex-wrap: wrap; gap: 7px; }
.ball-task-hot-numbers b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; }
.ball-task-hot-preview small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.ball-task-independent-note {
  padding: 9px 10px; border-left: 3px solid var(--green); border-radius: 6px;
  background: var(--green-soft); color: var(--text); font-size: 11px; line-height: 1.6;
}
.ball-task-martingale {
  display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line-soft);
  border-radius: 9px; background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}
.ball-task-martingale textarea {
  width: 100%; min-height: 58px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px;
}
.ball-task-add {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 12px; border: 1px dashed var(--line); border-radius: 9px; background: transparent;
  color: var(--text); font-weight: 800; cursor: pointer;
}
.ball-task-add small { color: var(--muted); font-weight: 500; }
.ball-task-add svg { width: 17px; height: 17px; }
.ball-task-actions {
  display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--line-soft); background: var(--surface);
}
.ball-task-actions button { min-width: 90px; }

@media (max-width: 520px) {
  .ball-task-backdrop { padding: 0; align-items: stretch; }
  .ball-task-dialog { width: 100%; max-height: 100vh; border-radius: 0; border-left: 0; border-right: 0; }
  .ball-task-body { padding: 12px 10px; }
  .ball-task-item-head { grid-template-columns: 28px minmax(0, 1fr) auto auto; padding: 9px 10px; }
  .ball-task-fold { display: none; }
  .ball-task-fields { padding: 12px 10px 14px; }
  .ball-task-number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ball-task-number { justify-self: center; width: 42px; min-width: 42px; }
  .ball-task-inline { grid-template-columns: 92px minmax(0, 1fr); }
  .ball-task-actions { padding-bottom: max(12px, var(--bottom-safe)); }
}

/* ========== v59 清爽统一视觉：参考视频的轻量工作台 ========== */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #fbfcfe;
  --line: #d9e1ea;
  --line-soft: #e9eef4;
  --text: #17233a;
  --muted: #718096;
  --muted-2: #9aa7b7;
  --green: #16b35c;
  --green-2: #0d984a;
  --green-soft: #e4f6ec;
  --red: #e64b62;
  --red-soft: #fdecef;
  --amber: #d98a12;
  --amber-soft: #fff5df;
  --blue: #367fd1;
  --radius: 12px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #090d14;
  --surface: #101621;
  --surface-2: #141b28;
  --surface-3: #0d131d;
  --line: #243047;
  --line-soft: #1b2537;
  --text: #f5f7fb;
  --muted: #8792a6;
  --muted-2: #5f6b80;
  --green: #24d362;
  --green-2: #18b94f;
  --green-soft: rgba(36, 211, 98, .12);
  --red: #ff4d67;
  --red-soft: rgba(255, 77, 103, .12);
  --amber: #f6a72a;
  --amber-soft: rgba(246, 167, 42, .12);
  --blue: #55a7ff;
  color-scheme: dark;
}
body { background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, var(--surface) 12%) 100%); }
.app-shell { background: transparent; }
.topbar {
  height: 58px;
  border-bottom-color: var(--line-soft);
  box-shadow: 0 2px 16px rgba(30, 55, 80, .06);
}
.last-result-bar { box-shadow: 0 2px 12px rgba(30, 55, 80, .04); }
.main-content { width: min(1160px, 100%); padding-top: 24px; }
.page-heading { margin-bottom: 16px; }
.page-heading h1 { font-size: 23px; letter-spacing: -.2px; }
.eyebrow { letter-spacing: .6px; }
.panel, .status-banner, .stat-card, .strategy-card, .settings-section,
.profile-card, .profile-grid article, .trend-metrics article {
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(35, 59, 84, .055);
}
.panel-head { min-height: 54px; padding: 12px 16px; }
.status-banner { min-height: 68px; padding: 13px 15px; }
.status-icon, .strategy-icon { border-radius: 11px; }
.stat-card { min-height: 142px; padding: 14px 15px; }
.stat-card-title { padding-bottom: 10px; }
.stat-row { padding-top: 9px; }
.dashboard-mode-toolbar button,
.segmented button,
.filter-row input, .filter-row select,
.secondary-button, .primary-button, .primary-compact, .secondary-compact {
  border-radius: 10px;
}
.dashboard-mode-toolbar button { min-height: 42px; background: var(--surface); }
.run-button { border-radius: 10px; box-shadow: 0 4px 10px rgba(22, 179, 92, .16); }
.settings-layout { gap: 14px; }
.settings-section { gap: 13px; padding: 17px 18px; }
.settings-title { padding-bottom: 12px; }
.settings-title > svg { width: 20px; height: 20px; }
.field-label input, .field-label textarea, .mini-field input, .mini-field select,
.filter-row input, .filter-row select, select {
  min-height: 42px;
  border-radius: 10px;
  background: var(--surface);
}
.toggle-line { min-height: 52px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.toggle-line:last-child { border-bottom: 0; }
.strategy-grid { gap: 14px; }
.strategy-group { margin-bottom: 24px; }
.strategy-group-title { margin-bottom: 11px; color: var(--muted); }
.strategy-card { padding: 16px; }
.strategy-card-head { margin-bottom: 13px; }
.strategy-card-title { gap: 10px; }
.strategy-card-title strong { font-size: 14px; }
.strategy-card-title span { line-height: 1.5; }
.strategy-card-config { min-height: 46px; border-radius: 11px; }
.strategy-card-note { border: 1px solid var(--line-soft); background: var(--surface-3); }
.strategy-meta { color: var(--muted); }
.strategy-meta span { padding: 3px 7px; border-radius: 999px; background: var(--surface-2); }
.strategy-meta span:first-child { color: var(--green); background: var(--green-soft); }
.strategy-card-editor { padding-top: 2px; }
.strategy-card-editor .strategy-fields,
.strategy-card-editor .strategy-details { padding: 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--surface-2); }
.strategy-card-editor .strategy-details { padding-top: 12px; }
.strategy-card-editor .strategy-fields + .strategy-details { margin-top: 9px; }
.mini-field { gap: 6px; }
.mini-field span, .field-label > span { font-weight: 700; }
.ball-task-launch { min-height: 46px; border-radius: 11px; }
.ball-task-card-note { border: 1px solid var(--line-soft); border-radius: 8px; }
.section-note { border: 1px solid #d8e9f6; border-left: 3px solid var(--blue); border-radius: 10px; background: #f4f9fd; color: #58718c; }
.drawer { box-shadow: 4px 0 26px rgba(30, 55, 80, .08); }
.drawer-nav button { min-height: 48px; border-radius: 0 10px 10px 0; margin-right: 10px; }
.drawer-nav button.active::before { width: 4px; border-radius: 0 4px 4px 0; }
.bottom-nav { box-shadow: 0 -4px 18px rgba(30, 55, 80, .08); }
.toast { border-radius: 11px; box-shadow: 0 10px 30px rgba(30, 55, 80, .14); }
.modal-backdrop, .ball-task-backdrop { background: rgba(21, 34, 50, .34); backdrop-filter: blur(3px); }
.ball-task-dialog { border-radius: 16px; box-shadow: 0 22px 60px rgba(30, 55, 80, .2); }
.ball-task-item { border-radius: 12px; }
.ball-task-actions { background: var(--surface); }
html[data-theme="dark"] .panel,
html[data-theme="dark"] .status-banner,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .strategy-card,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .profile-grid article,
html[data-theme="dark"] .trend-metrics article { box-shadow: none; }
html[data-theme="dark"] .section-note { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
html[data-theme="dark"] .field-label input,
html[data-theme="dark"] .field-label textarea,
html[data-theme="dark"] .mini-field input,
html[data-theme="dark"] .mini-field select,
html[data-theme="dark"] .filter-row input,
html[data-theme="dark"] .filter-row select,
html[data-theme="dark"] select { background: var(--surface-3); }
@media (max-width: 720px) {
  .main-content { padding-top: 16px; }
  .page-heading h1 { font-size: 21px; }
  .panel, .status-banner, .stat-card, .strategy-card, .settings-section { border-radius: 13px; }
  .settings-section { padding: 15px; }
  .strategy-grid { gap: 11px; }
  .strategy-card { padding: 14px; }
  .strategy-card-config { min-height: 44px; }
  .panel-head { padding-left: 13px; padding-right: 13px; }
}

/* v61 · 视频同款紫白任务系统 */
:root,
html[data-theme="light"] {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #fafaff;
  --line: #dde2eb;
  --line-soft: #edf0f5;
  --text: #202633;
  --muted: #758096;
  --muted-2: #a0a8b6;
  --green: #9828e9;
  --green-2: #7f18d0;
  --green-soft: #f3e8fd;
  --blue: #9828e9;
  --radius: 16px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #15111c;
  --surface: #201a29;
  --surface-2: #2a2135;
  --surface-3: #241c2f;
  --line: #41354e;
  --line-soft: #342a40;
  --text: #f8f5fb;
  --muted: #b0a6bd;
  --muted-2: #7f748c;
  --green: #b45cff;
  --green-2: #9a38f2;
  --green-soft: rgba(180, 92, 255, .15);
  --blue: #b45cff;
}
html, body { background: var(--bg); }
body {
  background: var(--bg);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.app-shell { background: var(--bg); }
.topbar {
  height: 72px;
  grid-template-columns: auto minmax(170px, 1fr) auto auto auto auto;
  gap: 14px;
  padding: 0 18px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
html[data-theme="dark"] .topbar { background: rgba(32,26,41,.96); }
.top-expand {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
}
.top-expand svg { width: 17px; height: 17px; }
.topbar-brand {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 9px;
  color: var(--text);
  letter-spacing: -.3px;
  grid-column: 2;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.topbar .issue-block { grid-column: 3; }
.topbar .countdown-area { grid-column: 4; }
.topbar .run-controls { grid-column: 5; }
.topbar .topbar-actions { grid-column: 6; }
.topbar-brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #b44dff, #7c19d5);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 7px 18px rgba(139,35,219,.23);
}
.topbar-brand strong { font-size: 18px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .icon-button {
  width: 40px;
  height: 40px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.topbar-actions .view-mode-toggle { background: var(--green); color: #fff; }
@media (min-width: 960px) {
  html:not([data-view-mode="mobile"]) .topbar {
    grid-template-columns: minmax(150px, 1fr) auto auto auto auto;
    gap: 12px;
  }
  html:not([data-view-mode="mobile"]) .topbar-brand {
    grid-column: 1;
    position: static;
    transform: none;
    justify-self: start;
  }
  html:not([data-view-mode="mobile"]) .topbar .issue-block { grid-column: 2; }
  html:not([data-view-mode="mobile"]) .topbar .countdown-area { grid-column: 3; }
  html:not([data-view-mode="mobile"]) .topbar .run-controls { grid-column: 4; }
  html:not([data-view-mode="mobile"]) .topbar .topbar-actions { grid-column: 5; }
}
.last-result-bar {
  top: calc(72px + var(--top-safe));
  min-height: 58px;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248,249,252,.97);
  box-shadow: 0 8px 20px rgba(37,31,48,.05);
}
html[data-theme="dark"] .last-result-bar { background: rgba(36,28,47,.97); }
.last-result-bar > span:first-child {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 750;
}
.last-result-bar strong { color: var(--text); }
.last-result-bar #lastFormula {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 750;
}
.last-result-bar b {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
}
.main-content { width: min(1220px, 100%); padding-top: 24px; }
.panel, .status-banner, .stat-card, .strategy-card, .settings-section,
.profile-card, .profile-grid article, .trend-metrics article {
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(31,38,50,.055);
}
.run-button {
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(139,35,219,.2);
}
.sync-run-button {
  border-color: rgba(152,40,233,.28);
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
}
.dashboard-mode-toolbar button.active,
.segmented button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.drawer {
  background: var(--surface);
  border-right-color: var(--line);
  box-shadow: 12px 0 36px rgba(31,38,50,.08);
}
html[data-theme="dark"] .drawer { background: var(--surface); }
.brand-mark, .boot-mark { background: var(--green); color: #fff; border-radius: 13px; }
.drawer-nav button { color: var(--muted); }
.drawer-nav button.active {
  background: var(--green-soft);
  color: var(--green);
}
.drawer-nav button.active::before { background: var(--green); }
.bottom-nav {
  border-top-color: var(--line);
  background: rgba(255,255,255,.97);
  box-shadow: 0 -8px 24px rgba(31,38,50,.07);
}
html[data-theme="dark"] .bottom-nav { background: rgba(32,26,41,.97); }
.bottom-nav button.active { color: var(--green); }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(152,40,233,.24);
  outline-offset: 2px;
}
.mobile-run-dock { display: none; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar .issue-block, .topbar .countdown-area, .topbar .run-controls { display: none; }
  html[data-view-mode="mobile"] .topbar {
    grid-template-areas: "menu brand brand actions" "issue issue countdown countdown";
  }
  html[data-view-mode="mobile"] .topbar .issue-block { display: grid; }
  html[data-view-mode="mobile"] .topbar .countdown-area { display: flex; }
  html[data-view-mode="mobile"] .topbar .run-controls { display: none; }
  .mobile-run-dock {
    position: fixed;
    z-index: 60;
    left: 12px;
    right: 12px;
    bottom: 18px;
    display: flex;
    grid-column: auto;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 10px 30px rgba(67, 32, 91, .18);
    backdrop-filter: blur(14px);
  }
  .mobile-run-dock .run-button { flex: 1; min-width: 0; }
  .topbar .topbar-actions { grid-column: 3; }
  .topbar-brand { grid-column: 2; grid-row: 1; position: static; transform: none; }
  .main-content { padding-bottom: calc(96px + var(--bottom-safe)); }
}
@media (max-width: 720px) {
  .mobile-run-dock { bottom: calc(70px + var(--bottom-safe)); }
  .main-content { padding-bottom: calc(150px + var(--bottom-safe)); }
}
.legacy-strategy-head {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
@media (max-width: 520px) {
  .topbar { height: 66px; padding: 0 12px; gap: 7px; }
  .topbar-brand strong { display: none; }
  .topbar-brand-mark { width: 34px; height: 34px; }
  .top-expand { min-height: 38px; padding: 0 10px; font-size: 13px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button { width: 38px; height: 38px; }
  .last-result-bar { top: calc(66px + var(--top-safe)); min-height: 56px; padding: 7px 12px; font-size: 12px; }
  .last-result-bar > span:first-child { display: none; }
  .last-result-bar #lastFormula { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main-content { padding: 18px 12px calc(84px + var(--bottom-safe)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.login-delivery { display: grid; gap: 8px; }
.login-delivery-hint { padding: 9px 11px; border-left: 3px solid #f0a92e; border-radius: 4px; background: rgba(240, 169, 46, .10); color: #e3cdaa; font-size: 11px; line-height: 1.6; }
.login-resend { min-height: 38px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 700; }
.login-resend:disabled { opacity: .55; cursor: not-allowed; }


/* ============================================================================
   统一按钮语义色（按钮背景色规范）
   绿 = 止盈 / 止损 / 中奖停机 / 删除下注信息
   红 = 杀组 / ABC杀组 / 自定义策略 / 三期计划 / 追号 / 启动挂机 / 停止挂机 / 货币选择
   蓝 = 分享我的策略
   全部使用 CSS 变量与统一类名，深浅色主题、hover/active/disabled、对比度均覆盖。
   ============================================================================ */
:root {
  --btn-success: #1aa856;
  --btn-success-hover: #17964c;
  --btn-success-active: #127f40;
  --btn-success-text: #ffffff;
  --btn-danger: #e04360;
  --btn-danger-hover: #cd3a55;
  --btn-danger-active: #b23048;
  --btn-danger-text: #ffffff;
  --btn-primary: #3b8bf0;
  --btn-primary-hover: #337fe0;
  --btn-primary-active: #2b6fc7;
  --btn-primary-text: #ffffff;
}

html[data-theme="light"] {
  --btn-success: #12924a;
  --btn-success-hover: #0f8141;
  --btn-success-active: #0c6d37;
  --btn-danger: #d3324f;
  --btn-danger-hover: #bd2c47;
  --btn-danger-active: #a5263d;
  --btn-primary: #2f7de0;
  --btn-primary-hover: #2a70ca;
  --btn-primary-active: #2361b0;
}

.btn-success, .btn-danger, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2px;
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, transform .06s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-success { background: var(--btn-success); color: var(--btn-success-text); }
.btn-danger  { background: var(--btn-danger);  color: var(--btn-danger-text); }
.btn-primary { background: var(--btn-primary); color: var(--btn-primary-text); }

.btn-success:hover:not(:disabled) { background: var(--btn-success-hover); }
.btn-success:active:not(:disabled) { background: var(--btn-success-active); transform: translateY(1px); }
.btn-danger:hover:not(:disabled)  { background: var(--btn-danger-hover); }
.btn-danger:active:not(:disabled) { background: var(--btn-danger-active); transform: translateY(1px); }
.btn-primary:hover:not(:disabled) { background: var(--btn-primary-hover); }
.btn-primary:active:not(:disabled){ background: var(--btn-primary-active); transform: translateY(1px); }

.btn-success:disabled, .btn-danger:disabled, .btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.2);
  transform: none;
}
.btn-success:focus-visible, .btn-danger:focus-visible, .btn-primary:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .75);
  outline-offset: 2px;
}

/* 启动挂机 / 停止挂机（同一个按钮的两种状态，都是红色语义） */
.run-button { background: var(--btn-danger) !important; color: var(--btn-danger-text) !important; }
.run-button:hover:not(.busy) { background: var(--btn-danger-hover) !important; }
.run-button:active:not(.busy) { background: var(--btn-danger-active) !important; }
.run-button.running { background: var(--btn-danger-active) !important; color: var(--btn-danger-text) !important; }
.run-button.busy, .run-button:disabled { opacity: .55; filter: grayscale(.2); }

/* 追号（目标/模式选择）与追号里的杀组选项：红色语义 */
#chaseFundTargetType button.active,
#chaseFundMode button.active,
.segmented button[data-ctype="kill"].active { background: var(--btn-danger); border-color: var(--btn-danger); color: var(--btn-danger-text); }

/* 货币选择：红色语义 */
#currencySegment button.active { background: var(--btn-danger); border-color: var(--btn-danger); color: var(--btn-danger-text); }

/* 删除下注信息 / 中奖停机：绿色语义 */
.toggle-line.act-success .toggle-ui { border-color: var(--btn-success); }
.toggle-line.act-success > input:checked + .toggle-ui,
.toggle-line.act-success input:checked ~ .toggle-ui { background: var(--btn-success); border-color: var(--btn-success); }
.toggle-line.act-success strong { color: var(--btn-success); }

/* 止盈 / 止损：绿色语义 */
.field-label.act-success > span { color: var(--btn-success); font-weight: 700; }
.field-label.act-success input { border-color: var(--btn-success); }
.field-label.act-success input:focus { box-shadow: 0 0 0 3px rgba(26, 168, 86, .22); }

/* 分享我的策略：蓝色语义 */
#shareCreateBtn, .btn-primary { background: var(--btn-primary); color: var(--btn-primary-text); border: 0; }
#shareCreateBtn:hover:not(:disabled) { background: var(--btn-primary-hover); }
#shareCreateBtn:active:not(:disabled) { background: var(--btn-primary-active); }

/* 移动端：语义按钮占满一行、可点区域不小于 44px */
@media (max-width: 480px) {
  .btn-success, .btn-danger, .btn-primary { min-height: 44px; width: 100%; font-size: 14px; }
}


/* ── 自定义下注法（规则卡 + 目标按钮选择）───────────────────────────── */
.cr-editor { display: flex; flex-direction: column; gap: 12px; }
.cr-empty { padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 13px; }
.cr-rule { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.cr-rule-head { display: flex; align-items: center; gap: 10px; }
.cr-no { font-weight: 800; color: var(--text); margin-right: auto; }
.cr-del { border: 1px solid var(--line); background: transparent; color: var(--red); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.cr-del:hover { background: var(--red-soft); }
.cr-field { display: flex; flex-direction: column; gap: 6px; }
.cr-inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.cr-label { font-size: 12px; color: var(--muted); }
.cr-pick { width: 100%; min-height: 40px; text-align: left; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-3); color: var(--text); font-size: 13px; cursor: pointer; }
.cr-pick:hover { border-color: var(--blue); }
.cr-count { color: var(--muted); font-size: 12px; }
.cr-inline input { width: 88px; min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); }
.cr-inline button[data-cr-action="mult"] { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; cursor: pointer; }
.cr-inline button[data-cr-action="mult"].active { background: var(--blue); border-color: var(--blue); color: #fff; }
.cr-summary { font-size: 12px; color: var(--muted); line-height: 1.6; }
.cr-summary strong { color: var(--text); }
.cr-error { font-size: 12px; color: var(--red); }
.cr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) { .cr-inline { align-items: flex-start; } .cr-inline input { width: 100%; } }


/* ── 统一弹层（选择器）：遮罩覆盖全视口、面板在遮罩上、底部导航与操作条在遮罩下 ── */
:root { --overlay-z: 300; }          /* 高于 顶栏100 / 抽屉80 / 导航40 / 操作条30，低于 150 不动(无) */
#crOverlayRoot:empty { display: none; }
.cr-layer { position: fixed; inset: 0; z-index: var(--overlay-z); display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.55); overscroll-behavior: contain; }
.cr-panel { width: min(680px, 100%); max-height: min(86dvh, calc(100dvh - 72px)); display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border-radius: 18px 18px 0 0;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 -12px 40px rgba(0,0,0,.35); }
.cr-panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cr-panel-head small { display: block; color: var(--muted); font-size: 11px; }
.cr-panel-head strong { font-size: 15px; }
.cr-panel-head button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.cr-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cr-tabs button { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; cursor: pointer; }
.cr-tabs button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.cr-grid { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; padding: 12px 14px; }
.cr-grid button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; cursor: pointer; }
.cr-grid button.active { background: var(--green); border-color: var(--green); color: #07110a; font-weight: 800; }
.cr-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(10px + var(--bottom-safe));
  border-top: 1px solid var(--line); background: var(--surface); }
.cr-foot .cr-foot-count { margin-right: auto; color: var(--muted); font-size: 12px; }
.cr-foot button { min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px; cursor: pointer; }
.cr-foot button.primary { border: 0; background: var(--blue); color: #fff; font-weight: 800; }
.cr-foot button.danger { border: 0; background: var(--btn-danger, var(--red)); color: #fff; }
@media (max-height: 520px) { .cr-panel { max-height: 100dvh; border-radius: 0; } }


/* ── 今日盈亏排行榜：紫色分段按钮（与页面主题一致，去掉浏览器默认外观） ── */
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-3); }
.lb-tabs button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease; }
.lb-tabs button:hover:not(.active):not(:disabled) { background: var(--surface-2); color: var(--text); }
.lb-tabs button.active { background: linear-gradient(180deg, #a63bf5, #8b1fd8); color: #fff; box-shadow: 0 4px 12px rgba(139,31,216,.28); }
.lb-tabs button:active:not(:disabled) { transform: translateY(1px); }
.lb-tabs button:focus-visible { outline: 2px solid #c98bff; outline-offset: 2px; }
.lb-tabs button:disabled { opacity: .55; cursor: progress; }
html[data-theme="light"] .lb-tabs button.active { background: linear-gradient(180deg, #9828e9, #7e18ce); color: #fff; }
.lb-meta { margin: 8px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.lb-empty { padding: 18px 4px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 380px) { .lb-tabs button { font-size: 12px; padding: 8px 6px; } }

/* ── 固定操作条 + 底部导航 + 安全区的预留空间（避免遮挡榜单最后一行） ── */
:root { --fixed-bars-space: calc(64px + 72px + var(--bottom-safe, 0px) + 16px); }
.app-shell { padding-bottom: var(--fixed-bars-space); }

/* 经典卡片并入任务区后旧容器只作暂存 */
#strategyGrid { display: none !important; }
.strategy-card.classic-merged { margin: 0; }

/* 新版与经典策略共用同一套卡片、开关和配置按钮布局。 */
#strategyV2Root .sv2-card-grid > .strategy-card {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
#strategyV2Root .sv2-card-grid .strategy-card-head { min-height: 72px; }
#strategyV2Root .sv2-card-grid .strategy-meta { margin-top: auto; padding-top: 12px; }
#strategyV2Root .sv2-unified-card .switch input {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: pointer;
  pointer-events: auto;
}
@media (max-width: 620px) {
  #strategyV2Root .sv2-card-grid > .strategy-card { min-height: 254px; }
}

/* ══════════ 盈亏设置（止盈/止损）卡片 ══════════ */
.profit-form { display: grid; gap: 12px; }
.profit-head { display: grid; gap: 10px; }
.profit-head .toggle-line { margin: 0; }
.profit-currency { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-3);
  color: var(--muted); font-size: 12px; }
.profit-currency b { color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.profit-currency small { color: var(--muted-2); font-size: 11px; }
.toggle-line.compact { min-height: 0; gap: 8px; justify-content: flex-start; }
.profit-note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.profit-baseline { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-3); color: var(--text); font-size: 12px; line-height: 1.5; }
.profit-baseline.positive { border-color: rgba(36,211,98,.4); color: var(--green); }
.profit-baseline.negative { border-color: rgba(255,77,103,.4); color: var(--red); }
.profit-targets-state { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 12px; line-height: 1.55; background: var(--surface-3); color: var(--muted); }
.profit-targets-state.is-on { border-color: rgba(139,31,216,.45); color: var(--text); background: rgba(139,31,216,.08); }
.profit-targets-state.is-warn { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.profit-targets-state.is-off { border-style: dashed; }
.profit-lock-note { color: var(--muted-2); font-size: 11.5px; line-height: 1.55; }
.field-label input:disabled, .field-label textarea:disabled { opacity: .55; }

/* ══════════ 紧凑下注详情入口 + 明细页 ══════════ */
.bet-detail-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px;
  margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer;
  -webkit-appearance: none; appearance: none; }
.bet-detail-button:active { transform: translateY(1px); }
.bet-detail-button:focus-visible { outline: 2px solid #c98bff; outline-offset: 2px; }
.bet-detail-button.attention { border-color: rgba(139,31,216,.45); background: rgba(139,31,216,.08); }
.bet-detail-copy { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.bet-detail-copy strong { font-size: 13.5px; font-weight: 800; }
.bet-detail-copy small { color: var(--muted); font-size: 11.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.bet-detail-button > i:last-child { color: var(--muted); flex: 0 0 auto; }
.session-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.session-summary span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 12px; }
.session-summary b { color: var(--text); }
.bet-detail-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.bet-detail-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bet-detail-card > header strong { font-size: 13.5px; }
.bet-detail-card > header small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.bet-detail-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.bet-detail-profit { font-size: 13px; font-weight: 800; }
.bet-detail-profit.win { color: var(--green); }
.bet-detail-profit.loss { color: var(--red); }
.bet-detail-profit.pending { color: var(--muted); font-weight: 600; }
.bet-detail-state { color: var(--muted-2); font-size: 11px; }
.bet-detail-lines { display: grid; gap: 6px; }
.bet-detail-line { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 8px; background: var(--surface-3); }
.bet-detail-pick { flex: 1 1 auto; min-width: 0; color: var(--text); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-detail-amount { color: var(--text); font-size: 12.5px; font-weight: 700; }
.bet-detail-tag { color: var(--muted); font-size: 11px; }
.bet-detail-card > footer { color: var(--muted); font-size: 11.5px; }
.load-more-wrap { display: grid; gap: 6px; justify-items: center; padding: 12px 0 calc(var(--fixed-bars-space, 120px) + 4px); }
.load-more-button { min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, #a63bf5, #8b1fd8); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }
.load-more-button:disabled { opacity: .55; cursor: progress; }
.load-more-button.is-hidden { display: none; }
.load-more-status { color: var(--muted); font-size: 11.5px; text-align: center; }

/* ══════════ 字段级自动保存状态 ══════════ */
.field-save-status { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.field-save-status.pending { color: var(--green); }
.field-save-status.ok { color: var(--green); }
.field-save-status.error { color: var(--red); }
.field-save-status.empty { color: var(--muted-2); }

/* ══════════ 下注群字段 + 推荐群折叠块 ══════════ */
.group-field { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-3); }
/* The cached group image occupies the same fixed box as its fallback. */
.group-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); flex: 0 0 40px; }
.group-avatar img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .12s ease; }
.group-avatar img.is-loaded { opacity: 1; }
.group-avatar-fallback { position: absolute; inset: 0; z-index: 1; display: flex;
  align-items: center; justify-content: center; color: var(--muted); font-size: 13px; font-weight: 800; }
.group-avatar.has-photo .group-avatar-fallback { visibility: hidden; }
.group-chip .group-avatar { width: 24px; height: 24px; flex-basis: 24px; }
.group-chip .group-avatar-fallback { font-size: 12px; }
.group-field-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.group-field-foot .field-save-status { margin-top: 0; }
.group-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.group-chip > span:last-child { color: var(--text); font-size: 12px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }

/* 参考 Telegram 引用块的折叠入口：左侧细色条 + 淡色背景 + 右侧箭头 */
.group-rec-block { border-radius: 12px; overflow: hidden; }
.group-rec-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 10px 12px 10px 0; border: 0; border-radius: 12px; background: var(--surface-2);
  color: var(--text); text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none; }
.group-rec-toggle:active { transform: translateY(1px); }
.group-rec-toggle:focus-visible { outline: 2px solid #c98bff; outline-offset: 2px; }
.group-rec-bar { display: block; width: 3px; align-self: stretch; margin-left: 0;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #a63bf5, #8b1fd8); }
.group-rec-head { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
.group-rec-head strong { font-size: 13.5px; font-weight: 800; }
.group-rec-head small { color: var(--muted); font-size: 11.5px; }
.group-rec-arrow { flex: 0 0 auto; margin-right: 12px; color: var(--muted);
  transition: transform .18s ease; }
.group-rec-block.is-open .group-rec-arrow { transform: rotate(180deg); }
.group-rec-panel { display: grid; gap: 8px; margin-top: 8px; }
.group-rec-panel.is-hidden { display: none; }
.group-rec-row { display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.group-rec-row.is-current { border-color: rgba(139,31,216,.5); background: rgba(139,31,216,.08); }
.group-rec-copy { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
.group-rec-copy strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-rec-copy small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-rec-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.group-rec-pick { min-height: 34px; padding: 0 12px; border: 0; border-radius: 8px;
  background: linear-gradient(180deg, #a63bf5, #8b1fd8); color: #fff; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.group-rec-pick:disabled { opacity: .55; }
.group-rec-open { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.group-rec-current { display: inline-flex; align-items: center; gap: 4px; color: #a63bf5; font-size: 11.5px; font-weight: 800; }
.group-rec-status.error { color: var(--amber); font-size: 11px; }
.group-rec-loading, .group-rec-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-size: 12px; text-align: center; }
.group-rec-loading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.group-rec-error { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--red);
  border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 12px; flex-wrap: wrap; }
.group-rec-error button { min-height: 32px; padding: 0 12px; border: 1px solid var(--red); border-radius: 8px;
  background: transparent; color: var(--red); font-size: 12px; font-weight: 700; cursor: pointer; }

/* ══════════ 后台：两类推荐挂机群 ══════════ */
.admin-inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-inline-actions button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  color: var(--text); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.admin-inline-actions button:disabled { opacity: .55; cursor: progress; }
.admin-resolve-status { color: var(--muted); font-size: 11.5px; line-height: 1.55; word-break: break-word; }
.admin-resolve-status.has-error { color: var(--amber); }
@media (max-width: 380px) {
  .group-rec-head strong { font-size: 12.5px; }
  .group-rec-copy strong { font-size: 12px; }
  .field-pair { grid-template-columns: minmax(0, 1fr); }
}
