
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 0;
  background-color: #f5f5f5;
}

/* ========== 小篆字体定义 ========== */
@font-face {
  font-family: 'XiaoZhuan';
  src: url('/fonts/xiaozhuan2.woff2') format('woff2');
  font-weight:lighter;
  font-style: normal;
  font-display: swap;
}

/* 内容区域标题的小篆图标（始终显示） */
.zhuan-icon {
  font-family: 'XiaoZhuan', 'SimSun', 'STSong', serif;
  font-size: 1.1em;
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  transition: all 0.3s ease;
}

/* 菜单文字默认样式 */
.tab-text {
  font-family: 'SimSun', 'STSong', serif;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

/* 菜单悬停时切换为小篆字体 - 柔和过渡效果 */
.tab-btn:hover .tab-text {
  font-family: 'XiaoZhuan', 'SimSun', 'STSong', serif !important;
  font-size: 1.7em !important;
  transform: translateY(-1px) !important;
  letter-spacing: 1px !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 顶部导航栏样式 */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.navbar-brand {
  color: white !important;
  font-weight: bold;
  font-size: 1.1rem;
}

/* 移动端优化 */
.container-fluid {
  max-width: 600px;
  margin: 0 auto;
}

/* ========== 悬浮顶栏 ========== */
.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 9999;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.sticky-content {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
}

.sticky-issue {
  font-size: 0.85rem;
  white-space: nowrap;
}

.sticky-balls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sticky-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: bold;
  color: white;
  font-size: 0.8rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sticky-ball.ball-a { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.sticky-ball.ball-b { background: linear-gradient(135deg, #4ecdc4, #44a08d); }
.sticky-ball.ball-c { background: linear-gradient(135deg, #a8e063, #56ab2f); }

.sticky-sum {
  font-size: 0.85rem;
  white-space: nowrap;
}

.sticky-countdown {
  font-size: 0.85rem;
  white-space: nowrap;
  color: #ffd700;
}

/* 卡片样式 */
.result-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 开奖信息横向布局 */
.lottery-header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.current-issue-section,
.next-issue-section {
  text-align: center;
  min-width: 80px;
}

.section-label {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 4px;
}

.issue-number {
  font-size: 1.1rem;
  font-weight: bold;
  color: #212529;
}

.balls-and-countdown {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.number-balls-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.equals-sign {
  font-size: 1.2rem;
  font-weight: bold;
  color: #6c757d;
  margin: 0 4px;
}

.sum-ball-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  font-weight: bold;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.attribute-balls {
  display: flex;
  gap: 4px;
}

.attr-ball-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.countdown-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.countdown-display {
  font-size: 2rem;
  font-weight: bold;
  color: #2196F3;
  line-height: 1;
}

.countdown-label {
  font-size: 1rem;
  color: #6c757d;
}

.number-ball-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: bold;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.number-ball-outline.ball-a { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.number-ball-outline.ball-b { background: linear-gradient(135deg, #4ecdc4, #44a08d); }
.number-ball-outline.ball-c { background: linear-gradient(135deg, #a8e063, #56ab2f); }

.attr-ball-outline.ball-big { background: linear-gradient(135deg, #e91e63, #c2185b); }
.attr-ball-outline.ball-small { background: linear-gradient(135deg, #4CAF50, #388e3c); }
.attr-ball-outline.ball-odd { background: linear-gradient(135deg, #ff9800, #f57c00); }
.attr-ball-outline.ball-even { background: linear-gradient(135deg, #2196F3, #1976d2); }

/* 数字球样式 */
.number-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: bold;
  color: white;
  margin: 4px;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ball-a { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.ball-b { background: linear-gradient(135deg, #4ecdc4, #44a08d); }
.ball-c { background: linear-gradient(135deg, #a8e063, #56ab2f); }
.ball-sum { 
  background: linear-gradient(135deg, #f093fb, #f5576c);
  width: 50px;
  height: 50px;
  font-size: 1.3rem;
}

/* 大小单双颜色 */
.ball-big { background: linear-gradient(135deg, #e91e63, #c2185b); }
.ball-small { background: linear-gradient(135deg, #4CAF50, #388e3c); }
.ball-odd { background: linear-gradient(135deg, #ff9800, #f57c00); }
.ball-even { background: linear-gradient(135deg, #2196F3, #1976d2); }

/* 倒计时 */
.countdown-timer {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: #2196F3;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.waiting-text {
  color: #ff9800;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 等待开奖急促呼吸灯效果 */
.countdown-waiting {
  color: #ff5722;
  font-weight: bold;
  animation: urgentPulse 0.6s infinite;
}

@keyframes urgentPulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.3; 
    transform: scale(0.95);
  }
}

/* JavaScript控制的急促呼吸灯效果（用于动态切换） */
.urgent-pulse {
  animation: urgentPulseJS 0.6s infinite;
}

@keyframes urgentPulseJS {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
    text-shadow: 0 0 10px rgba(255, 87, 34, 0.8);
  }
  50% { 
    opacity: 0.4; 
    transform: scale(0.95);
    text-shadow: 0 0 5px rgba(255, 87, 34, 0.4);
  }
}

/* 遗漏项样式 */
.omission-item {
  display: inline-block;
  padding: 6px 12px;
  margin: 4px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  color: white;
  min-width: 60px;
  text-align: center;
}

/* 统计网格 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.stat-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

/* 特殊 13/14 标记 */
.special-13-14 {
  background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
  color: #333 !important;
  animation: shine 2s infinite;
}

@keyframes shine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

/* 历史表格 */
.history-table {
  width: 100%;
  font-size: 0.85rem;
}

.history-table th {
  background: #f8f9fa;
  padding: 8px;
  font-weight: bold;
}

.history-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

/* 视图切换按钮 */
.view-toggle {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.toggle-btn {
  padding: 8px 24px;
  border: 2px solid #4CAF50;
  border-radius: 20px;
  background: white;
  color: #4CAF50;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.toggle-btn.active {
  background: #4CAF50;
  color: white;
}

/* 图表容器 */
.chart-container {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 分页 */
.pagination .page-link {
  color: #4CAF50;
  border-color: #ddd;
  margin: 0 2px;
  border-radius: 8px !important;
}

.pagination .page-item.active .page-link {
  background-color: #4CAF50;
  border-color: #4CAF50;
}

/* 列表组优化 */
.list-group-flush .list-group-item {
  border: none;
  padding-left: 0;
  padding-right: 0;
}

/* ========== 标签页菜单 ========== */
.analysis-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tab-btn {
  flex: 1;
  min-width: calc(50% - 4px);
  padding: 12px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  color: #666;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  border-color: #4CAF50;
  background: #4CAF50;
  color: white;
}

.tab-btn:hover:not(.active) {
  border-color: #4CAF50;
}

/* 标签内容区域 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 遗漏统计网格 */
.omission-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.omission-box {
  border-radius: 6px;
  padding: 10px 6px;
  text-align: center;
  color: white;
}

.omission-label {
  font-size: 0.72rem;
  font-weight: bold;
  margin-bottom: 3px;
}

.omission-value {
  font-size: 0.88rem;
  font-weight: bold;
}

/* 数字网格 */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.number-box {
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
  color: white;
}

.number-label {
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 2px;
}

.number-value {
  font-size: 0.9rem;
  font-weight: bold;
}

/* 统计框 */
.stat-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

.stat-percent {
  font-size: 0.75rem;
  color: #999;
  margin-top: 2px;
}

/* 形态框 */
.pattern-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* ========== 纯 CSS 图表 ========== */
/* 柱状图容器 */
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  height: 240px;
  padding: 10px 5px;
  background: #fafafa;
  border-radius: 8px;
  overflow-x: auto;
  gap: 2px;
}

/* 柱状项 - 固定高度让柱子百分比正确计算 */
.bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 24px;
  margin: 0 1px;
  height: 210px; /* 固定高度，减去标签空间 */
}

/* 柱子容器 - 高度由内联样式控制，最小高度确保数字可见 */
.bar {
  width: 100%;
  min-height: 4px; /* 最小高度，确保能显示数字 */
  max-height: 200px; /* 最大高度，防止数字被遮挡 */
  border-radius: 3px 3px 0 0;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
  background: #2196F3;
  flex-shrink: 0;
}

.bar:hover {
  opacity: 0.8;
  transform: scaleY(1.05);
}

/* 柱状数值标签 */
.bar-value {
  font-size: 0.6rem;
  color: white;
  font-weight: bold;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* 柱状标签 */
.bar-label {
  font-size: 0.65rem;
  color: #666;
  margin-top: 4px;
  text-align: center;
}

/* 条形进度条容器 */
.bar-container {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

/* 条形进度条 */
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* 折线图容器 */
.line-chart {
  position: relative;
  height: 150px;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

/* SVG 连接线 */
.line-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 折线点 */
.line-point {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 2;
}

/* 折线点圆点 */
.point {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.point:hover {
  transform: translateY(50%) scale(1.3);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* 响应式优化 */
@media (max-width: 360px) {
  .numbers-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  
  .number-box {
    padding: 6px 2px;
  }
  
  .number-label {
    font-size: 0.7rem;
  }
  
  .number-value {
    font-size: 0.8rem;
  }
  
  .bar-chart {
    height: 120px;
  }
  
  .line-chart {
    height: 120px;
  }
}

/* ========== 遗漏统计 - 历史最大提示 ========== */
.omission-max-hint {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  line-height: 1.2;
}

.number-max-hint {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  line-height: 1.2;
}

/* ========== 特组分析页面样式 ========== */
.special-group-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.special-group-box {
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

.special-group-box.frost {
  background: linear-gradient(135deg, #9c27b0, #673ab7) !important;
  box-shadow: 0 0 20px rgba(156, 39, 176, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.3);
  animation: frost-pulse 2s ease-in-out infinite;
}

.special-group-box.frost::before {
  content: '❄️';
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 2rem;
  opacity: 0.3;
  filter: blur(2px);
  animation: frost-drift 3s ease-in-out infinite;
}

@keyframes frost-pulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.3);
  }
  50% { 
    box-shadow: 0 0 30px rgba(156, 39, 176, 0.8), inset 0 0 40px rgba(255, 255, 255, 0.5);
  }
}

@keyframes frost-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-3px, 3px) rotate(180deg); }
}

.special-group-box.flame {
  background: linear-gradient(135deg, #f44336, #ff5722) !important;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.6), inset 0 0 30px rgba(255, 255, 0, 0.3);
  animation: flame-flicker 1.5s ease-in-out infinite;
}

.special-group-box.flame::before {
  content: '🔥';
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 2rem;
  opacity: 0.3;
  filter: blur(2px);
  animation: flame-rise 2s ease-in-out infinite;
}

@keyframes flame-flicker {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.6), inset 0 0 30px rgba(255, 255, 0, 0.3);
  }
  50% { 
    box-shadow: 0 0 35px rgba(244, 67, 54, 0.9), inset 0 0 50px rgba(255, 255, 0, 0.5);
  }
}

@keyframes flame-rise {
  0%, 100% { 
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  50% { 
    transform: translate(-2px, -5px) scale(1.1);
    opacity: 0.5;
  }
}

.special-group-label {
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.special-group-value {
  font-size: 1.1rem;
  font-weight: bold;
}

.special-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.special-stat-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  border: 2px solid;
}

.special-stat-label {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.special-stat-value {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 4px 0;
}

.special-stat-percent {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 6px;
}

.special-bar-container {
  background: #e0e0e0;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}

.special-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* 底部导航栏 */
.nav-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 1000;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.nav-item-mobile {
  text-align: center;
  color: #666;
  font-size: 0.75rem;
  text-decoration: none;
  flex: 1;
}

.nav-item-mobile.active {
  color: var(--primary-color);
  font-weight: bold;
}

.nav-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 2px;
}

/* CSS 变量定义 */
:root {
  --primary-color: #4CAF50;
  --secondary-color: #2196F3;
  --danger-color: #f44336;
  --warning-color: #ff9800;
  --info-color: #00bcd4;
  --big-color: #e91e63;
  --small-color: #4CAF50;
  --odd-color: #ff9800;
  --even-color: #2196F3;
  --extreme-big-color: #9c27b0;
  --extreme-small-color: #795548;
}

/* 响应式优化 */
@media (max-width: 768px) {
  /* 开奖信息卡片 - 保持横向布局，缩小间距 */
  .lottery-header-layout {
    flex-direction: row;  /* 保持横向 */
    gap: 0.5rem;  /* 缩小间距 */
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;  /* 不换行 */
  }
  
  .current-issue-section,
  .next-issue-section {
    flex: 0 0 auto;
    min-width: 50px;
  }
  
  .section-label {
    font-size: 0.6rem;
  }
  
  .issue-number {
    font-size: 0.75rem;
  }
  
  .balls-and-countdown {
    flex: 0 0 auto;
  }
  
  .number-balls-row {
    gap: 4px;
  }
  
  .number-ball-outline {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  
  .sum-ball-outline {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .attr-ball-outline {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
  
  .countdown-display {
    font-size: 1.2rem;
  }
  
  .countdown-label {
    font-size: 0.75rem;
  }
  
  .equals-sign {
    font-size: 0.8rem;
  }
  
  /* 分析菜单 - 改为2列网格 */
  .analysis-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    overflow: visible;
  }
  
  .tab-btn {
    min-width: auto;
    padding: 10px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: visible;
  }
  
  /* AI数据分析师按钮全宽 */
  .ai-analyst-tab {
    grid-column: span 2;
    justify-content: center;
    margin-left: 0 !important;
    margin-top: 4px;
  }
  
  /* 历史开奖表格 */
  .history-table {
    font-size: 0.8rem;
  }
  
  .history-table th,
  .history-table td {
    padding: 6px 4px;
  }
  
  .history-table .number-ball {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.8rem !important;
    margin: 2px !important;
  }
  
  .history-table td .fw-bold {
    font-size: 0.85rem;
  }
  
  .history-table .text-muted {
    font-size: 0.7rem !important;
  }
  
  .attr-ball-outline {
    padding: 2px 6px;
    font-size: 0.75rem;
  }
  
  /* 遗漏统计 */
  .omission-item {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: 50px;
  }
  
  .omission-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  
  /* 统计网格 */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* 特组分析 */
  .special-group-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .special-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  /* 按钮和标题 */
  .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
  
  h6 {
    font-size: 1rem;
  }
  
  /* 图表容器 */
  .chart-container {
    padding: 12px;
  }
  
  .special-group-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .special-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 576px) {
  .special-group-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .special-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .analysis-tabs {
    gap: 6px;
  }
  
  .tab-btn {
    font-size: 0.8rem;
    padding: 8px 6px;
  }
  
  .history-table {
    font-size: 0.75rem;
  }
  
  .number-ball-outline {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .omission-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .special-group-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .special-group-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .special-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .special-group-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 露珠展示样式 ========== */
.luzhu-container {
  margin-top: 20px;
}

.luzhu-stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.luzhu-stats-bar .badge {
  font-size: 0.85rem;
}

.luzhu-wrapper {
  display: flex;
  flex-direction: row;
  gap: 4px;
  padding: 10px;
  overflow-x: auto;
  min-height: 150px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.luzhu-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  min-width: 32px;
  align-items: center;
  transition: all 0.2s ease;
}

.luzhu-column:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.luzhu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.85rem;
  color: white;
  animation: luzhuAppear 0.3s ease;
}

@keyframes luzhuAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 最新一期露珠呼吸灯效果 */
.luzhu-item.latest {
  animation: luzhuBreath 2s ease-in-out infinite, luzhuAppear 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes luzhuBreath {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.6);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 1), 0 0 40px rgba(255, 255, 255, 0.8);
  }
}

/* 大小颜色 */
.luzhu-item.big {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.luzhu-item.small {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

/* 单双颜色 */
.luzhu-item.odd {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.luzhu-item.even {
  background: linear-gradient(135deg, #4a90e2, #007bff);
}

/* 组合颜色 */
.luzhu-item.big-odd {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.luzhu-item.big-even {
  background: linear-gradient(135deg, #ff9a56, #ff6b6b);
}

.luzhu-item.small-odd {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.luzhu-item.small-even {
  background: linear-gradient(135deg, #4a90e2, #007bff);
}

/* 高亮匹配项 */
.luzhu-column.highlight {
  background: linear-gradient(135deg, #fff3cd, #ffe69c);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* 筛选控制区域 */
.luzhu-controls {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

/* 滚动条美化 */
.luzhu-wrapper::-webkit-scrollbar {
  height: 8px;
}

.luzhu-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.luzhu-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.luzhu-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ========== 浮动导航球（滚动时显示） ========== */
.floating-nav-balls {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 999;
}

.floating-balls-left,
.floating-balls-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
}

.floating-balls-left {
  left: 20px;
}

.floating-balls-right {
  right: 20px;
}

.floating-ball-item {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #4CAF50;
  color: #4CAF50;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: bold;
}

.floating-ball-item:hover {
  background: #4CAF50;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.floating-ball-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.floating-ball-item.disabled:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #4CAF50;
  transform: none;
}

.ball-text {
  user-select: none;
}

/* 关闭第二层按钮 */
.close-second-layer-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 90px;
  height: 44px;
  border-radius: 22px;
  background: rgba(244, 67, 54, 0.95);
  border: 2px solid white;
  color: white;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(244, 67, 54, 0.5);
  pointer-events: auto;
  z-index: 1002; /* 高于第二层容器 */
}

.close-second-layer-btn:hover {
  background: #d32f2f;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.7);
}

.close-second-layer-btn span {
  font-size: 16px;
  line-height: 1;
}

.close-second-layer-btn small {
  font-size: 12px;
  font-weight: 500;
}

/* 第二层内容容器 */
.second-layer-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.second-layer-content {
  background: #f5f5f5; /* 与主页面背景一致 */
  border-radius: 16px !important; /* 确保四个角都是圆角 */
  max-width: 100vw; /* 加宽到95%视口宽度 */
  max-height: 85vh; /* 为底部关闭按钮留空间 */
  overflow: hidden !important; /* 关键：裁剪内部内容，防止超出圆角 */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  position: relative;
  display: block !important; /* 改为block */
  visibility: visible !important;
  opacity: 1 !important;
}

/* 第二层内容滚动区域 */
.second-layer-scroll {
  overflow-y: auto;
  overflow-x: auto; /* 允许横向滚动，表格需要这个 */
  display: block !important;
  visibility: visible !important;
  max-height: 85vh;
}

/* 确保克隆的内容显示为block */
.second-layer-scroll > div {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 确保表格在第二层中正常显示 */
.second-layer-scroll table,
.second-layer-scroll table * {
  display: revert !important; /* 恢复默认display值 */
  visibility: visible !important;
}

.second-layer-scroll .table-responsive {
  display: block !important;
  overflow-x: auto !important;
  visibility: visible !important;
}

/* 确保result-card正常显示 */
.second-layer-scroll .result-card {
  display: block !important;
  visibility: visible !important;
}

/* 确保第二层内部的result-card不破坏外层圆角 */
.second-layer-scroll > div:first-child .result-card:first-child {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  margin-top: 0 !important;
}

.second-layer-scroll > div:last-child .result-card:last-child {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-bottom: 0 !important;
}

/* 修复第二层内所有result-card的圆角 */
.second-layer-scroll .result-card {
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}

.second-layer-scroll .result-card:last-child {
  margin-bottom: 12px !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .floating-balls-left {
    left: 10px;
  }
  
  .floating-balls-right {
    right: 10px;
  }
  
  .floating-ball-item {
    width: 45px;
    height: 45px;
    font-size: 12px;
  }
  
  .close-second-layer-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 20px;
  }
  
  .second-layer-content {
    max-width: 95vw;
    max-height: 85vh;
    padding: 15px;
  }
}

