:root {
  --bgTheme: #1e3973;
  --primary: #1e3973;
  --secondary: #3458a0;
  --color5: #162d5d;
  --max-width: 768px;
  --card: #ffffff;
  --line: #e3e7f0;
  --text: #222;
  --muted: #8a8785;
  --body-bg: #eef1f7;
  --red: #e53935;
  --gold: #e0a800;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.6;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 74px;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ---------------- 顶部栏 ---------------- */
.site-header {
  background: linear-gradient(135deg, var(--color5) 0%, var(--bgTheme) 55%, var(--secondary) 100%);
  color: #fff;
  padding: 16px 14px;
}
.header-inner { display: flex; align-items: center; gap: 12px; }
.header-logo { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.header-txt { flex: 1; min-width: 0; }
.site-header h1 { font-size: 20px; letter-spacing: 1px; margin-bottom: 4px; }
.disclaimer { font-size: 12px; opacity: .92; line-height: 1.5; }

/* ---------------- 页面面板 ---------------- */
.page { padding: 10px 8px 20px; }
.panel { display: none; }
.panel.active { display: block; animation: fadein .2s ease; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(30, 57, 115, .06);
}
.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--bgTheme); }
.card h3 { margin: 0 0 8px; font-size: 14px; color: #333; }

/* ---------------- 开奖彩球盒（参考站格式） ---------------- */
.lotteryBox {
  background-color: #fff;
  color: #000;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(30, 57, 115, .10);
  margin-bottom: 12px;
  -webkit-user-select: none;
  user-select: none;
}
.lotteryBox * { box-sizing: border-box; }
.lotteryTitleBox { display: flex; align-items: center; justify-content: space-between; background: #f4f6fb; }
.lotteryTitle {
  flex: 1;
  border: solid #d6d6d6;
  border-width: 0;
  cursor: pointer;
  padding: 6px 0 5px;
  line-height: 1.3;
  text-align: center;
  border-right: 1px solid #e3e7f0;
}
.lotteryTitle:last-child { border-right: 0; }
.lotteryTitleN { font-size: 15px; font-weight: 900; color: #333; }
.lotteryTitleT { color: #8a8785; font-size: 12px; }
.lotteryTitleActive { background-color: var(--bgTheme); }
.lotteryTitleActive .lotteryTitleN { color: #fff; }
.lotteryTitleActive .lotteryTitleT { color: #dce6ff; }
.lotteryCodeBox { border-top: 2px solid var(--bgTheme); }
.lotteryLinks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px dashed #e3e7f0;
}
.lotteryLinks1 { font-size: 15px; font-weight: 600; }
.nowQiNumDom { color: #f00; font-size: 1.06em; }
.res-desc { color: #001100; }
.copy-link { color: #2389e9; font-size: 13px; font-weight: 400; margin-left: 6px; }
.links-right { display: flex; gap: 6px; align-items: center; }
.mixBtn {
  background-image: linear-gradient(141.21deg, #6a11cb 14.48%, #2575fc 77.45%);
  border-radius: 3px;
  color: #fff;
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  height: 24px;
  line-height: 24px;
  padding: 0 8px;
  cursor: pointer;
  border: none;
}
.mixBtn-ghost { background: #fff; color: #006ce3; border: 1px solid #006ce3; line-height: 22px; }
.lotteryCodes { display: flex; padding: 10px 4px 4px; }
.lotteryCodeContainer { align-items: center; display: flex; flex: 3 1 0; justify-content: center; }
.lotteryCodeContainerPlus { flex: 1.5 1 0; display: flex; align-items: center; justify-content: center; color: #c9c9c9; font-size: 26px; font-weight: 400; }
.lotteryCodeContainer1 { width: 100%; }
.lotteryCodeNumber {
  align-items: center;
  aspect-ratio: 1 / 1;
  background-repeat: no-repeat;
  background-size: contain;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  width: 88% !important;
  max-width: 56px;
  border-radius: 50%;
}
.lotteryCodeNumber > span { font-size: 1.3rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.lotteryCodeInfo { font-size: 14px; text-align: center; color: #333; }
.lotteryCodeInfo .wx { font-weight: 700; }
.wx-jin { color: #b8860b; }
.wx-mu { color: #2e7d32; }
.wx-shui { color: #1565c0; }
.wx-huo { color: #e53935; }
.wx-tu { color: #8d6e63; }

/* 波色彩球 */
.lotteryCodeRed { background-image: radial-gradient(circle at 32% 28%, #ffd9d9, #ef5350 52%, #a3162e 92%); }
.lotteryCodeBlue { background-image: radial-gradient(circle at 32% 28%, #d6e9ff, #42a5f5 52%, #1a4f9c 92%); }
.lotteryCodeGreen { background-image: radial-gradient(circle at 32% 28%, #d8f7e2, #43c96b 52%, #0d7a3c 92%); }
.lotteryCodeGray { background-image: radial-gradient(circle at 32% 28%, #f0f0f0, #bdbdbd 52%, #7a7a7a 92%); }

/* 下期开奖信息 */
.lotteryNextInfo {
  color: #8a8785;
  font-size: 14px;
  padding: 4px 10px 10px;
}
.lotteryNextInfoContent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  width: 100%;
  flex-wrap: wrap;
}
.nextOpenNum { color: #f00; font-weight: 700; }
.kj-countdown { color: #1e3973; font-weight: 700; background: #eef2fb; border-radius: 4px; padding: 0 6px; }

/* ---------------- 开奖记录列表（参考站格式） ---------------- */
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-count { font-size: 13px; color: var(--muted); }
.kj-list { min-height: 40px; }
.kj-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}
.kj-tit {
  background: linear-gradient(90deg, #f2f5fc, #e9eefb);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  border-bottom: 1px solid var(--line);
}
.kj-box { padding: 8px 4px 4px; }
.kj-item .lotteryBox { margin-bottom: 0; box-shadow: none; border-radius: 0; }
.kj-item .lotteryCodeNumber { max-width: 42px; }
.kj-item .lotteryCodeNumber > span { font-size: 1rem; }
.kj-item .lotteryCodeInfo { font-size: 11px; line-height: 1.4; }
.kj-item .lotteryCodeContainerPlus { font-size: 20px; }
.btn-load {
  display: block;
  width: 100%;
  margin: 4px 0 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--bgTheme);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-load:hover { background: #f4f7ff; }
.empty-hint { text-align: center; color: var(--muted); font-size: 13px; padding: 14px 0; }

/* ---------------- 表单 ---------------- */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input[type="text"], input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fdfbf7;
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(30, 57, 115, .25);
  border-color: var(--bgTheme);
}
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #3a3f4d;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.btn:hover { border-color: #b9c4dd; }
.btn-primary { background: var(--bgTheme); border-color: var(--bgTheme); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--color5); border-color: var(--color5); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-danger { color: #c62828; border-color: #e7b7bd; }
.btn-danger:hover { background: #fdf1f2; }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.msg { font-size: 14px; margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; display: none; }
.msg.ok { display: block; background: #eef7ee; color: #2e7d32; }
.msg.err { display: block; background: #fdf0f1; color: #c62828; }

/* ---------------- 彩球（表格/选号/预览通用） ---------------- */
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 1px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  vertical-align: middle;
}
.ball-red { background: radial-gradient(circle at 32% 28%, #ffd9d9, #ef5350 52%, #a3162e 92%); }
.ball-blue { background: radial-gradient(circle at 32% 28%, #d6e9ff, #42a5f5 52%, #1a4f9c 92%); }
.ball-green { background: radial-gradient(circle at 32% 28%, #d8f7e2, #43c96b 52%, #0d7a3c 92%); }
.ball-special { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold); }
.balls-cell { white-space: nowrap; }

.set-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin-top: 10px;
  background: #f8fafd;
}
.set-no { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------------- 表格 ---------------- */
.freq-scroll { overflow-x: auto; margin-top: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 7px 8px; text-align: center; }
.tbl th { background: #f2f5fc; color: var(--bgTheme); font-weight: 700; }
.tbl tr:nth-child(even) td { background: #fafbfe; }
.btn-del { color: #c62828; border: 1px solid #e7b7bd; background: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.btn-del:hover { background: #fdf1f2; }
.tier { display: inline-block; background: var(--bgTheme); color: #fff; border-radius: 4px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

/* ---------------- 统计 ---------------- */
.hot-cold { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hot-cold > div { min-width: 0; }
.chip {
  display: inline-block;
  margin: 3px 4px 3px 0;
  padding: 3px 8px;
  border-radius: 14px;
  background: #f2f5fc;
  color: #333;
  font-size: 12.5px;
}
.chip b { color: var(--bgTheme); }
canvas { width: 100%; max-width: 100%; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, .1);
  z-index: 1000;
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.tabbar-icon { width: 24px; height: 24px; font-size: 21px; line-height: 24px; text-align: center; }
.tabbar-text { font-size: 11px; color: #666; margin-top: 1px; }
.tabbar-item.active .tabbar-text { color: var(--bgTheme); font-weight: 700; }

/* ---------------- 页脚 / Toast ---------------- */
.site-footer { padding: 10px 16px 6px; text-align: center; }
.site-footer p { font-size: 12px; color: var(--muted); }
.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: rgba(22, 45, 93, .95);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 24px;
  z-index: 2000;
  max-width: 88vw;
  text-align: center;
  transition: transform .25s ease;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------------- 小屏适配 ---------------- */
@media screen and (max-width: 420px) {
  .site-header h1 { font-size: 17px; }
  .lotteryCodeNumber > span { font-size: 1.1rem; }
  .lotteryCodeInfo { font-size: 12px; }
  .lotteryLinks1 { font-size: 14px; }
  .hot-cold { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
