/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: #fafafa;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  font-size: 10px;
}

/* 1. 顶部导航栏 */
.top-nav {
  background-color: #dc3545;
  color: #fff;
  padding: 12px 15px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.top-nav-container {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
}
.nav-logo i {
  margin-right: 8px;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user span {
  font-size: 13px;
}
.nav-points {
  background-color: #fff;
  color: #dc3545;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}
.nav-btn {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}
.nav-admin {
  background-color: #ffc107;
  color: #333;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
}

/* 2. 开奖模块（核心修复：固定容器结构+匹配JS逻辑） */
.lottery-wrap {
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 12px 15px;
  /* 固定位置：顶部导航下方，不随滚动移动 */
  position: relative;
  z-index: 10;
}
.lottery-container {
  max-width: 100%;
  margin: 0 auto;
}
/* 倒计时标题栏 */
.lottery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.lottery-title {
  font-size: 15px;
  font-weight: bold;
  color: #dc3545;
  display: flex;
  align-items: center;
}
.lottery-title i {
  margin-right: 6px;
}
#countdownTimer {
  font-size: 13px;
  color: #666;
  text-align: right;
}
#countdownTimer .next-issue {
  color: #dc3545;
  font-weight: bold;
}
/* 开奖中提示 */
#drawingStatus {
  font-size: 14px;
  color: #dc3545;
  text-align: center;
  margin: 8px 0;
  display: none;
}
#drawingStatus i {
  margin-right: 5px;
  animation: spin 1s linear infinite;
}
/* 开奖数字容器（关键：匹配JS创建的结构，包含生肖标签） */
#lotteryNumbers {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* 让生肖标签在数字下方对齐 */
  width: 100%;
  margin: 8px 0;
  padding: 0 5px;
  /* 固定宽度：确保7个容器均匀分布，不换行 */
  min-height: 80px; /* 预留数字+生肖标签高度，防止布局跳动 */
}
/* JS动态创建的数字容器（包含数字+生肖） */
.lottery-number-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 12%; /* 7个容器平均分配宽度（12%*7≈84%，留间隙） */
  max-width: 50px;
}
/* 数字圆圈（匹配JS的wave色和revealed状态） */
.lottery-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #999;
  position: relative; /* 用于波色标签定位 */
  margin-bottom: 4px; /* 数字与生肖标签间距 */
}
/* 数字揭晓动画（JS添加的revealed类） */
.lottery-number.revealed {
  color: #fff;
  animation: numberReveal 0.5s ease-out forwards;
}
/* 波色标签（JS动态添加，右上角） */
.wave-badge {
  position: absolute;
  bottom: -4px;
  right: 0;
  font-size: 10px;
  padding: 0.5px 4px;
  border-radius: 2px;
  color: white;
  font-weight: bold;
}
/* 生肖标签（JS动态添加，数字下方） */
.zodiac-label {
  font-size: 11px;
  color: #666;
  text-align: center;
  width: 100%;
}
/* 开奖信息提示 */
#currentDrawInfo {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: 6px;
}

/* 3. 文章列表区域 */
.article-container {
  max-width: 100%;
  padding: 0 15px;
  margin: 15px auto;
}
.article-header {
  background-color: #fff;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 15px;
}
.article-section-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
}
.article-section-title i {
  color: #dc3545;
  margin-right: 8px;
}

/* 文章卡片样式 */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  padding: 15px;
  transition: all 0.2s ease;
}
.article-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.article-card-title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}
.article-card-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}
.article-card-meta i {
  margin-right: 4px;
}
.article-card-excerpt {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.article-card-price {
  font-size: 14px;
  font-weight: bold;
  color: #dc3545;
}
.article-card-free {
  font-size: 14px;
  font-weight: bold;
  color: #28a745;
}
.article-card-btn {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn-view {
  background-color: #dc3545;
  color: #fff;
}
.btn-view:hover {
  background-color: #c82333;
  color: #fff;
}
.btn-purchase {
  background-color: #fff;
  color: #dc3545;
  border-color: #dc3545;
}
.btn-purchase:hover {
  background-color: #dc3545;
  color: #fff;
}
.btn-login {
  background-color: #fff;
  color: #dc3545;
  border-color: #dc3545;
}

/* 4. 页脚样式 */
.footer {
  background-color: #333;
  color: #ccc;
  padding: 12px 0;
  margin-top: 20px;
  width: 100%;
}
.footer-content {
  max-width: 100%;
  margin: 0 auto;
  font-size: 12px;
  text-align: center;
  padding: 0 15px;
}

/* 5. 模态框美化 */
.modal-header {
  background-color: #dc3545;
  color: #fff;
  padding: 10px 15px;
}
.modal-title {
  font-size: 16px;
  font-weight: bold;
}
.modal-body {
  font-size: 14px;
  color: #333;
  padding: 15px;
}
.modal-footer {
  padding: 10px 15px;
  border-top: 1px solid #eee;
}
.modal-footer .btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 4px;
}
.btn-points {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}
.btn-points:hover {
  background-color: #c82333;
  color: #fff;
}
.btn-recharge {
  background-color: #ffc107;
  color: #333;
  border-color: #ffc107;
}
.btn-recharge:hover {
  background-color: #e0a800;
  color: #333;
}

/* JS用到的动画（还原JS逻辑中的动画名） */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes numberReveal {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
/* JS用到的脉冲动画（接近开奖时的提示） */
@keyframes animate-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.text-red-600 {
  color: #dc3545;
}
.animate-pulse {
  animation: animate-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 响应式适配（确保手机端不换行） */
@media (max-width: 360px) {
  .lottery-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .zodiac-label {
    font-size: 10px;
  }
}
@media (min-width: 420px) {
  .lottery-number {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}