:root {
  --chrome: 76px;
  --sport: 0px;
  --ink: #1b1633;
  --muted: rgba(27, 22, 51, 0.62);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.72);
  --line-soft: rgba(40, 24, 80, 0.1);
  --shadow: 0 18px 48px rgba(72, 48, 140, 0.14);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --accent: #5b6cff;
  --num: #14182e;
  --spread: #9a6400;
  --total: #c43b6e;
  --water: #1463b8;
  --euro: #5b45d6;
  --red: #d3124a;
  --green: #0c8a58;
  --push: #a67c00;
  --head: rgba(255, 255, 255, 0.55);
  --head-ink: #1b1633;
  --soft: rgba(255, 255, 255, 0.34);
  --pane: rgba(255, 255, 255, 0.86);
  --ticket: rgba(255, 255, 255, 0.62);
  --active: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(214, 228, 255, 0.72));
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #d5def2;
  --muted: rgba(190, 202, 230, 0.72);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.24);
  --line-soft: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --inset: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --accent: #8ad8ff;
  --num: #ffffff;
  --spread: #ffd56a;
  --total: #ff8eb8;
  --water: #8ad8ff;
  --euro: #cbb6ff;
  --red: #ff7594;
  --green: #3ee0a0;
  --push: #ffd36a;
  --head: rgba(28, 24, 58, 0.98);
  --head-ink: #c5d0ea;
  --soft: rgba(255, 255, 255, 0.06);
  --pane: rgba(18, 16, 42, 0.94);
  --ticket: rgba(255, 255, 255, 0.06);
  --active: linear-gradient(180deg, rgba(170, 220, 255, 0.28), rgba(255, 150, 220, 0.14));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(980px 640px at 8% -8%, rgba(150, 120, 255, 0.48), transparent 62%),
    radial-gradient(760px 520px at 96% 0%, rgba(110, 190, 255, 0.5), transparent 58%),
    radial-gradient(680px 500px at 78% 110%, rgba(255, 140, 210, 0.36), transparent 52%),
    linear-gradient(165deg, #f6f3ff 0%, #e7f1ff 46%, #f3e9ff 100%);
  background-attachment: fixed;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 700px at 8% -10%, rgba(124, 72, 255, 0.58), transparent 62%),
    radial-gradient(820px 560px at 94% 6%, rgba(64, 156, 255, 0.4), transparent 58%),
    radial-gradient(720px 540px at 74% 112%, rgba(255, 80, 170, 0.3), transparent 52%),
    linear-gradient(165deg, #2a1450 0%, #14182f 48%, #0b1224 100%);
}
button, input, select, b, strong, h1, h2, h3, th { font: inherit; color: inherit; font-weight: 400; }
button { cursor: pointer; }
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.7;
}
.orb-a {
  width: 360px;
  height: 420px;
  right: -80px;
  top: 8%;
  background: linear-gradient(180deg, rgba(154, 231, 255, 0.95), rgba(106, 168, 255, 0.2));
}
.orb-b {
  width: 300px;
  height: 340px;
  left: 32%;
  top: 6%;
  background: linear-gradient(180deg, rgba(255, 176, 234, 0.85), rgba(160, 120, 255, 0.15));
}
.orb-c {
  width: 420px;
  height: 240px;
  left: 8%;
  bottom: -80px;
  background: rgba(255, 255, 255, 0.55);
}
html[data-theme="dark"] .orb { opacity: 0.55; }
html[data-theme="dark"] .orb-c { background: rgba(255, 255, 255, 0.16); }

.topbar, .rail, .scoreboard, .card, .placeholder, .drawer, .pane, .strategy-card, .detail-block, .live-rail, .live-stage, .live-card, .factory-chip, .profit-chart, .profit-board, .profit-orders {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--chrome);
  margin: 12px 12px 0;
  padding: 10px 14px;
  border-radius: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-name {
  font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", sans-serif;
  font-weight: 800;
  font-style: oblique 16deg;
  font-synthesis: style;
  font-size: 20px;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #241f1a;
}
html[data-theme="dark"] .brand-name { color: #f3efe8; }
.sport-switch { display: flex; align-items: center; gap: 4px; flex: none; }
.sport-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 400;
}
.sport-btn.active {
  background: rgba(27, 22, 51, 0.08);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(27, 22, 51, 0.12);
}
html[data-theme="dark"] .sport-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.sport-btn:hover:not(.active) { color: var(--ink); }
.sport-icon { font-size: 15px; line-height: 1; }
.menu { display: flex; align-items: center; gap: 26px; flex: 1; margin-left: 18px; }
.nav-btn {
  position: relative;
  padding: 8px 2px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 400;
}
.nav-btn.active { color: var(--ink); background: transparent; box-shadow: none; }
.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #67d4ff, #ff78d4);
}
.nav-btn:hover:not(.active) { color: var(--ink); }
.theme-btn, .chip, .league-select, .search, .player-row, .ticket, .jump a, .quarter, .odd-pill, .close-btn {
  border: 1px solid var(--line);
  background: var(--glass-strong);
  box-shadow: var(--inset);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-radius: 14px;
}
.theme-btn, .close-btn {
  padding: 8px 14px;
  font-weight: 400;
}
.chip.active, .ticket.active {
  background: var(--active);
  color: var(--ink);
  border-color: rgba(180, 220, 255, 0.7);
  box-shadow: 0 10px 28px rgba(90, 140, 255, 0.22), var(--inset);
}
.top-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  flex: none;
}
body[data-shell="login"] .top-end { margin-left: 0; }
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-width: 64px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  flex: none;
  font-size: 13px;
  line-height: 1;
}
.theme-btn[hidden] { display: none; }
.telegram-btn {
  gap: 6px;
  min-width: 0;
  padding: 0 14px;
  margin-left: 0;
}
.telegram-icon {
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor;
}
.user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: 0;
  min-width: 140px;
}
.user-chip[hidden] { display: none; }
.user-chip b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}
.user-chip > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
body[data-shell="login"] .topbar {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body[data-shell="login"] .brand,
body[data-shell="login"] .sport-switch,
body[data-shell="login"] .menu,
body[data-shell="login"] .user-chip,
body[data-shell="login"] #telegramBtn,
body[data-shell="login"] #logoutBtn,
body[data-shell="login"] #boardNav,
body[data-shell="admin"] .sport-switch,
body[data-shell="admin"] .menu { display: none; }
body[data-shell="app"] #boardNav { display: none; }
.desk {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - var(--chrome) - var(--sport) - 36px);
  padding: 12px;
}
.rail, .stage { min-height: 0; }
.rail {
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  overflow: hidden;
}
.rail-tools {
  padding: 14px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.rail-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.rail-meta #linesAt.is-schedule {
  flex: 1 0 100%;
  order: 3;
  letter-spacing: 0;
}
.search, .league-select { padding: 9px 12px; width: 100%; }
.search::placeholder { color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 10px; font-size: 12px; font-weight: 400; border-radius: 999px; }
.list, .stage {
  overflow: auto;
  overscroll-behavior: contain;
}
.list { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.ticket, .card { content-visibility: auto; }
.ticket { contain-intrinsic-size: auto 120px; }
.card { contain-intrinsic-size: auto 420px; }
.rail, .scoreboard, .card, .pane, .ticket, .player-row, .drawer, .live-rail, .live-stage {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--pane);
}
.ticket, .player-row { background: var(--ticket); }
.league-block h2 {
  margin: 2px 0 10px;
  font-size: 18px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.league-block h2 .muted { font-size: 13px; font-weight: 400; }
.swatch { width: 8px; height: 8px; border-radius: 99px; display: inline-block; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16); }
.ticket {
  width: 100%;
  text-align: left;
  padding: 12px;
  margin-bottom: 8px;
  display: block;
}
html[data-theme="light"] .ticket {
  background: #fff;
  border: 1px solid rgba(48, 36, 96, 0.16);
  box-shadow: 0 6px 16px rgba(72, 48, 140, 0.08);
  margin-bottom: 12px;
}
html[data-theme="light"] .ticket.active {
  background: linear-gradient(180deg, #ffffff, #e8f0ff);
  border-color: rgba(70, 120, 220, 0.42);
  box-shadow: 0 10px 24px rgba(72, 100, 200, 0.16);
}
.ticket-top, .team-line, .odds-line, .score-side, .pane-head, .drawer-top, .profile-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ticket-top { font-size: 12px; font-weight: 400; margin-bottom: 6px; color: var(--muted); }
.ticket.active .ticket-top { color: var(--ink); }
.team-line { align-items: center; font-size: 15px; }
.club-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-line b { font-weight: 400; }
.logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: none;
  background: #fff;
  border-radius: 6px;
  padding: 2px;
}
.logo.sm { width: 18px; height: 18px; border-radius: 5px; padding: 1px; }
.logo.league { width: 32px; height: 32px; border-radius: 8px; padding: 2px; }
.logo.lg { width: 58px; height: 58px; border-radius: 16px; padding: 6px; }
.club { display: flex; align-items: center; gap: 14px; min-width: 0; }
.side.away .club { flex-direction: row-reverse; }
.rank, .muted, .sub { color: var(--muted); font-weight: 400; font-size: 12px; }
.score-num { font-variant-numeric: tabular-nums; font-weight: 400; color: var(--num); font-size: 16px; }
.score-num.live { color: var(--red); }
.clock { color: var(--water); font-variant-numeric: tabular-nums; }
.odds-line {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.odds-label, .odds-miss, .odds-dot { color: var(--muted); font-weight: 400; }
.num-spread, .num-total, .num-water, .num-euro { font-weight: 400; letter-spacing: 0; }
.num-spread { color: var(--spread); }
.num-total { color: var(--total); }
.num-water { color: var(--water); }
.num-euro { color: var(--euro); }
.stage { padding: 4px 8px 40px 2px; }
.scoreboard {
  border-radius: 28px;
  padding: 22px 22px 16px;
  margin-bottom: 14px;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.board-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}
.mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.mid .kicker {
  justify-content: center;
  flex-wrap: wrap;
  max-width: 440px;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}
.mid .odd-row { margin-top: 0; justify-content: center; flex-wrap: nowrap; }
.mid .odd-pill { font-size: 16px; padding: 7px 12px; }
.mid .odd-pill b { font-size: 18px; }
.side { min-width: 0; }
.side.away { text-align: right; }
.side h2 { margin: 0; font-size: 34px; line-height: 1.12; font-weight: 400; letter-spacing: -0.02em; }
.versus {
  background: var(--glass-strong);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 400;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  box-shadow: var(--inset);
}
.big-score {
  font-size: 48px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--num);
}
.quarters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.quarter, .odd-pill {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 400;
  background: var(--soft);
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
}
.odd-pill { display: inline-flex; align-items: baseline; gap: 4px; }
.odd-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.jump {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0;
}
.jump a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 400;
  border-radius: 999px;
}
.jump a.tag-standings { color: #0b7ea8; background: rgba(20, 160, 210, 0.16); border-color: rgba(11, 126, 168, 0.45); }
.jump a.tag-h2h { color: #9a6400; background: rgba(255, 190, 60, 0.2); border-color: rgba(154, 100, 0, 0.4); }
.jump a.tag-recent { color: #c43b6e; background: rgba(255, 120, 160, 0.16); border-color: rgba(196, 59, 110, 0.4); }
.jump a.tag-scoring { color: #c45a12; background: rgba(255, 150, 70, 0.18); border-color: rgba(196, 90, 18, 0.4); }
.jump a.tag-schedule { color: #5b45d6; background: rgba(140, 120, 255, 0.16); border-color: rgba(91, 69, 214, 0.4); }
.jump a.tag-handicap { color: #0c8a58; background: rgba(40, 190, 120, 0.16); border-color: rgba(12, 138, 88, 0.4); }
.jump a.tag-totals { color: #b4236a; background: rgba(255, 110, 180, 0.16); border-color: rgba(180, 35, 106, 0.4); }
.jump a.tag-lineup { color: #1463b8; background: rgba(70, 140, 255, 0.16); border-color: rgba(20, 99, 184, 0.4); }
html[data-theme="dark"] .jump a.tag-standings { color: #8ad8ff; background: rgba(138, 216, 255, 0.16); border-color: rgba(138, 216, 255, 0.45); }
html[data-theme="dark"] .jump a.tag-h2h { color: #ffd56a; background: rgba(255, 213, 106, 0.16); border-color: rgba(255, 213, 106, 0.45); }
html[data-theme="dark"] .jump a.tag-recent { color: #ff8eb8; background: rgba(255, 142, 184, 0.16); border-color: rgba(255, 142, 184, 0.45); }
html[data-theme="dark"] .jump a.tag-scoring { color: #ffb07a; background: rgba(255, 176, 122, 0.16); border-color: rgba(255, 176, 122, 0.45); }
html[data-theme="dark"] .jump a.tag-schedule { color: #cbb6ff; background: rgba(203, 182, 255, 0.16); border-color: rgba(203, 182, 255, 0.45); }
html[data-theme="dark"] .jump a.tag-handicap { color: #3ee0a0; background: rgba(62, 224, 160, 0.16); border-color: rgba(62, 224, 160, 0.45); }
html[data-theme="dark"] .jump a.tag-totals { color: #ff7ad9; background: rgba(255, 122, 217, 0.16); border-color: rgba(255, 122, 217, 0.45); }
html[data-theme="dark"] .jump a.tag-lineup { color: #9eb6ff; background: rgba(158, 182, 255, 0.18); border-color: rgba(158, 182, 255, 0.45); }
.card { border-radius: 24px; margin-bottom: 16px; overflow: hidden; }
.card > h3 {
  margin: 0;
  padding: 14px 16px 12px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0.06em;
  font-weight: 400;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.card > h3::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex: none;
}
.card > h3:hover { color: var(--water); }
.card.is-folded > h3 { border-bottom-color: transparent; }
.card.is-folded > h3::after { transform: rotate(-45deg); }
.card.is-folded > :not(h3) { display: none; }
.card-body { padding: 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pane { border-radius: 18px; min-width: 0; overflow: hidden; }
.pane-head, .block-label {
  padding: 10px 12px;
  font-weight: 400;
  background: var(--soft);
  border-bottom: 1px solid var(--line-soft);
}
.pane-head { justify-content: flex-start; align-items: center; gap: 8px; }
.block-label { border-radius: 14px 14px 0 0; }
.table-wrap { overflow: auto; max-height: 420px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.grid td {
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 7px;
  text-align: center;
  white-space: nowrap;
  color: var(--ink);
}
.grid tr.head td { color: var(--head-ink); }
.grid tr.head td {
  background: var(--head);
  color: var(--head-ink);
  font-weight: 400;
  position: sticky;
  top: 0;
}
.grid td.tone-win, .grid td .tone-win { color: var(--green); font-weight: 400; }
.grid td.tone-lose, .grid td .tone-lose { color: var(--red); font-weight: 400; }
.grid td.tone-push, .grid td .tone-push { color: var(--push); font-weight: 400; }
.grid td .tone-win, .grid td .tone-lose, .grid td .tone-push { margin: 0 1px; }
.roster { display: grid; gap: 8px; padding: 10px; }
.group-label { font-size: 11px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.player-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 64px 1fr;
  text-align: left;
  padding: 8px 10px;
  margin-top: 6px;
  font-weight: 400;
}
.player-row:hover { background: var(--active); }
.empty, .error-line { padding: 14px; color: var(--muted); font-weight: 400; }
.placeholder {
  max-width: 720px;
  margin: 48px auto;
  border-radius: 28px;
  padding: 32px;
}
.placeholder h1 {
  font-size: 48px;
  margin: 12px 0;
  letter-spacing: -0.03em;
  font-weight: 400;
}
.stamp {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  font-size: 12px;
}
.backdrop {
  position: fixed;
  top: calc(var(--chrome) + 12px);
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(8, 10, 24, 0.38);
  backdrop-filter: blur(6px);
  z-index: 30;
}
.drawer {
  position: fixed;
  top: calc(var(--chrome) + 12px);
  right: 12px;
  height: calc(100vh - var(--chrome) - 24px);
  width: min(920px, calc(100vw - 24px));
  border-radius: 28px;
  z-index: 40;
  overflow: auto;
  padding: 18px 18px 40px;
}
.drawer.is-strategy { width: min(1120px, calc(100vw - 24px)); }
.drawer .detail-block { width: auto; margin: 0 0 12px; }
.drawer-top { align-items: flex-start; margin-bottom: 12px; }
.who { display: flex; gap: 14px; align-items: center; }
.who img, .ph {
  width: 96px;
  height: 120px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--soft);
  box-shadow: var(--shadow);
}
.who h2 { margin: 0 0 4px; font-size: 28px; letter-spacing: -0.02em; }
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin: 12px 0 16px;
  background: var(--soft);
}
.profile-grid div { display: contents; }
.profile-grid span, .profile-grid b {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
}
.profile-grid span { background: var(--head); color: var(--head-ink); font-weight: 400; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { border-bottom: 1px solid var(--line-soft); padding: 6px 4px; text-align: center; }
.mini-table th { background: var(--head); color: var(--head-ink); font-weight: 400; }
.mini-table tr.avg td { color: var(--muted); }
.section-gap { margin-top: 16px; }
.close-btn { border-radius: 999px; font-weight: 400; }
.state-live { color: var(--red); }
.state-final { color: var(--muted); }
.loading { padding: 40px; font-weight: 400; }
.list, .stage, .drawer, .table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 160, 210, 0.55) transparent;
}
.ind-head { margin-bottom: 4px; }
.ind-clubs { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; }
.ind-clubs h2 { margin: 0; font-size: 28px; }
.layer-note { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.league-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.league-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 124px;
  padding: 14px 12px 12px;
  border-radius: 16px;
  background: var(--ticket);
  border: 1px solid var(--line-soft);
}
.league-tile-name { color: var(--ink); font-size: 13px; line-height: 1.35; }
.league-tile b, .metric b { font-weight: 400; font-size: 18px; line-height: 1.05; color: var(--water); font-variant-numeric: tabular-nums; }
.league-tile b.rate-high, .metric b.rate-high { color: var(--green); }
.league-tile b.rate-low, .metric b.rate-low { color: var(--red); }
.league-tile b.core-margin { color: var(--spread); }
.league-tile b.core-total { color: var(--total); }
.team-panels { align-items: start; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.league-tile-extra { color: var(--num); font-size: 12px; }
.league-tile-use { margin-top: auto; color: var(--muted); font-size: 12px; line-height: 1.35; }
.ind-table td, .ind-table th { white-space: normal; }
.ind-table th {
  background: var(--head);
  color: var(--head-ink);
  font-weight: 400;
  padding: 8px 7px;
  text-align: center;
  position: sticky;
  top: 0;
}
.ind-name { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.ind-name span, .metric i, .metric span { color: var(--muted); font-size: 11px; font-style: normal; }
.ind-table tr.core-margin td:nth-child(3),
.ind-table tr.core-margin td:nth-child(4) { color: var(--spread); }
.ind-table tr.core-total td:nth-child(3),
.ind-table tr.core-total td:nth-child(4) { color: var(--total); }
.ind-table tr.core-margin, .ind-table tr.core-total { background: rgba(255, 255, 255, 0.03); }
.starter-list { display: grid; gap: 8px; padding: 8px; }
.player-card { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.player-card .pane-head { padding: 8px 10px; font-size: 15px; }
html[data-theme="light"] .player-card {
  background: #fff;
  border-color: rgba(48, 36, 96, 0.16);
  box-shadow: 0 8px 22px rgba(72, 48, 140, 0.1);
}
html[data-theme="light"] .player-card .pane-head {
  background: linear-gradient(180deg, rgba(226, 236, 255, 0.96), rgba(255, 255, 255, 0.78));
  border-bottom: 1px solid rgba(48, 36, 96, 0.1);
}
.player-name { color: var(--euro); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px; }
.metric { background: var(--ticket); border-radius: 10px; padding: 7px 8px; min-width: 0; }
html[data-theme="light"] .player-card .metric {
  background: #f3f6ff;
  border: 1px solid rgba(48, 36, 96, 0.12);
}
html[data-theme="light"] .player-card .metric span { color: rgba(27, 22, 51, 0.78); font-size: 12px; }
.metric span { display: block; line-height: 1.35; font-size: 13px; color: var(--ink); }
.metric i { display: block; margin: 2px 0 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.metric b { display: block; margin: 4px 0 0; }

.strategy-page {
  height: calc(100vh - var(--chrome) - var(--sport) - 36px);
  overflow: auto;
  padding: 16px 0 36px;
}
.strategy-top,
.strategy-filters,
.strategy-grid,
.factory-status,
.detail-block,
.profit-chart,
.profit-boards {
  width: min(1560px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}
.strategy-top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 14px; }
.factory-status {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.strategy-page .factory-status,
.factory-status-9 {
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}
.factory-chip {
  min-width: 0;
  text-align: center;
  border-radius: 16px;
  padding: 12px 8px;
}
.factory-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.factory-chip b {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.factory-chip.tone-run b { color: var(--water); }
.factory-chip.tone-spread b { color: var(--spread); }
.factory-chip.tone-total b { color: var(--total); }
.factory-chip.tone-sample b { color: var(--euro); }
.factory-chip.tone-profit b { color: var(--green); }
.factory-chip.tone-live b { color: var(--accent); }
.strategy-page .factory-chip,
.factory-status-9 .factory-chip { padding: 12px 4px; }
.strategy-page .factory-chip span,
.factory-status-9 .factory-chip span { font-size: 11px; }
html[data-theme="light"] .factory-chip {
  background: #fff;
  border: 1px solid rgba(48, 36, 96, 0.16);
  box-shadow: 0 6px 16px rgba(72, 48, 140, 0.08);
}
.factory-title { display: flex; align-items: center; gap: 12px; }
.factory-title h1 { margin: 0; font-size: 28px; font-weight: 400; }
.factory-run {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  color: var(--water);
}
.factory-run-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
}
.factory-mill {
  position: relative;
  width: 28px;
  height: 28px;
}
.factory-ring,
.factory-hub { position: absolute; border-radius: 50%; }
.factory-ring-a {
  inset: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: factory-spin 1.35s linear infinite;
}
.factory-ring-b {
  inset: 6px;
  border: 2px solid var(--accent);
  border-left-color: transparent;
  animation: factory-spin-rev 1.9s linear infinite;
}
.factory-hub {
  inset: 11px;
  background: var(--green);
  animation: factory-pulse 1.6s ease-in-out infinite;
}
@keyframes factory-spin { to { transform: rotate(360deg); } }
@keyframes factory-spin-rev { to { transform: rotate(-360deg); } }
@keyframes factory-pulse {
  0%, 100% { transform: scale(0.72); opacity: 0.55; }
  50% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .factory-ring,
  .factory-hub { animation: none; }
}
.strategy-lead {
  max-width: 1080px;
  margin: 12px 0 0;
}
.strategy-lead-desc {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-style: oblique 16deg;
  font-synthesis: style;
  line-height: 1.9;
  letter-spacing: 0.06em;
}
.strategy-lead-desc .lead-num { font-style: inherit; }
.strategy-lead-rules {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: "Avenir Next", "DIN Alternate", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.04em;
}
.strategy-lead-rules li span:first-child {
  display: inline-block;
  min-width: 7.2em;
  margin-right: 10px;
  color: var(--ink);
  letter-spacing: 0.14em;
}
.lead-num {
  color: var(--water);
  font-variant-numeric: tabular-nums;
  font-style: normal;
}
.lead-num.is-up { color: var(--green); }
.lead-num.is-down { color: var(--red); }
.strategy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.strategy-card { position: relative; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.strategy-card:hover { z-index: 5; }
.strategy-card-top { display: flex; flex-direction: column; align-items: stretch; }
.strategy-head-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.strategy-leagues { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 24px; align-content: flex-start; }
.strategy-leagues span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}
.strategy-name { display: flex; align-items: flex-end; min-height: calc(1.35em * 2); margin-top: 12px; }
.strategy-card-top h2 { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 400; }
.strategy-card-top p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  min-height: calc(1.55em * 3);
  max-height: calc(1.55em * 3);
  overflow: hidden;
}
.strategy-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.strategy-filters label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
.strategy-kicker { display: flex; gap: 6px; flex-wrap: wrap; }
.strategy-kicker span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}
.market-spread .strategy-kicker span:first-child { color: var(--spread); }
.market-total .strategy-kicker span:first-child { color: var(--total); }
.strategy-kicker .strategy-stage.is-live { color: var(--green); }
.strategy-kicker .strategy-stage.is-test { color: var(--water); }
.strategy-rate { flex: none; text-align: right; font-size: 22px; line-height: 1; font-weight: 400; color: var(--water); font-variant-numeric: tabular-nums; }
.strategy-rate i { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-style: normal; letter-spacing: 0.08em; }
.strategy-rate.rate-high { color: var(--green); }
.strategy-rate.rate-low { color: var(--red); }
.equity-wrap { background: var(--ticket); border: 1px solid var(--line-soft); border-radius: 16px; padding: 10px 12px 6px; }
.equity-wrap > span, .equity-empty { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
.equity-wrap .kline { height: 96px; }
.equity-empty { height: 96px; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; text-align: center; }
.strategy-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.strategy-stats div { min-width: 0; background: var(--ticket); border-radius: 12px; padding: 8px 8px 7px; }
.strategy-stats span { display: block; color: var(--muted); font-size: 12px; }
.strategy-stats b { display: block; margin-top: 3px; font-size: 16px; line-height: 1.1; font-weight: 400; color: var(--water); font-variant-numeric: tabular-nums; }
.strategy-stats b.rate-high { color: var(--green); }
.strategy-stats b.rate-low { color: var(--red); }
.strategy-actions { display: flex; gap: 8px; }
.strategy-actions button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  padding: 9px 12px;
  font-weight: 400;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: var(--inset);
  color: var(--ink);
}
.strategy-actions .detail-icon { width: 16px; height: 16px; color: var(--euro); }
.strategy-brief { color: var(--muted); line-height: 1.55; }
.detail-label { margin: 16px 0 8px; font-size: 15px; font-weight: 400; }
.rule-list { margin: 0; padding-left: 18px; color: var(--ink); }
.rule-list li { margin: 4px 0; }
.today-order { border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: var(--ticket); }
.today-order header { display: flex; justify-content: space-between; gap: 10px; }
.today-order header span, .today-order p { color: var(--water); }
.today-order ul { margin: 8px 0 0; padding-left: 18px; }
.today-order em { color: var(--muted); font-style: normal; }
.grid td.bet-win { color: var(--green); }
.grid td.bet-lose { color: var(--red); }
.grid td.bet-push { color: var(--push); }
.detail-block { border-radius: 24px; padding: 16px 18px 18px; margin-bottom: 14px; }
.detail-block h2 { margin: 0; font-size: 18px; font-weight: 400; }
.detail-title { display: flex; align-items: center; gap: 8px; }
.detail-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-icon circle { fill: currentColor; stroke: none; }
.detail-icon-brief { color: var(--euro); }
.detail-icon-curve { color: var(--green); }
.detail-icon-stats { color: var(--water); }
.detail-icon-orders { color: var(--spread); }
.detail-block h3 { margin: 14px 0 8px; font-size: 14px; font-weight: 400; color: var(--muted); }
.detail-top { margin-bottom: 12px; }
.detail-back {
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 400;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--ink);
}
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-note { margin: 8px 0 4px; color: var(--muted); font-size: 12px; }
.detail-stats { margin-top: 12px; }
.range-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.range-pills button {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 400;
  background: var(--soft);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.range-pills button.on,
.range-pick.on { background: var(--active); color: var(--ink); border-color: rgba(180, 220, 255, 0.7); }
.range-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 400;
  background: var(--soft);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.range-pick > button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}
.range-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 148px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 4px;
  border-radius: 16px;
  background: var(--pane);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.range-menu button {
  border-radius: 999px;
  padding: 6px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
}
.range-menu button.on,
.range-menu button:hover { background: var(--soft); }
.range-menu input[type="date"] {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--soft);
  color: var(--ink);
}
.kline-wrap { position: relative; }
.kline { width: 100%; height: auto; display: block; }
.kline-empty { height: 220px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.k-grid { stroke: var(--line-soft); stroke-width: 1; }
.k-zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.k-hit { fill: transparent; cursor: crosshair; }
.k-hover { pointer-events: none; }
.k-hover[hidden] { display: none; }
.k-cursor { stroke: var(--water); stroke-width: 1; stroke-dasharray: 2 3; }
.k-dot { stroke: var(--ink); stroke-width: 1.5; }
.k-dot.up { fill: var(--green); }
.k-dot.down { fill: var(--red); }
.kline-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: baseline;
  min-width: 148px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--pane);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.kline-tip[hidden] { display: none; }
.kline-tip b { color: var(--ink); font-size: 14px; font-weight: 400; }
.kline-tip b.up { color: var(--green); }
.kline-tip b.down { color: var(--red); }
.equity-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.equity-line.up { stroke: var(--green); }
.equity-line.down { stroke: var(--red); }
.k-label { fill: var(--muted); font-size: 11px; font-weight: 400; }
.order-table { max-height: 560px; }
.order-table .grid td { text-align: center; }
.order-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.order-pager div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.order-pager button {
  min-width: 32px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 400;
  background: var(--soft);
  border: 1px solid var(--line-soft);
  color: var(--muted);
}
.order-pager button.on { background: var(--active); color: var(--ink); border-color: rgba(180, 220, 255, 0.7); }
.order-pager button:disabled { opacity: 0.4; cursor: default; }

.live-page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - var(--chrome) - var(--sport) - 36px);
  padding: 12px;
}
.live-page > .loading { grid-column: 1 / -1; }
.live-rail, .live-stage { min-height: 0; overflow: auto; border-radius: 26px; }
.live-rail { display: flex; flex-direction: column; padding: 14px; }
.live-rail-top { margin-bottom: 12px; flex: none; }
.live-status {
  width: 100%;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.live-status .factory-chip { padding: 10px 6px; }
.live-status .factory-chip span { font-size: 12px; }
.live-status .factory-chip b { font-size: 20px; }
.live-list { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; }
.live-card {
  width: 100%;
  text-align: left;
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--ticket);
  cursor: pointer;
}
.live-card .strategy-rate { font-size: 18px; }
.live-card .strategy-rate i { margin-top: 3px; }
.live-card .strategy-leagues { margin-top: 6px; min-height: 0; }
.live-card .strategy-name { min-height: 0; margin-top: 6px; }
.live-card .strategy-name h2,
.live-card h2 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 400; }
.live-card .strategy-card-top p {
  min-height: 0;
  max-height: 1.45em;
  margin-top: 4px;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.live-card .equity-wrap { padding: 6px 8px 4px; border-radius: 12px; }
.live-card .equity-wrap .kline,
.live-card .equity-empty { height: 52px; }
.live-card .strategy-stats { gap: 6px; }
.live-card .strategy-stats div { padding: 6px; border-radius: 10px; }
.live-card .strategy-stats b { font-size: 14px; }
.live-card.active {
  background: var(--active);
  color: var(--ink);
  border-color: rgba(180, 220, 255, 0.7);
  box-shadow: 0 10px 28px rgba(90, 140, 255, 0.22), var(--inset);
}
html[data-theme="light"] .live-card {
  background: #fff;
  border: 1px solid rgba(48, 36, 96, 0.16);
  box-shadow: 0 8px 20px rgba(72, 48, 140, 0.1);
}
html[data-theme="light"] .live-card .strategy-stats div,
html[data-theme="light"] .live-card .equity-wrap {
  background: #f3f6ff;
  border: 1px solid rgba(48, 36, 96, 0.1);
}
html[data-theme="light"] .live-card.active {
  background: linear-gradient(180deg, #ffffff, #e8f0ff);
  border-color: rgba(70, 120, 220, 0.42);
  box-shadow: 0 10px 24px rgba(72, 100, 200, 0.16);
}
.live-stage { padding: 16px 18px 24px; }
.live-detail-top { margin-bottom: 12px; }
.live-detail-top h1 { margin: 2px 0 0; font-size: 18px; font-weight: 400; }
.live-stage .detail-block { width: auto; margin: 0 0 12px; }
.live-stage .detail-title { font-size: 14px; }
.live-stage .detail-icon { width: 14px; height: 14px; }
.live-fold-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-fold-head {
  flex: 1;
  width: auto;
  min-width: 0;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
}
.live-fold-head::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  flex: none;
}
.live-fold.is-folded .live-fold-head::after { transform: rotate(-45deg); }
.live-sort { position: relative; flex: none; margin-left: auto; }
.live-sort-btn {
  appearance: none;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 400;
  background: var(--soft);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  cursor: pointer;
}
.live-sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 148px;
  padding: 8px;
  display: grid;
  gap: 4px;
  border-radius: 16px;
  background: var(--pane);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.live-sort-menu button {
  border-radius: 999px;
  padding: 6px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 400;
}
.live-sort-menu button.on,
.live-sort-menu button:hover { background: var(--soft); }
.live-fold-body { margin-top: 14px; }
.live-fold.is-folded .live-fold-body { display: none; }

.profit-page {
  height: calc(100vh - var(--chrome) - var(--sport) - 36px);
  overflow: hidden;
  padding: 10px 0 12px;
  display: flex;
  flex-direction: column;
}
.profit-page .strategy-top {
  width: min(1760px, calc(100% - 32px));
  flex: none;
  margin-bottom: 10px;
}
.profit-body {
  width: min(1760px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.48fr);
  gap: 10px;
}
.profit-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profit-page .factory-status,
.profit-page .profit-chart,
.profit-page .profit-boards {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}
.profit-page .factory-status { gap: 6px; }
.profit-page .factory-chip { padding: 8px 4px; }
.profit-page .factory-chip span { font-size: 11px; }
.profit-page .factory-chip b { margin-top: 3px; font-size: 18px; }
.profit-chart {
  flex: 1 1 220px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  padding: 8px 8px 6px;
}
.profit-chart .kline-wrap,
.profit-chart .kline-empty {
  flex: 1;
  min-height: 0;
}
.profit-chart .kline { height: 100%; }
.profit-chart .kline-empty { height: auto; }
.profit-boards {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.7fr);
  gap: 8px;
  align-items: start;
  flex: none;
}
.profit-board {
  min-width: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: 10px 8px 8px;
}
.profit-board h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 400;
}
.profit-board .table-wrap { flex: none; overflow: hidden; }
.profit-table .grid {
  table-layout: fixed;
  width: 100%;
}
.profit-table .grid td { text-align: center; height: 22px; padding: 0 3px; font-size: 11px; }
.profit-table .grid td:first-child {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profit-table .grid td:not(:first-child) { width: 34px; }
.profit-week .grid td,
.profit-week .grid td:first-child {
  text-align: center;
}
.profit-week .grid td:first-child { width: 31%; }
.profit-week .grid td:not(:first-child) { width: 23%; }
.profit-table .rank-cell { max-width: 100%; }
.profit-table .profit-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profit-board-strategy .grid td {
  height: auto;
  min-height: 26px;
  padding: 5px 6px;
  font-size: 12px;
  vertical-align: middle;
}
.profit-board-strategy .grid td:first-child {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  line-height: 1.3;
}
.profit-board-strategy .grid td:not(:first-child) { width: 48px; }
.profit-board-strategy .rank-cell {
  align-items: flex-start;
  flex-wrap: wrap;
}
.profit-board-strategy .profit-name {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}
.profit-orders {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: 8px 6px 6px;
}
.profit-orders-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  min-width: 0;
}
.profit-orders-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  flex: none;
}
.profit-order-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.profit-order-filters .range-pick {
  padding: 3px 10px;
  font-size: 12px;
  max-width: 42%;
}
.profit-order-filters .range-pick > button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.profit-orders-head span {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  flex: none;
}
.profit-order-table {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.profit-order-table .grid {
  table-layout: fixed;
  width: 100%;
}
.profit-order-table .grid td {
  text-align: center;
  height: 26px;
  padding: 0 2px;
  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profit-order-table .grid .head td {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--head);
}
html[data-theme="light"] .profit-order-table .grid .head td {
  background: #fff;
}
.profit-order-table .col-name { width: 15.8%; }
.profit-order-table .col-time { width: 9.1%; }
.profit-order-table .col-league { width: 6%; }
.profit-order-table .col-team { width: 9.6%; }
.profit-order-table .col-side { width: 7%; }
.profit-order-table .col-odds { width: 4.5%; }
.profit-order-table .col-score { width: 6.4%; }
.profit-order-table .col-result { width: 5.3%; }
.profit-order-table .col-money { width: 6%; }
.profit-name { display: inline; }
.rank-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}
.rank-medal {
  width: 18px;
  height: 20px;
  flex: none;
}
.rank-medal path,
.rank-medal circle { fill: currentColor; }
.rank-medal text { fill: #fff; font-size: 7.6px; font-weight: 400; }
.rank-medal.is-gold { color: #e2b100; }
.rank-medal.is-silver { color: #9aa4b5; }
.rank-medal.is-bronze { color: #c56a2d; }
.profit-sum td { color: var(--ink); }
html[data-theme="light"] .profit-chart,
html[data-theme="light"] .profit-board,
html[data-theme="light"] .profit-orders {
  background: #fff;
  border: 1px solid rgba(48, 36, 96, 0.16);
  box-shadow: 0 8px 20px rgba(72, 48, 140, 0.08);
}

@media (min-width: 981px) {
  body { overflow: hidden; }
}
@media (max-width: 1200px) and (min-width: 981px) {
  .strategy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .desk { grid-template-columns: 1fr; height: auto; }
  .strategy-page,
  .live-page,
  .profit-page { height: auto; overflow: auto; }
  .profit-body { grid-template-columns: 1fr; }
  .live-page { grid-template-columns: 1fr; }
  .strategy-top,
  .strategy-filters,
  .strategy-grid,
  .factory-status,
  .detail-block,
  .profit-chart,
  .profit-boards,
  .profit-body { width: calc(100% - 32px); }
  .profit-boards { grid-template-columns: 1fr; }
  .profit-order-table { max-height: 420px; }
  .factory-status { gap: 6px; }
  .strategy-page .factory-status { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .factory-chip { padding: 10px 4px; }
  .factory-chip span { font-size: 11px; }
  .factory-chip b { font-size: 18px; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .strategy-filters { grid-template-columns: 1fr 1fr; }
  .strategy-top { flex-direction: column; align-items: flex-start; }
  .strategy-grid { grid-template-columns: 1fr; }
  .rail { border-right: 0; }
  .list { max-height: 360px; }
  .split, .board-grid, .profile-grid { grid-template-columns: 1fr; }
  .league-grid { grid-template-columns: 1fr 1fr; }
  .side.away, .board-grid { text-align: left; }
  .side.away .club { flex-direction: row; }
  .topbar { flex-wrap: wrap; position: relative; }
  .brand-logo { height: 38px; }
  .brand-name { font-size: 16px; letter-spacing: 0.04em; }
  .side h2 { font-size: 24px; }
  .who h2 { font-size: 22px; }
  .menu { order: 3; width: 100%; margin-left: 0; gap: 18px; }
  .orb { display: none; }
  .backdrop { top: 0; z-index: 60; }
  .drawer,
  .drawer.is-strategy {
    top: 0;
    right: 0;
    z-index: 70;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
}
.auth-card {
  width: min(360px, 100%);
  border-radius: 20px;
  padding: 28px 26px 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-logo { width: 36px; height: 36px; display: block; }
.auth-wordmark {
  display: block;
  font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", sans-serif;
  font-weight: 800;
  font-style: oblique 16deg;
  font-synthesis: style;
  font-size: 18px;
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: inherit;
}
.auth-brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
}
.admin-card,
.admin-dialog {
  width: min(440px, 100%);
  border-radius: 24px;
  padding: 28px 24px 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset);
}
.auth-card h1 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 400;
}
.admin-page h1,
.admin-dialog h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 400;
}
.auth-card label,
.admin-form label,
.admin-dialog label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
.auth-card input,
.admin-form input,
.admin-form select,
.admin-dialog input,
.admin-search {
  border: 1px solid var(--line);
  background: var(--glass-strong);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 400;
}
.auth-card input {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(48, 36, 96, 0.07);
  border: 1px solid rgba(48, 36, 96, 0.14);
}
.auth-card input:focus {
  outline: none;
  border-color: var(--water);
}
html[data-theme="dark"] .auth-card input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.auth-actions button[type="submit"] {
  min-width: 36px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--water);
  color: #fff;
  box-shadow: none;
}
html[data-theme="dark"] .auth-actions button[type="submit"] {
  color: #10162a;
}
.auth-card button,
.admin-form button,
.admin-dialog button,
.admin-search {
  font-weight: 400;
}
.auth-actions,
.admin-actions,
.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.auth-error,
.admin-error { color: var(--red); font-size: 13px; min-height: 1.2em; }
.auth-error:empty { display: none; }
.admin-page {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  width: calc(100% - 24px);
  min-height: calc(100vh - var(--chrome) - 36px);
  margin: 12px;
}
.admin-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: calc(100vh - var(--chrome) - 48px);
  padding: 14px 10px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
}
.admin-side-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 400;
}
.admin-side-item.active {
  color: var(--ink);
  background: var(--active);
}
.admin-side-item:hover:not(.active) { color: var(--ink); }
.admin-main { min-width: 0; }
.admin-card { width: 100%; padding: 18px 18px 12px; margin-bottom: 12px; }
.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.admin-form .admin-actions { grid-column: 1 / -1; }
.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 10px;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 13px;
}
.admin-table tr.head td { color: var(--muted); }
.admin-ok { color: var(--green); }
.admin-off { color: var(--red); }
.admin-table button {
  margin-right: 8px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--water);
}
.admin-table button.is-danger { color: var(--red); }
.admin-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(18, 16, 40, 0.46);
}
.admin-mask[hidden] { display: none; }
.admin-dialog { width: min(560px, calc(100% - 32px)); }
.admin-dialog .admin-form { grid-template-columns: 1fr 1fr; }
html[data-theme="light"] .auth-card,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .admin-side,
html[data-theme="light"] .admin-dialog {
  background: #fff;
  border: 1px solid rgba(48, 36, 96, 0.16);
}
.telegram-mask { z-index: 90; }
.telegram-dialog {
  width: min(520px, calc(100% - 32px));
  background: var(--pane);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="dark"] .telegram-dialog {
  background: #16142c;
}
.telegram-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 13px;
}
.telegram-field input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 8px;
  background: rgba(48, 36, 96, 0.07);
  border: 1px solid rgba(48, 36, 96, 0.16);
}
html[data-theme="dark"] .telegram-field input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.telegram-steps {
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}
.telegram-actions {
  justify-content: center;
  gap: 16px;
}
.telegram-actions .theme-btn {
  min-width: 88px;
}
.telegram-actions button[type="submit"] {
  background: var(--water);
  color: #fff;
  border: 0;
  box-shadow: none;
}
html[data-theme="dark"] .telegram-actions button[type="submit"] {
  color: #10162a;
}
html[data-theme="light"] .telegram-dialog {
  background: #fff;
  border: 1px solid rgba(48, 36, 96, 0.16);
}
@media (max-width: 980px) {
  .admin-form { grid-template-columns: 1fr 1fr; }
}
