/* ==========================================================================
   前台公共样式（首页 + 历史记录页共用）
   --------------------------------------------------------------------------
   设计约定：
   · 颜色统一走 CSS 变量，/api/site 的 theme 会覆盖最上面 6 个主题变量，
     后台改色后整站即时生效；
   · 其余中性色 / 圆角 / 阴影是固定设计变量，保证整站视觉一致；
   · 淡色底（tint）用 color-mix 现算，跟着主题色走，前面都留了兜底色。
   ========================================================================== */

:root {
  /* ---- 后台可改的主题色 ---- */
  --primary: #1d4ed8;      /* 主色：标题渐变起 / 蓝字 / 主按钮 */
  --primary-to: #3b82f6;   /* 主色渐变止 */
  --ball: #dc2626;         /* 号码球（全站统一颜色） */
  --red: #dc2626;          /* 红字 / 强调按钮 */
  --green: #059669;        /* 绿字 */
  --hl: #fde68a;           /* 高亮底色 */

  /* ---- 固定设计变量 ---- */
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --surface: #ffffff;
  --bg: #e9e8b769;
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 14px 30px -20px rgba(15, 23, 42, .35);
  --maxw: 1040px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
[v-cloak] { display: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--hl); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  background: color-mix(in srgb, #fff 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  background-image: linear-gradient(135deg, var(--primary), var(--primary-to));
  box-shadow: 0 6px 14px -8px var(--primary);
}

.brand-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background .18s ease, color .18s ease;
}

.nav a:hover { background: var(--line-soft); color: var(--ink); }

.nav a.on {
  background: #eef2ff;
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   页面容器
   ========================================================================== */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px 8px;
}

/* ==========================================================================
   顶部轮播图
   ========================================================================== */
.banner {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.bn-view { position: relative; overflow: hidden; }

.bn-track { display: flex; transition: transform .55s cubic-bezier(.4, 0, .2, 1); }

.bn-slide { flex: 0 0 100%; min-width: 100%; }

.bn-in {
  position: relative;
  display: block;
  height: clamp(158px, 25vw, 300px);
  background: var(--bg);
}

.bn-in img { width: 100%; height: 100%; object-fit: cover; }

.bn-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 0 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-to));
}

.bn-ph-t { font-size: clamp(16px, 2.4vw, 22px); font-weight: 700; }
.bn-ph-s { font-size: clamp(12px, 1.6vw, 14px); font-style: normal; opacity: .88; }

.bn-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 30px 18px 14px;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, .72));
}

.bn-cap b { font-size: 15px; font-weight: 600; }
.bn-cap i { font-size: 13px; font-style: normal; opacity: .88; }

.bn-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 4px 12px -6px rgba(15, 23, 42, .5);
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s ease;
}

.banner:hover .bn-nav { opacity: 1; }
.bn-nav.prev { left: 10px; }
.bn-nav.next { right: 10px; }

.bn-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.bn-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

.bn-dots span.on { width: 22px; background: #fff; }

/* ==========================================================================
   公告栏：一条横向滚动的文字
   ========================================================================== */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.nt-tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  background: color-mix(in srgb, var(--primary) 11%, #fff);
}

.nt-view { flex: 1; min-width: 0; overflow: hidden; }

.nt-run {
  display: flex;
  width: max-content;
  min-width: 200%;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
  animation: nt-ltr 20s linear infinite;
  will-change: transform;
}

.nt-text { flex: 1 1 auto; padding-right: 3em; }

@keyframes nt-ltr { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes nt-rtl { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.nt-run.rtl { animation-name: nt-rtl; }
.notice:hover .nt-run { animation-play-state: paused; }

/* ==========================================================================
   其他站点（友情链接）：公告下面、开奖直播上面那一条
   ========================================================================== */
.sites {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* 红条：站名 + 主域名 */
.st-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: #e40000;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: center;
}

/* 绿条：一句提示 */
.st-note {
  padding: 6px 12px;
  background: #0b8a0b;
  color: #ffe600;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.st-list { list-style: none; margin: 0; padding: 0; }

.st-list li + li { border-top: 1px solid #ededed; }

.st-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 12px;
  font-size: 17px;
  font-weight: 700;
  color: #e40000;
  text-decoration: none;
  word-break: break-all;
}

.st-list li:first-child a { font-size: 19px; }

.st-list a:hover { background: #fff6f6; text-decoration: underline; }

.st-arrow { color: #e40000; font-size: 1.1em; }

@media (max-width: 560px) {
  .st-head { font-size: 17px; }
  .st-list a { font-size: 15px; }
  .st-list li:first-child a { font-size: 17px; }
}

/* ==========================================================================
   卡片外壳
   ========================================================================== */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
  transition: box-shadow .2s ease;
}

.card:hover { box-shadow: var(--shadow); }

.card-title {
  position: relative;
  padding: 15px 18px 15px 22px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: .01em;
}

.card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  background-image: linear-gradient(180deg, var(--primary), var(--primary-to));
}

.card-title .y { color: var(--ink); }

.card-title span:not(.y) {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

/* 推荐条 */
.rec {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #f8fafc;
  background: color-mix(in srgb, var(--primary) 5%, #fff);
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.rec .badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  background: var(--red);
  padding: 2px 9px;
  border-radius: 999px;
}

.rec .rec-text { color: var(--ink); font-weight: 500; }

.rec .rec-text em { font-style: normal; color: var(--red); }

.card-body { padding: 16px 18px; }

.card-body.soft {
  /* 上面已经有 .card-title 的分割线了，这里不再画线、不留间距，
     内容直接贴着标题，卡片看起来更整。 */
  background: #fbfcfe;
}

/* ==========================================================================
   通用文字样式（后台「行样式」下拉对应的类）
   ========================================================================== */
.red   { color: var(--red); }
.blue  { color: var(--primary); }
.green { color: var(--green); }
.black { color: var(--ink); }
.center { display: block; text-align: center; }

.hl  { background: var(--hl); color: inherit; padding: 0 3px; border-radius: 4px; }
.hl2 { background: var(--hl); color: var(--primary); font-weight: 600; padding: 1px 7px; border-radius: 6px; }

.tag {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  background: color-mix(in srgb, var(--primary) 10%, #fff);
}

.btn {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
}

.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--primary);
  vertical-align: -3px;
}

.joke {
  display: block;
  margin: 6px 0;
  padding: 9px 14px;
  border-left: 3px solid var(--primary);
  border-left-color: color-mix(in srgb, var(--primary) 45%, #fff);
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
  line-height: 1.85;
}

.pair   { display: block; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink); }
.cap    { display: block; font-size: 13px; color: var(--muted); line-height: 1.7; }
.result {
  display: block;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 每一段文字都包在 .ln 里，方便一行里放多段不同颜色的字 */
.ln { display: inline; }
.ln.hero, .ln.pair, .ln.cap, .ln.result, .ln.center, .ln.joke { display: block; }

.hero {
  margin: 10px 0;
  padding: 13px 18px;
  border-radius: var(--r);
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
  background: var(--primary);
  background-image: linear-gradient(135deg, var(--primary), var(--primary-to));
  box-shadow: 0 14px 26px -22px var(--primary);
}

/* ==========================================================================
   模块 0：开奖直播
   ========================================================================== */
.live {
  border-color: #dbe3f0;
  border-color: color-mix(in srgb, var(--primary) 20%, #fff);
}

.live::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--primary);
  background-image: linear-gradient(90deg, var(--primary), var(--primary-to));
}

.live-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px 0;
}

.live-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.live-title::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .16);
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
  50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, .06); }
}

@media (prefers-reduced-motion: reduce) {
  .live-title::before { animation: none; }
}

.live-title .red { color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }

.live-timer {
  margin-left: auto;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.live-his {
  flex: none;
  padding: 6px 14px;
  border: 1px solid #dbe3f0;
  border-color: color-mix(in srgb, var(--primary) 22%, #fff);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #f8fafc;
  background: color-mix(in srgb, var(--primary) 6%, #fff);
  white-space: nowrap;
  transition: background .18s ease;
}

.live-his:hover { background: color-mix(in srgb, var(--primary) 12%, #fff); }

.live-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 18px 16px;
}

.live-next {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.live-next .red { color: var(--red); font-weight: 600; }

.refresh-btn {
  flex: none;
  padding: 9px 20px;
  border: 0;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 20px -14px var(--primary);
  cursor: pointer;
  transition: filter .18s ease, transform .18s ease;
}

.refresh-btn:hover { filter: brightness(1.08); }
.refresh-btn:active { transform: translateY(1px); }
.refresh-btn:disabled { opacity: .6; cursor: default; filter: none; }

/* ==========================================================================
   号码球：全站统一颜色，球里显示的就是后台填的那段文字（如「龙」）
   ========================================================================== */
.ball-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(3px, 1.1vw, 18px);
  padding: 18px 18px 4px;
}

.ball-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ball {
  --bs: clamp(30px, 9.4vw, 58px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--bs);
  height: var(--bs);
  padding: 0 2px;
  border-radius: 50%;
  border: 2px solid var(--ball);
  background: #fff;
  background-image: radial-gradient(circle at 50% 34%, #fff 42%, #fff 100%);
  background-image: radial-gradient(circle at 50% 34%, #fff 42%, color-mix(in srgb, var(--ball) 14%, #fff) 100%);
  color: var(--ball);
  font-size: calc(var(--bs) * .5);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  letter-spacing: -.01em;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -4px 10px -6px rgba(15, 23, 42, .35), 0 2px 8px -3px rgba(15, 23, 42, .18);
}

.ball-plus {
  flex: none;
  color: var(--faint);
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 600;
  line-height: 1;
}

/* 「+」和最后一个球贴在一起，整体跟在队尾 */
.ball-tail {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.2vw, 12px);
  flex: none;
}

/* 开奖动画：到点之后一个个放球，还没放出来的球直接留空（位置留着，什么都不画） */
.ball.ball-wait {
  visibility: hidden;
  animation: none;
}

.ball-plus.wait { visibility: hidden; }

/* 开奖前那几分钟「准备开奖」：球先空着，里面只放一个问号 */
.ball.ball-prep {
  border-color: color-mix(in srgb, var(--faint) 45%, #fff);
  background-image: none;
  color: var(--faint);
  font-weight: 600;
  box-shadow: none;
}

@keyframes ball-breathe {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* 刚放出来的那个球弹一下 */
.ball.ball-in { animation: ball-pop .45s cubic-bezier(.2, 1.4, .5, 1); }

@keyframes ball-pop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.live-tip {
  padding: 0 18px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .ball.ball-wait,
  .ball.ball-in,
  .ball-row.opening .ball-plus { animation: none; }
}

/* 历史页 / 列表里的小号球 */
.ball-row.compact {
  justify-content: center;
  gap: clamp(5px, 1.6vw, 18px);
  padding: 12px 0 2px;
}

.ball-row.compact .ball {
  --bs: clamp(30px, 5.6vw, 50px);
}

.ball-row.compact .ball-plus { color: var(--faint); font-size: clamp(13px, 2.6vw, 20px); }

/* ==========================================================================
   各栏目版式
   ========================================================================== */

/* 表格型：一行一条，细分割线 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl td {
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  line-height: 1.85;
  text-align: left;
  vertical-align: top;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafbfe; }
.tbl p { margin: 0; }

/* 图文型 */
.poster img { width: 100%; border-radius: var(--r); }
.poster .ph-img { margin-bottom: 12px; }
.poster-text p { margin-bottom: 6px; font-size: 14px; line-height: 1.8; }

.ph-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r);
  color: var(--faint);
  font-size: 13px;
  letter-spacing: .04em;
  background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 14px, #f1f5f9 14px, #f1f5f9 28px);
}

.ph-img.tall { height: 300px; }

/* 单行型 */
.list-line li {
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  text-align: center;
  transition: background .15s ease;
}
.list-line li:last-child { border-bottom: 0; }
.list-line li:hover { background: #fafbfe; }

/* 分组型 */
.group {
  padding: 12px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  line-height: 1.95;
  text-align: center;
}
.group:last-child { border-bottom: 0; }
.group p { margin: 0; }

/* 页签型 */
.tabs {
  display: flex;
  gap: 4px;
  margin: 14px 18px;
  padding: 4px;
  border-radius: var(--r);
  background: #f1f5f9;
  overflow-x: auto;
}

.tabs .tab {
  flex: 1 0 auto;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.tabs .tab:hover { color: var(--ink); }

.tabs .tab.on {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 图片位：栏目顶部、页签、每一条里的图片都走这块 */
.media { margin: 12px 0; }
.media .ph-img { height: 240px; }
.media img { display: block; width: 100%; border-radius: var(--r); }

/* 栏目顶部图片（所有版式通用） */
.card-img { padding: 16px 18px 0; }
.card-img > .media { margin: 0; }

/* 折叠区 */
.lts-wrapper { position: relative; }
.collapsible { overflow: hidden; transition: max-height .3s ease; }

/* 折叠时底部做个渐隐，看起来是被截断的，而不是硬切 */
.lts-wrapper.is-collapsed .collapsible {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 56px), rgba(0, 0, 0, .04));
  mask-image: linear-gradient(180deg, #000 calc(100% - 56px), rgba(0, 0, 0, .04));
}

.show-all-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 0;
  border: 1px solid #dbe3f0;
  border-color: color-mix(in srgb, var(--primary) 22%, #fff);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: #f8fafc;
  background: color-mix(in srgb, var(--primary) 6%, #fff);
  cursor: pointer;
  transition: background .18s ease;
}

.show-all-btn:hover { background: color-mix(in srgb, var(--primary) 12%, #fff); }

/* 蓝色大方块标题（编号行） */
.bigtitle { width: 100%; margin: 10px 0; border-collapse: collapse; }
.bigtitle td {
  padding: 10px 14px;
  border-radius: var(--r);
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  background: var(--primary);
  background-image: linear-gradient(135deg, var(--primary), var(--primary-to));
}
.bigtitle td .y { color: #fff; }

/* 右下角浮动关闭按钮 */
.close-btn {
  position: fixed;
  right: 20px;
  bottom: 28px;
  width: 40px;
  height: 40px;
  line-height: 38px;
  text-align: center;
  font-size: 17px;
  color: var(--muted);
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 8px 22px -10px rgba(15, 23, 42, .4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 99;
  transition: color .18s ease, box-shadow .18s ease;
}

.close-btn:hover { color: var(--ink); box-shadow: 0 10px 26px -10px rgba(15, 23, 42, .5); }

/* ==========================================================================
   历史记录页
   ========================================================================== */
.his-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.his-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.his-back::before { content: "←"; font-size: 15px; }
.his-back:hover { color: var(--primary); }

.his-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease;
}

.his-pick:hover { border-color: color-mix(in srgb, var(--primary) 45%, #fff); }

.his-chev {
  position: static;
  font-size: 11px;
  font-style: normal;
  opacity: .55;
}

.year-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 18px 36px -20px rgba(15, 23, 42, .45);
  z-index: 20;
}

.year-list li {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.year-list li:hover {
  background: #eef2ff;
  background: color-mix(in srgb, var(--primary) 9%, #fff);
  color: var(--primary);
}

/* 当前选中的年份 */
.year-list li.on {
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  color: var(--primary);
  font-weight: 600;
}

/* 「全部年份」那一项 */
.year-list li.his-all {
  margin-bottom: 4px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  color: var(--muted);
}

.his-list { display: flex; flex-direction: column; gap: 12px; }

.his-item {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}

.his-item:hover { box-shadow: var(--shadow); }

.his-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.his-date .red { color: var(--red); font-weight: 600; }

.his-empty {
  padding: 56px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

/* 上拉加载更多 */
.his-more {
  padding: 18px 0 4px;
  text-align: center;
}

.his-more-tip {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.his-more-tip.done { color: var(--muted); }

.his-spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 2px solid color-mix(in srgb, var(--primary) 25%, #fff);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: his-spin .7s linear infinite;
}

@keyframes his-spin {
  to { transform: rotate(360deg); }
}

.his-more-btn {
  margin-top: 10px;
  padding: 9px 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.his-more-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, #fff);
  box-shadow: var(--shadow-sm);
}

.his-more-btn:disabled { cursor: default; opacity: .6; }

/* 加载 / 错误提示、页脚 */
.app-tip {
  padding: 14px 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.app-tip.error { color: var(--red); }

.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

/* ==========================================================================
   小屏微调
   ========================================================================== */
@media (max-width: 720px) {
  .topbar-in { height: 56px; padding: 0 14px; gap: 10px; }
  .brand-name { font-size: 22px; }
  .nav a { padding: 6px 11px; font-size: 13px; }
  .page { padding: 16px 12px 4px; }
  .banner { border-radius: 12px; }
  .bn-nav { width: 30px; height: 30px; font-size: 17px; }
  .notice { gap: 8px; padding: 8px 12px; }
  .nt-run { font-size: 13px; }
  .card { border-radius: 12px; margin-bottom: 14px; }
  .card-title { padding: 13px 14px 13px 18px; font-size: 15px; }
  .card-body { padding: 13px 14px; }
  .rec { padding: 9px 14px; }
  .live-head { padding: 14px 14px 0; gap: 8px; }
  .live-timer { font-size: 22px; }
  .live-foot { padding: 4px 14px 14px; }
  .ball-row { padding: 14px 14px 2px; }
  .tabs { margin: 12px 14px; }
  .card-img { padding: 13px 14px 0; }
  .his-bar, .his-item { padding-left: 14px; padding-right: 14px; }
  .site-foot { padding: 16px 14px 28px; }
}

@media (max-width: 420px) {
  body { font-size: 14px; }
  .page { padding: 14px 8px 4px; }
  .card-title span:not(.y) { display: block; margin: 2px 0 0; }
  .live-title { font-size: 14px; }
  .live-next { font-size: 13px; }
  .tbl td, .list-line li, .group { font-size: 14px; }
  .his-pick { font-size: 13px; padding: 6px 12px; }
}

