/* Dark Mode and Mobile Fixes */

/* Dark mode for card backgrounds */
.dark-theme .bg-white {
  background-color: #1e293b !important;
  color: #f3f4f6 !important;
}

/* 修复暗黑模式下默认白色背景问题 */
.dark-theme .dark\:bg-black,
.dark-theme .dark\:bg-gray-800,
.dark-theme .dark\:bg-gray-900 {
  background-color: #1e293b !important;
}

/* 修复暗黑模式下表格和内容区域 */
.dark-theme .col-span-1.bg-white,
.dark-theme .col-span-1.lg\:col-span-2.bg-white,
.dark-theme .col-span-1.lg\:col-span-3.bg-white {
  background-color: #1e293b !important;
  color: #f3f4f6 !important;
}

/* Enhance header gradients in dark mode */
.dark-theme .bg-gradient-to-r.from-primary-600.to-primary-500 {
  background-image: none !important;
  background-color: #1e293b !important;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2) !important;
}

/* 修复暗黑模式下header文字颜色 */
.dark-theme .text-gray-900.dark\:text-white {
  color: #f3f4f6 !important;
}

/* Text colors in dark mode */
.dark-theme .text-gray-700,
.dark-theme .text-gray-800,
.dark-theme .text-gray-900 {
  color: #e5e7eb !important;
}

.dark-theme .text-gray-600,
.dark-theme .text-gray-500,
.dark-theme .text-gray-400 {
  color: #d1d5db !important;
}

.dark-theme .text-purple-800 {
  color: #c4b5fd !important;
}

/* 修复暗黑模式下三个区域背景颜色问题 */
.dark-theme .bg-white.dark\:bg-gray-800,
.dark-theme .bg-gray-50.dark\:bg-gray-700,
.dark-theme .bg-white.dark\:bg-gray-800 .divide-y.divide-gray-200.dark\:divide-gray-700 {
  background-color: #1e293b !important;
}

.dark-theme .bg-white.rounded-lg.shadow-md.overflow-hidden,
.dark-theme .col-span-1.bg-white.dark\:bg-gray-800.rounded-lg.shadow-md.overflow-hidden,
.dark-theme .col-span-1.lg\:col-span-2.bg-white.dark\:bg-gray-800.rounded-lg.shadow-md.overflow-hidden,
.dark-theme .col-span-1.lg\:col-span-3.bg-white.dark\:bg-gray-800.rounded-lg.shadow-md.overflow-hidden {
  background-color: #1e293b !important;
}

/* 修复暗黑模式下头部区域背景颜色 */
.dark-theme .px-4.py-2.text-sm.text-gray-600.dark\:text-gray-300.bg-gray-50.dark\:bg-gray-700,
.dark-theme .px-4.py-4.text-xl.font-semibold.text-gray-900.dark\:text-white.flex.items-center {
  background-color: #0f172a !important;
}

/* 修复暗黑模式下所有表头背景色 */
.dark-theme .bg-gray-50.dark\:bg-gray-700.hidden.md\:table-header-group,
.dark-theme .bg-gray-50.dark\:bg-gray-900.hidden.md\:table-header-group {
  background-color: #0f172a !important;
}

/* 修复暗黑模式下期数显示问题 */
.dark-theme .draw-number,
.dark-theme .font-medium.text-gray-900.dark\:text-gray-100,
.dark-theme .text-gray-900.dark\:text-gray-100 {
  color: #ffffff !important;
  background-color: rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  font-weight: 600;
}

.dark-theme .draw-issue-number {
  color: #ffffff !important;
  background-color: rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

.dark-theme .bg-gray-50 {
  background-color: #0f172a !important;
  color: #e5e7eb !important;
}

.dark-theme .border-gray-200,
.dark-theme .border-gray-300 {
  border-color: #374151 !important;
}

.dark-theme .divide-gray-200,
.dark-theme .divide-gray-300,
.dark-theme .dark\:divide-gray-700 {
  --tw-divide-opacity: 1;
  border-color: rgba(55, 65, 81, var(--tw-divide-opacity)) !important;
}

/* 修复浅色模式下三个区域的背景色 */
:not(.dark-theme) .bg-white.dark\:bg-gray-800 {
  background-color: #ffffff !important;
}

:not(.dark-theme) .bg-gray-50.dark\:bg-gray-700 {
  background-color: #f9fafb !important;
}

/* 确保期数在浅色模式下为黑色 */
:not(.dark-theme) .font-medium.text-gray-900.dark\:text-gray-100,
:not(.dark-theme) .draw-issue-number,
:not(.dark-theme) .draw-number {
  color: #000000 !important;
  font-weight: 600;
}

/* 確保暗黑模式下的彩球保持原色 */
.dark-theme .ball-3d[data-number="1"],
.dark-theme .ball-3d[data-number="2"],
.dark-theme .ball-3d[data-number="7"],
.dark-theme .ball-3d[data-number="8"],
.dark-theme .ball-3d[data-number="12"],
.dark-theme .ball-3d[data-number="13"],
.dark-theme .ball-3d[data-number="18"],
.dark-theme .ball-3d[data-number="19"],
.dark-theme .ball-3d[data-number="23"],
.dark-theme .ball-3d[data-number="24"],
.dark-theme .ball-3d[data-number="29"],
.dark-theme .ball-3d[data-number="30"],
.dark-theme .ball-3d[data-number="34"],
.dark-theme .ball-3d[data-number="35"],
.dark-theme .ball-3d[data-number="40"],
.dark-theme .ball-3d[data-number="45"],
.dark-theme .ball-3d[data-number="46"] {
  background-color: #ef4444 !important; /* 紅波 */
  color: #ffffff !important;
}

.dark-theme .ball-3d[data-number="3"],
.dark-theme .ball-3d[data-number="4"],
.dark-theme .ball-3d[data-number="9"],
.dark-theme .ball-3d[data-number="10"],
.dark-theme .ball-3d[data-number="14"],
.dark-theme .ball-3d[data-number="15"],
.dark-theme .ball-3d[data-number="20"],
.dark-theme .ball-3d[data-number="25"],
.dark-theme .ball-3d[data-number="26"],
.dark-theme .ball-3d[data-number="31"],
.dark-theme .ball-3d[data-number="36"],
.dark-theme .ball-3d[data-number="37"],
.dark-theme .ball-3d[data-number="41"],
.dark-theme .ball-3d[data-number="42"],
.dark-theme .ball-3d[data-number="47"],
.dark-theme .ball-3d[data-number="48"] {
  background-color: #3b82f6 !important; /* 藍波 */
  color: #ffffff !important;
}

.dark-theme .ball-3d[data-number="5"],
.dark-theme .ball-3d[data-number="6"],
.dark-theme .ball-3d[data-number="11"],
.dark-theme .ball-3d[data-number="16"],
.dark-theme .ball-3d[data-number="17"],
.dark-theme .ball-3d[data-number="21"],
.dark-theme .ball-3d[data-number="22"],
.dark-theme .ball-3d[data-number="27"],
.dark-theme .ball-3d[data-number="28"],
.dark-theme .ball-3d[data-number="32"],
.dark-theme .ball-3d[data-number="33"],
.dark-theme .ball-3d[data-number="38"],
.dark-theme .ball-3d[data-number="39"],
.dark-theme .ball-3d[data-number="43"],
.dark-theme .ball-3d[data-number="44"],
.dark-theme .ball-3d[data-number="49"] {
  background-color: #22c55e !important; /* 綠波 */
  color: #ffffff !important;
}

.dark-theme .ball-3d.special {
  background-color: #f59e0b !important; /* 金色 */
  color: #ffffff !important;
}

.dark-theme .special-number-plus {
  color: #f59e0b !important; /* 金色 */
}

/* 修复暗黑模式下光泽球效果 */
.dark-theme .ball-glossy[data-number="1"],
.dark-theme .ball-glossy[data-number="2"],
.dark-theme .ball-glossy[data-number="7"],
.dark-theme .ball-glossy[data-number="8"],
.dark-theme .ball-glossy[data-number="12"],
.dark-theme .ball-glossy[data-number="13"],
.dark-theme .ball-glossy[data-number="18"],
.dark-theme .ball-glossy[data-number="19"],
.dark-theme .ball-glossy[data-number="23"],
.dark-theme .ball-glossy[data-number="24"],
.dark-theme .ball-glossy[data-number="29"],
.dark-theme .ball-glossy[data-number="30"],
.dark-theme .ball-glossy[data-number="34"],
.dark-theme .ball-glossy[data-number="35"],
.dark-theme .ball-glossy[data-number="40"],
.dark-theme .ball-glossy[data-number="45"],
.dark-theme .ball-glossy[data-number="46"] {
  background: radial-gradient(circle at 30% 30%, #ef4444, #b91c1c) !important;
  color: #ffffff !important;
}

.dark-theme .ball-glossy[data-number="3"],
.dark-theme .ball-glossy[data-number="4"],
.dark-theme .ball-glossy[data-number="9"],
.dark-theme .ball-glossy[data-number="10"],
.dark-theme .ball-glossy[data-number="14"],
.dark-theme .ball-glossy[data-number="15"],
.dark-theme .ball-glossy[data-number="20"],
.dark-theme .ball-glossy[data-number="25"],
.dark-theme .ball-glossy[data-number="26"],
.dark-theme .ball-glossy[data-number="31"],
.dark-theme .ball-glossy[data-number="36"],
.dark-theme .ball-glossy[data-number="37"],
.dark-theme .ball-glossy[data-number="41"],
.dark-theme .ball-glossy[data-number="42"],
.dark-theme .ball-glossy[data-number="47"],
.dark-theme .ball-glossy[data-number="48"] {
  background: radial-gradient(circle at 30% 30%, #3b82f6, #1d4ed8) !important;
  color: #ffffff !important;
}

.dark-theme .ball-glossy[data-number="5"],
.dark-theme .ball-glossy[data-number="6"],
.dark-theme .ball-glossy[data-number="11"],
.dark-theme .ball-glossy[data-number="16"],
.dark-theme .ball-glossy[data-number="17"],
.dark-theme .ball-glossy[data-number="21"],
.dark-theme .ball-glossy[data-number="22"],
.dark-theme .ball-glossy[data-number="27"],
.dark-theme .ball-glossy[data-number="28"],
.dark-theme .ball-glossy[data-number="32"],
.dark-theme .ball-glossy[data-number="33"],
.dark-theme .ball-glossy[data-number="38"],
.dark-theme .ball-glossy[data-number="39"],
.dark-theme .ball-glossy[data-number="43"],
.dark-theme .ball-glossy[data-number="44"],
.dark-theme .ball-glossy[data-number="49"] {
  background: radial-gradient(circle at 30% 30%, #22c55e, #15803d) !important;
  color: #ffffff !important;
}

.dark-theme .ball-glossy.special {
  background: radial-gradient(circle at 30% 30%, #f59e0b, #b45309) !important;
  color: #ffffff !important;
}

.dark-theme .glossy-plus {
  color: #f59e0b !important;
}

/* Mobile fixes for lottery numbers */
@media (max-width: 768px) {
  #recent-draws-body .ball-3d {
    width: 30px;
    height: 30px;
    font-size: 14px;
    margin: 0 2px;
  }

  /* Improved mobile layout for recent draws */
  .mobile-draw-row td {
    padding: 12px 8px;
  }

  /* 确保手机版暗黑模式下三个区域背景为深色 */
  body.dark-theme .bg-white.dark\:bg-gray-800,
  body.dark-theme .bg-gray-50.dark\:bg-gray-700 {
    background-color: #1e293b !important;
  }

  /* 确保手机版暗黑模式下所有文本颜色正确 */
  body.dark-theme .text-gray-700,
  body.dark-theme .text-gray-800,
  body.dark-theme .text-gray-900 {
    color: #e5e7eb !important;
  }

  /* 确保手机版暗黑模式下期数文本为白色 */
  body.dark-theme .font-medium.text-gray-900.dark\:text-gray-100,
  body.dark-theme [id*="recent-draws-body"] .font-medium {
    color: #ffffff !important;
  }

  /* 为手机版白色模式下的最近10期开奖结果的期数添加框框 */
  body:not(.dark-theme) #recent-draws-body .font-medium,
  body:not(.dark-theme) #recent-draws-body .text-gray-900,
  body:not(.dark-theme) [id*="recent-draws-body"] .font-medium {
    color: #000000 !important;
    background-color: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
  }

  /* Make the numbers container scrollable horizontally */
  #recent-draws-body .flex-nowrap {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 8px;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  /* Hide scrollbar for Chrome, Safari and Opera */
  #recent-draws-body .flex-nowrap::-webkit-scrollbar {
    display: none;
  }

  #recent-draws-body .special-number-container {
    margin-left: 4px;
  }

  /* Add subtle indicator that content is scrollable */
  #recent-draws-body .flex-nowrap::after {
    content: '';
    flex: 0 0 8px;
  }

  /* Scroll indicators */
  #recent-draws-body .flex-nowrap.is-scrollable {
    position: relative;
  }

  #recent-draws-body .flex-nowrap.can-scroll-right::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1));
    pointer-events: none;
  }

  .dark-theme #recent-draws-body .flex-nowrap.can-scroll-right::after {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1));
  }

  #recent-draws-body .flex-nowrap.can-scroll-left::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to left, transparent, rgba(0, 0, 0, 0.1));
    pointer-events: none;
  }

  .dark-theme #recent-draws-body .flex-nowrap.can-scroll-left::before {
    background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.1));
  }

  /* 修复手机版暗黑模式下最新开奖结果的期数显示 */
  .dark-theme #latest-draw-content .draw-number,
  .dark-theme [id*="latest-draw-content"] .text-gray-900.dark\:text-gray-100 {
    color: #ffffff !important;
    background-color: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
  }

  /* 修复手机版暗黑模式下最近10期开奖结果的期数显示 */
  .dark-theme #recent-draws-body .font-medium,
  .dark-theme #recent-draws-body .text-gray-900.dark\:text-gray-100,
  .dark-theme [id*="recent-draws-body"] .font-medium.text-gray-900.dark\:text-gray-100 {
    color: #ffffff !important;
    background-color: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
  }

  /* 确保期数文本内容有足够的对比度 */
  .dark-theme [id*="recent-draws-body"] span.font-medium {
    color: #ffffff !important;
  }
}

/* 修复暗黑模式下toast通知样式 */
.dark-theme #toast {
  background-color: #1e293b !important;
  border: 1px solid #374151;
}

.dark-theme #toast .toast-title {
  color: #f3f4f6 !important;
}

.dark-theme #toast .toast-description {
  color: #d1d5db !important;
}

.dark-theme #toast button {
  background-color: #1e293b !important;
  color: #d1d5db !important;
}

/* Prize info in dark mode */
.dark-theme .bg-purple-50 {
  background-color: rgba(91, 33, 182, 0.1) !important;
}

.dark-theme .border-purple-100 {
  border-color: rgba(91, 33, 182, 0.2) !important;
}

.dark-theme .text-primary-600 {
  color: #a78bfa !important;
}

.dark-theme .text-secondary-700 {
  color: #f9a8d4 !important;
}

/* 修复即将开奖区域颜色 */
.dark-theme .from-purple-50 {
  background: rgba(91, 33, 182, 0.1) !important;
}

.dark-theme .to-indigo-50 {
  background: rgba(79, 70, 229, 0.1) !important;
}

.dark-theme .bg-gradient-to-r.from-purple-50.to-indigo-50 {
  background: #1e293b !important;
  border-color: rgba(91, 33, 182, 0.2) !important;
}

.dark-theme .bg-white.rounded-full {
  background-color: #334155 !important;
}

.dark-theme .bg-white.p-3 {
  background-color: #1e293b !important;
}

/* 修复footer暗黑模式 */
.dark-theme .footer {
  background-color: #0f172a !important;
  color: #e5e7eb !important;
  border-top: 1px solid #334155;
}

.dark-theme .footer a,
.dark-theme .footer-theme-btn {
  color: #a78bfa !important;
}

/* 修改标题区域背景和文字颜色 - 白色模式使用白色背景，暗黑模式使用暗黑色背景，两种模式下字体都是紫色 */
/* 白色模式下标题区域背景 */
:not(.dark-theme) .bg-gradient-to-r.from-primary-600.to-primary-500 {
  background-image: none !important;
  background-color: #ffffff !important;
}

/* 白色模式下标题文字颜色 */
:not(.dark-theme) .bg-gradient-to-r.from-primary-600.to-primary-500 .text-white {
  color: #8b5cf6 !important;
}

/* 暗黑模式下标题区域背景 */
.dark-theme .bg-gradient-to-r.from-primary-600.to-primary-500 {
  background-image: none !important;
  background-color: #1e293b !important;
}

/* 暗黑模式下标题文字颜色 */
.dark-theme .bg-gradient-to-r.from-primary-600.to-primary-500 .text-white {
  color: #a78bfa !important;
}

/* 修复暗黑模式下图表颜色和分析页的特定样式 */
.dark-theme .chart-wrapper {
  background-color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid #334155 !important;
}

.dark-theme canvas {
  filter: brightness(0.85) contrast(1.2) !important;
}

/* 修复分析页面上的表格样式 */
.dark-theme .history-table th {
  background-color: #0f172a !important;
  border-bottom-color: #334155 !important;
  color: #e5e7eb !important;
}

.dark-theme .history-table td {
  border-bottom-color: #334155 !important;
  color: #e5e7eb !important;
}

.dark-theme .history-table tr:nth-child(even) {
  background-color: #0f172a !important;
}

.dark-theme .history-table tr:hover {
  background-color: #1e293b !important;
}

.dark-theme .history-control {
  background-color: #0f172a !important;
  border-bottom-color: #334155 !important;
}

.dark-theme .page-btn {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

.dark-theme .page-btn:hover:not(.disabled) {
  background-color: #334155 !important;
}

.dark-theme .page-info {
  color: #d1d5db !important;
}

/* 特定修复历史记录页面样式 */
.dark-theme .history-header {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-bottom: 1px solid #334155 !important;
}

/* 修复分析页面的频率项颜色 */
.dark-theme .frequency-count {
  color: #cbd5e1 !important;
}

/* 修复热门冷门标签颜色 */
.dark-theme .hot-cold-tabs {
  border-bottom-color: #334155 !important;
}

.dark-theme .hot-cold-tab {
  color: #e5e7eb !important;
}

.dark-theme .hot-cold-tab.active {
  border-bottom-color: #a78bfa !important;
  color: #a78bfa !important;
}

/* 修复移动设备下暗黑模式图表问题 */
@media (max-width: 768px) {
  .dark-theme .chart-container {
    background-color: #1e293b !important;
    padding: 10px !important;
    border-radius: 8px !important;
    border: 1px solid #334155 !important;
  }
  
  .dark-theme .chart-title {
    color: #e5e7eb !important;
  }
}

/* 修复智能选号和玄学选号页面的暗黑模式问题 */

/* 通用卡片修复 */
.dark-theme .card {
  background-color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  border-color: #334155 !important;
}

.dark-theme .card-header {
  background-color: #0f172a !important;
  border-bottom-color: #334155 !important;
}

.dark-theme .card-title {
  color: #e5e7eb !important;
}

.dark-theme .card-description {
  color: #d1d5db !important;
}

.dark-theme .card-content {
  color: #e5e7eb !important;
}

/* 选项组样式修复 */
.dark-theme .option-group h3,
.dark-theme .section-title {
  color: #e5e7eb !important;
}

.dark-theme .radio-option {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

.dark-theme .radio-option:hover {
  background-color: #334155 !important;
}

.dark-theme .radio-option input:checked + .radio-label {
  color: #a78bfa !important;
}

/* 按钮样式修复 */
.dark-theme .button-primary,
.dark-theme .zodiac-btn,
.dark-theme .element-btn,
.dark-theme .star-btn,
.dark-theme .number-btn {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

.dark-theme .button-primary:hover,
.dark-theme .zodiac-btn:hover,
.dark-theme .element-btn:hover,
.dark-theme .star-btn:hover,
.dark-theme .number-btn:hover {
  background-color: #334155 !important;
}

.dark-theme .button-primary:active,
.dark-theme .zodiac-btn.active,
.dark-theme .element-btn.active,
.dark-theme .star-btn.active,
.dark-theme .number-btn.active {
  background-color: #4c1d95 !important;
  color: #ffffff !important;
  border-color: #6d28d9 !important;
}

/* 结果容器样式修复 */
.dark-theme .result-container {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}

.dark-theme .result-title {
  color: #e5e7eb !important;
}

.dark-theme .result-subtitle {
  color: #d1d5db !important;
}

/* 表单元素修复 */
.dark-theme input[type="text"],
.dark-theme input[type="number"],
.dark-theme input[type="date"],
.dark-theme select,
.dark-theme textarea {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

.dark-theme input[type="text"]:focus,
.dark-theme input[type="number"]:focus,
.dark-theme input[type="date"]:focus,
.dark-theme select:focus,
.dark-theme textarea:focus {
  border-color: #6d28d9 !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3) !important;
}

.dark-theme label {
  color: #e5e7eb !important;
}

.dark-theme ::placeholder {
  color: #9ca3af !important;
}

/* 修复选择器下拉菜单 */
.dark-theme select option {
  background-color: #1e293b !important;
  color: #e5e7eb !important;
}

/* 修复表格样式 */
.dark-theme table {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

.dark-theme th {
  background-color: #0f172a !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

.dark-theme td {
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

.dark-theme tr:nth-child(even) {
  background-color: #0f172a !important;
}

.dark-theme tr:hover {
  background-color: #2d3748 !important;
}

/* 修复分隔线 */
.dark-theme hr,
.dark-theme .divider {
  border-color: #334155 !important;
}

/* 修复信息框 */
.dark-theme .info-box {
  background-color: rgba(79, 70, 229, 0.1) !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
  color: #e5e7eb !important;
}

.dark-theme .warning-box {
  background-color: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #e5e7eb !important;
}

/* 修复提示气泡 */
.dark-theme .tooltip {
  background-color: #1e293b !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

.dark-theme .tooltip::before {
  border-color: #334155 transparent transparent transparent !important;
}

/* 修复移动端暗黑模式 */
@media (max-width: 768px) {
  .dark-theme .mobile-section {
    background-color: #1e293b !important;
    border-color: #334155 !important;
  }
  
  .dark-theme .mobile-tab {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
  }
  
  .dark-theme .mobile-tab.active {
    background-color: #4c1d95 !important;
    color: #ffffff !important;
  }
}
/* 专门针对截图中显示的移动版暗黑模式问题 */
/* 标题和页面整体背景 */
body.dark-theme { background-color: #0f172a !important; }
.dark-theme .app-header, .dark-theme header { background-color: #0f172a !important; }
/* 奖项信息白色区块 */
.dark-theme .prize-info, .dark-theme .prize-container, .dark-theme .prize-box { background-color: #1e293b !important; border-color: #334155 !important; }
/* 历史结果项目 */
.dark-theme .history-item, .dark-theme .history-card { background-color: #1e293b !important; border-color: #334155 !important; }
/* 期数和日期文本 */
.dark-theme .period, .dark-theme .draw-number, .dark-theme .date { color: #a78bfa !important; }
/* 星期和次要文本 */
.dark-theme .weekday { color: #94a3b8 !important; }
/* 修复倒计时区域 */
.dark-theme .countdown-container { background-color: #1e293b !important; border-color: #334155 !important; }
.dark-theme .countdown-time { color: #a78bfa !important; }
/* 修复底部导航 */
.dark-theme .bottom-nav, .dark-theme .footer-nav { background-color: #0f172a !important; border-top: 1px solid #334155 !important; }
/* 修复奖项文字颜色 */
.dark-theme .prize-label { color: #d1d5db !important; }
.dark-theme .prize-value { color: #a78bfa !important; }
/* 修复白色区块为暗色 */
.dark-theme .white-box, .dark-theme .bg-white { background-color: #1e293b !important; border-color: #334155 !important; }
/* 修复彩球样式 */
/* 修复白色模式被暗黑模式样式影响的问题 */
body:not(.dark-theme) { background-color: #ffffff !important; }
body:not(.dark-theme) .app-header, body:not(.dark-theme) header { background-color: #ffffff !important; }
body:not(.dark-theme) .prize-info, body:not(.dark-theme) .prize-container, body:not(.dark-theme) .prize-box { background-color: #ffffff !important; border-color: #e5e7eb !important; }
body:not(.dark-theme) .white-box, body:not(.dark-theme) .bg-white { background-color: #ffffff !important; border-color: #e5e7eb !important; }
body:not(.dark-theme) .history-item, body:not(.dark-theme) .history-card { background-color: #ffffff !important; border-color: #e5e7eb !important; }
body:not(.dark-theme) .period, body:not(.dark-theme) .draw-number { color: #8b5cf6 !important; }
body:not(.dark-theme) .date { color: #4b5563 !important; }
body:not(.dark-theme) .weekday { color: #6b7280 !important; }
body:not(.dark-theme) .countdown-container { background-color: #f3f4f6 !important; border-color: #e5e7eb !important; }
body:not(.dark-theme) .countdown-time { color: #8b5cf6 !important; }
body:not(.dark-theme) .bottom-nav, body:not(.dark-theme) .footer-nav { background-color: #ffffff !important; border-top: 1px solid #e5e7eb !important; }
body:not(.dark-theme) .prize-label { color: #4b5563 !important; }
body:not(.dark-theme) .prize-value { color: #8b5cf6 !important; }
/* 修复特定的强制CSS规则，避免影响白色模式 */
body:not(.dark-theme) .bg-white { background-color: #ffffff !important; }
@media (max-width: 768px) { body:not(.dark-theme) { background-color: #ffffff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .mobile-section { background-color: #ffffff !important; } }
/* 确保暗黑模式选择器更加具体，避免干扰白色模式 */
html body.dark-theme .white-box, html body.dark-theme .bg-white { background-color: #1e293b !important; }
html body:not(.dark-theme) .white-box, html body:not(.dark-theme) .bg-white { background-color: #ffffff !important; }
/* 特别针对手机版index.html的白色模式修复 */
@media (max-width: 768px) { body:not(.dark-theme) .grid .col-span-1, body:not(.dark-theme) .grid .lg\:col-span-2, body:not(.dark-theme) .grid .lg\:col-span-3 { background-color: #ffffff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .bg-white.dark\:bg-black, body:not(.dark-theme) .bg-white.dark\:bg-gray-900, body:not(.dark-theme) .bg-white.dark\:bg-gray-800 { background-color: #ffffff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) [class*="bg-white"] { background-color: #ffffff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .bg-gradient-to-r.from-purple-50.to-indigo-50 { background-image: linear-gradient(to right, #f5f3ff, #eef2ff) !important; background-color: #f5f3ff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) [id="latest-draw-content"] .bg-white, body:not(.dark-theme) [id="upcoming-draws-content"] .bg-white { background-color: #ffffff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) #recent-draws-body { background-color: #ffffff !important; } }
/* 修复移动版的圆角和阴影 */
@media (max-width: 768px) { body:not(.dark-theme) .rounded-lg { border-radius: 0.5rem !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; } }
/* 撤销可能影响白色模式的暗黑模式样式 */
body:not(.dark-theme) .white-box.bg-white, body:not(.dark-theme) .bg-white { background-color: #ffffff !important; }
/* 特别修复手机版index.html浅色模式的文本颜色 */
@media (max-width: 768px) { body:not(.dark-theme) .text-gray-900, body:not(.dark-theme) [class*="text-gray-9"] { color: #111827 !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .text-gray-800, body:not(.dark-theme) [class*="text-gray-8"] { color: #1f2937 !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .text-gray-700, body:not(.dark-theme) [class*="text-gray-7"] { color: #374151 !important; } }
@media (max-width: 768px) { body:not(.dark-theme) .text-primary-600, body:not(.dark-theme) [class*="text-primary-"] { color: #8b5cf6 !important; } }
/* 专门修复首页奖项信息在浅色模式下的显示 */
body:not(.dark-theme) .prize-info, body:not(.dark-theme) #latest-draw-content .bg-white { background-color: #ffffff !important; }
body:not(.dark-theme) .text-gray-900, body:not(.dark-theme) #latest-draw-content .text-gray-900 { color: #111827 !important; }
body:not(.dark-theme) #first-prize, body:not(.dark-theme) #second-prize, body:not(.dark-theme) #third-prize, body:not(.dark-theme) #fourth-prize, body:not(.dark-theme) #fifth-prize, body:not(.dark-theme) #sixth-prize, body:not(.dark-theme) #seventh-prize { color: #111827 !important; }
body:not(.dark-theme) #latest-draw-content .space-y-2 .flex .text-gray-900 { color: #111827 !important; }
body:not(.dark-theme) #latest-draw-content h3 { color: #111827 !important; }
@media (max-width: 768px) { body:not(.dark-theme) #latest-draw-content .bg-white { background-color: #ffffff !important; } }
@media (max-width: 768px) { body:not(.dark-theme) #latest-draw-content .text-gray-900, body:not(.dark-theme) #latest-draw-content [id*="prize"] { color: #111827 !important; } }
@media (max-width: 768px) { body:not(.dark-theme) #latest-draw-content .font-medium { color: #111827 !important; } }
body:not(.dark-theme) #latest-draw-content .border { border-color: #e5e7eb !important; }
/* 重置可能被错误覆盖的浅色模式样式 */
html body:not(.dark-theme) #latest-draw-content .bg-white.dark\:bg-gray-800 { background-color: #ffffff !important; border-color: #e5e7eb !important; }
html body:not(.dark-theme) #latest-draw-content .text-gray-900.dark\:text-gray-300, html body:not(.dark-theme) #latest-draw-content .text-gray-900.dark\:text-primary-400 { color: #111827 !important; }
html body:not(.dark-theme) #latest-draw-content .text-lg.font-medium.text-gray-900.dark\:text-gray-100 { color: #111827 !important; }
html body:not(.dark-theme) #latest-draw-content .rounded-lg.p-4.border.border-gray-200.dark\:border-gray-700.shadow-sm { background-color: #ffffff !important; border-color: #e5e7eb !important; }
/* 特殊修复特定移动设备下的奖项信息显示 */
@media (max-width: 480px) { html body:not(.dark-theme) #latest-draw-content .bg-white { background-color: #ffffff !important; } }
@media (max-width: 480px) { html body:not(.dark-theme) [id*="prize"] { color: #111827 !important; } }
/* 修复奖项标签的特定字体和颜色 */
html body:not(.dark-theme) #latest-draw-content .font-medium { color: #111827 !important; font-weight: 500 !important; }
html body:not(.dark-theme) #latest-draw-content .font-bold { color: #111827 !important; font-weight: 700 !important; }
/* 确保奖项列表的样式正确 */
html body:not(.dark-theme) #latest-draw-content .space-y-2 > div { border-color: #f3f4f6 !important; }
/* 修复图标颜色 */
html body:not(.dark-theme) #latest-draw-content .text-yellow-500, html body:not(.dark-theme) #latest-draw-content i.fas.fa-coins { color: #f59e0b !important; }
/* 重置可能与暗色模式冲突的样式 */
@media (prefers-color-scheme: light) { html body:not(.dark-theme) #latest-draw-content .bg-white { background-color: #ffffff !important; } }
@media (prefers-color-scheme: light) { html body:not(.dark-theme) #latest-draw-content .text-gray-900 { color: #111827 !important; } }
/* 确保奖项信息在所有设备上的显示一致性 */
html body:not(.dark-theme) #latest-draw-content .bg-white.rounded-lg.p-4.border.border-gray-200 { background-color: #ffffff !important; }
/* 最后的兜底修复规则 */
html body:not(.dark-theme) [id$="-prize"] { color: #111827 !important; }
/* 专门修复PC版暗黑模式问题，不影响浅色模式 */
@media (min-width: 769px) { .dark-theme { background-color: #0f172a !important; } }
@media (min-width: 769px) { .dark-theme .bg-white, .dark-theme .bg-white.dark\:bg-black, .dark-theme .bg-white.dark\:bg-gray-800, .dark-theme .bg-white.dark\:bg-gray-900 { background-color: #1e293b !important; } }
@media (min-width: 769px) { .dark-theme .text-gray-900, .dark-theme .text-gray-800, .dark-theme .text-gray-700 { color: #e5e7eb !important; } }
@media (min-width: 769px) { .dark-theme .text-gray-600, .dark-theme .text-gray-500, .dark-theme .text-gray-400 { color: #d1d5db !important; } }
@media (min-width: 769px) { .dark-theme .border-gray-200, .dark-theme .border-gray-300 { border-color: #374151 !important; } }
@media (min-width: 769px) { .dark-theme #latest-draw-content .bg-white.dark\:bg-gray-800 { background-color: #1e293b !important; border-color: #374151 !important; } }
@media (min-width: 769px) { .dark-theme #latest-draw-content .text-gray-900.dark\:text-gray-300 { color: #e5e7eb !important; } }
@media (min-width: 769px) { .dark-theme #latest-draw-content .text-gray-900.dark\:text-primary-400 { color: #a78bfa !important; } }
@media (min-width: 769px) { .dark-theme #latest-draw-content .text-lg.font-medium.text-gray-900.dark\:text-gray-100 { color: #f3f4f6 !important; } }
@media (min-width: 769px) { .dark-theme .bg-gray-50 { background-color: #0f172a !important; } }
@media (min-width: 769px) { .dark-theme .bg-gradient-to-r.from-purple-50.to-indigo-50 { background: #1e293b !important; border-color: rgba(91, 33, 182, 0.2) !important; } }
@media (min-width: 769px) { .dark-theme .bg-white.p-3 { background-color: #1e293b !important; border-color: #374151 !important; } }
@media (min-width: 769px) { .dark-theme .bg-white.rounded-full.p-2 { background-color: #334155 !important; } }
@media (min-width: 769px) { .dark-theme .text-secondary-700 { color: #f9a8d4 !important; } }
@media (min-width: 769px) { .dark-theme .text-gray-600.text-sm { color: #9ca3af !important; } }
@media (min-width: 769px) { .dark-theme #recent-draws-body { background-color: #1e293b !important; } }
@media (min-width: 769px) { .dark-theme .bg-gray-50.dark\:bg-gray-900 { background-color: #0f172a !important; } }
@media (min-width: 769px) { .dark-theme .text-xs.font-medium.text-gray-500.dark\:text-gray-300 { color: #d1d5db !important; } }
@media (min-width: 769px) { .dark-theme .footer { background-color: #0f172a !important; color: #e5e7eb !important; border-top: 1px solid #334155 !important; } }
@media (min-width: 769px) { .dark-theme .divide-gray-200.dark\:divide-gray-700 > * { border-color: #374151 !important; } }
/* 确保PC版暗黑模式下的圆角和阴影效果 */
@media (min-width: 769px) { .dark-theme .shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important; } }
@media (min-width: 769px) { .dark-theme .rounded-lg { border-radius: 0.5rem !important; } }
