@charset "utf-8";
/* ══════════════════════════════════════════════════════════════
   ailh888.com 主站 · 手机优先样式系统
   select / 号码页(新澳·香港) / 生肖页(新澳·香港) 共用
   基准宽 360~430，外壳 max 560。层级：顶栏 → 标签 → 内容
   ══════════════════════════════════════════════════════════════ */

:root {
  --brand: #1677ff;
  --brand-2: #69a9ff;

  --canvas: #f1f4f9;
  --panel: #ffffff;
  --panel2: #f4f7fc;
  --line: #e5eaf2;
  --line-soft: #eef2f8;
  --ink: #0b1322;
  --ink2: #2f3d53;
  --mute: #58637a;
  --mute2: #7b8697;

  --ok: #059669;
  --warn: #c2640a;
  --bad: #d92d20;

  --sh1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -16px rgba(16, 24, 40, 0.28);
  --sh2: 0 1px 1px rgba(16, 24, 40, 0.03), 0 16px 40px -24px rgba(16, 24, 40, 0.4);
  --rad: 18px;

  --accent: #1677ff;
  --accent2: #69a9ff;
  --accent-soft: #eef4ff;
  --accent-line: #cfe1ff;

  /* 兼容老页面的变量名 */
  --bg: var(--canvas);
  --card-bg: var(--panel);
  --border: var(--line);
  --text-main: var(--ink);
  --text-sub: var(--ink2);
  --text-muted: var(--mute);
  --primary: var(--brand);
  --primary-light: var(--accent-soft);
  --primary-dark: #0e42d2;
  --surface2: var(--panel2);
  --cyan: var(--brand);
  --accent-light: #fff4e6;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --tnum: "tnum" 1, "lnum" 1;
}

html.dark {
  --canvas: #080d16;
  --panel: #111a28;
  --panel2: #0c141f;
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);
  --ink: #e9eff9;
  --ink2: #c4cfe0;
  --mute: #9aa7bb;
  --mute2: #7f8da3;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --sh1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 26px -18px #000;
  --sh2: 0 1px 2px rgba(0, 0, 0, 0.5), 0 20px 44px -28px #000;
  --accent-soft: rgba(22, 119, 255, 0.18);
  --accent-line: rgba(22, 119, 255, 0.38);
  --primary-light: rgba(22, 119, 255, 0.18);
  --accent-light: rgba(250, 140, 22, 0.16);
  color-scheme: dark;
}

/* 市场色 */
.mk-am {
  --accent: #1677ff;
  --accent2: #69a9ff;
  --accent-soft: #eef4ff;
  --accent-line: #cfe1ff;
}
.mk-hk {
  --accent: #fa8c16;
  --accent2: #ffb04d;
  --accent-soft: #fff4e6;
  --accent-line: #ffddb0;
}
.mk-zam {
  --accent: #7c3aed;
  --accent2: #a78bfa;
  --accent-soft: #f3eeff;
  --accent-line: #ddd0ff;
}
.mk-zhk {
  --accent: #059669;
  --accent2: #34d399;
  --accent-soft: #e9f9f2;
  --accent-line: #bdedda;
}
html.dark .mk-am { --accent-soft: rgba(22, 119, 255, 0.18); --accent-line: rgba(22, 119, 255, 0.4); }
html.dark .mk-hk { --accent-soft: rgba(250, 140, 22, 0.18); --accent-line: rgba(250, 140, 22, 0.4); }
html.dark .mk-zam { --accent-soft: rgba(124, 58, 237, 0.2); --accent-line: rgba(124, 58, 237, 0.42); }
html.dark .mk-zhk { --accent-soft: rgba(5, 150, 105, 0.2); --accent-line: rgba(5, 150, 105, 0.42); }

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size:15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

b { font-feature-settings: var(--tnum); }
a { color: var(--accent); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 135, 160, 0.35); border-radius: 3px; }

/* ── 顶栏 ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 max(10px, env(safe-area-inset-left)) 0 max(10px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
@supports (background: color-mix(in srgb, #fff 50%, transparent)) {
  .topbar { background: color-mix(in srgb, var(--panel) 88%, transparent); }
}
.topbar-in {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-width: 0;
}
.tb-back {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: -2px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink2);
  font-size:18px;
  line-height: 1;
  text-decoration: none;
}
.tb-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #fff;
  font-size:14px;
  font-weight: 800;
  background: linear-gradient(150deg, var(--accent2), var(--accent));
  box-shadow: 0 6px 14px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.tb-title { min-width: 0; line-height: 1.2; }
.tb-title h1 {
  margin: 0;
  font-size:16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-title p {
  margin: 1px 0 0;
  font-size:11.5px;
  color: var(--mute2);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.tb-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size:13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--mute);
  font-size:14px;
  cursor: pointer;
}

/* ── 外壳 ─────────────────────────────────────────────── */
.shell,
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px 8px;
}

/* ── 标签条（整行折行，全部露出） ─────────────────────── */
.tabs,
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar,
.tab-nav::-webkit-scrollbar { display: none; }

.tab,
.tab-btn,
.tab-btn-new {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0 !important;
  height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 99px !important;
  background: var(--panel) !important;
  color: var(--mute) !important;
  font-size:13.5px !important;
  font-weight: 600 !important;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tab i,
.tab-btn i,
.tab-btn-new i { font-size:12px; }

.tab.on,
.tab-btn.active,
.tab-btn-new.active,
.tab-btn-new.on {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 16px -10px var(--accent);
}
/* 挑码助手 / 生肖统计 这类跳转按钮 */
.tab-btn-new[onclick*="window.open"] { color: var(--accent) !important; border-style: dashed !important; }

.tab-count {
  font-size:11px;
  font-weight: 600;
  opacity: 0.62;
  font-family: var(--font-mono);
}

/* ── 内容区 ───────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h2.sec,
h3.sec {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size:15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
}
h2.sec::before,
h3.sec::before {
  content: "";
  flex: none;
  width: 3px;
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}
h2.sec span,
h3.sec span {
  font-size:12px;
  font-weight: 500;
  color: var(--mute2);
  letter-spacing: 0;
}

/* ── KPI 卡 ───────────────────────────────────────────── */
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.kpi {
  padding: 11px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--sh1);
}
.kpi-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size:12px;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: 0.1px;
}
.kpi-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 7px;
  font-size:12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.kpi-ico.orange { background: var(--accent-light); color: #fa8c16; }
.kpi-ico.red { background: #fff1f0; color: #dc2626; }
.kpi-ico.purple { background: #f3eeff; color: #7c3aed; }
html.dark .kpi-ico.red { background: rgba(220, 38, 38, 0.16); }
html.dark .kpi-ico.purple { background: rgba(124, 58, 237, 0.2); }
.kpi > b,
.kpi .kpi-v {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--ink);
}
.kpi > b.accent,
.kpi .kpi-v.accent { color: #fa8c16; }
.kpi > b.red,
.kpi .kpi-v.red { color: #dc2626; }
.kpi > b.purple,
.kpi .kpi-v.purple { color: #7c3aed; }
.kpi > p,
.kpi .kpi-note {
  margin: 3px 0 0;
  font-size:11.5px;
  line-height: 1.4;
  color: var(--mute2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 折叠面板 ─────────────────────────────────────────── */
.fold {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--sh1);
  overflow: hidden;
}
.fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size:14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid var(--mute2);
  border-bottom: 1.7px solid var(--mute2);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.fold > summary .hint {
  font-size:12px;
  font-weight: 500;
  color: var(--mute2);
  letter-spacing: 0;
}
.fold-body { padding: 0 12px 12px; }

.rec-panel-box { background: transparent; }
.rec-panel-box.has-extreme { background: transparent; }

/* ── 卡片/面板 ────────────────────────────────────────── */
.card,
.panel {
  margin-bottom: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--sh1);
}

/* ── 筛选栏 ───────────────────────────────────────────── */
.fbox {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
}
.fgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.fgrid .wide { grid-column: 1 / -1; }
.filter-input,
.filter-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size:14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.filter-select {
  background-image: linear-gradient(45deg, transparent 50%, var(--mute2) 50%),
    linear-gradient(135deg, var(--mute2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
.filter-input:focus,
.filter-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-input::placeholder { color: var(--mute2); }
.fbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size:12.5px;
  color: var(--mute);
}
.fbar .btn-reset {
  margin-left: auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink2);
  font-size:13px;
  font-weight: 600;
  cursor: pointer;
}

/* ── 分段切换（表格 / 详情） ──────────────────────────── */
.seg {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 99px;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.seg-btn {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--mute);
  font-size:13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn.on {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px -8px var(--accent);
}

/* ── 表格 ─────────────────────────────────────────────── */
.tablewrap {
  overflow: auto;
  max-height: 60vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}
.tablewrap.plain { border: 0; border-radius: 0; }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size:13.5px;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 8px;
  background: var(--panel2);
  color: var(--mute);
  font-size:12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  font-size:13.5px;
  color: var(--ink2);
  text-align: left;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--panel2) 60%, transparent); }
@supports not (background: color-mix(in srgb, #fff 50%, transparent)) {
  tbody tr:nth-child(even) { background: var(--panel2); }
}
tbody tr:hover { background: var(--accent-soft); }
tbody tr.table-row-alt { background: color-mix(in srgb, var(--panel2) 60%, transparent); }
.sticky-thead th { position: sticky; top: 0; z-index: 2; }

/* 老页面的行内工具类归一化（这些表格是 JS 拼的） */
#historyBody td,
#headtailBody td,
#singleHeadBody td,
#singleTailBody td,
#doubleBody td,
#tensBody td,
#threeTailBody td,
#currentGapBody td,
#zodiacBody td,
#pingTeBody td,
#groupBody td,
#groupBody2 td,
#elementBody td,
#currentBody td,
#zodiacDetailHistory td,
#pingTeDetailHistory td {
  padding: 9px 8px;
  font-size:13.5px;
}
#historyBody td.text-center,
#headtailBody td.text-center,
#singleHeadBody td.text-center,
#singleTailBody td.text-center,
#doubleBody td.text-center,
#tensBody td.text-center,
#threeTailBody td.text-center,
#currentGapBody td.text-center,
#zodiacBody td.text-center { text-align: center; }

.num,
.mono { font-family: var(--font-mono); font-feature-settings: var(--tnum); }

/* 尾数配色 */
.tail-0 { color: #1677ff; }
.tail-1 { color: #16a34a; }
.tail-2 { color: #fa8c16; }
.tail-3 { color: #dc2626; }
.tail-4 { color: #7c3aed; }
.tail-5 { color: #db2777; }
.tail-6 { color: #0891b2; }
.tail-7 { color: #ea580c; }
.tail-8 { color: #64748b; }
.tail-9 { color: #0d9488; }

/* 排序箭头 */
.sort-arrow { display: inline-block; margin-left: 3px; font-size: 0.7em; opacity: 0.3; }
.sort-arrow.active { opacity: 1; color: var(--accent); }

/* ── 分页 ─────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size:12.5px;
  color: var(--mute);
}
.pager #pageButtons { display: flex; gap: 5px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink2);
  font-size:13.5px;
  font-weight: 600;
  cursor: pointer;
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pager-right .filter-select { width: auto; height: 32px; font-size:13px; }

/* ── 标签/徽章 ────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size:11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: var(--panel2);
  color: var(--mute);
}
.badge-green { background: #e7f8f0; color: #059669; }
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-yellow { background: #fff8e6; color: #ca8a04; }
.badge-blue { background: #eef4ff; color: #2563eb; }
html.dark .badge-green { background: rgba(5, 150, 105, 0.2); color: #34d399; }
html.dark .badge-red { background: rgba(220, 38, 38, 0.18); color: #f87171; }
html.dark .badge-yellow { background: rgba(202, 138, 4, 0.2); color: #fbbf24; }
html.dark .badge-blue { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }

.rec-tag {
  display: inline-block;
  margin: 3px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--ink2);
  font-size:12.5px;
  font-weight: 600;
}
.rec-tag.extreme {
  background: #fff1f0;
  border-color: #ffd0cc;
  color: #cf1322;
}
html.dark .rec-tag.extreme {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.32);
  color: #fca5a5;
}
.tag-extreme {
  background: #fff7e6;
  color: #d46b08;
  border: 1px solid #ffe0b2;
}
html.dark .tag-extreme { background: rgba(212, 107, 8, 0.18); border-color: rgba(212, 107, 8, 0.35); }

/* 号码球 */
.ball {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size:12.5px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(15, 23, 42, 0.16);
}
.ball.red { background: linear-gradient(160deg, #f7707c, #d81f2c); }
.ball.blue { background: linear-gradient(160deg, #5aa8ff, #1d4ed8); }
.ball.green { background: linear-gradient(160deg, #3ddc97, #0b8a55); }

.zodiac-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size:14px;
  background: linear-gradient(160deg, var(--accent2), var(--accent));
}

/* ── 8码推荐卡片 ──────────────────────────────────────── */
.top8-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.top8-kpi-item {
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  text-align: center;
}
.top8-kpi-val {
  font-family: var(--font-mono);
  font-size:19px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
.top8-kpi-val.red { color: #dc2626; }
.top8-kpi-lbl { margin-top: 2px; font-size:11px; color: var(--mute2); }
.top8-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.top8-card h2 { margin: 0 0 8px; font-size:14px; font-weight: 800; color: var(--ink); }
.top8-warn {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size:13.5px;
  font-weight: 700;
  text-align: center;
}
.top8-warn.danger { background: #fef2f2; color: #b91c1c; }
.top8-warn.ok { background: #f0fdf4; color: #15803d; }
html.dark .top8-warn.danger { background: rgba(220, 38, 38, 0.16); color: #fca5a5; }
html.dark .top8-warn.ok { background: rgba(5, 150, 105, 0.18); color: #6ee7b7; }
.top8-hit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.top8-hit-item:last-child { border-bottom: 0; }
.top8-hit-p { font-size:13px; font-weight: 700; color: var(--ink2); }
.top8-hit-d { font-size:11.5px; color: var(--mute2); font-family: var(--font-mono); }
.top8-hit-num { font-size:16px; font-weight: 700; font-family: var(--font-mono); }
.top8-hit-iv { margin-left: auto; font-size:12px; color: var(--mute); }
.top8-hit-iv b { color: var(--ink2); }

/* ── 图表容器 ─────────────────────────────────────────── */
.chart-container { position: relative; height: 280px; }
.chart-container.sm { height: 240px; }
.chart-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.chart-card h3 { margin: 0 0 8px; font-size:13.5px; font-weight: 700; color: var(--ink2); }

/* ── 骨架屏 ───────────────────────────────────────────── */
.skeleton-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding: 66px 12px 0;
  background: var(--canvas);
}
.skeleton-overlay.show { display: block; }
.sk-wrap { max-width: 560px; margin: 0 auto; }
.sk-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sk-card { height: 84px; border-radius: 16px; background: var(--panel2); animation: sk 1.2s ease-in-out infinite; }
.sk-tabs { height: 40px; margin-bottom: 12px; border-radius: 99px; background: var(--panel2); animation: sk 1.2s ease-in-out infinite; }
.sk-table { height: 320px; border-radius: 14px; background: var(--panel2); animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ── 弹窗 ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-backdrop.show,
.modal-backdrop[style*="display: flex"],
.modal-backdrop[style*="display:flex"] { display: flex; }
.modal-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow: auto;
  padding: 16px;
  border-radius: 20px 20px 0 0;
  background: var(--panel);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.28);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--mute);
  font-size:18px;
  line-height: 1;
  cursor: pointer;
}

/* ── 页脚 ─────────────────────────────────────────────── */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 14px 0 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size:11.5px;
  line-height: 1.6;
  color: var(--mute2);
}
.foot a { color: var(--mute); font-weight: 700; text-decoration: none; }

/* 回到顶部 */
#backToTop {
  position: fixed;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 70;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--mute);
  box-shadow: var(--sh1);
  font-size:15px;
  cursor: pointer;
}
#backToTop.hidden { display: none; }

/* 兼容老类名 */
.header { display: none; }
.live-dot { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.table-col-opt { }

/* ── 宽屏 ─────────────────────────────────────────────── */
@media (min-width: 600px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .shell, .container { padding: 14px 16px 10px; }
  .chart-container { height: 320px; }
}

/* ── 窄屏兜底 ─────────────────────────────────────────── */
@media (max-width: 359px) {
  .shell, .container { padding: 8px 10px 6px; }
  .kpi > b, .kpi .kpi-v { font-size: 21px; }
  .kpi-top { font-size:11.5px; }
  .tab, .tab-btn, .tab-btn-new { height: 32px !important; padding: 0 10px !important; font-size:13px !important; }
  .fgrid { grid-template-columns: 1fr; }
}

/* ══ 覆盖老页面内联样式 ══════════════════════════════════ */
.tab-btn-new[style*="22, 119, 255"],
.tab-btn-new.active,
.tab-btn-new.on {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.tab-btn-new[onclick*="window.open"] {
  color: var(--accent) !important;
  border-style: dashed !important;
}
.seg-btn {
  height: 30px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 99px !important;
  background: transparent !important;
  color: var(--mute) !important;
  font-size:13.5px !important;
  font-weight: 600 !important;
}
.seg-btn[style*="22, 119, 255"],
.seg-btn.on {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
@media (max-width: 640px) {
  .table-col-opt { display: none !important; }
}

/* ══ 生肖页：统计小卡 ═══════════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.stat-item {
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--sh1);
  text-align: center;
}
.stat-item .val {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--accent);
}
.stat-item .lbl { margin-top: 3px; font-size:11.5px; color: var(--mute2); letter-spacing: 0.2px; }

/* 生肖页里的内联深色文字统一 */
.tab-content h3 {
  margin: 0 0 8px !important;
  font-size:15px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
}
@media (min-width: 600px) {
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ══ 深色下丢掉 JS 写死的浅色行底 ═══════════════════════ */
html.dark #headtailBody tr,
html.dark #threeTailBody tr,
html.dark #currentGapBody tr,
html.dark #singleHeadBody tr,
html.dark #singleTailBody tr,
html.dark #doubleBody tr,
html.dark #tensBody tr,
html.dark #historyBody tr {
  background: transparent !important;
}
html.dark #headtailBody tr:nth-child(even),
html.dark #threeTailBody tr:nth-child(even),
html.dark #historyBody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ══ 生肖页：窄屏隐藏次要列 ═════════════════════════════ */
@media (max-width: 640px) {
  #tab-history th:nth-child(3), #tab-history td:nth-child(3),
  #tab-history th:nth-child(6), #tab-history td:nth-child(6),
  #tab-history th:nth-child(7), #tab-history td:nth-child(7),
  #tab-zodiac th:nth-child(3), #tab-zodiac td:nth-child(3),
  #tab-zodiac th:nth-child(8), #tab-zodiac td:nth-child(8),
  #tab-pingte th:nth-child(3), #tab-pingte td:nth-child(3),
  #tab-pingte th:nth-child(8), #tab-pingte td:nth-child(8),
  #tab-numbers th:nth-child(3), #tab-numbers td:nth-child(3),
  #tab-numbers th:nth-child(4), #tab-numbers td:nth-child(4) {
    display: none !important;
  }
}

/* ══ 亮/暗两套主题的细节打磨 ══════════════════════════════ */

/* 表头与斑马纹：暗色下用半透明白，别一片死黑 */
thead th { background: var(--panel2); color: var(--mute); }
html.dark thead th { background: rgba(255, 255, 255, 0.045); color: #b9c6d8; }
html.dark tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
html.dark tbody tr:hover { background: rgba(255, 255, 255, 0.05); }
html.dark thead th,
html.dark tbody td { border-color: var(--line-soft); }

/* 顶栏与按钮 */
html.dark .topbar { background: rgba(17, 26, 40, 0.88); border-bottom-color: rgba(255, 255, 255, 0.08); }
html.dark .icon-btn,
html.dark .tb-back { background: rgba(255, 255, 255, 0.055); border-color: rgba(255, 255, 255, 0.1); color: #cfd9e6; }
html.dark .page-btn { background: rgba(255, 255, 255, 0.05); border-color: var(--line); color: var(--ink2); }
html.dark .btn-reset { background: rgba(255, 255, 255, 0.05); }

/* 标签胶囊：暗色下抬一档，别和卡片同色 */
html.dark .tab,
html.dark .tab-btn,
html.dark .tab-btn-new {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #a8b5c8 !important;
}
html.dark .tab.on,
html.dark .tab-btn.active,
html.dark .tab-btn-new.active,
html.dark .tab-btn-new.on {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
html.dark .tab-btn-new[onclick*="window.open"] { color: var(--accent2) !important; border-style: dashed !important; }
html.dark .tab-count { opacity: 0.7; }

/* 卡片描边：暗色下提亮，浅色下压深一点 */
html.dark .kpi,
html.dark .card,
html.dark .panel,
html.dark .fold,
html.dark .chart-card,
html.dark .top8-card,
html.dark .mcard,
html.dark .draw,
html.dark .fbox,
html.dark .tablewrap,
html.dark .seg,
html.dark .top8-kpi-item { border-color: rgba(255, 255, 255, 0.085); }
html.dark .kpi,
html.dark .card,
html.dark .fold,
html.dark .chart-card,
html.dark .top8-card,
html.dark .mcard,
html.dark .draw { background: var(--panel); }

/* 输入控件 */
html.dark .filter-input,
html.dark .filter-select { background: rgba(255, 255, 255, 0.045); color: var(--ink); border-color: rgba(255, 255, 255, 0.1); }
html.dark .filter-input::placeholder { color: #6f7d92; }
.filter-input,
.filter-select { color: var(--ink); }
.filter-input::placeholder { color: var(--mute2); }

/* 小字统一：浅色别再淡到看不清 */
.kpi > p,
.kpi .kpi-note,
.stat-item .lbl,
.foot,
.top8-kpi-lbl,
.top8-hit-d,
.hit-d,
.mstat i { color: var(--mute2); }
html.dark .foot,
html.dark .top8-hit-d { color: #7f8da3; }

/* 骨架屏在暗色下别发光 */
html.dark .sk-card,
html.dark .sk-tabs,
html.dark .sk-table { background: rgba(255, 255, 255, 0.05); }

/* 页脚分隔线 */
html.dark .foot { border-top-color: var(--line-soft); }

/* 选中态 */
html.dark ::selection { background: rgba(105, 169, 255, 0.32); color: #fff; }

/* ══ 把老页面写死的文字色换回主题变量 ════════════════════
   tailwind.css 里 text-text-* 是编译死的 rgb：
   main=#333 sub=#666 muted=#999 —— 暗色下等于看不见。
   site.css 在 tailwind.css 之后加载，同权重直接覆盖。 */
.text-text-main { color: var(--ink); }
.text-text-sub { color: var(--ink2); }
.text-text-muted { color: var(--mute); }
.text-primary { color: var(--accent); }
.text-accent { color: var(--accent); }

/* JS 模板里写死的中性灰 */
[style*="color:#333"], [style*="color: #333"], [style*="color:rgb(51, 51, 51)"] { color: var(--ink) !important; }
[style*="color:#666"], [style*="color: #666"], [style*="color:rgb(102, 102, 102)"] { color: var(--ink2) !important; }
[style*="color:#888"], [style*="color: #888"], [style*="color:#999"], [style*="color: #999"],
[style*="color:#aaa"], [style*="color: #aaa"], [style*="color:#9ca3af"] { color: var(--mute2) !important; }

/* 暗色下这几档实心文字也提亮（不带浅色底的状态字） */
html.dark [style*="color:#2e7d32"] { color: var(--ok) !important; }
html.dark [style*="color:#e65100"] { color: var(--warn) !important; }
html.dark [style*="color:#1565c0"] { color: var(--accent2) !important; }

/* 尾数配色放在最后，保证优先于上面几条 */
.tail-0 { color: #1677ff; }
.tail-1 { color: #16a34a; }
.tail-2 { color: #fa8c16; }
.tail-3 { color: #dc2626; }
.tail-4 { color: #7c3aed; }
.tail-5 { color: #db2777; }
.tail-6 { color: #0891b2; }
.tail-7 { color: #ea580c; }
.tail-8 { color: #64748b; }
.tail-9 { color: #0d9488; }
html.dark .tail-0 { color: #7ab6ff; }
html.dark .tail-1 { color: #4ade80; }
html.dark .tail-2 { color: #fbbf24; }
html.dark .tail-3 { color: #f87171; }
html.dark .tail-4 { color: #a78bfa; }
html.dark .tail-5 { color: #f472b6; }
html.dark .tail-6 { color: #22d3ee; }
html.dark .tail-7 { color: #fb923c; }
html.dark .tail-8 { color: #94a3b8; }
html.dark .tail-9 { color: #2dd4bf; }

/* 暗色下内联的亮蓝也提一档 */
html.dark [style*="color:#1677ff"],
html.dark [style*="color:#2563eb"],
html.dark [style*="color:#0e42d2"] { color: var(--accent2) !important; }

/* ══ 字号放大后的防溢出兜底 ══════════════════════════════ */
.kpi { min-width: 0; }
.kpi > p,
.kpi .kpi-note { white-space: normal; overflow-wrap: anywhere; }
.stat-item { min-width: 0; }
.stat-item .lbl { white-space: normal; }
.cell,
.mstat { min-width: 0; }

/* KPI 副标：允许换行，但不要在日期中间断 */
.kpi > p,
.kpi .kpi-note { word-break: keep-all; overflow-wrap: normal; }

/* 日期整段不拆行 */
.nw { white-space: nowrap; }

/* ══ 装修：主视觉 / 推广条 ══════════════════════════════ */
.herocard {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 0 0 12px;
  border-radius: 20px;
  box-shadow: var(--sh2);
  text-decoration: none;
  background: #0c1421;
}
.herocard img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1120 / 440;
  object-fit: cover;
}
.herocard-txt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  max-width: 58%;
  padding: 0 18px;
  color: #fff;
}
.herocard-txt b {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.herocard-txt span {
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.74);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.herocard-txt em {
  margin-top: 7px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(6px);
}
.herocard:active { transform: scale(0.995); }

.promo {
  position: relative;
  display: block;
  overflow: hidden;
  margin: 14px 0 4px;
  border-radius: 18px;
  box-shadow: var(--sh1);
  text-decoration: none;
  background: #0c1421;
}
.promo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.promo .ptxt {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  max-width: 66%;
  padding: 0 18px;
  color: #fff;
}
.promo .ptxt b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.promo .ptxt span {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}
.promo::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-top: 1.8px solid rgba(255, 255, 255, 0.72);
  border-right: 1.8px solid rgba(255, 255, 255, 0.72);
  transform: rotate(45deg);
}
.promo:active { opacity: 0.94; }

/* 入口卡改成 3D 小图标 */
.entry .ico { padding: 0; background: none; box-shadow: none; overflow: hidden; }
.entry .ico img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
@media (max-width: 359px) {
  .herocard-txt b { font-size: 16px; }
  .herocard-txt span { font-size: 10.5px; }
}

/* 图上文字的可读性遮罩 */
.herocard::before,
.promo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(6, 10, 18, 0.82) 0%, rgba(6, 10, 18, 0.42) 42%, rgba(6, 10, 18, 0) 68%);
  pointer-events: none;
}
.herocard-txt,
.promo .ptxt,
.promo::after { z-index: 2; }

/* ══ 号码关系属性：波色球 / 属性标签 / 图例 ═══════════════ */
.nball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.14);
}
.nball.red { background: linear-gradient(160deg, #f2455a, #cc0d22); }
.nball.blue { background: linear-gradient(160deg, #4a90f7, #1258d0); }
.nball.green { background: linear-gradient(160deg, #2fc46a, #0b8340); }
.nball.sm { width: 23px; height: 23px; font-size: 11.5px; }

.nchips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
}
.nchip {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--panel2);
  color: var(--ink2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.nchip.him {
  background: rgba(225, 29, 72, 0.08);
  color: #e11d48;
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.18);
}
html.dark .nchip.him { background: rgba(244, 63, 94, 0.16); color: #fb7185; }

.wlegend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 2px 10px;
  font-size: 11.5px;
  color: var(--mute);
}
.wlegend span { display: inline-flex; align-items: center; gap: 5px; }
.wlegend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ══ 首页底部：号码属性对照表（平铺） ═══════════════════ */
.attrcard {
  margin-top: 14px;
  padding: 14px 14px 6px;
  scroll-margin-top: 68px;
}
.attrhd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.attrhd h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.3px; color: var(--ink); }
.attrhd span { font-size: 10.5px; color: var(--mute2); }

.attrsec { margin-top: 15px; }
.attrsec h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.attrsec h3::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.attrsec h3 i { font-style: normal; font-size: 10px; font-weight: 600; color: var(--mute2); letter-spacing: 0; }

.zgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.zcell {
  padding: 7px 7px 8px;
  border-radius: 12px;
  background: var(--panel2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.zcell .zh { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.zcell .zh img {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  object-fit: cover;
  filter: saturate(1.18) brightness(1.14);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.zcell .zn { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.zcell .zn b { font-size: 12.5px; font-weight: 800; color: var(--ink); letter-spacing: -0.2px; }
.zcell .zn i { font-size: 9px; font-style: normal; color: var(--mute2); white-space: nowrap; }
.zcell .zb { display: flex; flex-wrap: wrap; gap: 2px; }

.arow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}
.arow:last-child { border-bottom: 0; }
.arow .ak { flex: 0 0 32px; font-size: 12px; font-weight: 800; color: var(--ink); }
.arow .at { flex: 0 0 30px; font-size: 10px; font-style: normal; color: var(--mute2); }
.arow .ab { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }

.nball.xs { width: 17px; height: 17px; font-size: 8.5px; letter-spacing: -0.4px; }

.agrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; }
.agroup {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.5;
}
.agroup b { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--ink2); }
.agroup span { font-size: 11px; color: var(--mute); letter-spacing: 0.5px; }
.agroup.full { grid-column: 1 / -1; }
.agroup.full span { letter-spacing: 0.3px; }

@media (max-width: 359px) {
  .agrid { grid-template-columns: 1fr; }
  .arow .ak { flex-basis: 30px; }
}

/* 属性表内的分组小标题 */
.attrsub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 13px 0 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--mute);
  letter-spacing: 0;
}
.attrsub::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mute2);
}
.attrsec h3 + .agrid { margin-top: 2px; }

@media (max-width: 359px) {
  .zgrid { grid-template-columns: 1fr 1fr; }
}

/* ══ 首页开奖区（双市场） ══════════════════════════════ */
.drawbox { margin-top: 14px; padding: 13px 14px 12px; }
.drawbox.flash .db-mk { animation: dbFlash 1.3s ease; }
@keyframes dbFlash { 0% { background: rgba(22, 119, 255, 0.09); } 100% { background: transparent; } }

.db-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.db-ttl { font-size: 13px; font-weight: 800; color: var(--ink); letter-spacing: -0.2px; }
.db-live { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--mute2); }
.db-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute2); }
.db-live.on i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16); animation: dbPulse 2s infinite; }
.db-live.err i { background: #ef4444; }
@keyframes dbPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.db-mk { padding: 10px 0 4px; border-top: 1px solid var(--line-soft); }
.db-mk:first-of-type { border-top: 0; }
.db-mk-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.db-mk-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
}
.db-mk-tag.am { background: linear-gradient(135deg, #1677ff, #2563eb); }
.db-mk-tag.hk { background: linear-gradient(135deg, #fa8c16, #ea580c); }
.db-period { font-size: 11.5px; color: var(--mute); }
.db-period b { font-size: 14px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }
.db-date { margin-left: auto; font-size: 11px; color: var(--mute2); font-variant-numeric: tabular-nums; }

.db-balls { display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.db-balls .nball { width: 29px; height: 29px; font-size: 12.5px; }
.db-balls .nball.sp { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--panel), 0 0 0 4px #f59e0b; }
.db-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 9px; font-size: 10.5px; color: var(--mute); }
.db-meta .db-sp { color: var(--ink2); font-weight: 700; }
.db-meta .db-sp b { color: #f59e0b; font-size: 12.5px; }

.db-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--panel2);
  font-size: 11.5px;
  color: var(--mute);
}
.db-count b { font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }

.db-more {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--panel2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.db-more em { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--mute2); }
.db-more i { margin-left: auto; font-style: normal; color: var(--mute2); font-size: 16px; line-height: 1; }

/* ══ 历史开奖页 ═══════════════════════════════════════ */
.hseg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line-soft); margin: 12px 0 10px; }
.hseg button {
  height: 28px; padding: 0 18px; border: 0; border-radius: 99px;
  background: transparent; color: var(--mute); font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.hseg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12); }

.hchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.hchips::-webkit-scrollbar { display: none; }
.hchip {
  flex: 0 0 auto; height: 26px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--panel); color: var(--ink2);
  font-size: 11.5px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.hchip.on { background: var(--accent); border-color: transparent; color: #fff; }

.hstat { display: flex; align-items: baseline; gap: 8px; margin: 2px 2px 8px; font-size: 11px; color: var(--mute2); }
.hstat span:first-child { font-weight: 700; color: var(--ink2); }

.hlist { border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-soft); padding: 2px 12px; }
.hrow { padding: 9px 0; border-top: 1px solid var(--line-soft); }
.hrow:first-child { border-top: 0; }
.hr-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.hr-p { font-size: 12px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.hr-m { font-size: 10px; color: var(--mute2); }
.hr-d { margin-left: auto; font-size: 10.5px; color: var(--mute2); font-variant-numeric: tabular-nums; }
.hr-balls { display: flex; align-items: center; gap: 3px; }
.hr-balls .nball { width: 24px; height: 24px; font-size: 10.5px; }
.hr-balls .nball.sp { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--panel), 0 0 0 3px #f59e0b; }

.hmore {
  display: block; width: 100%; margin: 12px 0 2px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--ink2);
  font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
}

/* 号码 + 生肖 */
.bz {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.bz em {
  font-style: normal;
  font-size: 8.5px;
  line-height: 1;
  color: var(--mute2);
  letter-spacing: 0;
  transform: scale(0.95);
}
.bz.sp em { color: #f59e0b; font-weight: 700; }
.db-balls .bz em { font-size: 9px; }
.hr-balls .bz em { font-size: 8px; }
/* ══ 适老化：开奖区 / 历史页 放大 ═══════════════════════════ */
/* 开奖区 */
.db-ttl { font-size: 16.5px; }
.db-live { font-size: 12.5px; }
.db-live i { width: 7px; height: 7px; }
.db-mk-tag { font-size: 12.5px; padding: 3px 10px; border-radius: 8px; }
.db-period { font-size: 14px; }
.db-period b { font-size: 19px; }
.db-date { font-size: 13px; }
.db-balls .nball { width: 34px; height: 34px; font-size: 15px; }
.db-balls .bz em { font-size: 11.5px; }
.db-meta { font-size: 12.5px; gap: 9px; margin-top: 11px; }
.db-meta .db-sp { font-size: 13px; }
.db-meta .db-sp b { font-size: 15.5px; }
.db-count { font-size: 13.5px; padding: 10px 13px; }
.db-count b { font-size: 18px; }
.db-more { font-size: 15px; padding: 13px 14px; }
.db-more em { font-size: 12px; }
.db-more i { font-size: 19px; }

/* 历史页 —— 再放大一档 */
.hseg button { height: 36px; font-size: 16px; padding: 0 22px; }
.hchip { height: 32px; font-size: 15px; padding: 0 15px; }
.hstat { font-size: 14px; margin-bottom: 10px; }
.hlist { padding: 5px 13px; border-radius: 16px; }
.hrow { padding: 13px 0; }
.hr-top { gap: 9px; margin-bottom: 8px; }
.hr-p { font-size: 17.5px; }
.hr-m { font-size: 14px; }
.hr-d { font-size: 14px; }
.hr-balls { gap: 3px; }
.hr-balls .nball { width: 32px; height: 32px; font-size: 14.5px; }
.hr-balls .bz em { font-size: 12.5px; }
.hmore { font-size: 16.5px; padding: 16px; }

/* 360 以下收一点点，仍保证一行 7 个球 */
@media (max-width: 359px) {
  .db-balls .nball { width: 31px; height: 31px; font-size: 13.5px; }
  .db-balls .bz em { font-size: 10.5px; }
  .hr-balls .nball { width: 29px; height: 29px; font-size: 13px; }
  .hr-balls .bz em { font-size: 11px; }
  .hr-p { font-size: 16px; }
}

/* ══ 每市场：记录入口 + 下期时间 ═══════════════════════ */
.db-rec {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(22, 119, 255, 0.1);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.db-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--panel2);
  font-size: 12.5px;
  color: var(--mute);
}
.db-next .db-nx b { color: var(--ink2); font-weight: 800; font-variant-numeric: tabular-nums; }
.db-next .db-nx-c {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}

/* 历史页两个板块 */
.hsec { margin-top: 16px; }
.hsec:first-child { margin-top: 10px; }
.hsec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.hsec-t { font-size: 12px; color: var(--mute2); }
.hsec .hlist { box-shadow: inset 0 0 0 1px var(--line-soft); }

@media (max-width: 359px) {
  .db-rec { font-size: 10.5px; padding: 3px 7px; }
  .db-next { font-size: 11.5px; }
  .db-next .db-nx-c { font-size: 13.5px; }
}

/* ══ 首页海报（www.ailh888.com） ══════════════════════ */
.herocard.poster { background: #0c1421; }
.herocard.poster::before { display: none; }
.herocard.poster img { aspect-ratio: 750 / 220; width: 100%; height: auto; display: block; }

/* 锚点跳转留出顶部固定栏高度 */
.hsec { scroll-margin-top: 70px; }
