/* ================================================================
   双色球分析系统 - 全局样式
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --primary-light: #ff6b6b;
  --blue-ball: #1d6af5;
  --blue-ball-dark: #1045c0;
  --accent: #ffd60a;
  --accent-dark: #e6b800;
  --bg-dark: #0a0e1a;
  --bg-card: #111827;
  --bg-card2: #1a2235;
  --bg-card3: #1e2d45;
  --text-primary: #f0f4ff;
  --text-secondary: #8a99b8;
  --text-muted: #4a5568;
  --border: #1e2d45;
  --hot-color: #ff4757;
  --cold-color: #1e90ff;
  --normal-color: #2ed573;
  --gradient-red: linear-gradient(135deg, #e63946, #c1121f);
  --gradient-blue: linear-gradient(135deg, #1d6af5, #0a3eb8);
  --gradient-gold: linear-gradient(135deg, #ffd60a, #e6b800);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow-red: 0 0 20px rgba(230,57,70,0.3);
  --shadow-glow-blue: 0 0 20px rgba(29,106,245,0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============ 背景装饰 ============ */
body::before {
  content: '';
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 10% 10%, rgba(230,57,70,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(29,106,245,0.08) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* ============ 布局 ============ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative; z-index: 1;
}

/* ============ 头部 ============ */
.header {
  background: linear-gradient(180deg, rgba(10,14,26,0.98) 0%, rgba(10,14,26,0.95) 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex; align-items: center; gap: 12px;
}

.logo-icon {
  width: 48px; height: 48px;
  background: var(--gradient-red);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-glow-red);
}

.logo-text h1 {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, #fff, #e63946);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text p {
  font-size: 0.75rem; color: var(--text-secondary);
}

.header-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-secondary);
}

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ed573;
  box-shadow: 0 0 6px #2ed573;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* ============ 免责声明横幅 ============ */
.disclaimer-banner {
  background: linear-gradient(90deg, rgba(230,57,70,0.15), rgba(29,106,245,0.1));
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  margin: 20px 0;
  font-size: 0.82rem;
  color: #ffd60a;
  text-align: center;
  line-height: 1.8;
}

.disclaimer-banner strong { color: #ff6b6b; }

/* ============ 统计卡片行 ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow-red);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.red { background: rgba(230,57,70,0.15); }
.stat-icon.blue { background: rgba(29,106,245,0.15); }
.stat-icon.gold { background: rgba(255,214,10,0.15); }
.stat-icon.green { background: rgba(46,213,115,0.15); }

.stat-info .label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px; }
.stat-info .value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }

/* ============ 操作按钮区 ============ */
.action-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px; height: 20px;
  background: var(--gradient-red);
  border-radius: 2px;
  display: inline-block;
}

.btn-group {
  display: flex; gap: 12px; flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
  position: relative; overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width 0.4s, height 0.4s, opacity 0.4s;
  opacity: 0;
}

.btn:active::after {
  width: 200px; height: 200px; opacity: 1;
  transition: 0s;
}

.btn-primary {
  background: var(--gradient-red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(230,57,70,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(230,57,70,0.5);
}

.btn-blue {
  background: var(--gradient-blue);
  color: #fff;
  box-shadow: 0 4px 15px rgba(29,106,245,0.3);
}
.btn-blue:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(29,106,245,0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5; cursor: not-allowed;
  transform: none !important;
}

/* ============ 提示消息 ============ */
.toast-container {
  position: fixed; top: 80px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.88rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  max-width: 360px;
  animation: slideIn 0.3s ease;
  display: flex; align-items: flex-start; gap: 10px;
}
.toast.success { border-left: 3px solid #2ed573; }
.toast.error { border-left: 3px solid #ff4757; }
.toast.info { border-left: 3px solid #1d6af5; }
.toast.warning { border-left: 3px solid #ffd60a; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ 加载状态 ============ */
.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,14,26,0.85);
  z-index: 1000;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  backdrop-filter: blur(4px);
}
.loading-overlay.show { display: flex; }

.spinner {
  width: 56px; height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--text-secondary); font-size: 0.95rem; }

/* ============ 最新开奖展示 ============ */
.latest-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card2));
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-glow-red);
  position: relative; overflow: hidden;
}

.latest-card::before {
  content: '🏆最新开奖';
  position: absolute; top: 12px; right: 20px;
  font-size: 0.75rem; color: var(--text-secondary);
  background: rgba(230,57,70,0.1);
  padding: 4px 10px; border-radius: 20px;
}

.latest-info {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}

.latest-issue { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.latest-date { font-size: 0.85rem; color: var(--text-secondary); }

.balls-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.ball {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}

.ball.red {
  background: var(--gradient-red);
  color: #fff;
  box-shadow: 0 3px 12px rgba(230,57,70,0.5);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.ball.blue {
  background: var(--gradient-blue);
  color: #fff;
  box-shadow: 0 3px 12px rgba(29,106,245,0.5);
}

.ball-sep { color: var(--text-muted); font-size: 1.2rem; margin: 0 4px; }

.prize-info {
  display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap;
}
.prize-item { font-size: 0.85rem; color: var(--text-secondary); }
.prize-item strong { color: var(--accent); }

/* ============ 数据表格 ============ */
.table-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 700px;
}

thead th {
  background: var(--bg-card2);
  padding: 12px 14px;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(30,45,69,0.6);
  transition: var(--transition);
}

tbody tr:hover { background: rgba(230,57,70,0.05); }

tbody td {
  padding: 10px 14px;
  text-align: center;
  color: var(--text-primary);
}

.td-issue { color: var(--accent); font-weight: 600; }
.td-date { color: var(--text-secondary); }

.ball-sm {
  display: inline-flex;
  width: 30px; height: 30px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  margin: 1px;
}
.ball-sm.red { background: var(--gradient-red); color: #fff; }
.ball-sm.blue { background: var(--gradient-blue); color: #fff; }

.td-money { font-size: 0.82rem; color: #2ed573; }
.td-pool { font-size: 0.82rem; color: var(--accent); }

/* 分页 */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 20px; flex-wrap: wrap;
}

.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  font-family: inherit;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--gradient-red);
  border-color: transparent;
  color: #fff;
}

.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-info { font-size: 0.82rem; color: var(--text-secondary); padding: 0 8px; }

/* ============ 图表区域 ============ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.chart-title {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}

.echarts-box {
  width: 100%; height: 280px;
}

/* ============ 频率分析网格 ============ */
.freq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.freq-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  cursor: default;
  transition: var(--transition);
}

.freq-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.freq-item .ball { width: 36px; height: 36px; font-size: 0.82rem; }

.freq-item .count {
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-primary);
}

.freq-item .prob {
  font-size: 0.68rem; color: var(--text-secondary);
}

.freq-item.hot { border-color: var(--hot-color); background: rgba(255,71,87,0.08); }
.freq-item.cold { border-color: var(--cold-color); background: rgba(30,144,255,0.08); }

.legend-row {
  display: flex; gap: 16px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
}

.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-secondary);
}

.legend-dot {
  width: 12px; height: 12px; border-radius: 3px;
}

/* ============ 统计信息卡片 ============ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.info-card .title { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; font-weight: 600; }

.dist-bar {
  margin-bottom: 10px;
}

.dist-bar .bar-label {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-secondary);
  margin-bottom: 4px;
}

.dist-bar .bar-track {
  height: 8px; border-radius: 4px;
  background: var(--bg-card2);
  overflow: hidden;
}

.dist-bar .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

/* ============ 推荐号码 ============ */
.recommend-section {
  margin-bottom: 24px;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.recommend-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative; overflow: hidden;
}

.recommend-card::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
}

.recommend-card:nth-child(1)::after { background: var(--gradient-red); }
.recommend-card:nth-child(2)::after { background: var(--gradient-blue); }
.recommend-card:nth-child(3)::after { background: var(--gradient-gold); }

.recommend-card:hover {
  border-color: rgba(230,57,70,0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-red);
}

.recommend-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.strategy-tag {
  font-size: 0.78rem; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
}

.strategy-tag.hot { background: rgba(255,71,87,0.15); color: var(--hot-color); }
.strategy-tag.cold_hot { background: rgba(29,106,245,0.15); color: var(--cold-color); }
.strategy-tag.uniform { background: rgba(46,213,115,0.15); color: var(--normal-color); }

.recommend-balls {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}

.rec-ball {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}

.rec-ball .ball { width: 42px; height: 42px; font-size: 0.9rem; }

.rec-ball .prob-tag {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.rec-ball .type-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  position: absolute; top: -2px; right: -2px;
}
.type-dot.hot { background: var(--hot-color); box-shadow: 0 0 4px var(--hot-color); }
.type-dot.cold { background: var(--cold-color); box-shadow: 0 0 4px var(--cold-color); }

.recommend-disclaimer {
  font-size: 0.72rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
  line-height: 1.8;
}

.global-disclaimer {
  background: linear-gradient(135deg, rgba(230,57,70,0.1), rgba(29,106,245,0.05));
  border: 1px solid rgba(230,57,70,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 0.82rem;
  color: var(--accent);
  line-height: 2;
  text-align: center;
}

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  line-height: 2;
}

/* ============ 进度条 ============ */
.progress-bar-container {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
  display: none;
}
.progress-bar-container.show { display: block; }
.progress-bar {
  height: 100%;
  background: var(--gradient-red);
  width: 0;
  border-radius: 2px;
  transition: width 0.3s;
  animation: progress-pulse 1s infinite alternate;
}
@keyframes progress-pulse {
  from { opacity: 0.7; } to { opacity: 1; }
}

/* ============ 选项卡 ============ */
.tab-nav {
  display: flex; gap: 4px;
  background: var(--bg-card2);
  padding: 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: none; cursor: pointer;
  font-size: 0.88rem; font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn.active {
  background: var(--gradient-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(230,57,70,0.3);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* 空状态 */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .charts-grid { grid-template-columns: 1fr; }
  .recommend-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .echarts-box { height: 220px; }
  .ball { width: 38px; height: 38px; font-size: 0.85rem; }
  .logo-text h1 { font-size: 1.1rem; }
  .balls-row { gap: 6px; }
  .freq-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  table { font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .tab-btn { padding: 6px 12px; font-size: 0.82rem; }
}
