:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e3e6ea;
  --text: #1f2430;
  --muted: #667085;
  --primary: #2f5bd9;
  --primary-weak: #eaf0ff;
  --red: #c0392b;
  --green: #1e8449;
  --amber: #b7791f;
  --gray-bg: #f0f1f3;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 20px 28px 16px;
}
.site-header h1 { margin: 0 0 6px; font-size: 22px; }
.tagline { margin: 0; font-size: 17px; font-weight: 600; color: var(--primary); }
.subtagline { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.data-warning {
  margin: 14px 28px 0;
  padding: 12px 16px;
  background: #fff7e6;
  border: 1px solid #f5d9a0;
  border-radius: 8px;
  color: #7a4d00;
}
.data-warning.hidden { display: none; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 28px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
}
.tab-btn:hover { color: var(--text); background: var(--gray-bg); }
.tab-btn.active { color: var(--primary); border-color: var(--border); border-bottom-color: var(--bg); background: var(--bg); font-weight: 600; }

main { padding: 20px 28px 40px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

h2 { font-size: 19px; margin: 8px 0 10px; }
h3 { font-size: 16px; margin: 22px 0 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.cards { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 16px; }

/* 下一期在测目标（醒目主位置） */
.hero-next {
  background: linear-gradient(135deg, #eef3ff 0%, #fdf3e7 100%);
  border: 2px solid var(--primary);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 6px 0 18px;
  box-shadow: 0 4px 14px rgba(47, 91, 217, .10);
}
.hero-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.hero-tag {
  background: var(--primary); color: #fff; font-weight: 700;
  padding: 3px 12px; border-radius: 6px; font-size: 14px;
}
.hero-period { font-size: 15px; font-weight: 700; color: var(--text); }
.hero-lock { font-size: 12px; color: var(--muted); }
.hero-body { display: flex; flex-wrap: wrap; gap: 20px 36px; align-items: center; }
.hero-guess { text-align: center; min-width: 130px; }
.hero-guess-label { font-size: 12px; color: var(--muted); }
.hero-guess-big {
  font-size: 52px; line-height: 1.1; font-weight: 800; color: var(--primary);
  text-shadow: 0 1px 0 rgba(0,0,0,.05);
}
/* 概览页 hero 主猜号码：大号波色彩球 + 球下生肖徽章，明显突出 */
.hero-nums { min-width: 320px; }
.hero-nums-balls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 6px; margin-top: 6px; }
.hero-nums .ball { width: 46px; height: 46px; font-size: 19px; }
.hero-nums .ball-zodiac { font-size: 13px; font-weight: 700; color: var(--red); }
.hero-nums .ball-wrap { margin: 2px 6px; }
.hero-meta { flex: 1 1 320px; font-size: 14px; color: var(--text); line-height: 1.9; }
.hero-meta strong { color: var(--red); }
.hero-honest {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(47,91,217,.35);
  font-size: 13px; color: #8a5a00; font-weight: 600;
}
.card {
  flex: 1 1 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card .num { font-size: 28px; font-weight: 700; color: var(--text); }
.card .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }

.honest-note {
  background: var(--primary-weak);
  border: 1px solid #c9d8ff;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
}
.honest-note ul { margin: 4px 0 4px 20px; padding: 0; }

.quick-links { margin: 12px 0; }
.link-btn {
  margin-right: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.link-btn:hover { opacity: .9; }

.section-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin: 8px 0 14px;
}
.filters label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.filters input, .filters select {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  min-width: 140px;
}

.series-checkbox { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.series-checkbox legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checkbox-list label { font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 5px; }

.warning-box {
  background: #fdecea;
  border: 1px solid #f5b7b1;
  color: #a93226;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 10px 0;
  font-weight: 600;
}
.warning-box.hidden { display: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.data-table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 640px; }
.data-table th, .data-table td {
  border-bottom: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.data-table thead th { background: #f7f8fa; font-weight: 600; position: sticky; top: 0; }
.data-table tbody tr:hover { background: #fafbfc; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.badge-a { background: #e6f4ea; color: #1e8449; }
.badge-b { background: #eaf0ff; color: #2f5bd9; }
.badge-c { background: #fdecea; color: #a93226; }
.badge-gray { background: #f0f1f3; color: #667085; }

.zodiac-chip { display: inline-block; padding: 0 6px; margin: 1px; border-radius: 6px; background: #f0f1f3; font-size: 12px; }
.zodiac-hit { background: #e6f4ea; color: #1e8449; font-weight: 600; }
.zodiac-miss { background: #fdecea; color: #a93226; }

.hit-cell { font-variant-numeric: tabular-nums; }
.hit-undefined { color: var(--muted); }

.lock-form { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.form-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; }
.form-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; flex: 1 1 220px; }
.form-row input, .form-row select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: #fff; color: var(--text); }
.lock-form button[type=submit] {
  background: var(--primary); color: #fff; border: none; padding: 9px 20px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.export-row { margin: 12px 0; }
.export-row button { margin-right: 10px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; }

.load-more { margin: 12px 0; }
.load-more-btn {
  background: var(--primary-weak);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.load-more-btn:hover { background: #dbe6ff; }

a { color: var(--primary); }
.data-table a { color: var(--primary); word-break: break-all; }

.selftest { padding: 20px 28px 40px; border-top: 1px solid var(--border); background: var(--panel); }
.selftest h2 { margin-top: 0; }
.test-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 8px 0; background: #fff; }
.test-item.pass { border-left: 4px solid var(--green); }
.test-item.fail { border-left: 4px solid var(--red); }
.test-item .test-title { font-weight: 600; }
.test-item .test-detail { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.pass-tag { color: var(--green); font-weight: 700; }
.fail-tag { color: var(--red); font-weight: 700; }

.site-footer { padding: 16px 28px; background: var(--panel); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.site-footer p { margin: 4px 0; }
code { background: #f0f1f3; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.hidden { display: none; }

/* ===== 全站常驻目标条（滚动不消失） ===== */
.top-target-bar {
  position: sticky; top: 0; z-index: 100;
  background: #1f2430; color: #fff;
  padding: 10px 28px;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.top-target-bar .ttb-period { font-weight: 700; font-size: 16px; }
.top-target-bar .ttb-badge {
  background: #c0392b; color: #fff;
  font-weight: 800; font-size: 22px;
  padding: 1px 16px; border-radius: 8px; line-height: 1.3;
}
.top-target-bar .ttb-label { font-size: 15px; font-weight: 600; }
.top-target-bar .ttb-meta { font-size: 13px; color: #cdd5e0; }

/* ===== 彩球 + 逐码生肖徽章 ===== */
.ball-wrap { display: inline-flex; flex-direction: column; align-items: center; margin: 2px 4px; vertical-align: top; }
.ball {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; line-height: 1;
  position: relative;
}
.ball-red { background: #c0392b; }
.ball-blue { background: #2f5bd9; }
.ball-green { background: #1e8449; }
.ball-is-special { border: 2px solid #1f2430; box-shadow: 0 0 0 2px #fff; font-weight: 800; }
.ball-tag {
  position: absolute; top: -6px; right: -6px;
  background: #1f2430; color: #ffd34d; font-size: 10px; font-weight: 700;
  padding: 0 3px; border-radius: 4px; line-height: 1.4;
}
.ball-zodiac { font-size: 11px; color: #667085; margin-top: 2px; }

/* ===== 出现/没出生肖 左右两栏 ===== */
.zodiac-cols { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.zodiac-col { flex: 1 1 260px; border-radius: 8px; padding: 8px 12px; }
.zodiac-col-hit { background: #e6f4ea; border: 1px solid #b7e0c0; }
.zodiac-col-miss { background: #f6f6f7; border: 1px solid #e3e6ea; }
.zodiac-col .col-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }

/* 预测页 307 目标卡（醒目，与历史表/306 结果卡底色、边框区分） */
.target-card {
  background: linear-gradient(135deg, #eef3ff 0%, #fdf3e7 100%);
  border: 2px solid var(--primary);
  box-shadow: 0 4px 14px rgba(47, 91, 217, .10);
}

/* 统计页出现次数条形 */
.bar { width: 90px; height: 8px; background: #f0f1f3; border-radius: 4px; margin-top: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }

/* 宽表冻结期号列（第一列，横向滚动时钉住） */
.data-table thead th:first-child,
.data-table tbody td:first-child {
  position: sticky; left: 0; z-index: 2; background: #fff;
  box-shadow: 2px 0 4px rgba(0,0,0,.05);
}
.data-table thead th:first-child { background: #f7f8fa; z-index: 3; }

/* 开奖页常驻「多源同号」红色角标 */
.multi-badge {
  display: inline-block; background: #c0392b; color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 4px; margin-left: 6px; white-space: nowrap;
}

@media (max-width: 720px) {
  main, .site-header, .tabs, .selftest, .site-footer { padding-left: 14px; padding-right: 14px; }
  .cards { flex-direction: column; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { flex: 0 0 auto; white-space: nowrap; }
  .hero-guess-big { font-size: 40px; }
  .hero-body { gap: 14px; }
  .filters { gap: 10px; }
  .filters label { min-width: 100%; }
  .filters input, .filters select { width: 100%; }
  .data-table { font-size: 12px; }
  .form-row label { flex: 1 1 100%; }
  .top-target-bar { padding: 8px 14px; gap: 6px 12px; }
  .top-target-bar .ttb-badge { font-size: 18px; padding: 0 12px; }
  .ball { width: 28px; height: 28px; font-size: 12px; }
  .ball-zodiac { font-size: 10px; }
}
