/* ==========================================
   超级大乐透 · 数据分析与智能预测
   Design System & Component Styles
   ========================================== */

/* ========== CSS Variables ========== */
:root {
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-ball: 0 6px 16px rgba(0, 0, 0, 0.35);

  /* Font */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========== Theme Configurations ========== */
/* 1. Super Lotto Theme (Emerald Dark Green) */
/* ========== Theme Configurations ========== */
/* 1. Default & Super Lotto Theme (Emerald Dark Green) */
:root,
body,
body.theme-dlt {
  --bg-primary: #060a08;
  --bg-secondary: #0c120f;
  --bg-tertiary: #131d18;
  --card-bg: rgba(12, 18, 15, 0.5);
  --card-bg-hover: rgba(19, 29, 24, 0.65);
  --card-border: rgba(0, 255, 157, 0.08);
  --card-border-hover: rgba(0, 255, 157, 0.22);

  --text-primary: #f0f7f4;
  --text-secondary: #a4b8ad;
  --text-muted: #728a7e;

  --accent: #00ff9d;
  --accent-dim: rgba(0, 255, 157, 0.12);

  --front-start: #ff4d4f;
  --front-end: #cf1322;
  --front-glow: rgba(255, 77, 79, 0.3);
  --back-start: #1890ff;
  --back-end: #096dd9;
  --back-glow: rgba(24, 144, 255, 0.3);

  --hot: #ff4d4f;
  --cold: #1890ff;
  --warm: #faad14;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;

  --shadow-glow-front: 0 0 16px rgba(255, 77, 79, 0.22);
  --shadow-glow-back: 0 0 16px rgba(24, 144, 255, 0.22);
}

/* 2. PL3 Theme (Amber Wealth Gold) */
body.theme-pl3 {
  --bg-primary: #0f0c08;
  --bg-secondary: #17120c;
  --bg-tertiary: #221a11;
  --card-bg: rgba(23, 18, 12, 0.55);
  --card-bg-hover: rgba(34, 26, 17, 0.7);
  --card-border: rgba(251, 191, 36, 0.08);
  --card-border-hover: rgba(251, 191, 36, 0.22);

  --text-primary: #fbf9f5;
  --text-secondary: #c9bfb1;
  --text-muted: #8c8273;

  --accent: #ffb700;
  --accent-dim: rgba(255, 183, 0, 0.12);

  --front-start: #ffb700;
  --front-end: #e65c00;
  --front-glow: rgba(255, 183, 0, 0.3);
  --back-start: #facc15;
  --back-end: #ca8a04;
  --back-glow: rgba(250, 204, 21, 0.25);

  --hot: #ff3b30;
  --cold: #007aff;
  --warm: #ffb700;
  --success: #ffacc8;
  --warning: #ffb700;
  --danger: #ff3b30;

  --shadow-glow-front: 0 0 16px rgba(255, 183, 0, 0.22);
  --shadow-glow-back: 0 0 16px rgba(250, 204, 21, 0.2);
}

/* 3. World Cup Theme (Tri-Nation Fusion - US Blue, Canada Red, Mexico Green) */
body.theme-worldcup {
  --bg-primary: #070b14;
  --bg-secondary: #0d1222;
  --bg-tertiary: #141b33;
  --card-bg: rgba(13, 18, 34, 0.5);
  --card-bg-hover: rgba(20, 27, 51, 0.65);
  --card-border: rgba(255, 71, 87, 0.12);
  --card-border-hover: rgba(255, 71, 87, 0.28);

  --text-primary: #f2f5fa;
  --text-secondary: #a8b3cc;
  --text-muted: #737f99;

  --accent: #ff4757; /* Canada Red */
  --accent-dim: rgba(255, 71, 87, 0.15);

  --front-start: #00a86b; /* Mexico Green */
  --front-end: #05c46b;
  --front-glow: rgba(0, 168, 107, 0.25);
  --back-start: #2f80ed; /* USA Blue */
  --back-end: #00d2ff;
  --back-glow: rgba(47, 128, 237, 0.25);

  --hot: #ff4757;
  --cold: #2f80ed;
  --warm: #f1c40f;
  --success: #00a86b;
  --warning: #ffb700;
  --danger: #ff4757;

  --shadow-glow-front: 0 0 18px rgba(0, 168, 107, 0.22);
  --shadow-glow-back: 0 0 18px rgba(47, 128, 237, 0.22);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary); /* Use theme-specific bg-primary by default */
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-slow);
}

body.theme-dlt {
  background:
    linear-gradient(180deg, rgba(0, 255, 157, 0.04), transparent 400px),
    var(--bg-primary);
}

body.theme-pl3 {
  background:
    linear-gradient(180deg, rgba(255, 183, 0, 0.03), transparent 400px),
    var(--bg-primary);
}

body.theme-worldcup {
  background:
    radial-gradient(circle at 10% 20%, rgba(0, 168, 107, 0.06), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(255, 71, 87, 0.06), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(47, 128, 237, 0.05), transparent 60%),
    var(--bg-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ========== App Container ========== */
.app {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-2xl) var(--space-md);
  min-height: 100vh;
  background: transparent; /* Inherits body background */
}

/* ========== Header ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 10, 8, 0.65);
  border-bottom: 1px solid var(--card-border);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) 0;
  transition: background var(--transition-slow), border-color var(--transition-slow);
  width: 100%;
}

body.theme-dlt .header {
  background: rgba(6, 10, 8, 0.65);
}

body.theme-pl3 .header {
  background: rgba(15, 12, 8, 0.65);
}

body.theme-worldcup .header {
  background: rgba(7, 11, 20, 0.65);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo-icon {
  display: flex;
  align-items: center;
  position: relative;
  width: 50px;
  height: 34px;
  animation: pulse 3s ease-in-out infinite;
}

.logo-ball-red,
.logo-ball-blue {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  position: absolute;
}

.logo-ball-red {
  background: linear-gradient(135deg, var(--front-start), var(--front-end));
  left: 0;
  top: 4px;
  z-index: 2;
  box-shadow: var(--shadow-glow-front), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.logo-ball-blue {
  background: linear-gradient(135deg, var(--back-start), var(--back-end));
  right: 0;
  top: 4px;
  z-index: 1;
  box-shadow: var(--shadow-glow-back), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent), var(--front-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.data-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.badge-dot.error {
  background: var(--danger);
}

.update-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ========== Navigation Tabs ========== */
.nav-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  min-height: 42px;
}

.nav-tab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-tab:hover {
  background: var(--card-bg-hover);
  color: var(--text-primary);
  border-color: var(--card-border);
}

.nav-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(49, 217, 151, 0.25);
}

/* ========== Sections ========== */
.section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.active {
  display: block;
}

/* Home Section Column Layouts */
.home-left-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.home-left-col .card {
  margin-bottom: 0;
}

/* Desktop Grid Layout for Home Section */
@media (min-width: 1024px) {
  #sectionHome.section.active {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-lg);
    align-items: stretch;
  }

  .home-left-col {
    grid-column: 1;
    height: 100%;
    justify-content: space-between;
    margin-bottom: 0;
  }

  #sectionHome.section.active .recent-draws.card {
    grid-column: 2;
    height: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  #sectionHome.section.active .recent-draws.card .draws-list {
    flex-grow: 1;
    justify-content: space-between;
  }

  #sectionHome.section.active .prize-rules.card {
    grid-column: 1 / span 2;
    margin-bottom: 0;
  }
}

/* ========== Cards ========== */
.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.24);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-color: var(--card-border-hover);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.08), var(--shadow-card);
}

.empty-state,
.error-state {
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: var(--space-lg);
  text-align: center;
}

.error-state {
  border-color: rgba(239, 68, 68, 0.32);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ========== Lottery Balls ========== */
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  cursor: pointer;
  user-select: none;
  border: none;
  transition: box-shadow var(--transition-fast), filter var(--transition-fast);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.ball.front {
  background: radial-gradient(circle at 35% 35%, var(--front-start) 4%, var(--front-end) 85%);
  box-shadow:
    inset -3px -3px 8px rgba(0, 0, 0, 0.4),
    inset 3px 3px 8px rgba(255, 255, 255, 0.25),
    var(--shadow-glow-front);
}

.ball.front:hover {
  box-shadow:
    inset -3px -3px 8px rgba(0, 0, 0, 0.4),
    inset 3px 3px 8px rgba(255, 255, 255, 0.35),
    0 0 20px var(--front-start);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.ball.back {
  background: radial-gradient(circle at 35% 35%, var(--back-start) 4%, var(--back-end) 85%);
  box-shadow:
    inset -3px -3px 8px rgba(0, 0, 0, 0.4),
    inset 3px 3px 8px rgba(255, 255, 255, 0.25),
    var(--shadow-glow-back);
}

.ball.back:hover {
  box-shadow:
    inset -3px -3px 8px rgba(0, 0, 0, 0.4),
    inset 3px 3px 8px rgba(255, 255, 255, 0.35),
    0 0 20px var(--back-start);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

/* 3D highlight */
.ball::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 10px;
  width: 14px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.05) 80%);
  border-radius: 50%;
}

.ball.small {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

.ball.small::before {
  top: 4px;
  left: 8px;
  width: 12px;
  height: 7px;
}

.ball.mini {
  width: 30px;
  height: 30px;
  font-size: 0.75rem;
  animation: none;
}

.ball.mini::before {
  top: 3px;
  left: 7px;
  width: 10px;
  height: 6px;
}

.ball-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

.table-balls {
  gap: 4px;
}

/* ========== Latest Draw (Hero) ========== */
.latest-draw {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 8px 32px rgba(0, 0, 0, 0.24);
  transition: all var(--transition-normal);
}

.latest-draw::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity var(--transition-normal);
}

.latest-draw:hover::before {
  opacity: 1.0;
}

.draw-result {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  position: relative;
  z-index: 1;
}

.draw-result-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.draw-result-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.draw-result-row.front-row {
  border-left: 4px solid var(--front-start);
  background: linear-gradient(90deg, rgba(255, 77, 79, 0.04) 0%, rgba(255, 77, 79, 0.005) 100%);
  border-color: rgba(255, 77, 79, 0.1) rgba(255, 77, 79, 0.06) rgba(255, 77, 79, 0.06) var(--front-start);
}

.draw-result-row.front-row:hover {
  border-color: rgba(255, 77, 79, 0.22) rgba(255, 77, 79, 0.12) rgba(255, 77, 79, 0.12) var(--front-start);
  box-shadow: 0 6px 16px rgba(255, 77, 79, 0.08);
}

.draw-result-row.back-row {
  border-left: 4px solid var(--back-start);
  background: linear-gradient(90deg, rgba(24, 144, 255, 0.04) 0%, rgba(24, 144, 255, 0.005) 100%);
  border-color: rgba(24, 144, 255, 0.1) rgba(24, 144, 255, 0.06) rgba(24, 144, 255, 0.06) var(--back-start);
}

.draw-result-row.back-row:hover {
  border-color: rgba(24, 144, 255, 0.22) rgba(24, 144, 255, 0.12) rgba(24, 144, 255, 0.12) var(--back-start);
  box-shadow: 0 6px 16px rgba(24, 144, 255, 0.08);
}

.theme-pl3 .draw-result-row.front-row {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(255, 183, 0, 0.04) 0%, rgba(255, 183, 0, 0.005) 100%);
  border-color: rgba(255, 183, 0, 0.1) rgba(255, 183, 0, 0.06) rgba(255, 183, 0, 0.06) var(--accent);
}

.theme-pl3 .draw-result-row.front-row:hover {
  border-color: rgba(255, 183, 0, 0.22) rgba(255, 183, 0, 0.12) rgba(255, 183, 0, 0.12) var(--accent);
  box-shadow: 0 6px 16px rgba(255, 183, 0, 0.08);
}

.zone-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  min-width: 60px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.zone-label.front-zone {
  color: #fff;
  background: rgba(255, 77, 79, 0.18);
  border: 1px solid rgba(255, 77, 79, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.zone-label.back-zone {
  color: #fff;
  background: rgba(24, 144, 255, 0.18);
  border: 1px solid rgba(24, 144, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.zone-divider {
  display: none;
}

.draw-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.draw-issue {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.draw-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.draw-meta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--card-border);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
}

.draw-extra {
  display: flex;
  gap: var(--space-xl);
}

.extra-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.extra-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.extra-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ========== Countdown ========== */
.countdown {
  background: linear-gradient(135deg, rgba(49, 217, 151, 0.06), rgba(54, 197, 240, 0.04));
}

.countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
}

.countdown-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.countdown-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.countdown-sep {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-muted);
  margin-top: -12px;
  animation: pulse 1s ease-in-out infinite;
}

.countdown-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.countdown-live {
  font-size: 1.5rem;
  color: var(--danger);
  font-weight: 600;
  animation: pulse 1s ease-in-out infinite;
}

.theme-pl3 .draw-result {
  justify-content: flex-start;
}

.theme-pl3 #latestFront {
  justify-content: flex-start;
}

/* ========== Recent Draws List ========== */
.draws-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.draw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.draw-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--card-border);
}

.draw-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.draw-item-issue {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.draw-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.draw-item-balls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.draw-item-plus {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 2px;
}

/* ========== Data Table ========== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  border-bottom: 2px solid var(--card-border);
}

.data-table th {
  padding: var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.issue-num {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--accent);
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding-top: var(--space-lg);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.page-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
}

.page-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
}

/* ========== Search Bar ========== */
.search-bar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.search-input,
.search-select {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.search-input:focus,
.search-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.search-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ========== Stats Overview ========== */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.stat-icon {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stat-icon.hot {
  background: rgba(239, 68, 68, 0.15);
  color: var(--hot);
}

.stat-icon.cold {
  background: rgba(59, 130, 246, 0.15);
  color: var(--cold);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* ========== Sub Tabs ========== */
.sub-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-xs);
}

.sub-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sub-tab:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.sub-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

.sub-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========== Stat Panels ========== */
.stat-panel {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-panel.active {
  display: block;
}

.frequency-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: calc(-1 * var(--space-sm)) 0 var(--space-md);
}

.frequency-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-sm);
  min-height: 42px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  padding: 8px 10px;
  font-size: 0.78rem;
  min-width: 0;
}

.frequency-chip span {
  color: var(--text-muted);
}

.frequency-chip strong {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frequency-chip em {
  color: var(--text-secondary);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.frequency-chip.hot {
  border-color: rgba(239, 68, 68, 0.2);
}

.frequency-chip.cold {
  border-color: rgba(59, 130, 246, 0.2);
}

.frequency-chip.avg {
  border-color: rgba(49, 217, 151, 0.22);
}

/* ========== Chart Container ========== */
.chart-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  padding: var(--space-md);
  min-height: 240px;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
}

.chart-pie-container {
  max-width: 450px;
  margin: 0 auto;
}

/* ========== Hot/Cold Grid ========== */
.hotcold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: var(--space-sm);
}

.heatmap-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  transition: all var(--transition-fast);
  cursor: default;
}

.heatmap-cell.hot {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.heatmap-cell.cold {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.heatmap-cell.warm {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.heatmap-cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.cell-num {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.heatmap-cell.hot .cell-num { color: var(--hot); }
.heatmap-cell.cold .cell-num { color: var(--cold); }
.heatmap-cell.warm .cell-num { color: var(--warm); }

/* ========== Tags ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag.hot {
  background: rgba(239, 68, 68, 0.2);
  color: var(--hot);
}

.tag.cold {
  background: rgba(59, 130, 246, 0.2);
  color: var(--cold);
}

.tag.warm {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warm);
}

/* ========== Sum Stats ========== */
.sum-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--card-border);
  margin-top: var(--space-lg);
}

.sum-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.sum-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sum-stat-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

/* ========== Trend Number Selector ========== */
.trend-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-lg);
}

.trend-num-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.trend-num-btn:hover {
  border-color: var(--front-end);
  color: var(--front-end);
}

.trend-num-btn.active {
  background: linear-gradient(145deg, var(--front-start), var(--front-end));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow-front);
}

/* ========== Prediction Section ========== */
.predict-header {
  background: linear-gradient(135deg, rgba(49, 217, 151, 0.08), rgba(54, 197, 240, 0.04));
}

.predict-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: -var(--space-sm);
}

.predict-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.strategy-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.predictions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.prediction-card {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prediction-card.pred-high {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.prediction-card.pred-balanced {
  border-color: rgba(251, 191, 36, 0.30);
}

.prediction-card.pred-aggressive {
  border-color: rgba(249, 115, 22, 0.30);
}

.pred-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.pred-label {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
}

.pred-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pred-confidence {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  color: var(--conf-color, #fff);
  background: color-mix(in srgb, var(--conf-color) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--conf-color) 35%, transparent);
  white-space: nowrap;
}

.pred-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 10px;
  border-radius: 10px;
}

.ball.ball-warn {
  position: relative;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.55), 0 0 12px rgba(249, 115, 22, 0.35);
  animation: warnPulse 2.4s ease-in-out infinite;
}

.warn-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f97316;
  box-shadow: 0 0 4px rgba(249, 115, 22, 0.9);
}

@keyframes warnPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.45), 0 0 8px rgba(249, 115, 22, 0.25); }
  50% { box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.85), 0 0 18px rgba(249, 115, 22, 0.55); }
}

.pred-overkill-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-md);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  font-size: 0.78rem;
  color: #fdba74;
  line-height: 1.5;
}

.overkill-icon {
  color: #f97316;
  font-size: 0.95rem;
}

.pred-balls {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.pred-zone {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

.zone-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 32px;
  flex: 0 0 auto;
}

.pred-reasoning {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--card-border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prediction-card .ball-row {
  flex-wrap: wrap;
  min-width: 0;
}

.prediction-card .ball {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.prediction-card .ball::before {
  top: 5px;
  left: 10px;
  width: 13px;
  height: 8px;
}

.prediction-history {
  margin-bottom: var(--space-lg);
}

.prediction-history-list {
  display: grid;
  gap: var(--space-md);
}

.prediction-history-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  padding: var(--space-md);
}

.history-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.history-record-head h3 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.history-record-head p {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.history-status {
  flex: 0 0 auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.history-status.reviewed {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.history-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.history-copy-btn {
  min-height: 28px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.72rem;
  padding: 4px 9px;
  transition: all var(--transition-fast);
}

.history-copy-btn:hover,
.history-copy-btn.copied {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.prediction-history-tickets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-sm);
}

.prediction-history-ticket {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 26, 0.36);
  padding: var(--space-sm);
}

.history-ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  min-width: 0;
}

.history-ticket-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-ticket-meta strong {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.history-ticket-meta strong.win {
  color: var(--success);
}

.history-ticket-balls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.history-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: var(--shadow-ball);
}

.history-ball.front {
  background: linear-gradient(135deg, var(--front-start), var(--front-end));
}

.history-ball.back {
  background: linear-gradient(135deg, var(--back-start), var(--back-end));
}

.history-ball.match {
  outline: 2px solid var(--success);
  outline-offset: 2px;
}

.history-plus {
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 2px;
}

.history-review-summary {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 26, 0.28);
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.history-review-summary strong {
  display: block;
  font-size: 0.86rem;
}

.review-kicker {
  color: var(--text-muted);
  display: block;
  font-size: 0.72rem;
  margin-bottom: 3px;
}

.review-draw-balls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.history-ticket-reason {
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.55;
  margin: 0;
}

.history-ticket-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-sm);
}

.review-tag {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1;
  padding: 4px 6px;
}

.review-tag.win {
  border-color: rgba(16, 185, 129, 0.32);
  color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}
.history-ticket-reason {
  margin-top: var(--space-sm);
}

.history-overkill-review {
  margin: var(--space-md) 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.22);
}

.overkill-review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fdba74;
  margin-bottom: 8px;
}

.overkill-rate {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 8px;
}

.overkill-review-balls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overkill-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.overkill-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.overkill-tag.hit {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.overkill-tag.miss {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: 42px;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--card-border-hover);
}

.btn-generate {
  background: linear-gradient(135deg, var(--accent), #36c5f0);
  color: var(--bg-primary);
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.btn-generate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

.btn-generate:hover {
  box-shadow: 0 0 30px rgba(49, 217, 151, 0.24), 0 0 44px rgba(54, 197, 240, 0.16);
  transform: translateY(-2px);
}

.btn-generate:active {
  transform: translateY(0);
}

/* ========== Progress Bar ========== */
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  flex: 1;
  min-width: 80px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #36c5f0);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ========== Disclaimer ========== */
.disclaimer {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.2);
}

.disclaimer p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== Footer ========== */
.footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-small {
  font-size: 0.7rem !important;
  margin-top: var(--space-xs);
  opacity: 0.6;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(6, 10, 8, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading {
  text-align: center;
}

.loading p {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* ========== App Toast ========== */
.app-toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-15px);
  z-index: 9999;
  padding: 12px 28px;
  background: rgba(13, 18, 34, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.4), 
    0 0 20px var(--accent-dim);
  opacity: 0;
  pointer-events: none;
  transition: 
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-dlt .app-toast {
  background: rgba(12, 18, 15, 0.88);
}

body.theme-pl3 .app-toast {
  background: rgba(23, 18, 12, 0.88);
}

body.theme-worldcup .app-toast {
  background: rgba(13, 18, 34, 0.88);
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Animations ========== */
@keyframes ballFadeIn {
  0% {
    transform: translateY(8px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo-text h1 {
    font-size: 1.25rem;
  }

  .nav-tabs {
    gap: 4px;
    overflow-x: auto;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.8rem;
    gap: 4px;
  }

  .nav-tab svg {
    width: 14px;
    height: 14px;
  }

  .ball {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .ball::before {
    top: 5px;
    left: 10px;
    width: 13px;
    height: 8px;
  }

  .countdown-value {
    font-size: 1.8rem;
  }

  .countdown-unit {
    min-width: 52px;
  }

  .draw-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--space-md) 0;
  }

  .draw-result-row {
    padding: 10px 14px;
    gap: var(--space-md);
  }

  .draw-result-row:hover {
    transform: none;
  }

  .draw-result .zone-label {
    min-width: 50px;
    font-size: 0.72rem;
    padding: 3px 6px;
  }

  .draw-result .ball-row {
    gap: 6px;
  }

  .draw-meta-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }

  .draw-extra {
    flex-direction: row;
    justify-content: space-around;
    border-top: none;
    padding-top: 0;
  }

  .draw-extra .extra-item {
    align-items: center;
  }

  .draw-actions {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .draw-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .predictions-grid {
    grid-template-columns: 1fr;
  }

  .history-record-head {
    flex-direction: column;
    align-items: stretch;
  }

  .history-status {
    width: fit-content;
  }

  .history-record-actions {
    justify-content: flex-start;
  }

  .search-bar {
    flex-direction: column;
    width: 100%;
  }

  .search-input,
  .search-select {
    width: 100%;
  }

  .card {
    padding: var(--space-md);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .latest-draw .card-header,
  .countdown .card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: var(--space-sm);
  }

  .latest-draw .card-header h2,
  .countdown .card-header h2 {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .latest-draw .draw-info {
    font-size: 0.75rem;
    gap: 8px;
  }

  .latest-draw .draw-issue {
    font-size: 0.8rem;
  }

  .countdown-label {
    font-size: 0.72rem;
    padding: 2px 8px;
    white-space: nowrap;
  }

  .predict-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-generate {
    text-align: center;
    justify-content: center;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .hotcold-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .heatmap-cell {
    padding: 8px 4px;
    gap: 2px;
  }

  .cell-num {
    font-size: 0.95rem;
  }

  .cell-tag {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .data-table th,
  .data-table td {
    padding: var(--space-sm);
    font-size: 0.8rem;
  }

  .draw-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  /* ========== Rules Table Mobile Overrides ========== */
  .rules-table {
    min-width: 580px;
  }

  .rules-table th {
    white-space: nowrap;
  }

  .rules-table th,
  .rules-table td {
    padding: 10px 8px;
    font-size: 0.72rem;
  }

  .prize-badge {
    min-width: 48px;
    padding: 2px 4px;
    font-size: 0.65rem;
  }

  .mini-balls-row {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap; /* 不折行，保持在一行显示，更加整洁 */
  }

  /* 仅缩放实际的球点，不缩放 + 号和文本，防止 + 号和文本高度宽度被写死挤压变形 */
  .ball-dot:not(.plus):not(.text-muted) {
    width: 10px;
    height: 10px;
  }

  .ball-dot.plus {
    font-size: 0.7rem;
    line-height: 1;
  }

  .ball-dot.text-muted {
    font-size: 0.68rem;
    white-space: nowrap;
    line-height: 1;
  }

  .bt-bar-row {
    flex-wrap: wrap;
    row-gap: var(--space-xs);
  }

  .bt-bar-label {
    min-width: 86px;
  }

  .bt-bar-value {
    min-width: 100%;
    text-align: left;
    white-space: normal;
  }

  .frequency-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app {
    padding: 0 var(--space-sm);
  }

  .nav-tabs {
    gap: 3px;
  }

  .nav-tab {
    padding: 6px 8px;
    font-size: 0.72rem;
    gap: 3px;
    flex: 0 0 auto;
  }

  .nav-tab svg {
    width: 12px;
    height: 12px;
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }

  .hotcold-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .ball {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  /* 预测卡片在超窄手机屏下的彩球微调，防止和前后区标签挤压 */
  .prediction-card .ball {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .prediction-card .zone-tag {
    min-width: 26px;
    font-size: 0.65rem;
  }

  .pred-zone {
    gap: var(--space-xs);
    align-items: flex-start;
  }

  .prediction-card .ball-row {
    gap: 5px;
  }

  .countdown-timer {
    gap: 3px;
  }

  .countdown-unit {
    min-width: 44px;
  }

  .countdown-value {
    font-size: 1.45rem;
  }

  .countdown-sep {
    font-size: 1.4rem;
  }

  .prediction-history-tickets {
    grid-template-columns: 1fr;
  }

  .history-ball {
    width: 24px;
    height: 24px;
    font-size: 0.68rem;
  }

  .checker-item {
    align-items: flex-start;
  }

  .data-table th.col-sales,
  .data-table td.col-sales,
  .data-table th.col-pool,
  .data-table td.col-pool {
    display: none;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 0.8rem;
  }
}

@media (min-width: 1024px) {
  .draw-result {
    gap: var(--space-lg);
  }

  .ball {
    width: 58px;
    height: 58px;
    font-size: 1.3rem;
  }
}

/* ========== Focus / Accessibility ========== */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========== Prize Rules ========== */
.rules-table-wrapper {
  overflow-x: auto;
  margin-top: var(--space-md);
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.rules-table th,
.rules-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.rules-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}

.rules-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.prize-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  text-align: center;
  min-width: 72px;
}

.prize-badge.gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warm);
  border-color: rgba(245, 158, 11, 0.3);
}

.prize-badge.silver {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.2);
}

.prize-badge.bronze {
  background: rgba(180, 83, 9, 0.15);
  color: #d97706;
  border-color: rgba(180, 83, 9, 0.3);
}

.mini-balls-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ball-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.ball-dot.front {
  background: linear-gradient(135deg, var(--front-start), var(--front-end));
  box-shadow: var(--shadow-glow-front);
}

.ball-dot.front.muted {
  opacity: 0.45;
}

.ball-dot.front.variant-a {
  background: #ff7a45;
}

.ball-dot.front.variant-b {
  background: #e7354f;
}

.ball-dot.front.variant-c {
  background: #ffbf69;
}

.ball-dot.back {
  background: linear-gradient(135deg, var(--back-start), var(--back-end));
  box-shadow: var(--shadow-glow-back);
}

.ball-dot.plus {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
}

.ball-dot.text-muted {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: auto;
  height: auto;
}

/* ========== Modal Overlay ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  padding: var(--space-md);
}

.modal-card {
  width: 100%;
  max-width: 580px;
  margin-bottom: 0;
  animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}

.history-modal-card {
  max-width: min(1080px, calc(100vw - 32px));
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--hot);
  background: rgba(239, 68, 68, 0.08);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.history-modal-body {
  padding-right: 4px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-textarea {
  width: 100%;
  height: 120px;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'Outfit', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.modal-textarea:focus {
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: var(--space-md);
}

/* ========== Checker Results ========== */
.checker-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
}

.checker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.checker-item.win {
  background: rgba(49, 217, 151, 0.05);
  border-color: rgba(49, 217, 151, 0.22);
}

.checker-item.error {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.28);
}

.checker-item-balls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.checker-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.checker-ball.front.match {
  color: #fff;
  background: linear-gradient(145deg, var(--front-start), var(--front-end));
  border-color: transparent;
  box-shadow: var(--shadow-glow-front);
}

.checker-ball.back.match {
  color: #fff;
  background: linear-gradient(145deg, var(--back-start), var(--back-end));
  border-color: transparent;
  box-shadow: var(--shadow-glow-back);
}

.checker-ball.plus {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: bold;
  border: none;
  background: transparent;
  width: auto;
  height: auto;
}

.checker-item-verdict {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.checker-message {
  color: #fca5a5;
  font-size: 0.8rem;
}

.match-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.prize-result-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.prize-result-badge.win {
  background: var(--accent);
  color: var(--bg-primary);
}

.prize-result-badge.lose {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* ========== Print ========== */
@media print {
  .nav-tabs,
  .loading-overlay,
  .btn,
  .search-bar,
  .countdown {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: none;
    backdrop-filter: none;
  }

  .ball {
    border: 2px solid #333;
    color: #333;
    box-shadow: none;
  }

  .ball.front {
    background: #ffccbc;
  }

  .ball.back {
    background: #bbdefb;
  }
}

/* ========== PL3 Theme & Dynamic Display Adaptations ========== */
.theme-pl3 .logo-ball-red {
  background: linear-gradient(135deg, #ffb700, #e65c00);
  box-shadow: 0 0 18px rgba(255, 183, 0, 0.28), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.theme-pl3 .logo-ball-blue {
  background: linear-gradient(135deg, #facc15, #ca8a04);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.24), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.theme-worldcup .logo-ball-red {
  background: linear-gradient(135deg, #00a86b, #05c46b);
  box-shadow: 0 0 18px rgba(0, 168, 107, 0.28), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.theme-worldcup .logo-ball-blue {
  background: linear-gradient(135deg, #2f80ed, #00d2ff);
  box-shadow: 0 0 18px rgba(47, 128, 237, 0.24), 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* ========== Lottery Switcher ========== */
.lottery-selector {
  display: flex;
  position: relative;
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  padding: 4px;
  gap: 4px;
  z-index: 5;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .lottery-selector {
    order: 3;
    width: 100%;
    margin-top: var(--space-sm);
  }
}

.selector-tab {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: 99px;
  cursor: pointer;
  z-index: 2;
  transition: color var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .selector-tab {
    flex: 1;
    padding: 12px 0;
  }
}

.selector-tab:hover {
  color: var(--text-primary);
}

.selector-tab.active {
  color: #000;
}

.selector-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 99px;
  z-index: 1;
  background: linear-gradient(135deg, #00ff9d, #1890ff);
  box-shadow: 0 4px 15px rgba(0, 255, 157, 0.25);
  transition: transform var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
}

.theme-pl3 .selector-tab.active {
  color: #fff;
}

.theme-pl3 .selector-slider {
  transform: translateX(calc(100% + 4px));
  background: linear-gradient(135deg, #ffb700, #ff4d4f);
  box-shadow: 0 4px 15px rgba(255, 183, 0, 0.3);
}

.theme-worldcup .selector-tab.active {
  color: #fff;
}

.theme-worldcup .selector-slider {
  transform: translateX(calc(200% + 8px));
  background: linear-gradient(135deg, #ff4757, #2f80ed);
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.35);
}

.theme-worldcup .nav-tabs {
  display: none;
}

/* ========== Rule table selectors ========== */
.theme-dlt .dlt-rules-table { display: block !important; }
.theme-dlt .pl3-rules-table { display: none !important; }
.theme-pl3 .dlt-rules-table { display: none !important; }
.theme-pl3 .pl3-rules-table { display: block !important; }

/* ========== Display Adapters for PL3 ========== */
.theme-pl3 .zone-divider,
.theme-pl3 .zone-label,
.theme-pl3 .back-row,
.theme-pl3 #latestBack,
.theme-pl3 .draw-extra .extra-item:nth-child(2) {
  display: none !important;
}

.theme-pl3 #historyTable th:nth-child(4),
.theme-pl3 #historyTable td:nth-child(4),
.theme-pl3 #historyTable th:nth-child(6),
.theme-pl3 #historyTable td:nth-child(6) {
  display: none !important;
}

.theme-pl3 .stats-overview .stat-card:nth-child(3),
.theme-pl3 .stats-overview .stat-card:nth-child(4) {
  display: none !important;
}

.theme-pl3 #panelFrequency .card:nth-child(2),
.theme-pl3 #panelGap .card:nth-child(2),
.theme-pl3 #panelHotcold .card:nth-child(2) {
  display: none !important;
}

/* ========== World Cup Predictor ========== */
.wc-hero {
  background:
    linear-gradient(135deg, rgba(49, 217, 151, 0.1), rgba(54, 197, 240, 0.05)),
    var(--card-bg);
  border-color: rgba(49, 217, 151, 0.18);
}

.wc-hero-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.wc-kicker {
  display: inline-flex;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.wc-hero h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
  margin-bottom: var(--space-md);
}

.wc-hero p,
.wc-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 72ch;
}

.wc-countdown {
  margin-top: var(--space-lg);
}

.wc-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.wc-meta-item,
.wc-top-card,
.wc-h2h-metrics > div,
.wc-mystic-grid > div,
.wc-info-block,
.wc-value-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.wc-meta-item {
  padding: var(--space-md);
  min-width: 0;
}

.wc-meta-item span,
.wc-h2h-metrics span,
.wc-mystic-grid span,
.wc-value-card small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.wc-meta-item strong,
.wc-h2h-metrics strong,
.wc-mystic-grid strong {
  color: var(--text-primary);
  font-size: 1rem;
  word-break: break-word;
}

.wc-top-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.wc-top-card {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  padding: 12px;
}

.wc-rank,
.wc-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-family: var(--font-heading);
}

.wc-rank {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.wc-rank.is-top-1 {
  color: #fbbf24;
}

.wc-rank.is-top-2 {
  color: #cbd5e1;
}

.wc-rank.is-top-3 {
  color: #d97706;
}

.wc-code {
  width: 34px;
  height: 28px;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--accent), var(--back-start));
  font-size: 0.78rem;
  letter-spacing: 0;
}

.wc-name,
.wc-team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.wc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.wc-tab {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  min-height: 38px;
  padding: 8px 14px;
  transition: all var(--transition-fast);
}

.wc-tab:hover {
  border-color: var(--card-border-hover);
  color: var(--text-primary);
}

.wc-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(49, 217, 151, 0.28);
}

.wc-odds-health-badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  align-self: center;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  cursor: help;
  white-space: nowrap;
}

.wc-panel {
  display: none;
}

.wc-panel.active {
  display: block;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wc-board,
.wc-detail-list,
.wc-market-list {
  display: flex;
  flex-direction: column;
}

.wc-board-row {
  display: grid;
  grid-template-columns: 36px 42px minmax(0, 1fr) minmax(90px, auto);
  gap: var(--space-md);
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.wc-board-row:last-child,
.wc-detail-row:last-child,
.wc-market-row:last-child {
  border-bottom: none;
}

.wc-team-sub,
.wc-narrative,
.wc-source-line,
.wc-h2h-card p,
.wc-squad-head p,
.wc-squad-table td span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.wc-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.wc-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--back-start));
  border-radius: inherit;
}

.wc-prob {
  text-align: right;
}

.wc-prob strong {
  display: block;
  font-size: 1rem;
  color: var(--text-primary);
}

.wc-prob span,
.wc-market-row strong,
.wc-value-card strong {
  font-size: 0.78rem;
  font-weight: 800;
}

.is-positive {
  color: var(--success) !important;
}

.is-negative {
  color: var(--danger) !important;
}

.is-neutral {
  color: var(--text-muted) !important;
}

.wc-detail-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  padding: 10px 0;
}

.wc-detail-row summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: var(--space-sm);
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.wc-detail-row summary::-webkit-details-marker {
  display: none;
}

.wc-pill,
.wc-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: rgba(49, 217, 151, 0.1);
  border: 1px solid rgba(49, 217, 151, 0.16);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.wc-factor-list {
  display: grid;
  gap: 8px;
  margin: var(--space-md) 0;
}

.wc-factor-bar,
.wc-h2h-factor {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 58px;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.78rem;
}

.wc-factor-bar > span,
.wc-h2h-factor > span {
  color: var(--text-secondary);
}

.wc-factor-bar > div,
.wc-h2h-factor > div,
.wc-market-bars {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.wc-factor-bar i,
.wc-h2h-factor i,
.wc-h2h-factor b,
.wc-market-bars span,
.wc-market-bars i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.wc-h2h-factor > div {
  display: flex;
}

.wc-mystic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.wc-mystic-grid > div {
  padding: 10px 12px;
}

.wc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.wc-ucl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.wc-ucl-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.wc-ucl-card h3 {
  font-size: 1rem;
}

.wc-ucl-card p {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 3px 0;
}

.wc-ucl-players {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.wc-ucl-player {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.wc-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  min-height: 42px;
  outline: none;
  padding: 9px 12px;
}

.wc-winbar {
  display: flex;
  height: 60px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: var(--space-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.wc-winbar span,
.wc-winbar i,
.wc-winbar b {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  color: #0a1410;
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  position: relative;
  transition: width 0.4s ease;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

.wc-winbar span {
  background: linear-gradient(180deg, #34d399, #10b981);
}

.wc-winbar i {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.wc-winbar b {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
}

/* 进度条太窄时隐藏文字（避免溢出） */
.wc-winbar span:empty,
.wc-winbar i:empty,
.wc-winbar b:empty {
  min-width: 0;
}

/* Conformal 校正卡片的推荐文字：用 set_size 颜色（绿/黄/红）
   避免和 4 维融合的 --accent（红色）混淆 */
.cp-calibrated .wc-ensemble-rec strong {
  color: inherit;  /* 父元素内联 style 的 color 生效 */
}

/* Conformal 校正 winbar：文字小一号 */
.cp-calibrated-bar span,
.cp-calibrated-bar i,
.cp-calibrated-bar b {
  font-size: 0.82rem;
  padding: 0 4px;
}

/* delta 单独成行（放在 winbar 下面）— 避免压住 winbar 段内文字 */
.cp-delta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: 'SF Mono', Menlo, monospace;
  font-weight: 700;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  margin: 6px 4px 0;
  min-height: 14px;
}
.cp-delta-row span:empty {
  /* 保留占位避免布局抖动，但内容为空时不显示 */
}
.cp-delta-row .cp-delta {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
}
.cp-delta-row .cp-delta.is-pos {
  color: var(--front-start, #00a86b);
}
.cp-delta-row .cp-delta.is-neg {
  color: var(--danger, #ff4757);
}

.wc-ensemble-winbar {
  margin-bottom: var(--space-md);
}

.wc-h2h-metrics,
.wc-h2h-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.wc-h2h-metrics > div {
  padding: var(--space-md);
}

.wc-score-card,
.wc-h2h-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.wc-expected {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: var(--space-md);
}

.wc-expected strong {
  color: var(--text-primary);
}

/* 胜平负概率卡片组（3 卡片，跟精选比分 6 卡片风格一致） */
.wc-expected-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.wc-expected-card {
  display: grid;
  gap: 4px;
  place-items: center;
  place-content: center;
  min-height: 80px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.045);
  position: relative;
  overflow: hidden;
}

.wc-expected-card.is-home {
  background: linear-gradient(135deg, rgba(49, 217, 151, 0.18), rgba(49, 217, 151, 0.05));
  border-color: rgba(49, 217, 151, 0.4);
}

.wc-expected-card.is-draw {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.4);
}

.wc-expected-card.is-away {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(96, 165, 250, 0.05));
  border-color: rgba(96, 165, 250, 0.4);
}

.wc-expected-card .wc-expected-team {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.wc-expected-card .wc-expected-pct {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.wc-expected-card.is-home .wc-expected-pct { color: #6ee7b7; }
.wc-expected-card.is-draw .wc-expected-pct { color: #fbbf24; }
.wc-expected-card.is-away .wc-expected-pct { color: #93c5fd; }

.wc-score-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.wc-score-grid > div {
  min-height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid transparent;
}

.wc-score-grid .is-featured {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.wc-score-grid.is-high > div {
  border-color: rgba(245, 158, 11, 0.16);
}

.wc-score-grid strong {
  font-size: 1.1rem;
}

.wc-score-grid span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.wc-score-card h3,
.wc-h2h-card h3 {
  font-size: 0.92rem;
  margin: var(--space-sm) 0;
}

.wc-h2h-split {
  grid-template-columns: repeat(2, 1fr);
}

.wc-record {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.wc-record div {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  text-align: center;
}

.wc-record strong {
  display: block;
  font-size: 1.1rem;
}

.wc-record span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.wc-official-h2h-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.wc-official-h2h-list > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 3px 10px;
  padding: 9px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.wc-official-h2h-list span,
.wc-official-h2h-list small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.wc-official-h2h-list strong {
  color: var(--text-primary);
  font-size: 0.8rem;
  min-width: 0;
}

.wc-official-h2h-list small {
  grid-column: 2;
}

.wc-player-group {
  margin-top: var(--space-sm);
}

.wc-player-group h4 {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.wc-player-vs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.wc-player-vs span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-player-vs span:last-child {
  text-align: right;
}

.wc-player-vs i {
  color: var(--warning);
  font-style: normal;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.wc-player-vs small {
  color: var(--warning);
  font-size: 0.72rem;
}

.wc-squad-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: var(--space-md);
}

.wc-squad-head h3 {
  font-size: 1.1rem;
}

.wc-squad-head > strong {
  color: var(--accent);
  font-size: 1.2rem;
}

.wc-squad-table .wc-pos {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 800;
}

.wc-market-row {
  display: grid;
  grid-template-columns: 28px 42px minmax(110px, 1fr) minmax(160px, 1fr) 130px 58px 68px 70px;
  gap: var(--space-sm);
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 0.82rem;
}

.wc-market-row .wc-rank {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: 0.02em;
}

.wc-market-row .wc-rank.top {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 200, 180, 0.3);
}

.wc-market-bars {
  display: grid;
  gap: 3px;
  height: 24px;
  background: transparent;
}

.wc-market-bars span,
.wc-market-bars i,
.wc-market-bars b {
  height: 6px;
  display: block;
  border-radius: 3px;
}

.wc-market-bars span {
  background: var(--back-start);
}

.wc-market-bars i {
  background: var(--warning);
}

.wc-market-bars b {
  background: linear-gradient(90deg, var(--accent), var(--front-end));
  box-shadow: 0 0 8px rgba(0, 200, 180, 0.25);
}

.wc-market-pcts {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.wc-market-pcts b {
  color: var(--text-primary);
  font-weight: 800;
}

.wc-market-fusion {
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wc-value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.wc-value-card {
  display: grid;
  gap: 4px;
  padding: var(--space-md);
}

.wc-value-card span {
  font-weight: 800;
}

.wc-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.wc-info-block {
  padding: var(--space-md);
}

.wc-info-block h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.wc-info-block p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
}

.wc-info-block code {
  color: var(--accent);
}

.wc-source-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  border-top: 1px solid var(--card-border);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
}

.wc-source-line a {
  color: var(--accent);
}

@media (max-width: 900px) {
  .wc-hero-main,
  .wc-h2h-split,
  .wc-info-grid {
    grid-template-columns: 1fr;
  }

  .wc-top-strip,
  .wc-meta-grid,
  .wc-ucl-grid,
  .wc-value-grid {
    grid-template-columns: 1fr;
  }

  .wc-score-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wc-market-row {
    grid-template-columns: 28px 42px minmax(0, 1fr);
  }

  .wc-market-row .wc-market-bars,
  .wc-market-row > span.wc-market-pcts {
    grid-column: 2 / -1;
  }

  .wc-market-row .wc-market-fusion,
  .wc-market-row > em:nth-of-type(2) {
    display: none;
  }
}

@media (max-width: 640px) {
  .wc-hero h2 {
    font-size: 2rem;
  }

  .wc-board-row {
    grid-template-columns: 30px 38px minmax(0, 1fr);
  }

  .wc-prob {
    grid-column: 3;
    text-align: left;
  }

  .wc-detail-row summary {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .wc-detail-row summary .wc-pill {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .wc-mystic-grid,
  .wc-h2h-controls,
  .wc-h2h-metrics,
  .wc-expected {
    grid-template-columns: 1fr;
  }

  .wc-vs {
    padding: 0;
    text-align: center;
  }

  .wc-score-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wc-player-vs {
    grid-template-columns: 1fr;
  }

  .wc-player-vs i,
  .wc-player-vs span:last-child {
    text-align: left;
  }
}

/* ========== Match Schedule & Group Tabs ========== */

/* 1. Group Selector Tabs */
.wc-group-selector {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding: 4px 16px 14px 16px;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--card-border);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.wc-group-selector::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.wc-group-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.wc-group-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.wc-group-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(49, 217, 151, 0.2);
  font-weight: 700;
}

/* 2. Match Groups Details */
.wc-match-group {
  border-bottom: 1px solid var(--card-border);
  padding: 0;
  transition: all var(--transition-normal);
}

.wc-match-group.is-hidden {
  display: none !important;
}

.wc-match-group:last-child {
  border-bottom: none;
}

.wc-match-group summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: background var(--transition-fast);
}

.wc-match-group summary:hover {
  background: var(--bg-tertiary);
}

.wc-match-group summary::-webkit-details-marker {
  display: none;
}

.wc-match-group summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.wc-match-group[open] summary::before {
  transform: rotate(90deg);
}

.wc-group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  width: auto;
  padding: 0 10px;
  white-space: nowrap;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--front-start), var(--front-end));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(231, 53, 79, 0.2);
}

.wc-group-teams {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. Double Column Cards Grid */
.wc-match-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.15);
}

/* 4. Glassmorphic Match Card */
.wc-match-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.wc-match-card:hover {
  transform: translateY(-3px);
  background: var(--card-bg-hover);
  border-color: var(--card-border-hover);
  box-shadow: 
    0 10px 20px rgba(0, 0, 0, 0.2), 
    0 0 12px rgba(49, 217, 151, 0.05);
}

/* 5. Match Card Header */
.wc-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.wc-match-time-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.wc-match-date {
  font-weight: 700;
  color: var(--text-primary);
}

.wc-match-day {
  color: var(--text-muted);
}

.wc-match-time {
  font-weight: 700;
  color: var(--accent);
  margin-left: 2px;
}

.wc-match-status {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  white-space: nowrap;
}

.wc-match-status.is-scheduled {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(49, 217, 151, 0.16);
}

.wc-match-status.is-final {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.wc-match-status.is-llm {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.32);
  cursor: help;
}

.wc-match-status.is-ensemble {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(96, 165, 250, 0.15));
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
  cursor: help;
  font-weight: 800;
}

.wc-match-status.is-odds {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.32);
  cursor: help;
  font-variant-numeric: tabular-nums;
}

/* 赔率趋势段（modal 详情） */
.wc-odds-trend {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), transparent);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.wc-odds-trend .wc-odds-trend-label {
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc-odds-trend .wc-odds-trend-values {
  display: flex;
  gap: var(--space-md);
  font-variant-numeric: tabular-nums;
}

.wc-odds-trend .wc-odds-trend-values strong {
  color: var(--text-primary);
  font-weight: 700;
}

.wc-odds-trend .wc-odds-trend-shift {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wc-odds-trend .wc-odds-trend-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* modal 底部 footer（已移除） */

/* LLM AI 视角对比面板（冠军概率 tab 底部） */
.wc-llm-perspective {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.06), rgba(168, 85, 247, 0.01));
}

.wc-llm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.wc-llm-perspective h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #c084fc;
  font-weight: 800;
}

.wc-llm-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.wc-llm-table {
  display: grid;
  gap: 2px;
}

.wc-llm-header,
.wc-llm-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.6fr) 64px 86px 64px 78px 78px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
}

.wc-llm-header {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.wc-llm-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}

.wc-llm-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wc-llm-name .wc-code {
  flex-shrink: 0;
}

.wc-llm-cell {
  color: var(--text-secondary);
  text-align: right;
}

.wc-llm-cell.is-llm-main {
  color: #c084fc;
  font-weight: 800;
}

.wc-llm-insight {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: var(--space-md) 0 0 0;
}

@media (max-width: 768px) {
  .wc-llm-header,
  .wc-llm-row {
    grid-template-columns: minmax(80px, 1fr) 50px 60px 50px 60px 60px;
    font-size: 0.72rem;
  }
}

/* 6. Match Card Body */
.wc-match-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: var(--space-xs) 0 var(--space-sm) 0;
  min-width: 0;
}

.wc-match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wc-match-team.is-home {
  align-items: flex-end;
  text-align: right;
}

.wc-match-team.is-away {
  align-items: flex-start;
  text-align: left;
}

.wc-match-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.wc-match-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.95rem; /* Larger flag emoji */
}

.wc-match-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

/* 7. Score Badge & VS Badge */
.wc-match-score-badge {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(49, 217, 151, 0.1);
  border: 1px solid rgba(49, 217, 151, 0.2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-heading);
  box-shadow: 0 2px 8px rgba(49, 217, 151, 0.06);
}

.wc-match-vs-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* 8. Match Card Footer */
.wc-match-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
  margin-top: auto;
  color: var(--text-muted);
}

.wc-venue-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.7;
}

.wc-match-venue {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.wc-update-badge {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--card-border);
}

.wc-matches-header {
  margin-bottom: var(--space-sm) !important;
}

/* ========== Responsive Breakpoints ========== */

@media (max-width: 900px) {
  .wc-match-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm);
  }
}

@media (max-width: 640px) {
  .wc-group-selector {
    padding: 2px 12px 10px 12px;
  }

  .wc-group-tab {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .wc-match-card {
    padding: 12px;
  }

  .wc-match-name {
    font-size: 0.8rem;
  }

  .wc-match-score-badge {
    font-size: 1rem;
    padding: 3px 8px;
    min-width: 46px;
  }

  .wc-match-body {
    gap: 8px;
  }
}

/* ========== WC H2H Modal ========== */
.wc-h2h-modal-card {
  max-width: min(820px, calc(100vw - 32px));
  max-height: 92dvh;
}

.wc-h2h-modal-header {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

.wc-modal-title-teams {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wc-modal-flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.wc-modal-vs {
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--warning);
  font-size: 1.05rem;
}

.wc-modal-prediction-title {
  margin-bottom: var(--space-md);
  text-align: center;
}

.wc-modal-prediction-title h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.wc-modal-prediction-title p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.wc-h2h-modal-body {
  overflow-y: auto;
  padding-right: 6px;
  flex-grow: 1;
}

.wc-h2h-modal-body::-webkit-scrollbar {
  width: 5px;
}

.wc-h2h-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.wc-match-card.is-clickable {
  cursor: pointer;
}

.wc-match-card.is-clickable::after {
  content: '分析 ➔';
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.62rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-fast);
  font-weight: 700;
}

.wc-match-card.is-clickable:hover::after {
  opacity: 0.85;
  transform: translateX(0);
}

/* Fade out animation for closing the modal smoothly */
.modal-overlay.fade-out {
  animation: fadeOut 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 640px) {
  .wc-modal-title-teams {
    gap: 8px;
  }
  
  .wc-modal-flag-badge {
    font-size: 0.95rem;
  }
  
  .wc-modal-vs {
    font-size: 0.85rem;
  }
}

/* ========== A11y: visually hidden but accessible to screen readers ========== */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A11y: 球号视觉提示：角落小圆点区分前/后区，对色盲用户更友好 */
.ball.front::after,
.ball-dot.front {
  /* 已有红色区分 */
}

.ball.back::after,
.ball-dot.back {
  /* 已有蓝色区分 */
}

/* A11y: 焦点态增强 - 模态框内元素 */
.modal-card *:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* A11y: 让开奖记录行支持键盘聚焦 */
.draw-item,
.checker-item {
  outline: none;
}

.draw-item:focus-visible,
.checker-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: rgba(49, 217, 151, 0.04);
}

/* ==================== 设备管理面板（云端同步）==================== */
.device-panel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  height: 32px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.device-panel-btn:hover {
  background: rgba(0, 245, 212, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.device-panel-btn:active {
  transform: scale(0.97);
}

.device-panel-btn svg {
  width: 16px;
  height: 16px;
}

.device-panel-btn-label {
  letter-spacing: 0.02em;
}

@media (max-width: 640px) {
  .device-panel-btn-label {
    display: none;
  }
  .device-panel-btn {
    padding: 6px 8px;
  }
}

.device-panel-overlay {
  align-items: center;
  justify-content: center;
}

.device-panel-card {
  max-width: 460px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.device-panel-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 4px 0;
}

.device-panel-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.device-panel-desc strong {
  color: var(--text-primary);
}

.device-panel-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(0, 245, 212, 0.06);
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: var(--radius-md);
}

.device-panel-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.device-panel-id {
  flex: 1;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  word-break: break-all;
  user-select: all;
}

.btn-icon {
  flex-shrink: 0;
  padding: 4px 10px;
  height: 28px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-icon:hover {
  background: rgba(0, 245, 212, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.device-panel-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md);
}

.device-panel-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  min-height: 220px;
  min-width: 220px;
}

.device-panel-qr img,
.device-panel-qr canvas {
  display: block;
  width: 200px !important;
  height: 200px !important;
}

.device-panel-qr-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
}

.device-panel-details {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
}

.device-panel-details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-primary);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-panel-details summary::-webkit-details-marker {
  display: none;
}

.device-panel-details summary::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.7rem;
  transition: transform var(--transition-normal);
}

.device-panel-details[open] summary::before {
  transform: rotate(90deg);
}

.device-panel-details[open] {
  padding-bottom: 12px;
}

.device-panel-manual-row {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.device-panel-manual-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  font-size: 0.82rem;
}

.device-panel-manual-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.device-panel-manual-row .btn {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 0.82rem;
}

.btn-danger {
  background: rgba(255, 80, 80, 0.12);
  color: #ff7a7a;
  border: 1px solid rgba(255, 80, 80, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 80, 80, 0.2);
  border-color: rgba(255, 80, 80, 0.6);
  color: #ff5252;
}

.device-panel-danger {
  border-color: rgba(255, 80, 80, 0.2);
}

.device-panel-danger-hint {
  margin: 8px 16px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.device-panel-danger .btn {
  margin: 12px 16px 4px;
  padding: 8px 16px;
  min-height: 36px;
  font-size: 0.82rem;
}

.device-panel-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.82rem;
  color: var(--accent);
  text-align: center;
  transition: color var(--transition-normal);
}

/* ========== World Cup Theme Option 3 Overrides ========== */
.theme-worldcup h2,
.theme-worldcup h3,
.theme-worldcup .wc-kicker,
.theme-worldcup .logo-text h1,
.theme-worldcup .selector-tab {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-worldcup .wc-hero {
  border: 1px solid rgba(255, 71, 87, 0.22) !important;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.04), rgba(47, 128, 237, 0.04)) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03), 0 8px 32px rgba(0, 0, 0, 0.2);
}

.theme-worldcup .wc-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(90deg, #ff4757 0%, #ffa502 35%, #2ed573 65%, #36c5f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 6px;
}

.theme-worldcup .wc-hero-sub {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.95rem !important;
  font-weight: 500;
  max-width: 72ch;
}

.theme-worldcup .wc-match-card {
  border-left: 3px solid var(--front-start); /* Mexico Green */
  border-right: 3px solid var(--back-start); /* USA Blue */
  background: rgba(13, 18, 34, 0.45);
}

.theme-worldcup .wc-match-card:hover {
  border-left-color: var(--front-end);
  border-right-color: var(--back-end);
  background: rgba(20, 27, 51, 0.6);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.4), 
    0 0 15px rgba(255, 71, 87, 0.15);
}

.theme-worldcup .wc-group-badge {
  background: linear-gradient(135deg, var(--accent), #ff7a7a) !important; /* Canadian Red Gradient */
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.25);
}

.theme-worldcup .wc-top-card {
  border-top: 2px solid var(--accent);
}

.theme-worldcup .wc-group-tab.active {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.25) !important;
}

/* ========== Today Match Panel (大卡片 + 轮播) ========== */
.wc-today-panel-host {
  margin-top: var(--space-lg);
}

.wc-today {
  position: relative;
  padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-lg);
  background: linear-gradient(180deg, rgba(20, 27, 51, 0.85) 0%, rgba(13, 18, 34, 0.6) 100%);
  border: 1px solid rgba(255, 71, 87, 0.18);
  overflow: hidden;
}

.wc-today-head-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.wc-today-h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  background: linear-gradient(90deg, #ff4757 0%, #ffa502 50%, #2ed573 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.wc-today-sub {
  margin: 0;
  color: var(--text-muted, #8a93a6);
  font-size: 0.85rem;
}

.wc-today-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.wc-today-dot-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.wc-today-strip {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
}

.wc-today-card {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.06) 0%, rgba(47, 128, 237, 0.08) 100%), rgba(13, 18, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.wc-today-card.is-featured {
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.12) 0%, rgba(47, 128, 237, 0.16) 100%), rgba(13, 18, 34, 0.65);
  border-color: rgba(255, 71, 87, 0.35);
  box-shadow: 0 12px 40px rgba(255, 71, 87, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wc-today-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 71, 87, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 71, 87, 0.2);
}

.wc-today-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  gap: var(--space-sm);
}

.wc-today-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #ff4757);
}

.wc-today-kicker svg {
  width: 14px;
  height: 14px;
}

.wc-today-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0 var(--space-lg) 0;
}

.wc-today-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wc-today-team.is-home {
  align-items: flex-end;
}
.wc-today-team.is-away {
  align-items: flex-start;
}

.wc-today-team-flag {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.wc-today-team-name {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
}

.wc-today-team-code {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
}

.wc-today-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-md);
}

.wc-today-featured-score {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(90deg, #36c5f0 0%, #ff4757 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.02em;
}

.wc-today-question {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.5);
}

.wc-today-featured-score.wc-today-pending {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--text-muted, #8a93a6);
  -webkit-text-fill-color: var(--text-muted, #8a93a6);
}

/* 已结束比赛: 真实比分 (FIFA 官方) — 高亮但降饱和 */
.wc-today-featured-score.wc-today-real-score {
  background: linear-gradient(90deg, #00a86b 0%, #5d6c7f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

/* 已结束卡片整体: 略降 opacity, 标明状态 */
.wc-today-card.is-finished {
  opacity: 0.85;
  border-color: rgba(0, 168, 107, 0.25);
}
.wc-today-card.is-finished:hover {
  opacity: 1;
}

/* 已结束角标 (右上) */
.wc-today-finished-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 168, 107, 0.12);
  color: #00a86b;
  border: 1px solid rgba(0, 168, 107, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.wc-today-score small {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* 北京时间 - 跟 AI 预测比分同列竖排, 在比分下面 */
.wc-today-bj-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.wc-today-bj-time .wc-today-chip-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* footer 一行布局: 左下 3 个胜率 + 当地 + 天气 chip */
.wc-today-foot-row--left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.wc-today-pct-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.wc-today-pct-inline.is-rec {
  background: linear-gradient(180deg, rgba(255, 71, 87, 0.18), rgba(255, 71, 87, 0.06));
  border-color: rgba(255, 71, 87, 0.4);
  color: #ff8a98;
  font-weight: 600;
}

.wc-today-pct-inline.is-cal {
  background: linear-gradient(180deg, rgba(46, 213, 115, 0.14), rgba(46, 213, 115, 0.04));
  border-color: rgba(46, 213, 115, 0.4);
  color: #6ee7b7;
  font-weight: 600;
}

.wc-today-pct-inline-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.wc-today-pct-inline-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wc-today-pct-inline-sub {
  font-size: 0.7rem;
  opacity: 0.75;
}

.wc-today-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: var(--space-md);
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.wc-today-foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wc-today-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

.wc-today-chip.is-muted {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.wc-today-chip.is-rec {
  background: linear-gradient(180deg, rgba(255, 71, 87, 0.18), rgba(255, 71, 87, 0.08));
  border-color: rgba(255, 71, 87, 0.45);
  color: #ff8a98;
  font-weight: 600;
}

.wc-today-chip.is-cal {
  background: rgba(0, 168, 107, 0.08);
  font-weight: 600;
}

.wc-today-chip-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.wc-today-nav {
  display: none;
}

.wc-today-disclaimer {
  margin: var(--space-md) 0 0 0;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.wc-today-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.wc-today-empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-bottom: 8px;
}

.wc-today-empty-sub {
  color: var(--text-muted, #8a93a6);
  font-size: 0.9rem;
}

/* 小屏: 主队居左,客队居右,比分居中(保留现布局) — 卡片已经够紧凑,无需特殊断点 */

/* ========== H2H Modal: 4-source Ensemble Card ========== */
.wc-h2h-meta {
  display: inline-block;
  margin-left: var(--space-sm);
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(54, 197, 240, 0.1);
  border: 1px solid rgba(54, 197, 240, 0.22);
  color: #36c5f0;
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

.wc-ensemble-card {
  background: linear-gradient(180deg, rgba(49, 217, 151, 0.06) 0%, rgba(49, 217, 151, 0.02) 100%);
  border: 1px solid rgba(49, 217, 151, 0.18);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.wc-ensemble-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px dashed rgba(49, 217, 151, 0.18);
}

.wc-ensemble-rec,
.wc-ensemble-conf {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wc-ensemble-rec-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wc-ensemble-rec strong,
.wc-ensemble-conf strong {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
  font-family: var(--font-heading);
}

.wc-ensemble-conf strong {
  color: var(--back-start);
}

.wc-ensemble-winbar {
  margin-bottom: var(--space-md);
}

.wc-ensemble-h2h-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.wc-ensemble-h2h-metrics > div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.wc-ensemble-h2h-metrics > div > span {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-bottom: 3px;
}

.wc-ensemble-h2h-metrics > div > strong {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
}

.wc-ensemble-card h4 {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.wc-ensemble-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .wc-ensemble-sources {
    grid-template-columns: 1fr;
  }
}

.wc-ensemble-source {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.wc-ensemble-source-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.wc-ensemble-icon {
  font-size: 1rem;
  line-height: 1;
}

.wc-ensemble-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
  flex: 1;
}

.wc-ensemble-weight {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Monaco', monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 99px;
}

.wc-ensemble-pct-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wc-ensemble-pct {
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: #fff;
  white-space: nowrap;
}

.wc-ensemble-pct.is-home {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.14));
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.wc-ensemble-pct.is-draw {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.14));
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.wc-ensemble-pct.is-away {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.22), rgba(59, 130, 246, 0.14));
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

.wc-ensemble-detail {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== H2H Modal: 缺源提示 ========== */
.wc-ensemble-source.is-empty {
  opacity: 0.55;
  background: transparent;
  border-style: dashed;
}

.wc-ensemble-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 6px 0 2px;
}

/* ============================================================
   v3.4.2: Conformal Prediction + Factor Attribution 样式
   - .wc-factor-meta: 队伍行右侧 metadata
   - .unc-badge: 置信度 badge（低/中/高）
   - .attr-block / .attr-row: 归因柱状条
   - .cp-set-box: H2H 弹窗的预测集卡片
   ============================================================ */

.wc-factor-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.unc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.unc-low {
  color: var(--front-start, #00a86b);
  background: var(--accent-dim, rgba(48, 209, 88, 0.12));
}
.unc-med {
  color: var(--warning, #faad14);
  background: rgba(250, 173, 20, 0.12);
}
.unc-high {
  color: var(--danger, #ff4d4f);
  background: rgba(255, 77, 79, 0.12);
}

.wc-factor-ci {
  font-size: 11px;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  margin: 8px 0 4px;
  font-family: 'SF Mono', Menlo, monospace;
  letter-spacing: 0.2px;
}

.attr-block {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 0.5px solid var(--card-border, rgba(255, 255, 255, 0.08));
}
.attr-hd {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  margin-bottom: 6px;
}
.attr-base {
  font-size: 12px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  margin-bottom: 8px;
  font-family: 'SF Mono', Menlo, monospace;
}
.attr-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.attr-lbl {
  flex: 0 0 64px;
  font-weight: 600;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}
.attr-bar {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}
.attr-seg {
  height: 100%;
  transition: width 0.3s ease;
}
.attr-val {
  flex: 0 0 72px;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  font-family: 'SF Mono', Menlo, monospace;
}
.attr-val.is-pos { color: var(--front-start, #00a86b); }
.attr-val.is-neg { color: var(--danger, #ff4757); }

/* H2H 弹窗：Conformal Prediction Set 卡片 */
.cp-set-box {
  /* 颜色由内联 style 根据 set_size 1/2/3 控制 */
}
.cp-set-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cp-set-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
}
.cp-set-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.4px;
}
.cp-set-exp {
  font-size: 12px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.8));
  margin-bottom: 4px;
  line-height: 1.4;
}
.cp-set-conf {
  font-size: 10.5px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  font-family: 'SF Mono', Menlo, monospace;
}

/* H2H 弹窗：Conformal 校正后的"安全边际"卡片
   复用 wc-ensemble-card 样式，但加 cp-calibrated 类做区分
   - 上方一行 raw → adj 对比
   - 概率柱带 delta（+1.2 / -3.4）
   - 底部说明为什么这步是合理的 */
.cp-calibrated {
  border: 1px dashed rgba(0, 168, 107, 0.35);
  background: linear-gradient(180deg, rgba(0,168,107,0.04) 0%, transparent 100%);
  margin-bottom: 14px;
}
.cp-raw-compare {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  margin: 10px 0 6px;
  font-family: 'SF Mono', Menlo, monospace;
  letter-spacing: 0.2px;
}
.cp-raw-compare span:last-child {
  color: var(--text-secondary, rgba(255, 255, 255, 0.8));
  font-weight: 600;
}
.cp-arrow {
  color: var(--front-start, #00a86b);
  font-weight: 800;
  font-size: 14px;
}
.cp-calibrated-bar {
  margin-top: 4px;
}
.cp-delta {
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', Menlo, monospace;
  background: rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.cp-delta.is-pos {
  color: var(--front-start, #00a86b);
}
.cp-delta.is-neg {
  color: var(--danger, #ff4757);
}
.cp-delta.is-neutral {
  color: var(--text-muted, rgba(255, 255, 255, 0.45));
}
.cp-calibrate-note {
  font-size: 11px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  line-height: 1.45;
  margin-top: 8px;
  font-style: italic;
}

/* ============================================================
 * v3.4.3: 4 源融合 + Conformal 校正增强样式
 * - 源完整性 / 一致度 / CI 反馈
 * ============================================================ */

.wc-ensemble-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px 0;
  font-size: 11px;
}

.wc-ensemble-sources.is-complete,
.wc-ensemble-sources.is-partial,
.wc-ensemble-sources.is-weak,
.wc-ensemble-agreement {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.wc-ensemble-sources.is-complete {
  background: rgba(0, 168, 107, 0.12);
  color: #00a86b;
  border: 1px solid rgba(0, 168, 107, 0.30);
}
.wc-ensemble-sources.is-partial {
  background: rgba(250, 173, 20, 0.12);
  color: #faad14;
  border: 1px solid rgba(250, 173, 20, 0.30);
}
.wc-ensemble-sources.is-weak {
  background: rgba(255, 71, 87, 0.12);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.30);
}

.wc-ensemble-agreement.is-good {
  background: rgba(0, 168, 107, 0.10);
  color: #00a86b;
}
.wc-ensemble-agreement.is-mid {
  background: rgba(250, 173, 20, 0.10);
  color: #faad14;
}
.wc-ensemble-agreement.is-bad {
  background: rgba(255, 71, 87, 0.10);
  color: #ff4757;
}

/* 冠军价值 picks: CI 半宽 badge */
.wc-value-card.is-low-conf {
  border-left: 3px solid #faad14;
}
.wc-value-ci {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  font-weight: 500;
}
.wc-value-discount {
  color: #faad14;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}
