/* ============================================================
   七彩威廉 · 北单赔率数据展示 - 浅色简洁风格
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f6fa;
  color: #333;
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

main.main {
  flex: 1;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-bottom: 1px solid #e8e8e8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #e94560;
}

.logo-icon {
  font-size: 1.4rem;
  color: #e94560;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-item {
  padding: 6px 16px;
  font-size: 0.9rem;
  color: #666;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item.active {
  background: #e94560;
  color: #fff;
  font-weight: 600;
}

.nav-item:not(.active):hover {
  background: #f0f0f0;
  color: #333;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-update {
  font-size: 0.8rem;
  color: #999;
}

/* ---------- Main ---------- */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #fff;
  border-radius: 8px 8px 0 0;
  border: 1px solid #e8e8e8;
  border-bottom: none;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.league-badge {
  background: #1890ff;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.issue-num {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  border-color: #1890ff;
  color: #1890ff;
  background: #e6f7ff;
}

.refresh-icon {
  font-size: 1rem;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-size: 0.85rem;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.filter-label input {
  margin-right: 4px;
}

.countdown {
  display: inline-block;
  min-width: 40px;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.countdown.warn { color: #e65100; background: #fff3e0; }
.countdown.off { color: #999; background: #f5f5f5; }

/* ---------- Status Bar ---------- */
.status-bar {
  padding: 10px 20px;
  font-size: 0.85rem;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  color: #666;
  border-radius: 0;
}

.status-bar.loading { background: #fffbe6; color: #d48806; }
.status-bar.success { background: #f6ffed; color: #389e0d; }
.status-bar.error   { background: #fff2f0; color: #cf1322; }

/* ---------- Table Card ---------- */
.table-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

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

.odds-table thead th {
  background: #fafafa;
  color: #666;
  font-weight: 600;
  padding: 12px 10px;
  white-space: nowrap;
  border-bottom: 1px solid #e8e8e8;
  text-align: center;
}

.odds-table thead .col-william-title {
  background: #fff1f0;
  color: #e94560;
  border-bottom: 1px solid #ffa39e;
}

.odds-table .sub-header th {
  padding: 6px 10px;
  font-size: 0.8rem;
  color: #999;
  font-weight: 500;
  background: #fff;
}

.odds-table .col-no    { width: 50px; }
.odds-table .col-league { width: 80px; color: #1890ff; font-size: 0.8rem; }
.odds-table .col-time  { width: 140px; font-size: 0.85rem; color: #666; }
.odds-table .col-home  { text-align: right; }
.odds-table .col-away  { text-align: left; }
.odds-table .col-draw  { width: 70px; text-align: center; }
.odds-table .col-william { width: 70px; }
.odds-table .col-status { width: 80px; }

.odds-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.odds-table tbody .col-league {
  color: #1890ff;
  font-size: 0.8rem;
}

.odds-table tbody .col-home,
.odds-table tbody .col-away {
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
}

.odds-table tbody tr:hover {
  background: #fafafa;
}

.odds-table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

.odds-table tbody tr:nth-child(even):hover {
  background: #f5f5f5;
}

/* 让球值 */
.let-ball {
  font-size: 0.75rem;
  color: #e94560;
  font-weight: 600;
  margin-left: 2px;
}

.let-ball.positive { color: #52c41a; }
.let-ball.zero     { color: #999; }

/* 威廉初赔列 */
.odds-table tbody .col-william {
  color: #e94560;
  font-weight: 600;
  background: #fff7f7;
}

/* SP 赔率 (主/平/客 - 来自北单) */
.sp-cell {
  color: #333;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-tag.upcoming { background: #e6f7ff; color: #1890ff; }
.status-tag.live     { background: #fff7e6; color: #fa8c16; }
.status-tag.finished { background: #f5f5f5; color: #999; }

/* 空行 */
.empty-row .empty-td {
  padding: 40px;
  color: #999;
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Debug ---------- */
.debug-panel {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
}

.debug-panel summary {
  cursor: pointer;
  color: #999;
  user-select: none;
}

.debug-panel pre {
  margin-top: 12px;
  padding: 12px;
  background: #1e1e1e;
  color: #9cdcfe;
  border-radius: 4px;
  font-size: 0.75rem;
  max-height: 300px;
  overflow: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 20px;
  color: #bbb;
  font-size: 0.8rem;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}

/* ---------- 比分情况 ---------- */
.col-score { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-score .score-final { color: #2e7d32; font-weight: 700; }
.col-score .score-live { color: #e53935; font-weight: 700; }
.col-score .score-pending { color: #c0c4cc; }
.score-live-dot {
  display: inline-block; width: 6px; height: 6px; margin-left: 5px;
  border-radius: 50%; background: #e53935; vertical-align: middle;
  animation: scorePulse 1.2s ease-in-out infinite;
}
@keyframes scorePulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; gap: 16px; height: 48px; }
  .main { padding: 12px; }
  .toolbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  .nav { display: none; }
  .odds-table { font-size: 0.8rem; }
}

/* ============================================================
   双赔率对比样式
   ============================================================ */
.col-compare { text-align: center; background: #f8f9fa; border-left: 2px solid #e2e8f0; }
.col-odds-tag.sp-tag { background: #fff1f0; color: #e53935; font-weight: 600; font-size: 0.72rem; }
.col-odds-tag.wm-tag { background: #e6f4ea; color: #2e7d32; font-weight: 600; font-size: 0.72rem; }
.col-odds { text-align: center; font-family: 'Consolas', monospace; font-weight: 600; font-size: 0.92rem; padding: 10px 6px !important; }
.sp-cell { color: #e53935; background: #fff9f8; }
.wm-cell { color: #2e7d32; background: #f5faf5; }
tr:hover .sp-cell { background: #fff0ed; }
tr:hover .wm-cell { background: #edf7ed; }
tr:hover { background: #f0f7ff !important; }

.col-detail-link { text-align: center; white-space: nowrap; }
.detail-btn {
  display: inline-block; padding: 4px 10px; border-radius: 12px;
  background: #e8eaf0; color: #9aa3b2;
  font-size: 0.78rem; cursor: pointer; transition: all 0.2s;
}
.detail-btn:hover { background: #d8dce6; color: #6b7484; transform: scale(1.05); }

/* 有分析内容的场次：橙红高亮 */
.detail-btn.has-analysis {
  background: linear-gradient(135deg, #e53935, #ff7043);
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
}
.detail-btn.has-analysis:hover {
  background: linear-gradient(135deg, #c62828, #e64a19);
  color: #fff; transform: scale(1.08);
}

/* ============================================================
   详情页样式 (match.html)
   ============================================================ */
.detail-header {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: #fff; padding: 24px; border-radius: 12px; margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(26, 35, 126, 0.3);
}
.detail-header .league-tag {
  display: inline-block; padding: 3px 10px; background: rgba(255,255,255,0.15);
  border-radius: 4px; font-size: 0.85rem; margin-bottom: 12px;
}
.detail-header .teams-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.detail-header .team {
  flex: 1; min-width: 150px; text-align: center;
}
.detail-header .team-name { font-size: 1.5rem; font-weight: 700; }
.detail-header .team-tag { font-size: 0.78rem; color: rgba(255,255,255,0.7); margin-top: 4px; }
.detail-header .vs {
  font-size: 1.2rem; font-weight: 700; color: rgba(255,255,255,0.6);
}
.detail-header .match-meta {
  margin-top: 12px; text-align: center; font-size: 0.88rem; color: rgba(255,255,255,0.8);
}

.odds-compare {
  background: #fff; border-radius: 10px; padding: 18px; margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.odds-compare h3 { font-size: 1rem; color: #333; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.odds-row { display: flex; gap: 20px; align-items: center; }
.odds-row .bookie {
  flex: 1; text-align: center; padding: 12px; border-radius: 8px;
  background: #f8f9fa; border: 1px solid #e9ecef;
}
.odds-row .bookie.william { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); border-color: #81c784; }
.odds-row .bookie.spf { background: linear-gradient(135deg, #ffebee, #ffcdd2); border-color: #ef9a9a; }
.odds-row .bookie-title { font-size: 0.85rem; color: #666; margin-bottom: 6px; }
.odds-row .bookie.william .bookie-title { color: #2e7d32; font-weight: 600; }
.odds-row .bookie.spf .bookie-title { color: #c62828; font-weight: 600; }
.odds-row .bookie-values { display: flex; justify-content: center; gap: 12px; }
.odds-row .bookie-values span {
  min-width: 42px; font-family: Consolas, monospace; font-weight: 700; font-size: 1.1rem;
  padding: 6px 8px; border-radius: 4px; background: rgba(255,255,255,0.6);
}

.section-card {
  background: #fff; border-radius: 10px; margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06); overflow: hidden;
}
.section-card h3 {
  padding: 12px 18px; font-size: 0.98rem; font-weight: 700;
  background: #f5f7fa; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; gap: 8px;
}
.section-card h3::before {
  content: ''; display: inline-block; width: 4px; height: 18px; border-radius: 2px;
}
.section-card.head-to-head h3::before { background: #ff6f00; }
.section-card.recent h3::before { background: #1976d2; }

/* ========== 欧核 AI 单场分析 ========== */
.section-card.analysis h3::before { background: #7b1fa2; }
#analysisBody { padding: 14px 18px; }
/* markdown 正文排版 */
.md-body { font-size: 0.92rem; line-height: 1.85; color: #333; }
.md-body h1 {
  font-size: 1.15rem;
  color: #0d47a1;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e3f2fd;
}
.md-body h2 {
  font-size: 1rem;
  color: #1565c0;
  margin: 22px 0 8px;
  padding-left: 8px;
  border-left: 3px solid #7b1fa2;
}
.md-body p { margin: 6px 0; }
.md-body strong { color: #b71c1c; }
.md-body ul, .md-body ol { margin: 6px 0 10px; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body hr { border: none; border-top: 1px dashed #ddd; margin: 16px 0; }
.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  font-size: 0.85rem;
  background: #fff;
}
.md-body th {
  background: #f5f7fa;
  color: #0d47a1;
  font-weight: 600;
  padding: 7px 10px;
  border: 1px solid #e6e8eb;
  text-align: left;
  white-space: nowrap;
}
.md-body td { padding: 6px 10px; border: 1px solid #eef0f2; }
.md-body tr:nth-child(even) td { background: #fafbfc; }
.md-body blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  background: #fafafa;
  border-left: 3px solid #ccc;
  color: #666;
}
.analysis-empty {
  padding: 40px 18px;
  text-align: center;
  color: #bbb;
  font-size: 0.9rem;
}

.fixture-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.fixture-table th {
  background: #fafafa; padding: 10px 12px; text-align: center;
  font-weight: 600; color: #666; border-bottom: 1px solid #eee; font-size: 0.82rem;
}
.fixture-table td {
  padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: center;
}
.fixture-table tr:hover { background: #fafbfc; }
.fixture-table .team-cell { text-align: left; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.fixture-table .result-win { color: #c62828; font-weight: 700; }
.fixture-table .result-draw { color: #f57f17; font-weight: 700; }
.fixture-table .result-lose { color: #2e7d32; font-weight: 700; }

/* ========== 赔率变化历史专业表格 ========== */
.od-compare {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fff9e6, #fff);
  border: 1px solid #ffe082; border-radius: 8px;
  padding: 14px 18px; margin-bottom: 14px;
}
.od-cmp-item { display: flex; align-items: center; gap: 6px; font-size: 1.05rem; }
.od-cmp-label {
  font-size: 0.75rem; color: #888; margin-right: 4px;
  background: #f5f5f5; padding: 2px 8px; border-radius: 4px;
}
.od-cmp-arrow { color: #f57f17; font-weight: 700; font-size: 1.2rem; }
.odds-history-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
  border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden;
}
.odds-history-table thead th {
  background: linear-gradient(180deg, #1565c0, #0d47a1);
  color: #fff; padding: 10px 12px; font-weight: 600; font-size: 0.85rem;
  text-align: center; letter-spacing: 1px;
}
.odds-history-table thead .col-time { width: 42%; }
.odds-history-table thead .col-home { width: 19%; }
.odds-history-table thead .col-draw { width: 19%; }
.odds-history-table thead .col-away { width: 20%; }
.odds-history-table tbody td {
  padding: 9px 12px; text-align: center;
  border-bottom: 1px solid #f0f0f0;
}
.odds-history-table tbody tr:hover { background: #f5f9ff; }
.odds-history-table tbody tr.od-opening { background: #f1f8e9; }
.odds-history-table tbody tr.od-latest  { background: #fff8e1; font-weight: 600; }
.od-time { text-align: left !important; color: #555; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.od-num { display: inline-block; font-variant-numeric: tabular-nums; min-width: 42px; }
.od-up   { color: #c62828; font-weight: 700; }   /* 升高=红 */
.od-down { color: #2e7d32; font-weight: 700; }   /* 降低=绿 */
.od-tag {
  display: inline-block; padding: 1px 6px; margin-left: 6px;
  font-size: 0.65rem; font-weight: 600; border-radius: 3px;
}
.od-open { background: #2e7d32; color: #fff; }
.od-late { background: #f57f17; color: #fff; }

.recent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; }
@media (max-width: 768px) { .recent-grid { grid-template-columns: 1fr; } }

.recent-team h4 {
  font-size: 0.92rem; color: #333; margin-bottom: 10px; font-weight: 600;
}
.recent-stats { display: flex; gap: 12px; margin-bottom: 10px; font-size: 0.85rem; }
.recent-stats .stat {
  padding: 4px 10px; border-radius: 12px; font-weight: 600;
}
.recent-stats .win { background: #ffebee; color: #c62828; }
.recent-stats .draw { background: #fff3e0; color: #e65100; }
.recent-stats .lose { background: #e8f5e9; color: #2e7d32; }

.recent-bars { display: flex; gap: 4px; margin-bottom: 12px; }
.recent-bars .bar {
  flex: 1; height: 22px; border-radius: 4px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 0.72rem; font-weight: 700;
}
.recent-bars .bar.win { background: #ef5350; }
.recent-bars .bar.draw { background: #ffa726; }
.recent-bars .bar.lose { background: #66bb6a; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 20px;
  color: #1976d2; font-size: 0.88rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; margin-bottom: 16px;
}
.back-btn:hover { background: #e3f2fd; border-color: #1976d2; }

.loading-spinner { text-align: center; padding: 60px 20px; color: #999; }
.empty-tip { text-align: center; padding: 30px; color: #999; font-size: 0.88rem; }
