/**
 * 新版六合彩系统 - 主样式文件
 * 包含彩票球、生肖属性、自动刷新等组件样式
 */

/* ===== 全局样式 ===== */
:root {
  /* 主色调 - 六合彩红色风格 */
  --primary-color: #dc143c;
  --primary-dark: #b8001f;
  --primary-light: #ff4757;
  --secondary-color: #2c3e50;
  --success-color: #27ae60;
  --info-color: #3498db;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --gold-color: #f1c40f;
  
  /* 波色系统 */
  --red-wave-start: #FF0000;
  --red-wave-end: #CC0000;
  --green-wave-start: #00FF00;
  --green-wave-end: #00CC00;
  --blue-wave-start: #0000FF;
  --blue-wave-end: #0000CC;
  
  /* 生肖颜色 */
  --zodiac-snake: #FF6B6B;
  --zodiac-dragon: #4ECDC4;
  --zodiac-rabbit: #45B7D1;
  --zodiac-tiger: #FFA07A;
  --zodiac-ox: #98D8C8;
  --zodiac-rat: #F7DC6F;
  --zodiac-pig: #BB8FCE;
  --zodiac-dog: #85C1E9;
  --zodiac-rooster: #F8C471;
  --zodiac-monkey: #82E0AA;
  --zodiac-goat: #D7BDE2;
  --zodiac-horse: #F1948A;
  
  /* 五行颜色 */
  --element-metal: #FFD700;
  --element-wood: #228B22;
  --element-water: #4169E1;
  --element-fire: #FF4500;
  --element-earth: #D2691E;
  
  /* 动画时长 */
  --animation-duration: 0.3s;
  --ball-animation-duration: 0.6s;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  min-height: 100vh;
}

/* 六合彩装饰背景 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(220, 20, 60, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
}

/* ===== 导航栏红色主题 ===== */
.navbar-dark.bg-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
  box-shadow: 0 2px 10px rgba(220, 20, 60, 0.3);
}

.navbar-brand {
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.brand-text {
  background: linear-gradient(135deg, #fff 0%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.brand-number {
  color: #ffd700;
  font-weight: 900;
  margin-left: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 移动端切换按钮 */
.view-switch {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-switch:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(220, 20, 60, 0.6);
}

.view-switch i {
  font-size: 24px;
}

/* 移动端视图样式 */
body.mobile-view {
  max-width: 414px;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(0,0,0,0.2);
  background: white;
}

body.mobile-view .container {
  max-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
}

/* 移动端视图下的优化 - 整体缩小 */
body.mobile-view .lottery-tabs {
  padding: 0.3rem;
  gap: 0.2rem;
}

body.mobile-view .lottery-tab {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

/* 移动端视图样式 - 简化 */
body.mobile-view .lottery-result-container {
  font-size: 14px;
  padding: 6px;
}

body.mobile-view .lottery-result-header {
  font-size: 15px;
}

body.mobile-view .lottery-numbers-container {
  gap: 3px;
}

body.mobile-view .lottery-plus-sign {
  font-size: 20px;
  margin-right: 3px;
}

body.mobile-view .lottery-ball h2 {
  font-size: 20px !important;
}

body.mobile-view .lottery-ball__zodiac {
  font-size: 11px;
  padding: 0 2px;
  margin-top: 3px;
}

/* ===== 彩票类型标签 ===== */
.lottery-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 移动端优化 - 水平滚动 */
@media (max-width: 768px) {
  .lottery-tabs {
    justify-content: flex-start;
    padding: 0.5rem;
    margin: 0 -0.5rem;
  }
  
  .lottery-tabs::-webkit-scrollbar {
    height: 4px;
  }
  
  .lottery-tabs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
  }
  
  .lottery-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
  }
}

.lottery-tab {
  padding: 0.5rem 1.2rem;
  border: 2px solid #dee2e6;
  border-radius: 25px;
  background: white;
  color: #6c757d;
  text-decoration: none;
  font-weight: 500;
  transition: all var(--animation-duration) ease;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.lottery-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.lottery-tab.active,
.lottery-tab.selected {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
}

.lottery-tab.active::after,
.lottery-tab.selected::after {
  content: '●';
  margin-left: 0.5rem;
  color: var(--gold-color);
  animation: pulse 2s ease-in-out infinite;
}

/* 禁用状态样式 */
.lottery-tab.inactive {
  opacity: 0.6;
  background: #f8f9fa;
  color: #6c757d;
  border-color: #dee2e6;
  cursor: not-allowed;
  position: relative;
}

.lottery-tab.inactive:hover {
  transform: none;
  box-shadow: none;
  border-color: #dee2e6;
  color: #6c757d;
}

.lottery-tab-disabled-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  color: #dc3545;
  font-size: 1.2rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== 彩票球样式（参考旧版设计）===== */
.lottery-ball-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  flex-shrink: 0;
  position: relative;
  flex: 1;
  min-width: 0; /* 允许flex子项缩小 */
}

/* 移动端彩票球优化 */
@media (max-width: 768px) {
  .lottery-ball-container {
    margin: 0 2px;
  }
}

@media (max-width: 650px) {
  .lottery-ball-container {
    margin: 0 2px;
  }
}

.lottery-ball {
  width: 100%;
  height: 61px;
  min-height: 61px; /* 确保最小高度 */
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  font-family: Tahoma, Geneva, sans-serif;
  flex-shrink: 0;
  color: white;
  box-sizing: border-box;
  transition: all var(--animation-duration) ease;
  position: relative;
  overflow: visible;
}

/* 移除3D光泽效果 */
.lottery-ball::before {
  display: none;
}

/* 移除底部阴影 */
.lottery-ball::after {
  display: none;
}

/* 移动端彩票球尺寸优化 */
@media (max-width: 650px) {
  .lottery-ball {
    height: 61px; /* 保持高度不变 */
    min-height: 61px;
    font-size: 24px; /* 只缩小字体 */
  }

  .lottery-ball h2 {
    font-size: 24px !important;
  }
}

.lottery-ball:hover {
  transform: none;
  box-shadow: none;
}

/* 波色样式 - 参考旧版纯色设计 */
.lottery-ball--red-wave {
  background-color: rgb(255, 0, 0);
  color: rgb(255, 255, 255);
}

.lottery-ball--green-wave {
  background-color: rgb(0, 153, 0);
  color: rgb(255, 255, 255);
}

.lottery-ball--blue-wave {
  background-color: rgb(0, 0, 255);
  color: rgb(255, 255, 255);
}

/* 特码样式 - 与普通球相同 */
.lottery-ball--special {
  /* 特码球与普通球样式相同 */
}

/* 移动端特码球 */
@media (max-width: 650px) {
  .lottery-ball--special {
    /* 与普通球相同 */
  }
}

/* 球的尺寸变体 - 不使用 */
.lottery-ball--small {
  /* 不使用 */
}

.lottery-ball--large {
  /* 不使用 */
}

/* 球的动画 - 简化 */
.lottery-ball--animate {
  animation: ballFadeIn 0.3s ease-out;
}

@keyframes ballFadeIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* ===== 号码属性标签（球内白色标签）===== */
.lottery-ball-labels {
  display: none; /* 不使用外部标签 */
}

/* 生肖/五行标签 - 在球内显示 */
.lottery-ball__zodiac {
  display: inline-block;
  height: 19px;
  line-height: 19px;
  margin-top: 6px;
  padding: 0 6px;
  border-radius: 2px;
  color: #333;
  font-size: 14px;
  background: #fff;
  font-weight: normal;
  text-shadow: none;
  box-shadow: none;
  letter-spacing: normal;
}

@media (max-width: 650px) {
  .lottery-ball__zodiac {
    margin-top: 4px;
    padding: 0 2px;
    font-size: 12px;
  }
}

/* 五行标签 - 不单独显示 */
.lottery-ball__element {
  display: none;
}

/* 五行颜色 - 深色文字清晰可见 */
.lottery-ball__element--metal {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
  color: #8B4513 !important;
  text-shadow: 0 0 3px rgba(255,255,255,0.8) !important;
}

.lottery-ball__element--wood {
  background: linear-gradient(135deg, #90EE90 0%, #32CD32 100%) !important;
  color: #004d00 !important;
  text-shadow: 0 0 3px rgba(255,255,255,0.8) !important;
}

.lottery-ball__element--water {
  background: linear-gradient(135deg, #87CEEB 0%, #4169E1 100%) !important;
  color: #00008B !important;
  text-shadow: 0 0 3px rgba(255,255,255,0.8) !important;
}

.lottery-ball__element--fire {
  background: linear-gradient(135deg, #FF6347 0%, #FF4500 100%) !important;
  color: #8B0000 !important;
  text-shadow: 0 0 3px rgba(255,255,255,0.8) !important;
}

.lottery-ball__element--earth {
  background: linear-gradient(135deg, #DEB887 0%, #D2691E 100%) !important;
  color: #4B2F1E !important;
  text-shadow: 0 0 3px rgba(255,255,255,0.8) !important;
}

/* 属性标签容器（大小、单双、波色） */
.lottery-ball__attributes {
  display: flex;
  gap: 0.15rem;
  margin-top: 0.1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 80px;
}

/* 属性标签样式 */
.lottery-ball__attr {
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 大小属性 */
.lottery-ball__attr--big {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.lottery-ball__attr--small {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

/* 单双属性 */
.lottery-ball__attr--odd {
  background: linear-gradient(135deg, #f39c12, #d68910);
}

.lottery-ball__attr--even {
  background: linear-gradient(135deg, #27ae60, #229954);
}

/* 生肖颜色 */
.zodiac-snake { background-color: var(--zodiac-snake); }
.zodiac-dragon { background-color: var(--zodiac-dragon); }
.zodiac-rabbit { background-color: var(--zodiac-rabbit); }
.zodiac-tiger { background-color: var(--zodiac-tiger); }
.zodiac-ox { background-color: var(--zodiac-ox); }
.zodiac-rat { background-color: var(--zodiac-rat); }
.zodiac-pig { background-color: var(--zodiac-pig); }
.zodiac-dog { background-color: var(--zodiac-dog); }
.zodiac-rooster { background-color: var(--zodiac-rooster); }
.zodiac-monkey { background-color: var(--zodiac-monkey); }
.zodiac-goat { background-color: var(--zodiac-goat); }
.zodiac-horse { background-color: var(--zodiac-horse); }

/* ===== 开奖结果容器（旧版样式）===== */
.lottery-result-container {
  font-size: 16px;
  height: auto;
  box-sizing: border-box;
  color: #333;
  padding: 8px;
  font-family: 'PingFang SC', 'microsoft yahei', arial, 'helvetica neue', 'hiragino sans gb', sans-serif;
  background: white;
  border-radius: 8px;
}

.lottery-result-header {
  display: flex;
  align-items: center;
  height: 17px;
  line-height: 17px;
  font-size: 17px;
  margin-bottom: 8px;
}

.lottery-result-title {
  flex: 1;
  text-align: left;
  font-weight: normal;
  font-size: 17px;
  color: #333;
}

.period-number {
  color: #f00;
  font-weight: normal;
}

.lottery-result-history-link {
  color: #f00;
  text-decoration: none;
  font-size: 17px;
}

.lottery-result-history-link:hover {
  text-decoration: underline;
}

.lottery-numbers-container {
  display: flex;
  margin: 8px 0;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 650px) {
  .lottery-result-container {
    font-size: 14px;
    padding: 8px;
  }

  .lottery-result-header {
    font-size: 16px;
  }

  .lottery-result-title {
    font-size: 16px;
  }

  .lottery-result-history-link {
    font-size: 16px;
  }

  .lottery-numbers-container {
    gap: 4px;
    margin: 8px 0;
  }
}

.lottery-plus-sign {
  display: flex;
  align-items: center;
  margin-right: 8px;
  font-size: 32px;
  font-weight: bold;
  color: #333;
}

@media (max-width: 650px) {
  .lottery-plus-sign {
    margin-right: 4px;
    font-size: 24px;
  }
}

.lottery-result-footer {
  display: flex;
  align-items: center;
  font-size: 16px;
  margin-top: 8px;
}

@media (max-width: 650px) {
  .lottery-result-footer {
    font-size: 15px;
  }
}

.lottery-result-info {
  flex: 1;
  color: #333;
}

.lottery-result-countdown {
  display: flex;
  align-items: center;
}

.lottery-refresh-btn {
  display: inline-block;
  width: 40px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  color: #fff;
  border-radius: 4px;
  background: #FF9900;
  border: none;
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
}

.lottery-refresh-btn:hover {
  background: #e68a00;
}

/* 下期倒计时样式 */
.next-draw-countdown {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin-right: 12px;
}

.countdown-title {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.countdown-time {
  font-size: 16px;
  font-weight: bold;
  color: #f00;
  font-family: 'Courier New', monospace;
}

.countdown-info {
  font-size: 14px;
  color: #666;
  margin-top: 2px;
}

/* 开奖时间信息样式 */
/* 移动端开奖信息优化 */
body.mobile-view .lottery-result-footer {
  font-size: 14px;
}

body.mobile-view .countdown-time {
  font-size: 14px;
}

body.mobile-view .countdown-info {
  font-size: 12px;
}

/* ===== 倒计时样式 ===== */
.countdown-display {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--success-color);
  line-height: 1;
  min-width: 60px;
  text-align: center;
  background: linear-gradient(135deg, #e8f5e8, #d4edda);
  border-radius: 8px;
  padding: 0.5rem;
  border: 2px solid var(--success-color);
}

.countdown-label {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-top: 0.25rem;
  font-weight: 600;
}



/* ===== 历史记录样式 ===== */
.history-item {
  padding: 1rem;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: white;
  transition: all var(--animation-duration) ease;
}

.history-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.history-item-period {
  font-weight: 700;
  color: var(--primary-color);
}

.history-item-date {
  color: var(--secondary-color);
}

.history-item-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin: 0.75rem 0;
}

.history-item-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--secondary-color);
}

.stat-item {
  padding: 0.125rem 0.5rem;
  background: #f8f9fa;
  border-radius: 12px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .lottery-ball {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .lottery-ball--small {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
  
  .lottery-ball--large {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
  
  .countdown-number {
    font-size: 2rem;
    min-width: 50px;
  }
  
  .lottery-numbers-container {
    gap: 0.25rem;
  }
  
  .lottery-plus-sign {
    font-size: 1.5rem;
    margin: 0 0.25rem;
  }
  

  
  .history-item-numbers {
    gap: 0.125rem;
  }
  
  .history-item-stats {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .lottery-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .lottery-tab {
    flex-shrink: 0;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* ===== 加载动画 ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(13, 110, 253, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* ===== 工具提示样式 ===== */
.tooltip-inner {
  background-color: rgba(0,0,0,0.9);
  color: white;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ===== 超小屏幕优化（iPhone SE等）===== */
@media (max-width: 400px) {
  .lottery-result-container {
    padding: 6px;
    font-size: 13px;
  }

  .lottery-result-title {
    font-size: 15px;
  }

  .lottery-result-history-link {
    font-size: 15px;
  }

  .lottery-ball-container {
    margin: 0 1px;
  }

  .lottery-ball {
    height: 56px; /* 稍微缩小高度 */
    min-height: 56px;
    font-size: 22px;
  }

  .lottery-ball h2 {
    font-size: 22px !important;
    line-height: 22px;
  }

  .lottery-ball__zodiac {
    margin-top: 3px;
    padding: 0 2px;
    font-size: 11px;
    height: 17px;
    line-height: 17px;
  }

  .lottery-numbers-container {
    gap: 2px;
    margin: 6px 0;
  }

  .lottery-plus-sign {
    margin-right: 2px;
    font-size: 20px;
  }

  .lottery-result-footer {
    font-size: 14px;
  }
}

/* ===== 中等屏幕优化（平板等）===== */
@media (min-width: 651px) and (max-width: 1024px) {
  .lottery-result-container {
    max-width: 800px;
    margin: 0 auto;
  }
}
