/* 锐榜 Radar — 浅色数据看板（参考 Linear / 现代 SaaS 仪表盘） */

:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --brand: #6366f1;
  --brand-2: #818cf8;
  --brand-bg: #eef2ff;
  --up: #059669;
  --up-bg: #ecfdf5;
  --down: #e11d48;
  --down-bg: #fff1f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --page-pad: clamp(16px, 3vw, 32px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Top bar */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px var(--page-pad);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  justify-self: start;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.product-switch {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  grid-column: 2;
  justify-self: center;
}

.product-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
}

.product-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

#stake-root.hidden,
#poly-root.hidden,
#radar-root.hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  word-break: break-all;
}

.poly-side {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.poly-side-buy {
  background: var(--up-bg);
  color: var(--up);
}
.poly-side-sell {
  background: var(--down-bg);
  color: var(--down);
}
.poly-side-neutral {
  background: var(--surface-2);
  color: var(--text-2);
}
.poly-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  background: var(--brand-bg);
  color: var(--brand);
}
.poly-tag-resonance {
  background: #fff7ed;
  color: #c2410c;
}
.poly-tag-system {
  background: var(--surface-2);
  color: var(--text-3);
}
.poly-whale strong {
  display: block;
}
.poly-addr {
  display: block;
  font-size: 0.75rem;
  color: var(--text-3);
  font-family: var(--mono);
}
.poly-title {
  max-width: 280px;
  white-space: normal;
  line-height: 1.35;
}
.poly-time {
  white-space: nowrap;
  font-size: 0.8125rem;
}
.poly-detail {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.poly-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.poly-detail-meta {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 0.875rem;
}
.poly-detail-body {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}
.poly-grid td, .poly-grid th {
  vertical-align: top;
}

.status-line {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-3);
  max-width: 50ch;
  text-align: right;
  grid-column: 3;
  justify-self: end;
}

.page {
  flex: 1;
  padding: 20px var(--page-pad) 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.stat-card .stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-card .stat-value.pos {
  color: var(--up);
}
.stat-card .stat-value.neg {
  color: var(--down);
}

/* Promo */
.promo-band {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-bg);
  border: 1px solid #c7d2fe;
  overflow: hidden;
}

.promo-band[hidden] {
  display: none !important;
}

.promo-viewport {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.promo-track {
  display: inline-flex;
  padding: 10px 0;
  white-space: nowrap;
  animation: marquee var(--promo-duration, 28s) linear infinite;
}

.promo-band:hover .promo-track {
  animation-play-state: paused;
}

.promo-track a {
  color: var(--brand);
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0 16px;
}

.promo-track .promo-text {
  color: var(--text-2);
  font-size: 0.82rem;
  margin: 0 16px;
}

.promo-sep {
  color: var(--text-3);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* Alert */
.alert-bar {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--down-bg);
  color: #9f1239;
  border: 1px solid #fecdd3;
  font-size: 0.85rem;
}
.alert-bar.hidden {
  display: none;
}

/* Blocks */
.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.block-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--line);
  border-radius: 999px;
}

.seg button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}

.seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Leaderboard strip */
.lb-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 20px 20px;
  scroll-snap-type: x proximity;
}

.lb-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lb-card:hover {
  border-color: var(--brand-2);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.lb-rank {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.08em;
}

.lb-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 6px;
}

.lb-user {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.lb-amount {
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex-shrink: 0;
}

.lb-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.5;
}

.lb-sub .pos {
  color: var(--up);
  font-weight: 600;
}
.lb-sub .neg {
  color: var(--down);
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.tab {
  border: none;
  background: none;
  padding: 10px 14px;
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab:hover {
  color: var(--text-2);
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.panel-shell {
  min-height: 320px;
}

.panel.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.panel-desc {
  margin: 0;
  padding: 14px 20px 0;
  font-size: 0.82rem;
  color: var(--text-3);
}

/* Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.filter-bar.compact {
  padding: 12px 20px;
}

.filter-bar input,
.filter-bar select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  background: var(--surface);
  color: var(--text);
}

.filter-bar input[type="search"] {
  min-width: 120px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn.solid {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.solid:hover {
  background: #4f46e5;
  color: #fff;
  text-decoration: none;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.grid th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.grid th.num,
.grid td.num {
  text-align: right;
}

.grid td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text);
}

.grid tbody tr:hover td {
  background: #f8fafc;
}

.grid tbody tr:last-child td {
  border-bottom: none;
}

.sport-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--brand-bg);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 600;
}

.player-link {
  font-weight: 600;
  color: var(--text);
}
.player-link:hover {
  color: var(--brand);
}

.player-name {
  font-weight: 600;
}

.player-id {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}

.badge-hidden {
  font-size: 0.75rem;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
}

.bet-id-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.bet-id-muted {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
}

.copy-btn {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  color: var(--text-3);
}

.amount-cell .amount-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.coin-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  vertical-align: middle;
  position: relative;
}

.coin-usdt {
  background: #26a17b;
}
.coin-usdt::after {
  content: "₮";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
}

.coin-usdc {
  background: #2775ca;
}
.coin-usdc::after {
  content: "$";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
}

.badge-risk {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-risk.low {
  background: var(--up-bg);
  color: var(--up);
}
.badge-risk.medium {
  background: #fffbeb;
  color: #b45309;
}
.badge-risk.high {
  background: var(--down-bg);
  color: var(--down);
}

.badge-parlay {
  font-size: 0.68rem;
  font-weight: 600;
  color: #7c3aed;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.pager-text {
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  flex: 1;
}

.empty-row {
  text-align: center;
  padding: 40px 16px !important;
  color: var(--text-3);
}

.pos {
  color: var(--up);
}
.neg {
  color: var(--down);
}

/* Mosaic / stack */
.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 20px;
}

.rec-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.rec-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.rec-card .reason {
  font-size: 0.8rem;
  color: var(--text-2);
  margin: 8px 0;
}

.score-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-bg);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.78rem;
}

.stack {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contrarian-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.contrarian-card h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.contrarian-meta {
  font-size: 0.8rem;
  color: var(--text-2);
}

.contrarian-view-tabs {
  margin-bottom: 0.75rem;
}

.contrarian-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.contrarian-history-stats .stat-card {
  min-width: 5.5rem;
}

.contrarian-result {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.contrarian-result.result-won {
  background: #dcfce7;
  color: #166534;
}

.contrarian-result.result-lost {
  background: #fee2e2;
  color: #991b1b;
}

.contrarian-result.result-pending {
  background: #f1f5f9;
  color: #475569;
}

.contrarian-result.result-other {
  background: #fef9c3;
  color: #854d0e;
}

.contrarian-history-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.contrarian-users {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.84rem;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
}

.duo h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-plain li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.btn-link {
  border: none;
  background: none;
  color: var(--brand);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0;
}
.btn-link.danger {
  color: var(--down);
}

.foot {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--text-3);
}

/* Legacy ingest banner classes from JS */
.ingest-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.ingest-banner.hidden {
  display: none;
}
.ingest-banner-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.ingest-banner:not(.ingest-banner-warn):not(.hidden) {
  background: var(--down-bg);
  color: #9f1239;
  border: 1px solid #fecdd3;
}

@media (max-width: 768px) {
  .filter-actions {
    margin-left: 0;
    width: 100%;
  }
  .duo {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-track {
    animation: none;
  }
}

.fixture-row {
  cursor: pointer;
}
.fixture-row:hover {
  background: var(--surface-2);
}
.fixture-link {
  text-align: left;
  font-weight: 500;
  max-width: 320px;
  white-space: normal;
  line-height: 1.35;
}
.fixture-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(2px);
}
.fixture-modal.hidden {
  display: none !important;
}
.fixture-modal-panel {
  width: min(920px, 100%);
  max-height: min(85vh, 900px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  padding: 16px 18px 18px;
}
.fixture-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.fixture-modal-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.fixture-modal-meta {
  margin: 0;
  color: var(--text-2);
  font-size: 0.875rem;
}
.fixture-modal-body .table-wrap {
  max-height: calc(85vh - 120px);
  overflow: auto;
}
.fixture-bets-grid td,
.fixture-bets-grid th {
  vertical-align: top;
}

.copy-report-bar,
.player-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
}

.copy-pick-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.copy-pick-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.score-pill.muted {
  opacity: 0.65;
}

.smart-money-bar {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.smart-money-head {
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.smart-money-track {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.smart-money-seg {
  flex: 1;
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.copy-status {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-2);
}

.fiat-usd-hint {
  color: var(--text-2);
  font-size: 0.82em;
  white-space: nowrap;
}
