/* 全局重置 - 基础 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "微软雅黑", Arial, sans-serif;
}

/* 关键修复：确保body和html能滚动 */
html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden; /* 禁止横向滚动 */
  overflow-y: auto;    /* 允许纵向滚动 */
  -webkit-overflow-scrolling: touch; /* 移动端顺滑滚动 */
}

/*全局容器：控制整个网页的最大宽度 */
.wrapper {
  width: 100%;
  max-width: 500px; /* 整个网页最大500px，包括开奖模块 */
  margin: 0 auto;   /* 网页居中 */
  padding: 0 3px; /* 左右留白，适配移动端 */
  /* 移除可能限制滚动的样式 */
  overflow: visible;
}

/* 轮播容器 - 核心：由图片撑高，圆点基于此定位 */
.slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
  background: #f5f5f5; /* 加载占位背景 */
  margin-bottom: 3px; /* 轮播图和公告栏间距 */
}

/* 加载动画 */
.slider::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 35px;
  height: 35px;
  margin-left: -17px;
  margin-top: -17px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: #999;
  border-radius: 50%;
  animation: loading 1s linear infinite;
  z-index: 0;
}
@keyframes loading {
  to { transform: rotate(320deg); }
}

/* 图片包裹层 - 撑满轮播容器 */
.slider-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease; /* 轮播过渡更丝滑 */
}

/* 轮播图片 - 完整显示+顶部对齐 */
.slider-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 80px;
  display: block;
  object-fit: contain; /* 完整显示图片 */
  object-position: top center; /* 顶部对齐，无空白 */
  border-radius: 0 !important;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  position: relative;
  border: none;
  z-index: 1;
}

/* 底部指示器 - 核心：浮在图片底部上层 */
.slider-dots {
  position: absolute;
  bottom: 12px; /* 距离图片底部的间距，和示例一致 */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  font-size: 16px;
  z-index: 99; /* 强制在图片上层 */
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5); /* 半透明白点 */
  cursor: pointer;
}
.dot.active {
  background: white; /* 选中的白点更亮 */
}

/* 广告轮播图--end */

/* 公告栏核心样式（适配图片版） */
.notice-bar {
  width: 100%;
  height: 32px;
  line-height: 32px;
  background-color: #fff;
  border: 1px solid #eee;
  overflow: hidden;
  position: relative;
  margin-bottom: 5px; /* 公告栏和开奖模块间距 */
}

/* 喇叭图标容器（适配图片，彻底遮挡文字） */
.notice-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;          /* 足够宽的遮挡区 */
  height: 32px;         /* 和公告栏同高 */
  background-color: #fff;/* 纯白背景挡文字 */
  z-index: 999;         /* 最高层级 */
  display: flex;
  align-items: center;
  justify-content: center; /* 图片水平居中 */
}

/* 喇叭图片样式（关键！适配透明背景/不变形） */
.notice-icon img {
  width: 18px;          /* 图片显示大小（可改） */
  height: 18px;         /* 和宽度一致，避免拉伸 */
  object-fit: contain;  /* 完整显示图片，不变形 */
}

/* 文字滚动包裹层（从图标右侧开始，永不重叠） */
.notice-scroll-wrap {
  position: absolute;
  left: 40px;           /* 直接避开图标区域 */
  top: 0;
  width: calc(100% - 40px); /* 仅在右侧显示文字 */
  height: 100%;
  overflow: hidden;
}

/* 滚动文字容器 */
.notice-content {
  position: absolute;
  white-space: nowrap;
  left: 100%;
  top: 0;
  font-size: 14px;
  color: #333;
  animation: noticeScroll 20s linear infinite;
}

@keyframes noticeScroll {
  0% { left: 100%; }
  100% { left: -100%; }
}

.notice-bar:hover .notice-content {
  animation-play-state: paused;
}

/* 站内公告滚动栏样式--end */

/* 开奖信息模块样式（适配500px宽度） */
.lottery-container {
  width: 100%;
  border: 0px solid #eee;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  margin-bottom: 5px;
}

/* 彩种标签栏 - 限制最多显示5个tab，超出自动适配 */
.lottery-tabs {
  display: flex;
  gap: 3px;
  background-color: #ffffff;
  border-bottom: 1px solid #07c160;
  /* 最多5个tab适配 */
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* 隐藏tab栏滚动条 */
.lottery-tabs::-webkit-scrollbar {
  display: none;
}
.tab-item {
  flex: 1;
  min-width: 80px; /* 最小宽度，防止过窄 */
  text-align: center;
  padding: 8px 0; /* 缩小内边距，适配移动端 */
  font-size: 16px;
  font-weight: 550;
  cursor: pointer;
  position: relative;
  color: #333;
  background-color: #f5f5f5; /* tab自身的背景色（原父容器的背景色） */
}

/* 激活态标签（新新彩默认激活） */
.tab-item.active {
  color: #fff;
  background-color: #07c160;
}

/* 开奖日期提示 */
.tab-date {
  display: block;
  font-size: 11px;
  font-weight: normal;
  margin-top: 1px;
}

/* 开奖信息主体 */
.lottery-content {
  border: 1px solid #07c160;
  border-top: none; /* 隐藏上边框 */
  padding: 12px;
}

/* 期数+倒计时栏 */
.lottery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 5px;
}

.period-num {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.period-number {
  color: #07c160;
}

.countdown {
  color: #e60000;
  font-size: 15px;
  font-weight: 500;
}

.history-btn {
  color: #07c160;
  text-decoration: none;
  font-size: 14px;
}

/* 开奖号码区域 */
.lottery-numbers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center; /* 号码居中显示 */
}

/* 号码球通用样式（适配目标网站的图片球） */
.number-ball {
  font-size: 20px;    /* 对应目标网站的.36rem */
  width: 45px;        /* 对应目标网站的.8rem */
  height: 45px;       /* 对应目标网站的.8rem */
  font-weight: 500;   /* 超粗体，匹配目标样式 */
  line-height: 45px;  /* 数字垂直居中 */
  margin: 0;       /* 水平居中 */
  text-align: center; /* 文字水平居中 */
  color: #000;        /* 数字颜色（目标网站是黑色，如需白色改#fff） */
  background-repeat: no-repeat;
  background-size: 45px 45px; /* 图片铺满整个球 */
  border-radius: 0;   /* 取消圆角（图片本身是圆形） */
  position: relative; /* 保留生肖文字定位 */
}

/* 蓝色球（用下载的图片做背景） */
.ball-blue {
  background-image: url("../imgs/blue-ball.png"); /* 替换成你实际的图片路径 */
}

/* 绿色球 */
.ball-green {
  background-image: url("../imgs/green-ball.png");
}

/* 红色球 */
.ball-red {
  background-image: url("../imgs/red-ball.png");
}

/* 灰色摇珠中球 */
.ball-gray {
  background: #cccccc !important; /* 纯灰色背景 */
  border-radius: 50% !important;   /* 正圆形 */
  background-image: none !important; /* 取消原来的图片 */
  color: #333;
}

/* 生肖五行说明（保留原有样式，适配图片球） */
.ball-desc {
  position: absolute;
  bottom: -35px;
  left: 0;
  width: 100%;
  text-align: center; 
  font-size: 14px;
  color: #333;
  font-weight: normal;
}

/* +号分隔符 */
.plus-sign {
  font-size: 16px;
  color: #333;
  margin: 0 4px;
}

/* 下期开奖提示 */
.next-period {
  margin-top: 30px;
  font-size: 15px;
  color: #e71607;
  text-align: center;
  font-family: Source Han Sans CN;
}

/* 隐藏非激活彩种内容 */
.lottery-panel {
  display: none;
}
.lottery-panel.active {
  display: block;
}

/* 广告图容器 - 适配全局500px宽度 */
.ad-container {
  width: 100%;
  margin-bottom: 5px; /* 广告图和下方文字的间距，可自定义 */
  background: #f5f5f5; /* 加载占位背景，和轮播图一致 */
}

/* 广告图样式 - 核心：完整显示、不变形 */
.ad-img {
  width: 100%; /* 撑满容器宽度，适配全局500px限制 */
  display: block; /* 去除图片默认的行内间隙 */
  object-fit: contain; /* 完整显示图片，不拉伸、不裁剪 */
  object-position: center; /* 图片居中 */
  min-height: 30px; /* 防止图片加载前容器高度为0 */
  border: none; /* 去除默认边框 */
}

/* ========== 资料预测模块样式========== */
.predict-container {
  width: 100%;
  margin-bottom: 3px;
  border: 1px solid #07c160;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* 预测模块标题栏（和开奖模块风格统一） */
.predict-title {
  background-color: #07c160;
  color: #fff;
  font-size: 16px;
  font-weight: 550;
  padding: 8px 12px;
  border-bottom: 1px solid #07c160;
  text-align: center;
}

/* 预测内容列表容器 */
.predict-list {
  padding: 10px 8px;
}

/* 单条预测内容项 */
.predict-item {
  margin-bottom: 8px;
  padding: 6px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 3px solid #07c160;
}

/* 期数行（第一行） */
.predict-period {
  font-size: 15px;
  color: #333;
  font-weight: 500;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 开奖结果标签（对错/开奖号） */
.predict-result {
  font-size: 14px;
  color: #e60000;
  font-weight: 500;
}

/* 预测内容行（核心内容） */
.predict-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.predict-zhodiac {
  color:  #0088ff; /* 蓝色突出生肖 */
  font-weight: 600;
}

.predict-number {
  color: #333;
   font-weight: 600;
  margin-left: 4px;
}
/* 吉美丑凶颜色定义 */
.ji-mei, .zuo-xiao, .qian-xiao { color: #07c160; font-weight: 600; } /* 吉美-绿色（和绿波/木属性一致） */
.chou-xiong, .you-xiao, .hou-xiao { color: #e60000; font-weight: 600; } /* 丑凶-红色（和红波/火属性一致） */

/* 风雨雷电分类颜色 */
.wind { color: #07c160; font-weight: 600; } /* 风-绿色 */
.thunder { color: #e60000; font-weight: 600; } /* 雷-红色 */
.rain { color: #0088ff; font-weight: 600; } /* 雨-蓝色 */
.lightning { color: #9370db; font-weight: 600; } /* 电-紫色 */

/* 春夏秋冬分类颜色（新增） */
.spring { color: #07c160; font-weight: 600; } /* 春-绿色 */
.summer { color: #e60000; font-weight: 600; } /* 夏-红色 */
.autumn { color: #e67e22; font-weight: 600; } /* 秋-橙色 */
.winter { color: #0088ff; font-weight: 600; } /* 冬-蓝色 */

/* 五行颜色定义（新增） */
.water { color: #0088ff; font-weight: 600; } /* 水-蓝色 */
.fire { color: #e60000; font-weight: 600; } /* 火-红色 */
.earth { color: #e67e22; font-weight: 600; } /* 土-橙色 */
.wood { color: #07c160; font-weight: 600; } /* 木-绿色 */
.gold { color: #f1c40f; font-weight: 600; } /* 金-黄色 */

/* 玄武六肖颜色定义（新增） */
.xuanwu { color: #663399; font-weight: 600; } /* 玄武-紫棕色 */

/* 天地三肖颜色定义（新增） */
.tian { color: #e60000; font-weight: 600; } /* 天-红色 */
.di { color: #0088ff; font-weight: 600; } /* 地-蓝色 */

/* 独家三头颜色定义（新增） */
.exclusive-three { color: #ff6600; font-weight: 600; } /* 独家三头-橙色 */

/* 凤凰五尾颜色定义（新增） */
.phoenix-five { color: #d35400; font-weight: 600; } /* 凤凰五尾-深橙色 */

/* 神机九肖颜色定义（新增） */
.shenji-nine { color: #8e44ad; font-weight: 600; } /* 神机九肖-紫色 */

/* 风雨雷电/双波中特/六合凤凰/家野各三肖/精准五行/平特一肖/准杀十码/玄武六肖/春夏秋冬/天地三肖/独家三头/凤凰五尾/彩霸王六肖/神机九肖列表通用样式 */
.weather-list, .wave-list, .phoenix-list, .animal-list, .five-elements-list, .pingte-list, .kill-number-list, .xuanwu-list, .season-list, .tian-di-list, .exclusive-three-list, .phoenix-five-list, .caibawang-list, .shenji-nine-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.weather-list-item, .wave-list-item, .phoenix-list-item, .animal-list-item, .five-elements-list-item, .pingte-list-item, .kill-number-list-item, .xuanwu-list-item, .season-list-item, .tian-di-list-item, .exclusive-three-list-item, .phoenix-five-list-item, .caibawang-list-item, .shenji-nine-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px; /* 减少内边距，节省空间 */
  border-bottom: 1px dashed #eee;
  font-size: 14px;
  white-space: nowrap; /* 强制单行显示，禁止子元素换行 */
}
/* 最后一行去掉下划线 */
.weather-list-item:last-child, .wave-list-item:last-child, .phoenix-list-item:last-child, .animal-list-item:last-child, .five-elements-list-item:last-child, .pingte-list-item:last-child, .kill-number-list-item:last-child, .xuanwu-list-item:last-child, .season-list-item:last-child, .tian-di-list-item:last-child, .exclusive-three-list-item:last-child, .phoenix-five-list-item:last-child, .caibawang-list-item:last-child, .shenji-nine-list-item:last-child {
  border-bottom: none;
}
/* 期数列 - 使用min-width替代固定宽度，保留弹性 */
.weather-period-col, .wave-period-col, .phoenix-period-col, .animal-period-col, .five-elements-period-col, .pingte-period-col, .kill-number-period-col, .xuanwu-period-col, .season-period-col, .tian-di-period-col, .exclusive-three-period-col, .phoenix-five-period-col, .caibawang-period-col, .shenji-nine-period-col {
  min-width: 65px; /* 基础最小宽度 */
  flex: 0 0 auto; /* 取消固定宽度，自适应内容 */
  color: #333;
  font-weight: 500;
  font-size: 15px;
}
/* 结果列 - 缩小宽度+自适应 */
.weather-result-col, .wave-result-col, .phoenix-result-col, .animal-result-col, .five-elements-result-col, .pingte-result-col, .kill-number-result-col, .xuanwu-result-col, .season-result-col, .tian-di-result-col, .exclusive-three-result-col, .phoenix-five-result-col, .caibawang-result-col, .shenji-nine-result-col {
  min-width: 70px; /* 基础最小宽度 */
  flex: 0 0 auto; /* 取消固定宽度，自适应内容 */
  color: #e60000;
  text-align: right;
}
/* 符号/内容列 - 占剩余空间，允许文字压缩 */
.weather-symbol-col, .wave-symbol-col, .phoenix-symbol-col, .animal-content-col, .five-elements-content-col, .pingte-content-col, .kill-number-content-col, .xuanwu-content-col, .season-symbol-col, .tian-di-content-col, .exclusive-three-content-col, .phoenix-five-content-col, .caibawang-content-col, .shenji-nine-content-col {
  flex: 1; /* 占满剩余空间 */
  text-align: center;
  color: #0088ff;
  font-weight: 600;
  overflow: hidden; /* 超出隐藏，防止撑破容器 */
  text-overflow: ellipsis; /* 超出显示省略号（可选） */
  white-space: nowrap; /* 强制单行 */
}

/* 风雨雷电/双波中特/六合凤凰/家野各三肖/精准五行/准杀十码/玄武六肖/春夏秋冬/天地三肖/独家三头/凤凰五尾/彩霸王六肖/神机九肖说明行样式 */
.weather-content, .wave-content, .phoenix-content, .animal-content, .five-elements-content, .kill-number-content, .pingte-content, .xuanwu-content, .season-content, .tian-di-content, .exclusive-three-content, .phoenix-five-content, .caibawang-content, .shenji-nine-content {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 8px;
  padding: 6px;
  background-color: #f0fff8;
  border-radius: 4px;
  text-align: center;
}

/* 双波颜色定义 */
.red-wave { color: #e60000; font-weight: 600; } /* 红波 */
.green-wave { color: #07c160; font-weight: 600; } /* 绿波 */
.blue-wave { color: #0088ff; font-weight: 600; } /* 蓝波 */

/* 家野各三肖颜色定义 */
.jia { color: #e60000; font-weight: 600; } /* 家-红色 */
.ye { color: #0088ff; font-weight: 600; } /* 野-蓝色 */

/* 六合凤凰/彩霸王六肖tab样式（复用开奖模块tab样式，保持统一） */
.phoenix-tabs, .caibawang-tabs, .paomaguatu-tabs, .fangcaodi-tabs, .wzjyx-tabs {
  display: flex;
  gap: 3px;
  background-color: #ffffff;
  border-bottom: 1px solid #07c160;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}
.phoenix-tabs::-webkit-scrollbar, .fangcaodi-tabs::-webkit-scrollbar, .caibawang-tabs::-webkit-scrollbar,.paomaguatu-tabs::-webkit-scrollbar ,.wzjyx-tabs::-webkit-scrollbar {
  display: none;
}
.phoenix-tab-item, .caibawang-tab-item, .fangcaodi-tab-item, .paomaguatu-tab-item, .wzjyx-tab-item {
  flex: 0 0 calc(20% - 2.4px); /* 适配5个tab均分 */
  min-width: 70px;
  text-align: center;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  color: #333;
  background-color: #f5f5f5;
}
.phoenix-tab-item.active, .caibawang-tab-item.active, .fangcaodi-tab-item.active, .paomaguatu-tab-item.active, .wzjyx-tab-item.active {
  color: #fff;
  background-color: #07c160;
}

/* 六合凤凰/彩霸王六肖图片容器 */
.phoenix-img-container, .caibawang-img-container, .fangcaodi-img-container, .paomaguatu-img-container, .wzjyx-img-container{
  width: 100%;
  background: #f5f5f5; /* 加载占位背景 */
  display: none; /* 默认隐藏所有图片容器 */
}
.phoenix-img-container.active, .caibawang-img-container.active, .fangcaodi-img-container.active, .paomaguatu-img-container.active, .wzjyx-img-container.active {
  display: block; /* 激活态显示 */
}
.phoenix-img, .caibawang-img, .fangcaodi-img, .paomaguatu-img, .wzjyx-img {
  width: 100%;
  display: block;
  object-fit: contain; /* 完整显示图片，不变形 */
  object-position: center;
  min-height: 100px; /* 防止图片加载前容器高度为0 */
  border: none;
}

/* 新增：生肖牌图片容器样式 */
.zodiac-card-container {
  width: 100%;
  margin: 5px 0; /* 和上下模块保持一致的间距 */
  background: #f5f5f5; /* 加载占位背景 */
}
.zodiac-card-img {
  width: 100%;
  display: block;
  object-fit: contain; /* 完整显示图片，不变形 */
  object-position: center;
  min-height: 50px; /* 防止图片加载前高度为0 */
  border: none;
}

/* 网站声明模块样式 */
.declaration-container {
  width: 100%;
  margin: 10px 0 20px 0; /* 上下间距，和其他模块保持一致 */
  padding: 15px 12px;
  background-color: #f9f9f9; /* 浅灰色背景，醒目但不刺眼 */
  border: 1px solid #eee;
  border-radius: 8px; /* 和其他模块圆角统一 */
}

.declaration-content {
  font-size: 14px;
  line-height: 1.8; /* 行高适中，便于阅读 */
  color: #666; /* 灰色文字，符合声明类内容的视觉风格 */
}

.declaration-text {
  margin-bottom: 8px; /* 两段声明之间的间距 */
  text-align: justify; /* 两端对齐，排版更美观 */
}

.disclaimer-text {
  text-align: justify;
  color: #e60000; /* 免责声明用红色突出，提醒用户注意 */
  font-weight: 500;
}

.highlight-bg {
  background: #ffeb3b;    /* 黄色底色，和四肖八码统一 */
  padding: 0 1px;         /* 仅左右内边距，避免上下错位 */
  border-radius: 3px;     /* 圆角，视觉更美观 */
  vertical-align: middle; /* 垂直居中，保证对齐 */
  line-height: 1.2;       /* 统一行高，无偏移 */
}
 
.result-black {
  color: #000 !important;
}
/* ========== 历史记录弹窗样式（最终版：修复标题栏高度+关闭按钮固定+号码不换行） ========== */
.history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 20px;
}
.history-modal.show {
  display: flex;
}
.history-popup {
  width: 95%;
  max-width: 500px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  /* 关键：强制弹窗容器的盒模型计算方式，避免滚动条影响布局 */
  box-sizing: border-box;
}

/* 标题栏：彻底固定高度，不受任何子元素/滚动条影响 */
.history-header {
  padding: 0 40px; /* 右侧留空给关闭按钮 */
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
  font-size: 18px;
  font-weight: bold; /* 补回标题加粗，视觉更协调 */
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  /* 核心修复1：用min-height+height双重固定高度，优先级最高 */
  height: 50px !important;
  min-height: 50px !important;
  /* 核心修复2：强制行高和高度一致，文字垂直居中不偏移 */
  line-height: 50px !important;
  z-index: 2;
  /* 禁止标题栏被压缩/拉伸 */
  flex-shrink: 0;
  flex-grow: 0;
}

/* 关闭按钮：强制定位到弹窗右上角，覆盖在标题栏上 */
.history-close {
  position: absolute;
  top: 10px; /* 距离弹窗顶部10px（标题栏内垂直居中） */
  right: 10px; /* 距离弹窗右侧10px */
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  font-size: 24px;
  font-weight: bold; /* X字符加粗 */
  color: #ff3333;
  cursor: pointer;
  padding: 0;
  line-height: 30px;
  text-align: center;
  z-index: 999;
  border-radius: 50%;
  background-color: #fff;
}
.history-close:hover {
  color: #e60000;
  background-color: #f5f5f5;
}

/* 内容区域：核心修复3 - 预留滚动条空间，避免挤压标题栏 */
.history-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
  /* 关键：强制预留滚动条宽度，无论是否有滚动条，布局都不变 */
  scrollbar-gutter: stable;
  /* 兼容移动端/WebKit内核 */
  -webkit-scrollbar-gutter: stable;
  /* 兜底：手动给右侧加padding，确保滚动条不影响内容 */
  padding-right: calc(15px + var(--scrollbar-width, 4px));
}

/* 以下原有样式不变 */
.history-item {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #e0e0e0;
}
.history-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.history-period-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.history-period {
  font-size: 16px;
  color: #333;
  font-weight: 500;
}
.history-date {
  font-size: 14px;
  color: #999;
}

/* 号码栏：不换行 + 横向滚动 */
.history-balls-wrap {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  margin-bottom: 8px;
  justify-content: center;
  overflow-x: auto;
  padding-bottom: 5px;
}
.history-balls-wrap::-webkit-scrollbar {
  height: 3px;
}
.history-balls-wrap::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

/* 号码球样式 */
.history-ball {
  width: 42px;
  height: 42px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 18px;
  font-weight: 500;
  position: relative;
  box-shadow: none;
  background-repeat: no-repeat;
  background-size: 42px 42px;
  flex-shrink: 0;
}
.history-ball.red { 
  background-image: url("../imgs/red-ball.png");
} 
.history-ball.green { 
  background-image: url("../imgs/green-ball.png");
} 
.history-ball.blue { 
  background-image: url("../imgs/blue-ball.png");
}
.history-ball.gray {
  background: #cccccc !important;
  border-radius: 50% !important;
  background-image: none !important; 
  color: #333;
}
.history-ball-plus {
  font-size: 16px;
  color: #999;
  margin: 0 2px;
  flex-shrink: 0;
}
.history-ball-desc {
  font-size: 11px;
  color: #666;
  text-align: center;
  margin-top: 4px;
  width: 42px;
}
.history-loading {
  text-align: center;
  padding: 15px;
  color: #666;
  font-size: 14px;
  display: none;
}
.history-loading.show {
  display: block;
}
.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}


/* 资料悬浮按钮（和回到顶部完全一样大） */
.data-float-btn {
  position: fixed !important;
  right: 15px !important;
  bottom: 15px !important;
  width: 50px !important;
  height: 50px !important;
  background-color: #8b5cf6 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
  z-index: 999999 !important;
  transition: all 0.3s ease !important;
  border: 2px solid #fff !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  touch-action: manipulation !important;
}
.data-float-btn:hover {
  background-color: #8b5cf6 !important;
  transform: scale(1.05) !important;
}
.btn-text {
  user-select: none;
}


/* 永久显示：回到顶部按钮（全机型兼容版） */
.back-to-top-btn {
  position: fixed !important;
  right: 15px !important;
  bottom: 75px !important;
  width: 50px !important;
  height: 50px !important;
  background-color: #555 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-size: 24px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
  z-index: 9999999 !important; /* 超级高优先级，永远在最上层 */
  transition: all 0.3s ease !important;
  border: 2px solid #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  touch-action: manipulation !important;
}
.back-to-top-btn:hover {
  background-color: #555 !important;
  transform: scale(1.05) !important;
}
.back-to-top-icon {
  user-select: none !important;
}
/* 资料弹窗遮罩层 */
.data-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}
.data-modal.show {
  display: block;
}
.data-modal-mask {
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

/* 弹窗内容容器 */
.data-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 750px; /* 调整最大宽度适配三列 */
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* 弹窗标题栏 */
.data-modal-header {
  padding: 8px 12px;    /* 缩小上下内边距 */
  height: 40px;         /* 固定高度，更精致 */
  background-color: #59e39f;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.data-modal-header h3 {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
}
.data-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 30px;
  text-align: center;
}
.data-modal-close:hover {
  color: #f5f5f5;
}

/* 弹窗列表容器 */
.data-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px; /* 调整内边距适配三列 */
  -webkit-overflow-scrolling: touch;
}

/* 导航列表样式（核心：固定三列布局，移除响应式降级） */
.data-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* 核心修改：固定三列，永不改变 */
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 强制三列均分 */
  gap: 8px; /* 行列间距，适配原有风格 */
  /* 兼容旧浏览器 */
  display: -ms-grid;
  -ms-grid-columns: 1fr 8px 1fr 8px 1fr;
  -ms-grid-rows: auto;
}

/* 兼容IE的网格间距 */
.data-nav-list > li:nth-child(3n+2) {
  -ms-grid-column: 3;
}
.data-nav-list > li:nth-child(3n+3) {
  -ms-grid-column: 5;
}

.data-nav-item {
  padding: 12px 8px; /* 微调内边距适配三列 */
  font-size: 15px;
  color: #333;
  cursor: pointer;
  /* 移除原有底部边框，替换为圆角+浅色背景 */
  border-bottom: none;
  background-color: #f9f9f9;
  border-radius: 6px;
  text-align: center; /* 文字居中 */
  transition: all 0.2s ease;
  /* 兼容IE */
  -ms-grid-row-span: 1;
}
/* 移除最后一个元素的边框样式（原有样式已无用） */
.data-nav-item:last-child {
  border-bottom: none;
}
.data-nav-item:hover {
  background-color: #e8f8f0; /* 适配绿色主题的hover背景 */
  color: #07c160;
}

/* 响应式适配：小屏幕仅调整字体/间距，不改变列数 */
@media (max-width: 600px) {
  .data-nav-item {
    font-size: 14px; /* 仅缩小字体，保持三列 */
    padding: 10px 6px; /* 缩小内边距 */
  }
  .data-nav-list {
    gap: 6px; /* 缩小间距 */
  }
/* 两个按钮统一缩小尺寸 */
  .data-float-btn,
  .back-to-top-btn {
    width: 45px !important;
    height: 45px !important;
    right: 10px !important;
  }

  /* 回到顶部按钮：图标缩小 */
  .back-to-top-btn {
    bottom: 65px !important;
    font-size: 20px !important; /* 从 24 → 20 */
  }

  /* 资料按钮：文字缩小 */
  .data-float-btn {
    bottom: 10px !important;
    font-size: 14px !important; /* 从 16 → 14 */
  }
}

/* 响应式适配（移动端进一步缩小） */
@media (max-width: 400px) {
  /* 原有响应式样式不变，仅补充历史记录球的响应式 */
  .number-ball {
    width: 40px;      /* 更小屏幕下缩到40px */
    height: 40px;
    font-size: 16px;  /* 字体同步缩小 */
    line-height: 40px;
    background-size: 40px 40px;
  }
  .tab-item {
    font-size: 14px;
    flex: 1; 
    min-width: 70px;
  }
  .ball-desc {
    font-size: 12px;   /* 生肖文字同步缩小 */
    bottom: -30px;
  }
  
  /* 预测模块响应式 */
  .predict-title {
    font-size: 14px;
    padding: 6px 10px;
  }
  .predict-period, .weather-list-item, .wave-list-item, .phoenix-list-item, .animal-list-item, .five-elements-list-item, .pingte-list-item, .kill-number-list-item, .xuanwu-list-item, .season-list-item, .tian-di-list-item, .exclusive-three-list-item, .phoenix-five-list-item, .caibawang-list-item, .shenji-nine-list-item {
    font-size: 13px; /* 进一步缩小字体 */
  }
  .predict-content, .weather-content, .wave-content, .phoenix-content, .animal-content, .five-elements-content, .kill-number-content, .pingte-content, .xuanwu-content, .season-content, .tian-di-content, .exclusive-three-content, .phoenix-five-content, .caibawang-content, .shenji-nine-content {
    font-size: 12px; /* 进一步缩小说明文字 */
  }
  /* 列表响应式 - 极小屏幕下期数列进一步缩小 */
  .weather-period-col, .wave-period-col, .phoenix-period-col, .animal-period-col, .five-elements-period-col, .pingte-period-col, .kill-number-period-col, .xuanwu-period-col, .season-period-col, .tian-di-period-col, .exclusive-three-period-col, .phoenix-five-period-col, .caibawang-period-col, .shenji-nine-period-col {
    min-width: 60px; /* 400px以下屏幕期数列最小宽度 */
    font-size: 13px; /* 期数文字缩小 */
  }
  .weather-result-col, .wave-result-col, .phoenix-result-col, .animal-result-col, .five-elements-result-col, .pingte-result-col, .kill-number-result-col, .xuanwu-result-col, .season-result-col, .tian-di-result-col, .exclusive-three-result-col, .phoenix-five-result-col, .caibawang-result-col, .shenji-nine-result-col {
    min-width: 65px; /* 400px以下屏幕结果列最小宽度 */
    font-size: 13px; /* 结果文字缩小 */
  }
  /* 六合凤凰/彩霸王六肖图片响应式 */
  .phoenix-img, .caibawang-img,.wzjyx-img,.paomaguatu-img {
    min-height: 80px;
  }
  /* 六合凤凰/彩霸王六肖tab响应式 */
  .phoenix-tab-item, .caibawang-tab-item,.paomaguatu-tab-item,.wzjyx-tab-item {
    font-size: 12px;
    flex: 0 0 calc(20% - 2px);
    min-width: 60px;
    padding: 4px 0;
  }
  /* 生肖牌图片响应式 */
  .zodiac-card-img {
    min-height: 80px; /* 小屏幕下缩小最小高度 */
  }
  
  .declaration-container {
    padding: 10px 8px;
  }
  .declaration-content {
    font-size: 12px;
    line-height: 1.6;
  }

/* 标题栏响应式：同样双重固定高度 */
  .history-header {
    font-size: 16px;
    height: 45px !important;
    min-height: 45px !important;
    line-height: 45px !important;
    padding: 0 35px;
  }
  .history-close {
    width: 26px;
    height: 26px;
    font-size: 20px;
    line-height: 26px;
    top: 9px;
    right: 9px;
  }
  .history-ball {
    width: 38px;
    height: 38px;
    font-size: 16px;
    background-size: 38px 38px;
  }
  .history-ball-desc {
    width: 38px;
    font-size: 10px;
  }
  .history-period {
    font-size: 14px;
  }
  .history-date {
    font-size: 12px;
  }
  .history-balls-wrap {
    gap: 3px;
  }
  /* 移动端内容区域滚动条预留空间同步缩小 */
  .history-body {
    padding-right: calc(15px + var(--scrollbar-width, 3px));
  }
  
  /* 资料导航 - 仅调整样式，不改变列数 */
   .data-float-btn {
    width: 45px;
    height: 45px;
    font-size: 14px;
    right: 10px;
    bottom: 10px;
  }
  
  /* 资料弹窗响应式 */
  .data-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  .data-modal-header {
    padding: 10px 12px;
  }
  .data-modal-header h3 {
    font-size: 16px;
  }
  
  /* 核心修改：移除原有1列/2列的降级规则，强制保持三列 */
  .data-nav-list {
    grid-template-columns: repeat(3, 1fr); /* 强制三列 */
    gap: 4px; /* 仅缩小间距 */
  }
  .data-nav-item {
    font-size: 13px; /* 仅缩小字体 */
    padding: 8px 4px; /* 仅缩小内边距 */
    border-radius: 4px; /* 微调圆角 */
    background-color: #f9f9f9; /* 保持背景色 */
    text-align: center; /* 保持居中 */
  }
}


/* 响应式适配（移动端进一步缩小） */
@media (max-width: 375px) {
  /* 原有响应式样式不变，仅补充历史记录球的响应式 */
  /* 注释掉的代码已删除 */
  .lottery-numbers {
    gap: 4px;
  }
  .countdown {
   font-size: 13px;
  }
  .history-btn {
   font-size: 13px;
  }
  
  /* 核心修改：375px仍强制三列，仅调整样式 */
  .data-nav-list {
    grid-template-columns: repeat(3, 1fr); /* 强制三列 */
    gap: 3px; /* 进一步缩小间距 */
  }
  .data-nav-item {
    font-size: 12px; /* 进一步缩小字体 */
    padding: 6px 2px; /* 进一步缩小内边距 */
  }
}
