:root {
  --bg: #0b1020;
  --card: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #e6e8f0;
  --text-dim: #9aa0b5;
  --accent: #4f7cff;
  --accent2: #7b5cff;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
}

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

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1a2350 0%, transparent 60%),
              radial-gradient(1000px 500px at 100% 0%, #2a1a4a 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* 顶部导航 */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.game-tabs { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.tab, .lang {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}
.tab:hover, .lang:hover { color: var(--text); border-color: var(--accent); }
.tab.active, .lang.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}
.lang-switch { display: flex; gap: 6px; }

/* 布局 */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.card h2 {
  font-size: 16px;
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 600;
}
.expect-tag {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

/* 号码球 */
.balls { display: flex; flex-wrap: wrap; gap: 8px; }
.ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.ball.special { background: linear-gradient(135deg, #f59e0b, #ef4444); }

/* 预测组 */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.group {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px;
}
.group .g-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.group .g-rate { color: var(--green); font-weight: 600; }
.g-sum { color: var(--text-dim); font-size: 12px; margin-top: 6px; }

/* 维度 */
.dimensions { display: flex; flex-direction: column; gap: 12px; }
.dim-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; }
.dim-row .dim-label { color: var(--text-dim); min-width: 90px; }

/* 频率/遗漏条 */
.bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.bar-item { font-size: 12px; color: var(--text-dim); }
.bar-track { height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* 回测统计 */
.backtest-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.stat {
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 120px;
}
.stat .s-label { font-size: 12px; color: var(--text-dim); }
.stat .s-value { font-size: 20px; font-weight: 700; color: var(--green); }
.strat-list { display: flex; flex-direction: column; gap: 8px; }
.strat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.strat-row .s-name { min-width: 80px; color: var(--text-dim); }
.strat-row .s-bar { flex: 1; height: 8px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.strat-row .s-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.strat-row .s-pct { min-width: 60px; text-align: right; color: var(--text); }

/* 开奖列表 */
.draw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.draw-table th, .draw-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--card-border); }
.draw-table th { color: var(--text-dim); font-weight: 500; }
.draw-table .mini-balls { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-ball {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}
.mini-ball.special { background: linear-gradient(135deg, #f59e0b, #ef4444); }

.loading { color: var(--text-dim); padding: 20px; text-align: center; }
.error { color: var(--red); padding: 20px; text-align: center; }

/* 最新开奖头部 */
.latest-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.latest-issue {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.latest-issue-suffix { color: var(--text-dim); font-size: 14px; }
.latest-date { margin-left: auto; color: var(--text-dim); font-size: 13px; }

/* 卡片头部（标题 + 右侧控件） */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin-bottom: 0; }
.recent-control { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.recent-control input {
  width: 70px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,.06);
  color: var(--text); font-size: 13px;
}
.recent-expect { color: var(--text); font-weight: 500; }
.recent-date { color: var(--text-dim); font-size: 11px; margin-top: 2px; }

/* 预测记录状态 */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status.pending { background: rgba(245, 158, 11, .15); color: var(--yellow); }
.status.hit { background: rgba(34, 197, 94, .15); color: var(--green); }
.status.miss { background: rgba(239, 68, 68, .15); color: var(--red); }

/* 预测记录命中详情 */
.pred-stats { margin-bottom: 14px; }
.pred-table td { vertical-align: middle; }
.hit-detail { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.hit-num, .miss-num {
  font-size: 12px; padding: 2px 8px; border-radius: 6px;
}
.hit-num { background: rgba(34, 197, 94, .12); color: var(--green); }
.miss-num { background: rgba(255, 255, 255, .06); color: var(--text-dim); }

/* 预测记录命中详情（号码球） */
.g-hit, .g-miss { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 0; }
.g-name { color: var(--text-dim); min-width: 60px; }
.g-zero { color: var(--text-dim); }
.g-hit .mini-ball { background: linear-gradient(135deg, #22c55e, #16a34a); }
.g-miss .mini-ball { background: rgba(255,255,255,.1); }

/* 玩法命中清单 */
.play-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.play-tag-hit, .play-tag-miss { font-size: 12px; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.play-tag-hit { background: rgba(34, 197, 94, .15); color: var(--green); }
.play-tag-miss { background: rgba(255, 255, 255, .06); color: var(--text-dim); }

/* 预测记录展开详情 */
.expand-btn { cursor: pointer; color: var(--accent); font-size: 16px; user-select: none; padding: 0 6px; }
.pred-detail td { background: rgba(0,0,0,.18); }
.pred-detail-box { padding: 6px 0; }
.pd-section { margin-bottom: 12px; }
.pd-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.pd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.pd-label { min-width: 80px; color: var(--text-dim); }
.pd-actual { color: var(--text-dim); font-size: 12px; }

/* Bingo18 玩法预测 */
.plays-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--card-border); }
.play-block { padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.play-block:last-child { border-bottom: none; }
.play-name { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; font-weight: 500; }
.play-preds { display: flex; flex-wrap: wrap; gap: 10px; }
.play-item { display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(255,255,255,.04); border: 1px solid var(--card-border); border-radius: 10px; padding: 8px 14px; min-width: 60px; }
.pp-num { font-size: 22px; font-weight: 700; color: var(--accent); }
.pp-method { font-size: 12px; color: var(--text-dim); }
.play-desc { color: var(--text-dim); font-size: 12px; margin-top: 8px; }
.latest-sum { color: var(--text-dim); font-size: 13px; margin-top: 8px; }

/* 响应式：手机 */
@media (max-width: 768px) {
  .topbar { gap: 10px; padding: 10px 12px; }
  .logo { font-size: 16px; }
  .groups { grid-template-columns: repeat(2, 1fr); }
  .ball { width: 34px; height: 34px; font-size: 13px; }
  .container { padding: 12px; gap: 12px; }
  .draw-table { font-size: 12px; }
}
@media (max-width: 480px) {
  .groups { grid-template-columns: 1fr; }
  .game-tabs { order: 2; width: 100%; }
  .lang-switch { margin-left: auto; }
}
