/* MDX 骨架APP — 專業賽馬風格 */
:root {
  --brand-red: #0e7c86;
  --brand-red-dark: #0a5a63;
  --brand-gold: #B8962E;
  --brand-gold-light: #D4A830;
  --bg-dark: #1A1A2E;
  --bg-card: #FFFFFF;
  --bg-card-alt: #F7F8FA;
  --bg-light: #F0F2F5;
  --bg-surface: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #3D3D54;
  --text-muted: #6B6B8A;
  --text-light: #8E8EAE;
  --border: #E8E8EE;
  --border-light: #F0F0F5;
  --odds-up: #DC2626;
  --odds-down: #16A34A;
  --alert-bg: #FFFCF0;
  --alert-border: #D4A830;
  --danger-bg: #FFF5F5;
  --danger-border: #DC2626;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.03);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --font: -apple-system, 'PingFang HK', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: -apple-system, 'PingFang HK', 'PingFang SC', 'Noto Sans SC', serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #F0F2F5;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
}

/* ===== iOS Landscape Support ===== */
@media (orientation: landscape) and (max-height: 480px) {
  body { max-width: 100%; }
  .appbar { padding: calc(4px + var(--safe-top)) 12px 6px; }
  .appbar .logo-icon { font-size: 18px; }
  .appbar .logo-text { font-size: 14px; }
  .appbar .version { display: none; }
  .venue-bar { padding: 6px 12px; }
  .bottom-nav { padding: 2px 0 calc(2px + var(--safe-bottom)); }
  .bottom-nav .nav-item { padding: 3px 0; gap: 1px; }
  .bottom-nav .nav-item .nav-svg { width: 18px; height: 18px; }
  .bottom-nav .nav-item span { font-size: 9px; }
  .race-card { margin: 4px 8px; }
  .race-card .rc-top { padding: 8px 10px; }
  .page-scroll { padding-bottom: 8px; }
  .detail-panel { max-width: 100%; }
  .detail-panel .dp-topbar { padding: calc(6px + var(--safe-top)) 12px 8px; }
  .detail-panel .dp-topbar .dp-title h2 { font-size: 14px; }
  .inline-horse-row { padding: 5px 12px; min-height: 40px; }
  .race-horse-row { padding: 6px 12px; min-height: 44px; }
  .countdown-strip { margin: 4px 8px; padding: 6px 10px; }
  .countdown-strip .cd-time { font-size: 18px; }
  .status-strip { padding: 6px 12px; }
}

/* ===== Splash Screen ===== */
.splash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(150deg, #1A1A2E 0%, #151528 40%, #0F0F20 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease;
}
.splash.hide {
  opacity: 0;
  pointer-events: none;
}
.splash-inner {
  text-align: center;
  padding: 32px;
  width: 100%;
  max-width: 280px;
}
.splash-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}
.splash-icon-md {
  opacity: 0.9;
}
.splash-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.splash-brand {
  font-size: 30px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 4px;
}
.splash-brand-sub {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-gold);
  letter-spacing: 8px;
  margin-top: 0;
}
.splash-ver {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 8px;
  letter-spacing: 1.5px;
}
.splash-progress {
  width: 160px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin: 0 auto 12px;
  overflow: hidden;
}
.splash-bar {
  height: 100%;
  width: 0%;
  background: var(--brand-gold);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.splash-msg {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
/* ===== App Bar ===== */
.appbar {
  background: linear-gradient(135deg, #0e7c86, #0a5a63);
  color: #FFF;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
}
.appbar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.appbar .logo-icon { font-size: 22px; }
.appbar .logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.appbar .logo-text .gold { color: var(--brand-gold); }
.appbar .version {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 1px;
}
.appbar .update-time {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}

/* ===== Venue Bar ===== */
.venue-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.venue-bar .date-main {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.venue-bar .venue-tag {
  background: var(--brand-red);
  color: #FFF;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.venue-bar .race-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Download Bar ===== */
.download-bar {
  background: linear-gradient(135deg, #FFFBEB, #FFF8E1);
  border-bottom: 2px solid var(--brand-gold);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  animation: slideDown 0.35s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.download-title {
  font-size: 14px;
  font-weight: 700;
  color: #B8860B;
}
.download-detail {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
}
.download-btn {
  background: var(--brand-gold);
  color: #1a1a1a;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.download-btn:active { transform: scale(0.96); }
.download-btn.loading { opacity: 0.6; pointer-events: none; }
.dl-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Download Progress */
.dl-progress-wrap {
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dl-progress-bar {
  height: 4px;
  background: #E5E5E5;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.dl-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-red));
  border-radius: 2px;
  transition: width 0.4s ease;
}
.dl-progress-text {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== Status Strip ===== */
.status-strip {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.status-tag {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.status-tag.red { color: var(--brand-red); border-color: #FECACA; background: #FEF2F2; }
.status-tag.green { color: #16A34A; border-color: #BBF7D0; background: #F0FDF4; }
.status-tag.gold { color: #B8860B; border-color: #FDE68A; background: #FFFBEB; }
.status-tag.gold.vip-reg-btn { 
  color: #fff; 
  border-color: var(--brand-gold); 
  background: linear-gradient(135deg, #D4AF37, #B8860B);
  animation: vipPulse 2s ease-in-out infinite;
  font-weight: 600;
}
.status-tag.gold.vip-reg-btn:active { 
  transform: scale(0.95); 
  opacity: 0.9;
}
@keyframes vipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0); }
}

/* ===== Countdown Strip ===== */
.countdown-strip {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 4px solid var(--brand-red);
  margin: 8px 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  flex-shrink: 0;
}
.countdown-strip .cd-race { font-weight: 700; }
.countdown-strip .cd-time {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-red);
  font-variant-numeric: tabular-nums;
}
.countdown-strip .cd-note { font-size: 11px; color: var(--text-secondary); }

/* ===== Page Container ===== */
.page-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-page {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.tab-page.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.tab-page.exit-left {
  opacity: 0;
  transform: translateX(-20px);
}
.tab-page.exit-right {
  opacity: 0;
  transform: translateX(20px);
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

/* Pull-to-refresh */
.pull-indicator {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
  display: none;
}
.pull-indicator.show { display: block; }
.pull-indicator .pull-icon {
  font-size: 22px;
  transition: transform 0.2s;
}
.pull-indicator.pulling .pull-icon { transform: rotate(180deg); }

/* ===== Race Card ===== */
.race-card {
  background: var(--bg-surface);
  margin: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  animation: cardIn 0.3s ease backwards;
}
.race-card:active { transform: scale(0.985); background: var(--bg-light); }
.race-card.allweather { border-left: 4px solid #F59E0B; }
.race-card.g1 { border-left: 4px solid var(--brand-gold); }
.race-card:not(.allweather):not(.g1) { border-left: 4px solid var(--brand-red); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.race-card .rc-top {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.race-card .rc-race-no {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-red);
  min-width: 48px;
}
.race-card.allweather .rc-race-no { color: #F59E0B; }
.race-card.g1 .rc-race-no { color: var(--brand-gold); }

.race-card .rc-info { flex: 1; margin-left: 6px; }
.race-card .rc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.race-card .rc-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.race-card .rc-countdown {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-red);
  text-align: right;
}
.race-card .rc-countdown.future { color: var(--text-secondary); }
.race-card .rc-countdown.passed { color: var(--text-muted); }

.race-card .rc-picks {
  padding: 0 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pick-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
}
.pick-chip.star {
  color: #B8860B;
  background: #FFFBEB;
  border-color: #FDE68A;
}
.pick-chip.top {
  color: #1D4ED8;
  background: #EFF6FF;
  border-color: #BFDBFE;
}
.pick-chip.dark {
  color: var(--text-secondary);
  background: var(--bg-light);
  border-color: var(--border);
}

/* ===== Alert Banners ===== */
.alert-banner {
  margin: 8px 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-banner.swap {
  background: var(--alert-bg);
  border-color: var(--brand-gold);
  color: #B8860B;
}
.alert-banner.banker {
  background: var(--danger-bg);
  border-color: var(--brand-red);
  color: var(--brand-red);
}
.alert-banner .alert-action {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.alert-banner.swap .alert-action { background: var(--brand-gold); color: #1a1a1a; }
.alert-banner.banker .alert-action { background: var(--brand-red); color: #FFF; }

/* ===== Detail Panel ===== */
.detail-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-surface);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  max-width: 480px;
  margin: 0 auto;
}

/* iOS横屏时detail panel全宽 */
@media (orientation: landscape) and (max-height: 480px) {
  .detail-panel { max-width: 100%; }
}
.detail-panel.open { transform: translateX(0); }

.detail-panel .dp-topbar {
  position: sticky;
  top: 0;
  background: var(--brand-red);
  color: #FFF;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}
.dp-topbar .dp-back {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #FFF;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dp-topbar .dp-title h2 { font-size: 16px; font-weight: 700; }
.dp-topbar .dp-title .dp-sub { font-size: 11px; color: rgba(255,255,255,0.8); }
.dp-body { padding: 0 0 40px; }

.detail-alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.detail-alert.swap { background: #FFFBEB; border-color: var(--brand-gold); color: #B8860B; }
.detail-alert.banker { background: #FEF2F2; border-color: var(--brand-red); color: var(--brand-red); }
.detail-alert.countdown { background: var(--bg-light); border-color: var(--text-muted); color: var(--text-secondary); }

/* ===== Race Dots Bar (global) ===== */
.race-dots-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 100;
}
.race-dots-bar::-webkit-scrollbar { display: none; }
.race-dot {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #1a1a1a;
}
.race-dot.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(196,30,58,0.2);
}
.race-dot.past {
  background: #CCC;
  border-color: #CCC;
  color: #888;
}

/* Inline race detail */
.inline-race-detail {
  background: var(--bg-surface);
  margin-bottom: 4px;
}
.inline-race-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid #F0F0F0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-race-header .race-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-red);
}
.inline-race-header .race-meta {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
  flex: 1;
}
.detail-btn {
  font-size: 11px;
  font-weight: 700;
  color: #0e7c86;
  background: #FFF8E1;
  border: 1.5px solid #D4AF37;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.detail-btn:hover { background: #FFE082; }
.inline-horse-row {
  display: grid;
  grid-template-columns: 28px 1fr 52px 40px;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #F8F8F8;
  min-height: 52px;
  font-size: 13px;
}
.inline-horse-row.pick {
  background: #FFFBF5;
  border-left: 3px solid var(--brand-gold);
}
.inline-horse-no {
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}
.inline-horse-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.inline-horse-info {
  font-size: 11px;
  color: #555;
}
/* 馬匹狀態近況三級指示（綠/黃/橙）— 獨立參考層 */
.hs-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,.10);
}
.hs-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: #666;
  padding: 6px 10px;
  background: #FAFAFA;
  border-bottom: 1px solid #EEE;
}
.hs-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
/* 狀態 × 大熱 交叉訊號（斗心 proxy） */
.hs-cross {
  position: relative;
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  padding: 1px 6px;
  border: 1px solid;
  border-radius: 8px;
  cursor: help;
  background: #FFF;
}
.hs-cross .hs-tip {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 30;
  display: none;
  width: 210px;
  padding: 6px 8px;
  background: #222;
  color: #FFF;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  border-radius: 6px;
}
.hs-cross:hover .hs-tip { display: block; }
/* 場次級狀態策略橫幅（熱錢效應 → 冷門價值位） */
.hs-strategy {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #FFFDF5;
  border: 1px solid #F0E0B0;
  border-left: 4px solid #F9A825;
  border-radius: 6px;
}
.hs-strategy.soft {
  background: #FFF5F5;
  border-color: #F3C6C6;
  border-left-color: #C62828;
}
/* 「可選腳」標籤（大熱但狀態不佳）— 只顯示四個字，唔展開分析（Dan 2026-09-12） */
.hs-cross.hs-optional { cursor: default; font-weight: 700; }
/* 每場 4 匹定案：首選 1 + 腳 2 + 冷敲 1 */
.picks4 {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #FFFBF2;
  border: 1px solid #EAD9A8;
  border-left: 4px solid #C41E3A;
  border-radius: 6px;
}
.picks4-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #8A6D1F;
  margin-bottom: 5px;
}
.picks4-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #222;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid #DDD;
  background: #FFF;
}
.pk-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
}
.pk-star { border-color: #C41E3A; background: #FFF3F5; }
.pk-star .pk-badge { background: #C41E3A; color: #FFF; }
.pk-leg { border-color: #D4AF37; }
.pk-leg .pk-badge { background: #D4AF37; color: #3A2E00; }
.pk-cold { border-color: #1565C0; background: #F2F7FD; }
.pk-cold .pk-badge { background: #1565C0; color: #FFF; }
.pk-odds { font-size: 11px; color: #888; font-weight: 400; }
.pk-opt {
  font-size: 10px;
  font-weight: 700;
  color: #EF6C00;
  border: 1px solid #EF6C00;
  border-radius: 6px;
  padding: 0 4px;
  background: #FFF7F0;
}
.inline-horse-score {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--brand-red);
}
.inline-horse-odds {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.inline-horse-odds.hot { color: #2E7D32; }
.inline-horse-odds.cold { color: #555; }

/* ===== HKJC-style Race Card (detail view) ===== */
.detail-panel .race-selector {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #F8F8F8;
  border-bottom: 1px solid #E5E5E5;
  scrollbar-width: none;
}
.detail-panel .race-selector::-webkit-scrollbar { display: none; }

.race-selector-item {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid #DDD;
  background: #FFF;
  color: #333;
  transition: all 0.15s;
}
.race-selector-item.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #FFF;
}
.race-selector-item.past {
  background: #EEE;
  border-color: #DDD;
  color: #555;
}

.race-info-header {
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid #F0F0F0;
}
.race-info-date {
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}
.race-info-main {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}
.race-info-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-red);
  margin-top: 4px;
}

/* Horse list - HKJC style */
.race-horse-list {
  background: var(--bg-surface);
}
.race-horse-row {
  display: grid;
  grid-template-columns: 32px 1fr 55px 32px 40px 24px;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #F5F5F5;
  min-height: 64px;
}
.race-horse-row:last-child { border-bottom: none; }

.horse-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.horse-info { min-width: 0; }
.horse-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.horse-jockey {
  font-size: 12px;
  color: #333;
  margin-top: 2px;
}
.horse-trainer {
  font-size: 11px;
  color: #555;
}

.horse-odds {
  text-align: center;
}
.horse-odds-box {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  min-width: 36px;
  text-align: center;
}
.horse-odds-box.hot {
  background: #E8F5E9;
  color: #2E7D32;
}
.horse-odds-box.normal {
  color: var(--text-primary);
}
.horse-odds-box.cold {
  color: #555;
}

.horse-draw {
  text-align: center;
  font-size: 14px;
  color: #333;
}

.horse-weight {
  text-align: center;
  font-size: 13px;
  color: #555;
}

.horse-arrow {
  text-align: right;
  color: #CCC;
  font-size: 14px;
}

/* Column headers */
.race-list-header {
  display: grid;
  grid-template-columns: 32px 1fr 55px 32px 40px 24px;
  gap: 8px;
  padding: 8px 16px;
  background: #FAFAFA;
  border-bottom: 1px solid #EEE;
  font-size: 11px;
  color: #1a1a1a;
  font-weight: 600;
}
.race-list-header span { text-align: center; }
.race-list-header span:first-child { text-align: center; }
.race-list-header span:nth-child(2) { text-align: left; padding-left: 0; }

/* ===== Top6 候选池 (同程4信号) ===== */
.top6-candidates {
  margin: 6px 12px;
  background: #F9F6F0;
  border: 1px solid #E8DFC8;
  border-radius: 8px;
  overflow: hidden;
}
.top6-title {
  font-size: 11px; font-weight: 700;
  padding: 6px 10px;
  background: #F0E8D8;
  color: #8B7355;
}
.top6-list {
  padding: 4px 0;
}
.t6-horse {
  display: flex; align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  gap: 4px;
}
.t6-horse.selected {
  background: rgba(212, 175, 55, 0.08);
}
.t6-horse.dropped {
  opacity: 0.55;
}
.t6-rank {
  width: 18px; text-align: right;
  color: #999; font-size: 10px;
}
.t6-no {
  width: 24px; font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}
.t6-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t6-score {
  width: 32px; text-align: right;
  font-weight: 600; color: var(--brand-gold);
  font-size: 11px;
}
.t6-odds {
  width: 38px; text-align: right;
  color: #666; font-size: 10px;
}
.t6-badge {
  font-size: 9px; padding: 1px 5px;
  border-radius: 8px; font-weight: 700;
  margin-left: 2px;
}
.t6-badge.star { background: #D4AF37; color: #fff; }
.t6-badge.pick { background: #22C55E; color: #fff; }
.t6-badge.drop { background: #CCC; color: #666; }

/* ===== Odds Table ===== */
.odds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.odds-table thead th {
  background: #F7F7F7;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  border-bottom: 2px solid var(--border);
}
.odds-table tbody td {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid #F0F0F0;
  color: var(--text-primary);
}
.odds-table tbody tr:last-child td { border-bottom: none; }
.odds-table tbody tr:active { background: var(--bg-light); }
.odds-table .horse-col { text-align: left; font-weight: 600; }
.odds-table .rank-1 td { background: #FFFBEB; }
.odds-table .rank-1 { font-weight: 700; }

.odds-move {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
}
.odds-move.up { color: var(--odds-up); }
.odds-move.down { color: var(--odds-down); }
.odds-move.stable { color: var(--text-muted); }
.odds-change-pct { font-size: 10px; margin-left: 2px; }
.score-val {
  font-weight: 700;
  color: var(--brand-gold);
  font-size: 14px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); }
.empty-state .state-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 28px;
  background: var(--brand-red);
  color: #FFF;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.empty-state .state-btn:active { opacity: 0.8; }

/* ===== Odds View ===== */
.odds-page { padding: 0 12px; }
.odds-page .section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--brand-gold);
  display: inline-block;
}

.odds-race-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}
.odds-race-row.odds-race-focus {
  border: 2px solid var(--brand-gold);
  background: #FFFDF5;
  box-shadow: 0 2px 12px rgba(212,175,55,0.15);
}
.odds-race-row .orr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.odds-race-row .orr-title { font-weight: 700; font-size: 14px; }
.odds-race-row .orr-time { font-size: 12px; color: var(--text-primary); }
.orr-badge { font-size: 10px; color: var(--brand-gold); font-weight: 700; background: #FFF8E1; padding: 2px 8px; border-radius: 10px; }

.mini-odds-list { font-size: 12px; }
.mini-odds-item {
  display: grid; grid-template-columns: 22px 28px 1fr 38px 60px 28px;
  gap: 4px; align-items: center; padding: 4px 0;
  border-bottom: 1px solid #F5F5F5;
}
.mini-odds-item:last-child { border-bottom: none; }
.mini-odds-item .mo-rank { font-size: 11px; text-align: center; }
.mini-odds-item .mo-no { font-weight: 700; color: var(--text-secondary); font-size: 11px; }
.mini-odds-item .mo-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mini-odds-item .mo-score { font-size: 10px; color: #555; text-align: right; }
.mini-odds-item .mo-odds { font-weight: 700; text-align: right; font-size: 11px; }

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: relative;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 150;
  flex-shrink: 0;
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.bottom-nav .nav-item.active { color: var(--brand-red); }
.bottom-nav .nav-item .nav-svg { width: 22px; height: 22px; }

.nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(22px);
  background: #EF4444;
  color: #FFF;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  text-align: center;
  padding: 0 5px;
}

/* ===== "我的" Page ===== */
.mine-page { padding: 16px; }
.mine-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.mine-card .mine-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.mine-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F5F5F5;
  cursor: pointer;
  font-size: 14px;
}
.mine-row:last-child { border-bottom: none; }
.mine-row:active { opacity: 0.7; }
.mine-row .mine-label { font-weight: 500; }
.mine-row .mine-value { color: var(--text-secondary); font-size: 13px; }
.mine-row .mine-arrow { color: var(--text-muted); font-size: 12px; }

.mine-action-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--brand-red);
  color: #FFF;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
.mine-action-btn:active { opacity: 0.8; }
.mine-action-btn.gold { background: var(--brand-gold); color: #1a1a1a; }

/* ===== Refresh Bar ===== */
.refresh-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.refresh-bar:active { background: var(--bg-light); }
.refresh-bar .refresh-btn {
  background: var(--brand-red);
  color: #FFF;
  border: none;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Toast ===== */
.toast-float {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,26,26,0.9);
  color: #FFF;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 1.8s forwards;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== Install Banner ===== */
.install-banner {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.install-banner .install-btn {
  background: var(--brand-gold);
  color: #1a1a1a;
  border: none;
  padding: 8px 16px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== Offline Banner ===== */
.offline-banner {
  background: #FFF0F0;
  color: var(--brand-red);
  text-align: center;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  display: none;
}
.offline-banner.show { display: block; }

/* ===== Utility ===== */
.flex-spacer { flex: 1; }

/* Scrollbar */
.page-scroll::-webkit-scrollbar { width: 0; }

/* ===== Login Overlay ===== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.login-card {
  background: #FFF;
  border-radius: 20px;
  padding: 32px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: loginIn 0.35s cubic-bezier(0.4,0,0.2,1);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo-md { margin-bottom: 12px; opacity: 0.85; }
.login-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; letter-spacing: 1px; }
.login-title::after { content: none; }
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }

.login-info {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-free-tip {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px;
  background: #FFF;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.login-vip-tip {
  font-size: 13px;
  color: #B8860B;
  font-weight: 700;
  padding: 8px;
  background: #FFFBEB;
  border-radius: 8px;
  border: 1px solid #FDE68A;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 4px;
  font-family: var(--font);
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--brand-gold); }

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--brand-red);
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  letter-spacing: 1px;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--brand-red-dark); }
.login-btn:active { opacity: 0.85; }

.login-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}
.login-skip:active { color: var(--text-primary); }

.login-error {
  color: var(--brand-red);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  min-height: 18px;
}

/* ===== VIP Badge ===== */
.vip-badge {
  background: linear-gradient(135deg, var(--brand-gold), #C9A030);
  color: #1a1a1a;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* ===== Upgrade Banner ===== */
.upgrade-banner {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  animation: slideDown 0.4s ease;
}
.upgrade-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #FFF;
  font-size: 13px;
  font-weight: 600;
}
.upgrade-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}
.upgrade-btn {
  background: var(--brand-gold);
  color: #1a1a1a;
  border: none;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.upgrade-btn:active { opacity: 0.8; }

/* ===== Hot Signal Banner (高分+热钱+临场急跌) ===== */
.hot-signal {
  margin: 4px 0; padding: 6px 10px; border-radius: 6px;
  font-size: 11px; display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.hot-signal.emergency {
  background: #e0f2f4; border: 2px solid #0e7c86;
  animation: pulse-emergency 1s infinite;
}
.hot-signal.suggest {
  background: #e9f5f6; border: 1px solid #0e7c86;
  animation: pulse 2s infinite;
}
.hot-signal.picked {
  background: #FFFBF0; border: 1px solid #D4AF37;
}
.hot-signal.warm {
  background: #FFFFF5; border: 1px solid #EAB308;
}
.hot-signal .hs-icon { font-size: 14px; flex-shrink: 0; }
.hot-signal .hs-detail { flex: 1; min-width: 180px; }
.hot-signal .hs-reason { font-size: 9px; color: #555; white-space: nowrap; }
.hot-signal.emergency .hs-detail strong { color: #0e7c86; font-size: 13px; }
.hot-signal.suggest .hs-detail strong { color: #0e7c86; }
.hot-signal.picked .hs-detail strong { color: #D4AF37; }
.hot-signal.warm .hs-detail strong { color: #EAB308; }
/* R8+ 过关飞标记: 虚线边框+半透明 */
.hot-signal.allup {
  opacity: 0.7;
  border-style: dashed;
}
.hot-signal.emergency.allup {
  background: #e0f2f4;
  border: 2px dashed #0e7c86;
}
.hot-signal.warm.allup {
  border: 1px dashed #D97706;
}
.hot-signal.allup-zone-warn {
  margin: 2px 0; padding: 4px 10px; border-radius: 4px;
  background: #FFF8EB; border: 1px dashed #D97706;
  display: flex; justify-content: space-between; align-items: center;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
@keyframes pulse-emergency {
  0%, 100% { opacity: 1; border-color: #0e7c86; }
  50% { opacity: 0.7; border-color: #FF6B6B; }
}
.race-card.locked {
  opacity: 0.5;
  border-left: 4px solid var(--text-muted);
  filter: blur(1px);
  pointer-events: none;
  position: relative;
}
.race-card.locked::after {
  content: '🔒 会员专属';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: var(--brand-gold);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  z-index: 1;
}

.race-card.locked:not(::after) {
  pointer-events: auto;
}

/* Lock divider */
.lock-divider {
  text-align: center;
  padding: 16px;
  margin: 4px 12px;
  background: linear-gradient(to right, transparent, #F0F0F0, transparent);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
}
.lock-divider::before,
.lock-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border);
}
.lock-divider::before { left: 0; }
.lock-divider::after { right: 0; }

/* ===== 大手升跌 Monitor (坚仔风格) ===== */
.monitor-page { padding: 8px 0 80px; --text-muted: #222222; }
.monitor-page .monitor-header-bar { color: #222 !important; }
.monitor-page .mv-time { color: #222 !important; }
.monitor-page .mv-race-info { color: #222 !important; }
.monitor-page .mv-horses { color: #111 !important; }
.monitor-page .mv-horses .arr { color: #222 !important; }
.monitor-page .mv-horses .strike { color: #666 !important; }
.monitor-page .mv-odds-old { color: #666 !important; }
.monitor-page .mv-change-label { color: #222 !important; }
.monitor-page .mv-odds-cur { color: #111 !important; }
.monitor-page .mv-odds-dir { color: #111 !important; }
.monitor-page .mv-group-header { color: #222 !important; }

.monitor-stats {
  display: flex; gap: 6px; margin: 0 12px 10px;
  flex-wrap: wrap;
}
.monitor-stat {
  flex: 1; min-width: 55px; background: var(--bg-panel);
  border-radius: 8px; padding: 8px 6px; text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.monitor-stat-num { font-size: 20px; font-weight: 800; }
.monitor-stat-label { font-size: 9px; color: var(--text-muted); margin-top: 1px; }
.monitor-stat.num-down .monitor-stat-num { color: #16A34A; }
.monitor-stat.num-up .monitor-stat-num { color: #0e7c86; }
.monitor-stat.num-warn .monitor-stat-num { color: #EA580C; }

.monitor-header-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 12px 8px; font-size: 11px; color: var(--text-muted);
}
.monitor-header-bar button {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 3px 10px; border-radius: 12px; font-size: 10px; cursor: pointer;
}

/* Pool filter tabs */
.monitor-filter {
  display: flex; gap: 4px; margin: 0 12px 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.monitor-filter-btn {
  padding: 5px 14px; border-radius: 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--brand-red); background: #fff; color: var(--brand-red);
  white-space: nowrap; transition: all 0.15s;
}
.monitor-filter-btn.active { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }
.monitor-filter-btn .count { font-size: 11px; opacity: 0.75; }

/* Movement card — Kinboy style */
.mv-group { margin-bottom: 6px; }
.mv-group-header {
  margin: 0 12px 4px; padding: 4px 10px;
  background: #F5F5F5; border-radius: 6px;
  font-size: 12px; font-weight: 700; color: #555;
}
/* R8+ 过关飞高发区 warning */
.mv-group-header.allup {
  background: #FFF8EB; border: 1px dashed #D97706;
  color: #92400E;
}
/* 🔴 同步检测确认: 全场>33%马同步跌 → 高度确信过关飞 */
.mv-group-header.allup-sync {
  background: #e0f2f4; border: 2px solid #0e7c86;
  color: #0a5a63;
}
.mv-card {
  background: var(--bg-panel); margin: 0 12px 8px;
  border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border-left: 3px solid transparent;
  display: grid; grid-template-columns: 55px 42px 1fr 60px 45px;
  gap: 6px; align-items: center;
  font-size: 12px;
}
.mv-card.big { border-left-color: #EA580C; background: #FFFBF5; }
.mv-card.hot { border-left-color: #16A34A; }
/* R8+ 过关飞标记: 虚线边框+半透明 */
.mv-card.allup {
  border-left-style: dashed;
  opacity: 0.65;
  background: #FEFEFE;
}
.mv-card.allup.big { border-left-color: #D97706; }
.mv-card.allup.hot { border-left-color: #D97706; }
/* 🔴 同步检测: 过关飞确认 → 更强标记 */
.mv-card.sync-allup {
  border-left-style: solid;
  opacity: 0.55;
  background: #FFF5F5;
}
.mv-card.sync-allup.big { border-left-color: #0e7c86; }
.mv-card.sync-allup.hot { border-left-color: #0e7c86; }

.mv-time { font-size: 10px; color: var(--text-muted); }
.mv-pool {
  font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 700;
  text-align: center; white-space: nowrap;
}
.mv-pool.win { background: #EBF5FF; color: #2563EB; }
.mv-pool.qin { background: #FEF3C7; color: #D97706; }
.mv-pool.qpl { background: #EDE9FE; color: #7C3AED; }

.mv-detail { display: flex; flex-direction: column; gap: 1px; }
.mv-race-info { font-size: 10px; color: var(--text-muted); }
.mv-horses { font-weight: 700; font-size: 13px; }
.mv-horses .strike { text-decoration: line-through; color: var(--text-muted); font-size: 10px; margin-right: 4px; }
.mv-horses .arr { color: var(--text-muted); margin: 0 2px; }

.mv-odds { text-align: right; }
.mv-odds-old { font-size: 10px; color: var(--text-muted); text-decoration: line-through; }
.mv-odds-cur { font-weight: 700; }
.mv-odds-dir { font-size: 9px; }

.mv-change { text-align: right; }
.mv-change-val { font-weight: 700; font-size: 14px; }
.mv-change-label { font-size: 9px; color: var(--text-muted); }

.mv-empty { 
  text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px;
}
.mv-empty .em-icon { font-size: 36px; margin-bottom: 8px; }

/* Threshold toggle */
.mv-threshold {
  display: flex; align-items: center; gap: 6px; margin: 4px 12px 8px;
  font-size: 10px; color: var(--text-muted);
}
.mv-threshold select {
  padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border);
  font-size: 10px; background: #fff;
}

/* ===== 资讯页 功能入口 ===== */
.info-links {
  display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding: 2px 0;
}
.info-link {
  flex-shrink: 0; padding: 8px 14px; border-radius: 18px; font-size: 12px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
  border: 1.5px solid var(--brand-red); background: #fff; color: var(--brand-red);
  text-decoration: none; transition: all 0.15s;
}
.info-link:active { background: var(--brand-red); color: #fff; }

/* ===== 关于模型 ===== */
.about-panel {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px; margin-bottom: 14px; font-size: 12px; color: #3d3d54; line-height: 1.7;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.about-panel h4 { color: var(--brand-red); font-size: 13px; margin-bottom: 6px; }
.about-panel .close-about {
  float: right; background: none; border: 1px solid var(--brand-red);
  color: var(--brand-red); border-radius: 12px; padding: 2px 10px; font-size: 11px; cursor: pointer;
}

/* ===== 赛日统计 Page ===== */
.stats-page { padding: 16px; }
.stats-header {
  text-align: center;
  margin-bottom: 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--brand-red), #8B1A1A);
  border-radius: var(--radius);
  color: #fff;
}
.stats-header-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.stats-header-sub { font-size: 12px; opacity: 0.8; }

.stats-summary {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}
.stats-summary-item {
  text-align: center;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--shadow-sm);
  flex: 1;
  margin: 0 4px;
}
.stats-summary-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-red);
  line-height: 1.2;
}
.stats-summary-item span:last-child {
  font-size: 11px;
  color: var(--text-muted);
}

.stats-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.stats-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s;
}
.stats-tab.active {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
}

.stats-block {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.stats-block-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.stats-th {
  padding: 6px 4px;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.stats-td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid #F5F5F5;
  color: var(--text-primary);
}
.stats-td strong { color: var(--brand-red); font-size: 13px; }
.stats-draw-ok { color: var(--text-primary); }
.stats-win { color: var(--brand-red); }

.stats-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.stats-empty .em-icon { font-size: 36px; margin-bottom: 8px; }
.stats-empty h3 { font-size: 16px; color: var(--text-primary); margin: 8px 0; }
.stats-empty p { font-size: 12px; margin-bottom: 16px; }

.stats-result-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F5F5F5;
  cursor: pointer;
  transition: background 0.15s;
}
.stats-result-row:active { background: #F9F9F9; }
.stats-result-row:last-child { border-bottom: none; }
.stats-result-race {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-red);
  min-width: 36px;
}
.stats-result-horses {
  font-size: 12px;
  color: var(--text-primary);
  margin-left: 8px;
}

/* ===== 閘前精選卡片 (Gate Selection) ===== */
.gate-selection {
  margin: 10px 12px;
  background: #FFFDF5;
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gs-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(135deg, #FFF8E1, #FFFDF5);
  cursor: pointer;
  user-select: none;
}
.gs-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-red);
}
.gs-subtitle {
  font-size: 10px;
  color: #999;
  margin-left: 8px;
  flex: 1;
}
.gs-toggle {
  font-size: 11px;
  color: #999;
}
.gs-body {
  padding: 0 12px 10px;
}
.gs-row {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  margin-top: 4px;
}
.gs-row.selected {
  background: linear-gradient(135deg, #FFF8E1, #FFFDF5);
  border: 1px solid var(--brand-gold);
}
.gs-row.dimmed {
  opacity: 0.5;
}
.gs-no {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-red);
  min-width: 28px;
}
.gs-info {
  flex: 1;
  min-width: 0;
}
.gs-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-detail {
  font-size: 10px;
  color: #888;
  margin-top: 1px;
}
.gs-score {
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-gold);
  min-width: 40px;
  text-align: right;
}
.gs-score.muted {
  color: #bbb;
}
.gs-divider {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}
.gs-legend {
  margin-top: 8px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 8px;
  font-size: 11px;
}
.gs-sig-row {
  display: flex;
  margin-bottom: 3px;
}
.gs-sig-label {
  color: #666;
  min-width: 90px;
  flex-shrink: 0;
}
.gs-sig-horses {
  color: #888;
  line-height: 1.4;
}
.gs-sig-horse {
  display: inline;
}
.gs-sig-horse.active {
  color: var(--brand-red);
  font-weight: 600;
}
.gs-legend-toggle {
  font-size: 10px;
  color: var(--brand-gold);
  text-align: center;
  margin-top: 6px;
  cursor: pointer;
}

/* ===== Factor Breakdown Modal ===== */
.scores-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.scores-modal-card {
  background: #FFF;
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
.scores-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #F0F0F0;
  position: sticky;
  top: 0;
  background: #FFF;
  z-index: 1;
}
.scores-modal-header span {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.scores-modal-close {
  background: #F5F5F5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}
.scores-modal-body {
  padding: 16px 20px 20px;
}

/* Factor bar items */
.factor-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F5F5F5;
}
.factor-item:last-child { border-bottom: none; }
.factor-label {
  width: 80px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  flex-shrink: 0;
}
.factor-bar-wrap {
  flex: 1;
  height: 10px;
  background: #F0F0F0;
  border-radius: 5px;
  overflow: hidden;
  margin: 0 10px;
}
.factor-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}
.factor-score {
  width: 44px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.factor-weight {
  width: 40px;
  text-align: right;
  font-size: 11px;
  color: #999;
}

/* Summary row in modal */
.scores-summary {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 8px;
  margin-top: 8px;
  border-top: 2px solid var(--brand-red);
  font-size: 15px;
  font-weight: 700;
}
.scores-summary-label { color: #333; }
.scores-summary-value { color: var(--brand-red); }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Score raw value tooltip */
.factor-raw {
  font-size: 10px;
  color: #BBB;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
