:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2a3a4d;
  --text: #e8edf4;
  --muted: #8899aa;
  --primary: #00c853;
  --home: #4caf50;
  --draw: #ffc107;
  --away: #2196f3;
  --risk-low: #00c853;
  --risk-mid: #ffc107;
  --risk-high: #ff5252;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.header {
  background: linear-gradient(135deg, #1a472a 0%, #0f3460 100%);
  padding: 1.5rem 1rem;
  text-align: center;
}

.header h1 { font-size: 1.4rem; font-weight: 700; }
.subtitle { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.form-row {
  margin-bottom: 0.75rem;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.form-row select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  min-width: 140px;
}

.btn-primary:active { opacity: 0.85; }

.auto-refresh {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.loading {
  text-align: center;
  padding: 1rem;
  color: var(--primary);
}

.hidden { display: none !important; }

.final-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.final-item {
  text-align: center;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg);
}

.final-item.home { border-top: 3px solid var(--home); }
.final-item.draw { border-top: 3px solid var(--draw); }
.final-item.away { border-top: 3px solid var(--away); }

.final-item .label { display: block; font-size: 0.8rem; color: var(--muted); }
.final-item .value { font-size: 1.5rem; font-weight: 700; }

.recommendation {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.95rem;
}

.recommendation .sep { margin: 0 0.5rem; color: var(--border); }
.recommendation strong { color: var(--primary); }

.risk-low { color: var(--risk-low) !important; }
.risk-mid { color: var(--risk-mid) !important; }
.risk-high { color: var(--risk-high) !important; }

.reason {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.chart-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 220px;
}

.chart-box.full {
  grid-column: 1 / -1;
  min-height: 200px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; white-space: nowrap; }
td:nth-child(2), td:nth-child(3), td:nth-child(4),
th:nth-child(2), th:nth-child(3), th:nth-child(4) {
  text-align: center;
  font-family: monospace;
}

.badge {
  background: var(--primary);
  color: #000;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.history-list {
  list-style: none;
  font-size: 0.85rem;
}

.history-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.sources ul { list-style: none; }
.sources li { padding: 0.35rem 0; }
.sources a { color: var(--primary); text-decoration: none; }

.data-sync { font-size: 0.75rem; color: var(--muted); margin-top: 0.35rem; }

/* 组合模式开关 */
.combo-switch {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.combo-btn {
  flex: 1;
  min-width: 90px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.combo-btn.active {
  background: #2196f3;
  border-color: #2196f3;
  color: #fff;
  font-weight: 600;
}

.fusion-summary {
  background: var(--bg);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.fusion-summary h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.fusion-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; line-height: 1.5; }

.prob-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prob-badges .badge {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.prob-badges .badge.home { background: #2196f3; color: #fff; }
.prob-badges .badge.draw { background: #607d8b; color: #fff; }
.prob-badges .badge.away { background: #e53935; color: #fff; }

/* 数据来源说明 */
.sources-rich .sources-intro { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.75rem; }
.source-list { list-style: none; }
.source-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.6;
}
.source-list li:last-child { border-bottom: none; }
.src-icon { margin-right: 0.35rem; }
.source-list em { color: var(--primary); font-style: normal; font-size: 0.85rem; }
.source-list a { color: #64b5f6; text-decoration: none; }
.disclaimer {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 152, 0, 0.12);
  border-left: 3px solid #ff9800;
  font-size: 0.85rem;
  color: #ffcc80;
  border-radius: 0 6px 6px 0;
}

/* 比分预测 */
.score-panel .score-highlight {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.score-main {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}
.score-prob { font-size: 0.95rem; color: var(--muted); }
.score-meta { font-size: 0.9rem; margin-bottom: 0.5rem; }
.score-top-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.score-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.score-chip .rank { color: var(--muted); font-size: 0.75rem; }
.score-chip .sc { font-weight: 600; }
.score-chip .pr { color: #64b5f6; }

/* 盘口信息 */
.odds-status { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.odds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.odds-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
.odds-item .label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.odds-item .value { font-size: 1rem; font-weight: 600; line-height: 1.4; word-break: break-word; }
.odds-source { font-size: 0.8rem; color: var(--muted); }

.formula-unavailable td { color: var(--muted); font-style: italic; }

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .charts { grid-template-columns: 1fr; }
  .final-grid { gap: 0.5rem; }
  .final-item .value { font-size: 1.2rem; }
  .recommendation { font-size: 0.85rem; }
  table { font-size: 0.75rem; }
}
