/* ============================================
   前台展示页样式
   ============================================ */

/* ====== 花花绿绿闪烁装饰 ====== */

/* Logo 金色闪光边框 */
.logo-shine {
  position: relative;
  padding: 4px 12px;
  border-radius: 8px;
  overflow: hidden;
}

.logo-shine::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -50%;
  width: 40%;
  height: calc(100% + 4px);
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.6), transparent);
  animation: logoSweep 2.5s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes logoSweep {
  0% { left: -50%; }
  50% { left: 110%; }
  100% { left: 110%; }
}

/* Logo 文字彩虹渐变闪烁 */
.logo-text-rainbow {
  background: linear-gradient(90deg, #ff0000, #ff8c00, #ffd700, #00ff00, #00bfff, #ff00ff, #ff0000);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowShift 3s linear infinite;
  font-weight: 800;
  text-shadow: none;
}

@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Logo 图片金光闪烁 */
.logo-img-glow {
  animation: logoGlow 1.5s ease-in-out infinite alternate;
  border-radius: 8px;
}

@keyframes logoGlow {
  0% {
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.4), 0 0 10px rgba(255, 215, 0, 0.2);
    filter: brightness(1) drop-shadow(0 0 3px rgba(255, 215, 0, 0.3));
  }
  100% {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 0 0 24px rgba(255, 215, 0, 0.4), 0 0 36px rgba(255, 140, 0, 0.3);
    filter: brightness(1.15) drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
  }
}

/* ---- 闪烁装饰横幅 ---- */
.deco-banner {
  max-width: 1200px;
  margin: 8px auto;
  padding: 0 24px;
}

.deco-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: linear-gradient(135deg, #1a0a2e, #16213e, #0f3460);
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15), inset 0 0 20px rgba(255, 215, 0, 0.05);
  overflow: hidden;
  position: relative;
}

/* 横幅流光效果 */
.deco-banner-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.08), transparent);
  animation: bannerSweep 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bannerSweep {
  0% { left: -100%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

.deco-star {
  font-size: 16px;
  animation: starTwinkle 1.2s ease-in-out infinite;
  display: inline-block;
}

.deco-star-red { color: #ff4757; animation-delay: 0s; }
.deco-star-gold { color: #ffd700; animation-delay: 0.3s; }
.deco-star-green { color: #2ed573; animation-delay: 0.6s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); text-shadow: 0 0 8px currentColor; }
}

.deco-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.deco-text-red {
  color: #ff4757;
  animation: textBlinkRed 1.5s ease-in-out infinite;
}

@keyframes textBlinkRed {
  0%, 100% { color: #ff4757; text-shadow: 0 0 4px rgba(255, 71, 87, 0.5); }
  50% { color: #ff6b81; text-shadow: 0 0 12px rgba(255, 71, 87, 0.8), 0 0 20px rgba(255, 71, 87, 0.4); }
}

.deco-text-gold {
  color: #ffd700;
  animation: textBlinkGold 1.5s ease-in-out infinite;
}

@keyframes textBlinkGold {
  0%, 100% { color: #ffd700; text-shadow: 0 0 4px rgba(255, 215, 0, 0.5); }
  50% { color: #fff3a0; text-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4); }
}

.deco-text-green {
  color: #2ed573;
  animation: textBlinkGreen 1.5s ease-in-out infinite;
}

@keyframes textBlinkGreen {
  0%, 100% { color: #2ed573; text-shadow: 0 0 4px rgba(46, 213, 115, 0.5); }
  50% { color: #7bed9f; text-shadow: 0 0 12px rgba(46, 213, 115, 0.8), 0 0 20px rgba(46, 213, 115, 0.4); }
}

/* 分隔闪烁点 */
.deco-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: dotBlink 0.8s ease-in-out infinite;
}

.deco-dot-red { background: #ff4757; box-shadow: 0 0 6px #ff4757; }
.deco-dot-gold { background: #ffd700; box-shadow: 0 0 6px #ffd700; animation-delay: 0.15s; }
.deco-dot-green { background: #2ed573; box-shadow: 0 0 6px #2ed573; animation-delay: 0.3s; }

@keyframes dotBlink {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.4); }
}

/* ---- 栏目标题闪光效果 ---- */
.section-title-shine {
  position: relative;
  overflow: hidden;
}

.section-title-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
  animation: titleSweep 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes titleSweep {
  0% { left: -60%; }
  50% { left: 120%; }
  100% { left: 120%; }
}

/* 栏目间装饰分隔线 */
.section-divider {
  max-width: 1200px;
  margin: 4px auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.section-divider .div-star {
  font-size: 12px;
  animation: starTwinkle 1.5s ease-in-out infinite;
}

.section-divider .div-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), rgba(255, 71, 87, 0.3), rgba(46, 213, 115, 0.3), transparent);
  max-width: 200px;
}

/* ---- 横幅广告（栏目之间） ---- */
.banner-ad {
  display: block;
  max-width: 1200px;
  margin: 10px auto;
  width: calc(100% - 32px);
  text-decoration: none;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.banner-ad:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}
.banner-ad-inner {
  display: block;
  line-height: 1.5;
  word-break: break-word;
}
.banner-ad.flash {
  animation: bannerFlash 1.1s ease-in-out infinite;
}
@keyframes bannerFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.banner-ad.scroll .banner-ad-inner {
  white-space: nowrap;
  display: inline-block;
  animation: bannerScroll 12s linear infinite;
}
@keyframes bannerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ====== 更多花哨装饰 ====== */

/* 导航栏霓虹流光边框 */
.nav-container {
  position: relative;
  overflow: hidden;
}

.nav-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -100%;
  width: 60%;
  height: calc(100% + 4px);
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 71, 87, 0.15),
    rgba(255, 215, 0, 0.2),
    rgba(46, 213, 115, 0.15),
    transparent
  );
  animation: navGlow 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes navGlow {
  0% { left: -100%; }
  50% { left: 120%; }
  100% { left: 120%; }
}

/* 导航项激活时金色脉冲 */
.nav-item.active {
  animation: navActivePulse 2s ease-in-out infinite;
}

@keyframes navActivePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(230, 0, 18, 0.25); }
  50% { box-shadow: 0 2px 12px rgba(230, 0, 18, 0.4), 0 0 20px rgba(255, 215, 0, 0.15); }
}

/* 公告栏闪烁背景 */
.announcement-bar {
  position: relative;
  overflow: hidden;
}

.announcement-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
  animation: announceSweep 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes announceSweep {
  0% { left: -50%; }
  50% { left: 120%; }
  100% { left: 120%; }
}

/* 栏目卡片悬浮霓虹光晕 */
.section {
  position: relative;
  transition: box-shadow 0.3s;
}

.section:hover {
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 栏目标题霓虹文字效果 */
.section-title {
  text-shadow: 0 0 8px rgba(230, 0, 18, 0.15);
}

/* 外链按钮霓虹发光 */
.ext-link-text-btn {
  animation: extLinkGlow 3s ease-in-out infinite;
}

@keyframes extLinkGlow {
  0%, 100% { box-shadow: 0 0 3px rgba(26, 86, 219, 0.2); }
  50% { box-shadow: 0 0 8px rgba(26, 86, 219, 0.4), 0 0 16px rgba(255, 215, 0, 0.1); }
}

/* 外链区域标题左侧闪烁条 */
.ext-link-title {
  position: relative;
}

.ext-link-title::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #ff4757, #ffd700, #2ed573);
  animation: titleBarBlink 2s ease-in-out infinite;
}

@keyframes titleBarBlink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
}

/* 头部金色底边流光 */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 71, 87, 0.4) 15%,
    rgba(255, 215, 0, 0.6) 30%,
    rgba(46, 213, 115, 0.4) 45%,
    rgba(255, 215, 0, 0.6) 60%,
    rgba(255, 71, 87, 0.4) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: headerRainbow 4s linear infinite;
}

@keyframes headerRainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* 倒计时数字脉冲 */
.countdown-unit {
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 2px 8px rgba(230, 0, 18, 0.35), 0 0 12px rgba(255, 215, 0, 0.1); }
}

/* 回到顶部按钮金色辉光 */
.back-to-top {
  animation: backToTopGlow 2s ease-in-out infinite;
}

@keyframes backToTopGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(230, 0, 18, 0.3); }
  50% { box-shadow: 0 4px 16px rgba(230, 0, 18, 0.3), 0 0 20px rgba(255, 215, 0, 0.2); }
}

/* 码球微微浮动 */
.lottery-ball {
  animation: ballFloat 3s ease-in-out infinite;
}

.lottery-balls .lottery-ball-wrapper:nth-child(odd) .lottery-ball {
  animation-delay: 0.5s;
}

.lottery-balls .lottery-ball-wrapper:nth-child(3n) .lottery-ball {
  animation-delay: 1s;
}

@keyframes ballFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .deco-banner { padding: 0 12px; }
  .deco-banner-inner { padding: 8px 12px; gap: 6px; }
  .deco-text { font-size: 13px; }
  .deco-star { font-size: 14px; }
  .section-divider { padding: 0 12px; }
}

@media (max-width: 480px) {
  .deco-banner { padding: 0 6px; }
  .deco-banner-inner { padding: 6px 10px; gap: 4px; }
  .deco-text { font-size: 11px; letter-spacing: 0.5px; }
  .deco-star { font-size: 12px; }
  .deco-dot { width: 4px; height: 4px; }
  .section-divider { padding: 0 6px; }
  .section-divider .div-star { font-size: 10px; }
}

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

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* iOS 安全区域 */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* 移除 iOS 点击高亮 */
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.85;
}

button {
  font: inherit;
}

/* ---- 固定头部 ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  /* iOS 安全区域 */
  padding-top: env(safe-area-inset-top);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  gap: 16px;
}

.admin-entry-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  background: transparent;
}

.admin-entry-btn:hover {
  background: var(--primary, #e60012);
  color: #fff;
  border-color: var(--primary, #e60012);
  opacity: 1;
}

.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 24px;
  color: #e60012;
  letter-spacing: 0.5px;
}

.logo img {
  max-height: 48px;
  width: auto;
}

.logo-text {
  white-space: nowrap;
}

/* ---- 公告栏 ---- */
.announcement-bar {
  position: fixed;
  top: calc(60px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 999;
  padding: 10px 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.announcement-text {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- 吸顶容器（导航+开奖模块） ---- */
/* 改为正常文档流，随页面一起滑动（不再固定吸顶） */
.sticky-nav-wrap {
  position: static;
  z-index: 998;
  background: #f5f5f5;
  padding-bottom: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

/* ---- 顶部广告与导航的间距：用 CSS 兄弟选择器强制控制，避免 JS 缓存导致的大段空白 ---- */
/* 顶部广告区有内容（显示）时，导航绿框紧贴广告区底部，不留大间距 */
#topAdArea:not(:empty) ~ #stickyNavWrap { margin-top: 0 !important; }
/* 顶部广告区为空（隐藏）时，由导航自己避开固定头部+公告，否则内容被挡 */
#topAdArea:empty ~ #stickyNavWrap { margin-top: 68px !important; }
body.has-announcement #topAdArea:empty ~ #stickyNavWrap { margin-top: 112px !important; }

/* 固定导航区的占位：改为可滑动后不再需要占位撑高，隐藏即可 */
.sticky-nav-placeholder {
  display: none;
  width: 100%;
}

.sticky-nav-wrap.is-stuck {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ---- 导航栏 ---- */
.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 8px;
}

/* 有公告时导航栏（fixed 模式下无需额外 offset） */
body.has-announcement .nav {
  padding-top: 8px;
}

.nav-container {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f0f0f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-item {
  flex: 1;
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 500;
  color: #555;
  background: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.nav-item:last-child {
  border-right: none;
}

.nav-item:hover {
  background: #ffffff;
  color: var(--primary, #e60012);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.nav-item.active {
  background: var(--primary, #e60012);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(230, 0, 18, 0.25);
}

/* ---- 导航信息区域（上：文字+倒计时+历史记录，下：独占一行） ---- */
.nav-info-area {
  max-width: 1200px;
  margin: 12px auto;
  padding: 0 24px;
}

.nav-info-top {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.nav-info-top .nav-info-col {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 52px;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 13px;
  color: #333;
}

.nav-info-top .nav-info-text {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 期数显示 ---- */
.period-display {
  font-size: 15px;
  font-weight: 400;
  color: #333;
  text-align: center;
  line-height: 1.4;
}

.period-display .period-number {
  color: #e60012;
  font-weight: 600;
  font-size: 15px;
}

.period-display .period-nav-name {
  color: #000;
  font-weight: 700;
  margin-right: 6px;
}

.period-empty {
  color: #ccc;
  font-weight: 400;
}

.nav-info-top .nav-info-right-col {
  flex: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* ---- 右侧区域（倒计时 + 历史记录） ---- */
.nav-info-right {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 未设置倒计时时的提示文字 */
.countdown-empty {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}

.nav-info-bottom {
  margin-top: 12px;
  background: #ffffff;
  border-radius: 8px;
  padding: 20px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-height: 60px;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 14px;
  color: #333;
  text-align: center;
}

.nav-info-bottom img {
  max-width: 100%;
  max-height: 300px;
  margin: 0 auto;
  border-radius: 4px;
}

.nav-info-col .col-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
  font-weight: 500;
}

.nav-info-col .col-value {
  font-size: 15px;
  color: #333;
  word-break: break-word;
}

/* ---- 多种码球样式 ---- */

/* 默认渐变球（已有） */
.ball-style-gradient.ball-red {
  background: radial-gradient(circle at 35% 30%, #ff4d4f, #e60012 50%, #b3000f 100%);
  border: 2px solid #c40010;
}
.ball-style-gradient.ball-blue {
  background: radial-gradient(circle at 35% 30%, #5cb8ff, #1890ff 50%, #0050b3 100%);
  border: 2px solid #1474cc;
}
.ball-style-gradient.ball-green {
  background: radial-gradient(circle at 35% 30%, #73d13d, #52c41a 50%, #237804 100%);
  border: 2px solid #3d9e14;
}

/* 实心球 */
.ball-style-solid.ball-red {
  background: #e60012;
  border: 2px solid #c40010;
  box-shadow: 0 3px 8px rgba(230, 0, 18, 0.35);
}
.ball-style-solid.ball-blue {
  background: #1890ff;
  border: 2px solid #1474cc;
  box-shadow: 0 3px 8px rgba(24, 144, 255, 0.35);
}
.ball-style-solid.ball-green {
  background: #52c41a;
  border: 2px solid #3d9e14;
  box-shadow: 0 3px 8px rgba(82, 196, 26, 0.35);
}
.ball-style-solid .ball-number {
  text-shadow: none;
}

/* 霓虹球 */
.ball-style-neon.ball-red {
  background: radial-gradient(circle at 50% 50%, #ff7875, #e60012 60%, #820014 100%);
  border: 2px solid #ff4d4f;
  box-shadow:
    0 0 6px rgba(230, 0, 18, 0.5),
    0 0 20px rgba(230, 0, 18, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.2);
}
.ball-style-neon.ball-blue {
  background: radial-gradient(circle at 50% 50%, #69c0ff, #1890ff 60%, #003a8c 100%);
  border: 2px solid #5cb8ff;
  box-shadow:
    0 0 6px rgba(24, 144, 255, 0.5),
    0 0 20px rgba(24, 144, 255, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.2);
}
.ball-style-neon.ball-green {
  background: radial-gradient(circle at 50% 50%, #95de64, #52c41a 60%, #135200 100%);
  border: 2px solid #73d13d;
  box-shadow:
    0 0 6px rgba(82, 196, 26, 0.5),
    0 0 20px rgba(82, 196, 26, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.2);
}
.ball-style-neon .ball-number {
  text-shadow: 0 0 6px rgba(255,255,255,0.6), 0 1px 3px rgba(0,0,0,0.3);
}

/* 3D 球 */
.ball-style-3d.ball-red {
  background: radial-gradient(circle at 30% 30%, #ff7875, #d90012 45%, #8c000e 100%);
  border: 2px solid #b3000f;
  box-shadow:
    inset -4px -4px 8px rgba(0,0,0,0.25),
    inset 4px 4px 8px rgba(255,255,255,0.2),
    0 5px 12px rgba(0,0,0,0.25);
}
.ball-style-3d.ball-blue {
  background: radial-gradient(circle at 30% 30%, #69c0ff, #1677ff 45%, #002c8c 100%);
  border: 2px solid #0050b3;
  box-shadow:
    inset -4px -4px 8px rgba(0,0,0,0.25),
    inset 4px 4px 8px rgba(255,255,255,0.2),
    0 5px 12px rgba(0,0,0,0.25);
}
.ball-style-3d.ball-green {
  background: radial-gradient(circle at 30% 30%, #95de64, #45a819 45%, #1a5200 100%);
  border: 2px solid #237804;
  box-shadow:
    inset -4px -4px 8px rgba(0,0,0,0.25),
    inset 4px 4px 8px rgba(255,255,255,0.2),
    0 5px 12px rgba(0,0,0,0.25);
}
.ball-style-3d .ball-number {
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* 玻璃球 */
.ball-style-glass.ball-red {
  background: linear-gradient(135deg, rgba(255,77,79,0.8), rgba(230,0,18,0.9));
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.1),
    0 4px 12px rgba(230,0,18,0.25),
    0 0 0 1px rgba(230,0,18,0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ball-style-glass.ball-blue {
  background: linear-gradient(135deg, rgba(92,184,255,0.8), rgba(24,144,255,0.9));
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.1),
    0 4px 12px rgba(24,144,255,0.25),
    0 0 0 1px rgba(24,144,255,0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ball-style-glass.ball-green {
  background: linear-gradient(135deg, rgba(115,209,61,0.8), rgba(82,196,26,0.9));
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.1),
    0 4px 12px rgba(82,196,26,0.25),
    0 0 0 1px rgba(82,196,26,0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ball-style-glass .ball-number {
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 特码球通用样式 —— 已与普通球统一，不再单独设置 */
.ball-style-solid.lottery-ball-special { }
.ball-style-neon.lottery-ball-special { }
.ball-style-3d.lottery-ball-special { }
.ball-style-glass.lottery-ball-special { }

/* ---- 富文本内容样式 ---- */
.rich-text-content {
  line-height: 1.6;
}

.rich-text-content span {
  display: inline;
}

.rich-text-content br {
  display: block;
  content: "";
  margin-bottom: 4px;
}

.rich-text-content p,
.rich-text-content div {
  margin: 0;
  padding: 0;
}

/* ---- 历史记录链接 ---- */
.nav-info-history-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #e60012);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--primary, #e60012);
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-info-history-link:hover {
  background: var(--primary, #e60012);
  color: #fff;
  opacity: 1;
}

/* ---- 彩票号码球（渐变色 + 高光 + 3D 阴影）---- */
.lottery-balls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 4px 0;
}

.lottery-ball-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.lottery-ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  position: relative;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.2),
    0 1px 3px rgba(0,0,0,0.15),
    inset 0 -4px 8px rgba(0,0,0,0.15);
  /* 高光伪元素 */
  overflow: hidden;
}

.lottery-ball::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 8px;
  right: 8px;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.lottery-ball::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 12px;
  right: 12px;
  height: 25%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.ball-number {
  position: relative;
  z-index: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  line-height: 1;
}

/* 红球渐变 */
.ball-red {
  background: radial-gradient(circle at 35% 30%, #ff4d4f, #e60012 50%, #b3000f 100%);
  border: 2px solid #c40010;
}

/* 蓝球渐变 */
.ball-blue {
  background: radial-gradient(circle at 35% 30%, #5cb8ff, #1890ff 50%, #0050b3 100%);
  border: 2px solid #1474cc;
}

/* 绿球渐变 */
.ball-green {
  background: radial-gradient(circle at 35% 30%, #73d13d, #52c41a 50%, #237804 100%);
  border: 2px solid #3d9e14;
}

/* ---- 图片码球（使用 img/red1.png 等图片） ---- */
.ball-img-red {
  background-image: url('../img/red1.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.ball-img-blue {
  background-image: url('../img/blue1.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.ball-img-green {
  background-image: url('../img/green1.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

/* 图片码球上的数字（深色，因为图片中心是白色） */
.ball-img-red .ball-number,
.ball-img-blue .ball-number,
.ball-img-green .ball-number {
  color: #333;
  text-shadow: 0 0 2px rgba(255,255,255,0.8);
  font-weight: 900;
}

/* 图片码球不显示伪元素高光/阴影 */
.ball-img-red::before,
.ball-img-red::after,
.ball-img-blue::before,
.ball-img-blue::after,
.ball-img-green::before,
.ball-img-green::after {
  display: none;
}

/* 特码球与普通球完全一致（用户要求去掉边框和特殊大小） */
.lottery-ball-special {
  /* 继承 .lottery-ball 的所有样式，不做特殊处理 */
}

.lottery-ball-meta {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  font-weight: 500;
}

.lottery-plus {
  font-size: 32px;
  font-weight: 700;
  color: #666;
  margin: 0 8px;
  align-self: center;
  flex-shrink: 0;
  padding-bottom: 18px;
  user-select: none;
}

/* 倒计时和时间同行 */
.countdown-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.countdown-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  white-space: nowrap;
}

.countdown-boxes {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.countdown-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  background: var(--primary, #e60012);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(230, 0, 18, 0.25);
}

.countdown-sep {
  font-weight: 700;
  color: var(--primary, #e60012);
  font-size: 15px;
}

.countdown-empty {
  font-size: 13px;
  color: #999;
  font-weight: 500;
}

/* ---- 主内容区 ---- */
.site-main {
  padding-top: 60px;
  min-height: 100vh;
}

/* 有公告时调整主内容区 */
body.has-announcement .site-main {
  padding-top: 100px;
}

/* ---- 栏目区域 ---- */
.section {
  background: #ffffff;
  margin: 16px auto;
  max-width: 1200px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.section-title {
  padding: 18px 24px 12px;
  font-size: 18px;
  font-weight: 700;
  color: #e60012;
  border-bottom: 2px solid #e60012;
  display: inline-block;
  margin: 16px 24px 0;
}

.section-grid {
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 24px 24px;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
  text-align: center;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  word-break: break-word;
}

/* grid 中每行最后一列无右边框 */
.section-grid .cell[data-col] {
  /* border-right handled below via JS-set data-col */
}
/* 用 CSS 没法直接知道最后一列是哪个，在 render 中加 class */
/* 最后一行无底边框：在 render 中最后的 cell 加 .cell-last-row */

.cell-header {
  background: #f0f0f0;
  font-weight: bold;
  font-size: 15px;
  color: #333;
}

.cell-last-col {
  border-right: none;
}

.cell-last-row {
  border-bottom: none;
}

.cell a {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.cell a:hover {
  text-decoration: underline;
}

.cell img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 4px;
}

.cell .cell-text {
  word-break: break-word;
  white-space: pre-wrap;
}

/* ---- 回到顶部 ---- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e60012;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(230, 0, 18, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #c40010;
}

.empty-state {
  max-width: 1200px;
  margin: 16px auto;
  text-align: center;
  padding: 80px 24px;
  color: #999;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.empty-state p {
  margin-top: 12px;
}

/* ---- 外链区域 ---- */
.ext-links-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- 导航上方顶部广告模块 ---- */
.top-ad-area {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 8px auto 0;
}
.top-ad-grid {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 8px;
  padding: 0 16px 0;
  box-sizing: border-box;
}
.top-ad-cell { display: flex; min-height: 10px; }
.top-ad-cell .top-ad-link { width: 100%; }
.top-ad-link {
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
  transition: opacity 0.2s ease;
}
.top-ad-link:hover { opacity: 0.85; }
.top-ad-text {
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 10px 16px;
  text-align: center;
  font-weight: 600;
  border-radius: 8px;
}
.top-ad-image {
  padding: 6px 12px;
}
.top-ad-icon {
  max-height: 60px;
  width: auto;
  display: block;
  margin: 0 auto;
}
.top-ad-icon-img { max-height: 60px; width: auto; max-width: 100%; }
.top-ad-icon-emoji { font-size: 34px; line-height: 1; }

@media (max-width: 768px) {
  .top-ad-text { padding: 8px 12px; }
  .top-ad-icon { max-height: 48px; }
  .top-ad-icon-emoji { font-size: 28px; }
  .top-ad-grid { gap: 6px; padding: 0 10px 0; }
  .top-ad-cell .top-ad-text { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .top-ad-text { padding: 6px 10px; border-radius: 6px; }
  .top-ad-icon { max-height: 40px; }
  .top-ad-icon-emoji { font-size: 24px; }
  .top-ad-grid { gap: 4px; padding: 0 6px 0; }
  .top-ad-cell .top-ad-text { padding: 6px 8px; }
  .top-ad-cell .top-ad-icon { max-height: 36px; }
}

.ext-link-block {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  opacity: 0;
  transform: translateY(16px);
  animation: extLinkFadeIn 0.5s ease forwards;
}

@keyframes extLinkFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ext-link-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--primary, #e60012);
  line-height: 1.4;
}

.ext-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---- 文字按钮样式（参考网站 top_nav_list 风格） ---- */
.ext-link-list-text {
  gap: 10px;
}

.ext-link-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: calc((100% - 40px) / 5);
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #1a56db;
  border: none;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.25s ease;
  opacity: 0;
  transform: scale(0.85);
  animation: extLinkItemPop 0.4s ease forwards;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ext-link-text-btn:hover {
  background: #1040b0;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.35);
  opacity: 1;
}

.ext-link-text-btn:active {
  transform: translateY(0) scale(1.02);
}

.ext-link-text-btn.ext-link-disabled {
  background: #7ea8e8;
  color: #fff;
  cursor: not-allowed;
  pointer-events: none;
}

.ext-link-text-btn.ext-link-disabled .ext-link-text-label {
  color: #fff;
}

.ext-link-text-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  color: #fff;
}

.ext-link-text-label {
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

/* ---- 图标按钮样式（参考网站 icon_list 风格） ---- */
.ext-link-list-icon {
  gap: 10px;
}

.ext-link-icon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: calc((100% - 30px) / 4);
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6);
  animation: extLinkItemPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ext-link-icon-btn:hover {
  transform: translateY(-4px) scale(1.1);
}

.ext-link-icon-btn:active {
  transform: translateY(-2px) scale(1.05);
}

.ext-link-icon-btn.ext-link-disabled {
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.6);
  opacity: 0.6;
}

.ext-link-icon-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  background: #f5f5f5;
  border: 2px solid #e8e8e8;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* ---- 图片图标 ---- */
.ext-link-icon-img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid #e8e8e8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  background: #fff;
}

.ext-link-icon-btn:hover .ext-link-icon-img {
  transform: rotate(8deg) scale(1.08);
  box-shadow: 0 6px 18px rgba(230, 0, 18, 0.25);
  border-color: var(--primary, #e60012);
}

.ext-link-text-icon-img {
  display: inline-block;
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 4px;
}

.ext-link-icon-label {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  max-width: 70px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
}

.ext-link-icon-btn:hover .ext-link-icon-label {
  color: var(--primary, #e60012);
}

@keyframes extLinkItemPop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .header-top {
    padding: 10px 16px;
    gap: 8px;
  }

  .logo {
    font-size: 20px;
  }

  .logo img {
    max-height: 36px;
  }

  .admin-entry-btn {
    padding: 4px 12px;
    font-size: 12px;
  }

  .nav {
    padding: 8px 12px 6px;
  }

  body.has-announcement .nav {
    padding-top: 8px;
  }

  .nav-container {
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 4px;
    font-size: 14px;
    white-space: normal;
    word-break: keep-all;
  }

  .nav-info-area {
    padding: 0 12px;
  }

  /* 768px 平板保持两栏横排 */
  .nav-info-top {
    flex-direction: row;
    gap: 6px;
  }

  .nav-info-top .nav-info-text,
  .nav-info-top .nav-info-right-col {
    flex: 1;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .nav-info-right {
    gap: 8px;
  }

  .countdown-title {
    font-size: 13px;
  }

  .countdown-unit {
    min-width: 30px;
    height: 26px;
    font-size: 13px;
  }

  .countdown-sep {
    font-size: 13px;
  }

  .period-display {
    font-size: 13px;
  }

  .period-display .period-number {
    font-size: 14px;
    letter-spacing: 1px;
  }

  .countdown-inline {
    flex-wrap: wrap;
    gap: 4px;
  }

  .lottery-ball {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }

  .lottery-ball-special {
    /* 与普通球统一尺寸 */
  }

  .nav-info-bottom {
    padding: 12px 10px;
  }

  /* 确保码球不换行 */
  .lottery-balls {
    gap: 6px 10px;
  }

  .lottery-plus {
    font-size: 26px;
    margin: 0 6px;
    padding-bottom: 14px;
  }

  .section,
  .empty-state {
    margin: 12px;
    border-radius: 6px;
  }

  .section-title {
    font-size: 16px;
    margin: 12px 16px 0;
    padding: 14px 16px 10px;
  }

  .section-grid {
    margin: 12px 16px;
    gap: 0;
  }

  .cell {
    padding: 10px 8px;
    min-height: 40px;
  }

  .back-to-top {
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .announcement-bar {
    top: calc(52px + env(safe-area-inset-top));
    padding: 8px 16px;
    font-size: 13px;
  }

  .site-main {
    padding-top: 0;
  }

  body.has-announcement .site-main {
    padding-top: 0;
  }

  .ext-links-area {
    padding: 0 12px 8px;
    gap: 12px;
  }

  .ext-link-block {
    padding: 12px 14px;
    border-radius: 8px;
  }

  .ext-link-title {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .ext-link-text-btn {
    width: calc((100% - 30px) / 4);
    height: 28px;
    font-size: 12px;
    padding: 0 4px;
  }

  .ext-link-icon-btn {
    width: calc((100% - 24px) / 4);
  }

  .ext-link-icon-emoji {
    width: 46px;
    height: 46px;
    font-size: 22px;
    border-radius: 12px;
  }

  .ext-link-icon-img {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .ext-link-icon-label {
    font-size: 11px;
    max-width: 60px;
  }

  .ext-link-list {
    gap: 8px;
  }

  .ext-link-list-icon {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .header-top {
    padding: 8px 10px;
    gap: 6px;
  }

  .logo {
    font-size: 16px;
  }

  .logo img {
    max-height: 28px;
  }

  .admin-entry-btn {
    padding: 3px 10px;
    font-size: 11px;
  }

  .nav {
    padding: 6px 8px 6px;
  }

  body.has-announcement .nav {
    padding-top: 6px;
  }

  .nav-item {
    padding: 10px 2px;
    font-size: 12px;
  }

  .nav-info-area {
    padding: 0 6px;
  }

  .banner-ad {
    width: calc(100% - 12px);
    margin: 8px auto;
  }

  /* 480px 以下两栏竖向堆叠 */
  .nav-info-top {
    flex-direction: column;
    gap: 8px;
  }

  .nav-info-top .nav-info-text,
  .nav-info-top .nav-info-right-col {
    flex: none;
    padding: 8px 10px;
    min-height: 40px;
    font-size: 12px;
  }

  .nav-info-top .nav-info-text {
    font-size: 12px;
  }

  .countdown-unit {
    min-width: 28px;
    height: 26px;
    font-size: 13px;
    padding: 0 2px;
  }

  .countdown-sep {
    font-size: 13px;
  }

  .countdown-title {
    font-size: 13px;
  }

  .countdown-empty {
    font-size: 12px;
  }

  .nav-info-right {
    gap: 6px;
  }

  .nav-info-history-link {
    font-size: 12px;
    padding: 5px 10px;
  }

  /* 码球在 390px iPhone 上保持横排 */
  .nav-info-bottom {
    padding: 10px 8px;
    font-size: 12px;
  }

  .lottery-balls {
    gap: 4px 8px;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
  }

  .lottery-ball {
    width: 34px;
    height: 34px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .lottery-ball-special {
    /* 与普通球统一尺寸 */
  }

  .lottery-ball-meta {
    font-size: 9px;
    white-space: nowrap;
  }

  .lottery-plus {
    font-size: 22px;
    margin: 0 3px;
    padding-bottom: 12px;
  }

  .lottery-ball-wrapper {
    flex-shrink: 0;
  }

  .period-display {
    font-size: 13px;
  }

  .period-display .period-number {
    font-size: 14px;
  }

  .countdown-inline {
    gap: 3px;
  }

  .section,
  .empty-state {
    margin: 8px;
  }

  .section-title {
    font-size: 15px;
    margin: 10px 12px 0;
    padding: 12px 12px 8px;
  }

  .section-grid {
    margin: 8px 12px;
    gap: 0;
  }

  .cell {
    padding: 8px 6px;
    min-height: 36px;
    font-size: 12px;
  }

  .cell img {
    max-height: 120px;
  }

  .announcement-bar {
    top: calc(46px + env(safe-area-inset-top));
    padding: 6px 12px;
    font-size: 12px;
  }

  .back-to-top {
    right: 10px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .ext-links-area {
    padding: 0 6px 4px;
    gap: 10px;
  }

  .ext-link-block {
    padding: 10px 12px;
  }

  .ext-link-title {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .ext-link-text-btn {
    width: calc((100% - 20px) / 3);
    height: 26px;
    font-size: 11px;
    padding: 0 3px;
  }

  .ext-link-icon-btn {
    width: calc((100% - 18px) / 3);
  }

  .ext-link-icon-emoji {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 10px;
  }

  .ext-link-icon-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .ext-link-icon-label {
    font-size: 10px;
    max-width: 52px;
  }

  .ext-link-list {
    gap: 6px;
  }

  .ext-link-list-icon {
    gap: 6px;
  }
}

/* ---- 开奖动画状态 ---- */
.draw-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #fff3cd, #ffe69c);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #d63031;
}

.draw-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e60012;
  animation: drawDotBlink 1s ease-in-out infinite;
}

.draw-status-text {
  letter-spacing: 1px;
}

@keyframes drawDotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* 码球显示动画 */
.lottery-ball-wrapper.draw-reveal {
  animation: ballReveal 0.8s ease-out;
}

@keyframes ballReveal {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-180deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.15) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* 开奖中的码球轻微脉动 */
.lottery-ball.drawing {
  animation: ballDrawingPulse 1.5s ease-in-out infinite;
}

@keyframes ballDrawingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.loading-tip {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* ====== 底部参考对照表 ====== */
.reference-sections-wrap {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reference-sections-wrap .section {
  margin: 0;
}

.reference-sections-wrap .ref-section {
  padding-bottom: 8px;
}

.reference-sections-wrap .section-title {
  margin: 16px 24px 8px;
  padding: 14px 24px 10px;
}

.ref-grid-zodiac {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 24px 24px;
}

.ref-zodiac-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
  min-height: 80px;
}

.ref-zodiac-cell:nth-child(3n) { border-right: none; }
.ref-zodiac-cell:nth-last-child(-n+3) { border-bottom: none; }

.ref-zodiac-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.ref-zodiac-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: inline-block;
}

.ref-zodiac-chong {
  font-weight: 500;
  color: #555;
}

.ref-table {
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 24px 24px;
  background: #fff;
}

.ref-table-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #e0e0e0;
}

.ref-table-row:last-child { border-bottom: none; }

.ref-table-label {
  flex: 0 0 60px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  color: #333;
}

.ref-color-row-red .ref-table-label   { color: #c40010; }
.ref-color-row-blue .ref-table-label  { color: #1474cc; }
.ref-color-row-green .ref-table-label { color: #237804; }

.ref-num-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 4px;
  flex: 1;
}

.ref-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border-radius: 3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  font-family: "Consolas", "Monaco", monospace;
}

.ref-num-red   { background: #e60012; border: 1px solid #c40010; }
.ref-num-blue  { background: #1890ff; border: 1px solid #1474cc; }
.ref-num-green { background: #52c41a; border: 1px solid #3d9e14; }

/* 参考表响应式 */
@media (max-width: 768px) {
  .reference-sections-wrap {
    padding: 0 12px;
    gap: 12px;
  }
  .reference-sections-wrap .section-title {
    margin: 12px 16px 6px;
    padding: 12px 16px 8px;
    font-size: 16px;
  }
  .ref-grid-zodiac {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 16px 16px;
  }
  .ref-zodiac-cell:nth-child(3n) { border-right: 1px solid #e0e0e0; }
  .ref-zodiac-cell:nth-child(2n) { border-right: none; }
  .ref-table { margin: 0 16px 16px; }
  .ref-table-row { padding: 8px 10px; gap: 8px; }
  .ref-table-label { flex: 0 0 48px; font-size: 14px; }
  .ref-zodiac-img { width: 32px; height: 32px; }
  .ref-num { min-width: 26px; height: 22px; font-size: 12px; }
}

@media (max-width: 480px) {
  .ref-grid-zodiac {
    grid-template-columns: 1fr;
  }
  .ref-zodiac-cell {
    border-right: none !important;
  }
  .ref-zodiac-cell:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
  }
  .ref-table-row { flex-wrap: wrap; }
  .ref-num-row { gap: 3px; }
}

/* ====== 栏目标题/边框/图片扩展设置 ====== */

/* 标题占一行：横跨整行，底部整条边框 */
.section-title.title-full-row {
  display: block;
  margin: 16px 24px 0;
  padding: 12px 24px;
  border-bottom: 2px solid;
  border-radius: 0;
}

/* 隐藏边框：去掉栏目卡片阴影与网格边框 */
.section.section-no-border {
  box-shadow: none;
  border-radius: 0;
}
.section.section-no-border .section-grid {
  border: none;
  border-radius: 0;
}

/* ====== PC 宽屏精细体验 ====== */
@media (min-width: 1200px) {
  .site-header .header-top {
    max-width: 1280px;
  }

  .nav,
  .nav-info-area,
  .ext-links-area {
    max-width: 1280px;
  }

  .section {
    max-width: 1280px;
  }

  .empty-state {
    max-width: 1280px;
  }

  .lottery-ball {
    width: 56px;
    height: 56px;
    font-size: 19px;
  }

  .lottery-ball-special {
    /* 与普通球统一尺寸 */
  }

  .period-display {
    font-size: 18px;
  }

  .period-display .period-number {
    font-size: 20px;
  }
}

/* ====== 跨浏览器滚动条美化 ====== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Firefox 滚动条 */
.nav-info-bottom,
.site-main {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

/* ====== 底部说明 ====== */
.site-footer {
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  padding: 20px 16px;
  margin-top: 24px;
}

.footer-disclaimer {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.footer-disclaimer .footer-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin: 0 0 10px;
}

.footer-disclaimer p {
  font-size: 13px;
  color: #888;
  line-height: 1.8;
  margin: 0 0 6px;
}

.footer-disclaimer p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   本期未开奖占位提示
   后台「本期开奖自动清空」到点后号码被清空，前台改为显示该提示
   ============================================================ */
.lottery-empty-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 16px;
  box-sizing: border-box;
  font-size: 15px;
  font-weight: 600;
  color: #9aa4b2;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed #d8dee6;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .lottery-empty-tip {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .lottery-empty-tip {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 13px;
    letter-spacing: 0;
  }
}
