/* === 🌟 豪華頁首設計 === */
.luxury {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(255, 215, 0, 0.12) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 20% 100%,
      rgba(138, 43, 226, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 100%,
      rgba(0, 191, 255, 0.06) 0%,
      transparent 50%
    ),
    linear-gradient(180deg, rgba(15, 20, 30, 0.8) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

.luxury::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}

.luxury::after {
  display: none;
}

.shine-text {
  font-size: 2.8rem;
  font-weight: 900;
  color: transparent;
  background: linear-gradient(
    135deg,
    #ffd700 0%,
    #fff8dc 25%,
    #ffd700 50%,
    #ffec8b 75%,
    #ffd700 100%
  );
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-shine 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  letter-spacing: 2px;
  line-height: 1.3;
}

@keyframes gold-shine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* 頁首圖標 */
.header-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  animation: float-icon 3s ease-in-out infinite;
}

.header-icon i {
  background: linear-gradient(135deg, #ffd700, #ff8c00, #ffd700);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.header-logo {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 24px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

@keyframes float-icon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* 標題裝飾 */
.title-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.title-main {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.title-decoration {
  color: #ffd700;
  font-size: 1rem;
  animation: twinkle 1.5s ease-in-out infinite;
}

.title-decoration:nth-child(3) {
  animation-delay: 0.75s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* 背景裝飾圓圈 */
.header-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 0, 0.1);
}

.deco-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -100px;
  animation: rotate-slow 30s linear infinite;
}

.deco-2 {
  width: 200px;
  height: 200px;
  bottom: -50px;
  left: -50px;
  border-color: rgba(138, 43, 226, 0.1);
  animation: rotate-slow 25s linear infinite reverse;
}

.deco-3 {
  width: 150px;
  height: 150px;
  top: 50%;
  left: 10%;
  border-color: rgba(0, 191, 255, 0.08);
  animation: rotate-slow 20s linear infinite;
}

@keyframes rotate-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
  letter-spacing: 2px;
  font-weight: 400;
}

@keyframes shine {
  0% {
    background-position: 0%;
  }
  100% {
    background-position: 300%;
  }
}

/* --- 🎨 全局色彩與設計變數 --- */
:root {
  /* 核心色調:深邃的星空藍與活力的電光紫 */
  --primary-color: #5b52f5; /* 電光紫 - 提升飽和度 */
  --secondary-color: #8b5cf6; /* 亮紫色 - 更柔和 */
  --accent-color: #14b8ff; /* 天藍色點綴 - 更明亮 */

  /* 功能性色彩 */
  --success-color: #10b981; /* 成功 - 綠色 */
  --warning-color: #f59e0b; /* 警告 - 琥珀色 */
  --error-color: #ef4444; /* 錯誤 - 紅色 */

  /* 背景與表面色彩 */
  --bg-main-start: #0f1419; /* 主背景 - 深灰藍 */
  --bg-main-end: #050509; /* 主背景 - 近黑 */
  --surface-color: rgba(30, 41, 59, 0.65); /* 容器背景 - 半透明深藍 */
  --surface-border: rgba(139, 152, 165, 0.25); /* 容器邊框 - 更明顯 */
  --surface-glow: rgba(91, 82, 245, 0.35); /* 容器光暈 - 增強 */

  /* 文字色彩 */
  --text-primary: #f9fafb; /* 主要文字 - 亮白 */
  --text-secondary: #a1a8b0; /* 次要文字 - 灰色 */
  --text-accent: var(--accent-color);

  /* 元件樣式 */
  --radius-md: 16px; /* 中等圓角 */
  --radius-lg: 24px; /* 大圓角 */
  --shadow-glow: 0 0 50px rgba(91, 82, 245, 0.3); /* 輝光陰影 - 增強 */
  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- 🚀 基礎與佈局 --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Noto Sans TC", "Inter", "Microsoft JhengHei UI", "Segoe UI", system-ui,
    sans-serif;
  background: linear-gradient(
    145deg,
    var(--bg-main-start) 0%,
    var(--bg-main-end) 100%
  );
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  body {
    padding: 0.5rem 0;
  }
}

/* --- ✨ 主容器與玻璃擬態效果 --- */
.container {
  width: 100%;
  max-width: 1200px;
  background: transparent;
  overflow: visible;
  animation: fadeIn 1s ease-out;
}

/* === 卡片樣式 === */
.card {
  background: var(--surface-color);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.card:hover {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(79, 70, 229, 0.1);
}

/* === 主要內容網格 (2x2) === */
.main-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

/* === 分析區域網格 (2列) === */
.analysis-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  padding: 0 1.5rem 1.5rem;
}

/* === 走勢 & 分享區域 === */
.extras-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 0 1.5rem 1.5rem;
}

/* === 記錄區域網格 (3列) === */
.records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 1.5rem 1.5rem;
}

.records-section {
  background: linear-gradient(
    160deg,
    rgba(30, 41, 59, 0.7),
    rgba(15, 23, 42, 0.85)
  );
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
}

.records-section .section-title {
  margin-bottom: 1rem;
}

/* === 響應式設計 === */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .extras-grid {
    grid-template-columns: 1fr;
  }

  .records-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0;
  }

  .main-grid,
  .analysis-grid,
  .extras-grid,
  .records-grid {
    padding: 0.5rem;
    gap: 0.75rem;
  }

  .trend-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .trend-title-main {
    font-size: 0.95rem;
  }

  .trend-title-sub {
    font-size: 0.75rem;
  }

  .trend-tab {
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
  }

  .card {
    padding: 1rem;
    border-radius: 12px;
  }
}

/* 頁首保持原樣 */
.header.luxury {
  background: var(--surface-color);
  backdrop-filter: blur(30px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  margin: 0 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.lottery-display {
  background: var(--surface-color);
  backdrop-filter: blur(30px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  margin: 0 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.announcement-bar {
  margin: 0 1.5rem 1.5rem;
  border-radius: var(--radius-lg);
}

/* --- 📈 走勢小圖 --- */
.trend-section {
  position: relative;
  overflow: hidden;
}

.trend-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.trend-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trend-title-main {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.trend-title-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.trend-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 0.25rem 0 0.25rem;
}

.trend-description {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
}

.trend-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.trend-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.trend-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
}

.trend-tab.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.25),
    rgba(56, 189, 248, 0.25)
  );
  border-color: rgba(99, 102, 241, 0.6);
  color: #eef2ff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.trend-chart {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--surface-border);
  min-height: 260px;
  position: relative;
  overflow-x: auto;
}

.trend-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  padding: 2rem 0;
}

.trend-meta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.trend-chip {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.trend-svg {
  width: 100%;
  height: 230px;
  min-width: 960px;
}

.trend-grid {
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 1;
}

.trend-bar {
  fill: url(#trendBarGradient);
}

.trend-bar-label {
  fill: #e2e8f0;
  font-size: 10px;
}

.trend-bar-value {
  fill: #f8fafc;
  font-size: 10px;
  font-weight: 600;
}

.trend-line-label {
  fill: #e2e8f0;
  font-size: 10px;
  font-weight: 600;
}

.trend-line {
  fill: none;
  stroke: url(#trendLineGradient);
  stroke-width: 3;
  filter: drop-shadow(0 4px 10px rgba(56, 189, 248, 0.3));
}

.trend-dot {
  fill: #38bdf8;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1;
}

@media (max-width: 768px) {
  .header.luxury,
  .lottery-display,
  .announcement-bar {
    margin: 0 0.5rem 0.75rem;
    border-radius: 12px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 🌌 頁首設計 --- */
.header {
  padding: 1.8rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--surface-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--text-primary), var(--accent-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.header.luxury {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.6rem 1.5rem;
  text-align: left;
  position: relative;
}

.header-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  position: relative;
  z-index: 1;
}

.header.luxury .title-sub {
  justify-content: flex-start;
  margin-top: 0.25rem;
}

.header.luxury .subtitle {
  margin-top: 0.35rem;
  letter-spacing: 1px;
}

.header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-top: 0.4rem;
}

.header-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- 🎱 開獎號碼顯示區 --- */
.lottery-display {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--surface-border);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), transparent);
}

.lottery-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.lottery-date {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.lottery-balls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lottery-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background:
    radial-gradient(
      120% 120% at 18% 18%,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(145deg, #d94b4b, #b63a3a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(255, 122, 122, 0.18);
  animation: none;
}

.lottery-ball::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 10px;
  width: 22px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  filter: blur(0.5px);
}

/* 最近三期與其他小尺寸號碼球樣式（避免手機溢位） */
.recent-number-ball,
.recommended-ball,
.record-ball {
  width: 30px;
  height: 30px;
  background:
    radial-gradient(
      120% 120% at 18% 18%,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(145deg, #5a54e6, #3a35c7);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 0 -4px 10px rgba(0, 0, 0, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto; /* 不讓 flex 自動縮放為負值 */
}

.recent-number-ball::before,
.recommended-ball::before,
.record-ball::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  width: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

/* 讓顯示多個號碼的容器在窄螢幕下換行，不會把最後一顆擠出容器 */
.recent-numbers-container,
.recommended-numbers,
.record-numbers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap; /* 允許換行 */
  align-items: center;
  justify-content: flex-start;
}

/* 其他玩家預測容器 - 讓三顆球在桌面上看起來更大但在手機自適應 */
#otherPlayersContainer .record-numbers,
#otherPlayersContainer .record-numbers > .record-ball {
  display: flex;
  align-items: center;
  justify-content: center;
}

#otherPlayersContainer .record-numbers {
  gap: 0.6rem;
  flex-wrap: nowrap; /* 預設在桌面嘗試一行顯示三顆 */
}

#otherPlayersContainer .record-ball {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  flex: 0 0 auto;
}

/* 更小螢幕時縮小圓球尺寸與間距 */
@media (max-width: 480px) {
  .lottery-ball {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .recent-number-ball,
  .recommended-ball,
  .record-ball {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .recent-numbers-container,
  .recommended-numbers,
  .record-numbers {
    gap: 0.35rem;
  }
}

.lottery-ball:nth-child(2) {
  background:
    radial-gradient(
      120% 120% at 18% 18%,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(145deg, #2fb5ad, #1f8c86);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(78, 205, 196, 0.18);
  animation-delay: 0.2s;
}

.lottery-ball:nth-child(3) {
  background:
    radial-gradient(
      120% 120% at 18% 18%,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(145deg, #2b93c9, #1f63c1);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(69, 183, 209, 0.18);
  animation-delay: 0.4s;
}

.lottery-ball:nth-child(4) {
  background:
    radial-gradient(
      120% 120% at 18% 18%,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(145deg, #d38b0a, #b36304);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(245, 158, 11, 0.18);
  animation-delay: 0.6s;
}

.lottery-ball:nth-child(5) {
  background:
    radial-gradient(
      120% 120% at 18% 18%,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0) 40%
    ),
    linear-gradient(145deg, #8f4ed6, #5f2cc7);
  box-shadow:
    inset 0 -8px 16px rgba(0, 0, 0, 0.2),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(168, 85, 247, 0.18);
  animation-delay: 0.8s;
}

@keyframes float-ball {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* 漸層圖示 */
.gradient-icon {
  background: linear-gradient(
    90deg,
    #ff5ff7,
    #f1abee
  ); /* 可換成你喜歡的漸層色 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem; /* 調整圖示大小 */
  margin-right: 6px; /* 圖示與文字間距 */
}

/* 小字說明 */
.small-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* 區塊樣式 */
.section-title {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}
/* --- 🧩 內容區域 --- */
.content {
  padding: 0;
}

.content > .error-message,
.content > .success-message,
.content > .loading {
  margin: 0 1.5rem 1rem;
}

/* --- 📝 投注區域 --- */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.number-inputs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.number-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.number-input {
  padding: 1rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 1.2rem;
  text-align: center;
  transition: var(--transition-fast);
}

.number-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 隨機選號按鈕 */
.random-pick-btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
  position: relative;
  overflow: hidden;
}

.random-pick-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transition: left 0.5s ease;
}

.random-pick-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.45);
}

.random-pick-btn:hover:not(:disabled)::before {
  left: 100%;
}

.random-pick-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.random-pick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  box-shadow: none;
}

.random-pick-btn i {
  font-size: 1.1rem;
}

/* 隨機選號動畫 */
.number-input.random-picking {
  animation: ballRolling 0.6s ease-in-out;
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

@keyframes ballRolling {
  0%,
  100% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.15);
  }
  20% {
    transform: scale(0.95);
  }
  30% {
    transform: scale(1.1);
  }
  40% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.2);
  }
  60% {
    transform: scale(0.85);
  }
  70% {
    transform: scale(1.15);
  }
  80% {
    transform: scale(0.9);
  }
  90% {
    transform: scale(1.1);
  }
}

/* 數字跳動效果 */
@keyframes numberJump {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.number-input.number-jumping {
  animation: numberJump 0.3s ease-in-out;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  color: #f8f8f8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 14px rgba(0, 0, 0, 0.25);
}

.gradient-icon-warning {
  background: linear-gradient(90deg, #fef08a, #facc15); /* 黃色漸層 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem;
  margin-right: 6px;
  display: inline-block;
}

.gradient-icon-danger {
  background: linear-gradient(90deg, #fecaca, #ef4444); /* 紅色漸層 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem;
  margin-right: 6px;
  display: inline-block;
}

.gradient-icon-closed {
  background: linear-gradient(90deg, #f87171, #b91c1c); /* 紅色漸層 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem;
  margin-right: 6px;
  display: inline-block;
}

.gradient-icon-waiting {
  background: linear-gradient(90deg, #60a5fa, #1e40af); /* 藍色漸層 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem;
  margin-right: 6px;
  display: inline-block;
}

.gradient-icon-open {
  background: linear-gradient(90deg, #4ade80, #166534); /* 綠色漸層 */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem;
  margin-right: 6px;
  display: inline-block;
}

/* 🎖️ 通用徽章樣式（柔霧金屬風）*/
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  color: #f4f4f4;
  background-clip: padding-box;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    0 2px 5px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 🟡 柔霧金色（降低對比）*/
.badge-gold {
  background: linear-gradient(135deg, #b9932e, #7a5f1c);
}

/* ⚪ 柔霧銀色 */
.badge-silver {
  background: linear-gradient(135deg, #9aa0a6, #6b7280);
}

/* 🟤 柔霧銅色 */
.badge-bronze {
  background: linear-gradient(135deg, #a1623a, #6b3f1d);
}

/* 💰 金幣圖示柔化 */
.badge i {
  color: #ffe08a;
  text-shadow: 0 0 6px rgba(255, 215, 100, 0.45);
}

/* --- 🎯 獎金說明 --- */
.prize-info {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.12) 0%,
    rgba(52, 211, 153, 0.08) 100%
  ) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.12);
  position: relative;
  overflow: hidden;
}

.prize-info::before {
  content: "";
  position: absolute;
  inset: -60% -20% 40% -20%;
  background: radial-gradient(
    circle at 20% 0%,
    rgba(45, 212, 191, 0.25),
    transparent 60%
  );
  pointer-events: none;
}

.prize-info::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.16),
    transparent
  );
  opacity: 0.35;
  transform: translateX(-100%);
  animation: prize-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}

.prize-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.prize-table th,
.prize-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-fast);
}

.prize-table th {
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.prize-table td {
  color: var(--text-secondary);
}

.prize-table td:last-child,
.prize-table th:last-child {
  text-align: right;
  padding-right: 1rem;
}

.prize-table tbody tr {
  transition: var(--transition-fast);
}

.prize-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.03);
}

.prize-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

.prize-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.12);
}

.prize-table tbody tr td:first-child {
  position: relative;
  padding-left: 2rem;
  color: #e2e8f0;
}

.prize-table tbody tr td:first-child::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.prize-table tbody tr:nth-child(2) td:first-child::before {
  background: linear-gradient(135deg, #60a5fa, #6366f1);
}

.prize-table tbody tr:nth-child(3) td:first-child::before {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

@keyframes prize-shimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* --- 🔘 按鈕樣式 --- */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  box-shadow: 0 8px 20px rgba(91, 82, 245, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow:
    0 15px 35px rgba(91, 82, 245, 0.5),
    0 0 25px rgba(91, 82, 245, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(91, 82, 245, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-secondary:hover::before {
  left: 100%;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-color);
  box-shadow: 0 5px 15px rgba(91, 82, 245, 0.2);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* --- 📊 記錄區域 --- */

.record-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  transition: var(--transition-fast);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.record-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.25);
}

.record-card.compact {
  padding: 0.9rem 1rem;
}

.record-card.win {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.18);
}

.record-card.lose {
  border-color: rgba(239, 68, 68, 0.28);
}

.record-card.pending {
  border-color: rgba(245, 158, 11, 0.28);
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.record-date {
  font-weight: 600;
  color: var(--text-primary);
}

.record-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.record-list-title {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.records-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.5rem;
}

.record-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 1rem;
}

.record-reward {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  color: var(--success-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.record-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-win {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.12);
}

.status-lose {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.12);
}

.status-info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info-color);
  border: 1px solid rgba(59, 130, 246, 0.12);
}

/* 用戶狀態樣式 */
.user-status {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-status.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.user-status.info {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.user-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 用戶名容器和檢查按鈕樣式 */
.username-container {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.username-container .input-field {
  flex: 1;
  margin-bottom: 0;
}

.check-user-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  margin-right: 6px; /* 調整圖示與文字的距離 */
  font-size: 1em; /* 可調整圖示大小 */
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(91, 82, 245, 0.35);
  position: relative;
  overflow: hidden;
}

.check-user-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.check-user-btn:hover::before {
  left: 100%;
}

.check-user-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 8px 25px rgba(91, 82, 245, 0.5),
    0 0 20px rgba(91, 82, 245, 0.3);
}

.check-user-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(91, 82, 245, 0.4);
}

.check-user-btn:disabled {
  background: rgba(156, 163, 175, 0.3);
  color: var(--text-secondary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.check-user-btn:disabled::before {
  display: none;
}

/* 號碼輸入框禁用狀態 */
.number-input:disabled {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

.record-numbers {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.record-ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.record-ball.matched {
  background: var(--success-color);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* --- 📱 響應式設計 --- */
@media (max-width: 768px) {
  body {
    padding: 0.5rem 0;
  }
  .content {
    padding: 0;
  }
  .header {
    padding: 1.5rem 1rem;
  }
  .header h1 {
    font-size: 1.8rem;
  }
  .lottery-balls {
    gap: 0.4rem;
  }
  .lottery-ball {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }
  .number-inputs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .number-inputs-wrapper {
    gap: 0.75rem;
  }

  .number-input {
    padding: 0.875rem;
    font-size: 1.1rem;
  }

  .random-pick-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
  }

  .record-numbers {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
  }
  .record-ball {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
  }

  /* Mobile: stack username input and check button */
  .username-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .username-container .input-field {
    width: 100%;
    margin-bottom: 0;
    padding: 0.875rem;
  }

  .check-user-btn {
    width: 100%;
    margin-right: 0;
    margin-top: 0.25rem;
  }
}

/* --- 🔄 載入動畫 --- */
.loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--surface-border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- ⚠️ 錯誤訊息 --- */
.error-message {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--error-color);
}

.success-message {
  display: none;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--success-color);
}

/* --- ⏰ 倒計時樣式 --- */
.countdown-section {
  margin: 1.5rem 0;
  padding: 1.2rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.countdown-section.warning {
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow: 0 0 22px rgba(250, 204, 21, 0.2);
  background: rgba(250, 204, 21, 0.08);
}

.countdown-section.danger {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}

.countdown-section:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* SweetAlert2 自訂樣式 */
.swal2-popup-custom {
  /* 更加不透明的深色背景 + 微毛玻璃 (較強) */
  background: rgba(8, 10, 15, 0.94);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.75),
    0 0 60px rgba(79, 70, 229, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(8px) saturate(120%);
}

.swal2-title-custom {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary) !important;
}

.swal2-html-custom {
  text-align: left;
  color: var(--text-primary);
}

.swal-server-msg {
  margin-top: 6px;
  padding: 10px 12px;
  /* 在深色彈窗內使用淺色且微透明訊息塊，提高可讀性且與整體保持層次 */
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid rgba(79, 70, 229, 0.95);
  color: var(--text-primary);
  border-radius: 6px;
}

/* 強化 backdrop，讓背景變暗以突出彈窗 */
.swal2-backdrop {
  background-color: rgba(0, 0, 0, 0.65) !important;
}

.swal2-confirm-custom {
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white !important;
  padding: 10px 18px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25) !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important; /* icon 與文字間距 */
}

.swal2-cancel-custom {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary) !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  margin-right: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important; /* icon 與文字間距 */
}

.swal2-close-custom {
  color: var(--text-secondary) !important;
}

/* 在小螢幕調整 SweetAlert2 的按鈕寬度 */
@media (max-width: 480px) {
  .swal2-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .swal2-confirm-custom,
  .swal2-cancel-custom {
    width: 100% !important;
    padding: 8px 14px !important;
    font-size: 0.9rem !important;
  }
  .swal2-popup-custom {
    padding: 1rem !important;
    margin: 0 0.5rem !important;
    max-width: calc(100vw - 1rem) !important;
  }
  .swal2-title-custom {
    font-size: 1rem !important;
  }
  .record-numbers {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    max-width: 100%;
    overflow-x: visible;
  }
  .record-ball {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .records-section {
    overflow-x: visible;
  }
}

/* 標題樣式 */
.countdown-title {
  display: flex; /* 使用 Flex 排版 */
  align-items: center; /* 垂直置中 */
  justify-content: center; /* 水平置中，如果不想水平置中可以用 flex-start */
  gap: 8px; /* 圖示和文字間距 */
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gradient-icon-clock {
  background: linear-gradient(90deg, #ff7eb3, #ff758c, #ff6a00);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.3rem;
  animation: glow 2s ease-in-out infinite alternate;
}

/* 倒數字體 */
.countdown-timer {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
  margin: 0.3rem 0;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease,
    opacity 0.3s ease;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
}

.countdown-timer.warning {
  /* 白色文字為主，搭配黃色光暈以避免被黃色背景覆蓋 */
  color: var(--text-primary);
  animation: pulse 1s infinite;
  text-shadow:
    0 0 14px rgba(250, 204, 21, 0.95),
    0 6px 18px rgba(0, 0, 0, 0.6);
  background: none;
}

.countdown-timer.danger {
  color: #fee2e2;
  animation: pulse 0.8s infinite;
  text-shadow:
    0 0 18px rgba(239, 68, 68, 0.95),
    0 6px 18px rgba(0, 0, 0, 0.6);
}

.countdown-timer.closed {
  color: var(--text-primary);
  text-shadow:
    0 0 12px rgba(255, 127, 127, 0.85),
    0 6px 18px rgba(0, 0, 0, 0.6);
  background: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* --- 🤖 AI預測推薦區域 --- */
.ai-recommendation-section {
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.15) 0%,
    rgba(124, 58, 237, 0.1) 100%
  ) !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
  position: relative;
  overflow: hidden;
}

.ai-recommendation-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #0ea5e9, #4f46e5);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.ai-recommendation-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
}

.ai-recommendation-numbers {
  text-align: center;
  position: relative;
  z-index: 1;
}

.recommendation-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 彩球風格推薦球 */
.recommended-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: #111;
  background: white;
  position: relative;
  margin: 0 6px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 2px 12px rgba(255, 255, 255, 0.7);
  border: 3px solid #eee;
  transition: transform 0.2s;
  overflow: hidden;
}
.recommended-ball:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.22),
    0 4px 16px rgba(0, 0, 0, 0.15),
    inset 0 2px 16px rgba(255, 255, 255, 0.8);
}
.recommended-ball::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  width: 36px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0.1)
  );
  opacity: 0.7;
  z-index: 1;
}
.recommended-ball[data-index="0"] {
  background: radial-gradient(circle at 60% 40%, #fff 60%, #2e8b57 100%);
  border-color: #2e8b57;
}
.recommended-ball[data-index="1"] {
  background: radial-gradient(circle at 60% 40%, #fff 60%, #daa520 100%);
  border-color: #daa520;
}
.recommended-ball[data-index="2"] {
  background: radial-gradient(circle at 60% 40%, #fff 60%, #dc143c 100%);
  border-color: #dc143c;
}
.recommended-ball[data-index="3"] {
  background: radial-gradient(circle at 60% 40%, #fff 60%, #4169e1 100%);
  border-color: #4169e1;
}
.recommended-ball[data-index="4"] {
  background: radial-gradient(circle at 60% 40%, #fff 60%, #8b008b 100%);
  border-color: #8b008b;
}

.recommended-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.recommendation-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  display: inline-block;
}

/* --- ✨ 增強輸入框焦點效果 --- */
.input-field:focus,
.number-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow:
    0 0 0 4px rgba(91, 82, 245, 0.15),
    0 0 20px rgba(91, 82, 245, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

/* --- 🎨 記錄卡片增強 hover 效果 --- */
.record-card {
  transition: var(--transition-smooth);
}

.record-card:hover {
  border-color: var(--primary-color);
  box-shadow:
    0 10px 30px rgba(91, 82, 245, 0.25),
    0 0 20px rgba(91, 82, 245, 0.15);
  transform: translateY(-2px);
}

/* === 🌟 新增功能樣式 === */

/* --- 粒子背景 --- */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.6;
  animation: float-particle 15s infinite ease-in-out;
}

.particle:nth-child(even) {
  background: var(--accent-color);
  animation-duration: 20s;
}

.particle:nth-child(3n) {
  background: #ff6b6b;
  animation-duration: 18s;
}

@keyframes float-particle {
  0%,
  100% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) rotate(720deg);
    opacity: 0;
  }
}

/* --- LIVE 標籤 (豪華版) --- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15),
    rgba(255, 165, 0, 0.1)
  );
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 8px 18px;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffd700;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
  letter-spacing: 2px;
  box-shadow:
    0 0 20px rgba(255, 215, 0, 0.2),
    inset 0 0 15px rgba(255, 215, 0, 0.1);
  animation: live-glow 2s ease-in-out infinite;
}

.live-badge::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  background: linear-gradient(90deg, #ffd700, #ff8c00, #ffd700);
  opacity: 0;
  z-index: -1;
  animation: border-glow 2s ease-in-out infinite;
}

@keyframes live-glow {
  0%,
  100% {
    box-shadow:
      0 0 20px rgba(255, 215, 0, 0.2),
      inset 0 0 15px rgba(255, 215, 0, 0.1);
  }
  50% {
    box-shadow:
      0 0 30px rgba(255, 215, 0, 0.4),
      inset 0 0 20px rgba(255, 215, 0, 0.15);
  }
}

@keyframes border-glow {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.3;
  }
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #ff3333;
  border-radius: 50%;
  box-shadow:
    0 0 10px #ff3333,
    0 0 20px #ff3333;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 10px #ff3333,
      0 0 20px #ff3333;
  }
  50% {
    transform: scale(1.2);
    box-shadow:
      0 0 15px #ff3333,
      0 0 30px #ff3333,
      0 0 45px #ff3333;
  }
}

@keyframes blink {
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0.3;
  }
}

@keyframes pulse-badge {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* --- 頁首統計 (豪華版) --- */
.header-stats {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 96px;
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 215, 0, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.stat-item:hover::before {
  left: 100%;
}

.stat-item:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15);
}

.stat-item:nth-child(1) i {
  color: #64b5f6;
}
.stat-item:nth-child(2) i {
  color: #ffd700;
}
.stat-item:nth-child(3) i {
  color: #ff7043;
}

.stat-item i {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px currentColor);
}

.stat-item span {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(180deg, #fff 0%, #a0a0a0 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.stat-item small {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- 熱門號碼區域 --- */
.hot-numbers-section {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.12) 0%,
    rgba(255, 159, 64, 0.08) 100%
  ) !important;
  border-color: rgba(255, 107, 107, 0.3) !important;
}

.hot-numbers-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.5rem;
}

.hot-numbers-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem 0;
}

.hot-numbers-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.hot-number-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-fast);
  cursor: pointer;
  min-width: 60px;
}

.hot-number-item:hover {
  background: rgba(255, 107, 107, 0.2);
  transform: scale(1.05);
}

.hot-number-item.rank-1 {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.3),
    rgba(255, 165, 0, 0.2)
  );
  border-color: rgba(255, 215, 0, 0.5);
}

.hot-number-item.rank-2 {
  background: linear-gradient(
    135deg,
    rgba(192, 192, 192, 0.3),
    rgba(169, 169, 169, 0.2)
  );
  border-color: rgba(192, 192, 192, 0.5);
}

.hot-number-item.rank-3 {
  background: linear-gradient(
    135deg,
    rgba(205, 127, 50, 0.3),
    rgba(184, 115, 51, 0.2)
  );
  border-color: rgba(205, 127, 50, 0.5);
}

.hot-number-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff6b6b, #ee5a52);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.hot-number-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.hot-number-count strong {
  color: var(--accent-color);
}

/* --- 號碼選擇器 --- */
.number-picker-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.quick-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.quick-pick-btn {
  padding: 0.55rem 0.95rem;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.2),
    rgba(59, 130, 246, 0.08)
  );
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  color: #93c5fd;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.quick-pick-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.3),
    rgba(99, 102, 241, 0.15)
  );
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.quick-pick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.clear-pick-btn {
  padding: 0.8rem 1.2rem;
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.2),
    rgba(239, 68, 68, 0.1)
  );
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #ef4444;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.clear-pick-btn:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.3),
    rgba(239, 68, 68, 0.2)
  );
  transform: translateY(-2px);
}

.clear-pick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.number-picker-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
}

.number-picker-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.selected-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(91, 82, 245, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

.selected-count strong {
  color: var(--accent-color);
}

.number-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  gap: 8px;
  max-width: 100%;
}

.picker-number {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--surface-border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-number:hover:not(.selected):not(.disabled) {
  background: rgba(91, 82, 245, 0.2);
  border-color: var(--primary-color);
  transform: scale(1.1);
}

.picker-number.selected {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 15px rgba(91, 82, 245, 0.4);
  transform: scale(1.1);
  animation: select-bounce 0.3s ease;
}

.picker-number.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.picker-number.hot {
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.2);
}

/* 隨機選號動畫 - 高亮效果 */
.picker-number.random-highlighting {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  color: white;
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

/* 數字按鈕跳動效果 */
.picker-number.number-jumping {
  animation: picker-jump 0.3s ease-in-out;
}

@keyframes picker-jump {
  0%,
  100% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.25);
  }
}

@keyframes select-bounce {
  0%,
  100% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* --- 頁尾 --- */
.site-footer {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.3));
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--surface-border);
  position: relative;
  overflow: hidden;
}

.footer-content {
  position: relative;
  z-index: 1;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-logo i {
  color: var(--accent-color);
  font-size: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.footer-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.footer-link:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-3px);
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-text p {
  margin: 0.3rem 0;
}

.footer-disclaimer {
  font-size: 0.75rem;
  opacity: 0.7;
}

.footer-decoration {
  position: absolute;
  bottom: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 200px;
  background: radial-gradient(
    ellipse,
    rgba(91, 82, 245, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* --- 響應式調整 --- */
@media (max-width: 768px) {
  .luxury {
    padding: 1.5rem 0.75rem 1.25rem;
  }

  .header-icon {
    font-size: 2rem;
  }

  .header-logo {
    width: 96px;
    height: 96px;
    border-radius: 20px;
  }

  .shine-text {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }

  .title-main {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .title-sub {
    gap: 0.4rem;
  }

  .header-stats {
    gap: 0.4rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .stat-item {
    padding: 0.6rem 0.8rem;
    min-width: 80px;
    flex: 1;
    max-width: 110px;
  }

  .stat-item span {
    font-size: 1.2rem;
  }

  .stat-item small {
    font-size: 0.65rem;
  }

  .number-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 5px;
  }

  .picker-number {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }

  .hot-number-item {
    min-width: 45px;
    padding: 0.4rem;
  }

  .hot-number-ball {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .number-picker-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .random-pick-btn,
  .clear-pick-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .subtitle {
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
  }

  .luxury {
    padding: 1.25rem 0.5rem 1rem;
    margin: 0 0.35rem 0.5rem !important;
    border-radius: 10px !important;
  }

  .header-icon {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
  }

  .header-logo {
    width: 82px;
    height: 82px;
    border-radius: 18px;
  }

  .shine-text {
    font-size: 1.5rem;
    letter-spacing: 0;
  }

  .title-main {
    font-size: 1rem;
    letter-spacing: 0;
  }

  .title-decoration {
    font-size: 0.7rem;
  }

  .subtitle {
    font-size: 0.65rem;
    margin-top: 0.4rem;
    letter-spacing: 0;
  }

  .header-stats {
    gap: 0.25rem;
    margin-top: 0.75rem;
  }

  .stat-item {
    padding: 0.5rem 0.5rem;
    min-width: 70px;
    border-radius: 10px;
  }

  .stat-item i {
    font-size: 0.9rem;
  }

  .stat-item span {
    font-size: 1rem;
  }

  .stat-item small {
    font-size: 0.55rem;
  }

  /* 主要內容區域 */
  .main-grid,
  .analysis-grid,
  .records-grid {
    padding: 0.35rem !important;
    gap: 0.5rem !important;
  }

  .card {
    padding: 0.875rem !important;
    border-radius: 10px !important;
  }

  .header.luxury,
  .lottery-display,
  .announcement-bar {
    margin: 0 0.35rem 0.5rem !important;
    border-radius: 10px !important;
  }

  .lottery-display {
    padding: 1rem 0.5rem;
  }

  .lottery-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .lottery-date {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .lottery-balls {
    gap: 0.3rem;
  }

  .lottery-ball {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* 表單區域 */
  .section-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }

  .number-inputs {
    gap: 0.5rem;
  }

  .number-input {
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 10px;
  }

  .username-container .input-field {
    padding: 0.75rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .check-user-btn {
    padding: 0.75rem;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .random-pick-btn,
  .clear-pick-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .quick-pick-actions {
    gap: 0.4rem;
  }

  .quick-pick-btn {
    flex: 1 1 calc(50% - 0.35rem);
    padding: 0.55rem 0.6rem;
    font-size: 0.75rem;
    justify-content: center;
  }

  .btn-primary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  /* 號碼選擇器 */
  .number-picker-section {
    margin-top: 0.75rem;
  }

  .number-picker-title {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .picker-number {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .number-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 4px;
    padding: 0.5rem;
  }

  /* 獎金說明 */
  .prize-table th,
  .prize-table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
  }

  /* 排行榜 */
  .leaderboard-item {
    padding: 0.5rem;
  }

  .leaderboard-rank {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }

  .leaderboard-username {
    font-size: 0.8rem;
  }

  /* 倒計時 */
  .countdown-section {
    margin: 0.75rem 0;
    padding: 0.75rem;
  }

  .countdown-title {
    font-size: 0.9rem;
  }

  .countdown-timer {
    font-size: 1.8rem;
  }

  .deco-circle {
    display: none;
  }
}

/* --- 容器層級修正 --- */
.container {
  position: relative;
  z-index: 1;
}

/* === 📢 公告跑馬燈 === */
.announcement-bar {
  display: flex;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(255, 215, 0, 0.12),
    rgba(255, 165, 0, 0.08),
    rgba(255, 215, 0, 0.12)
  );
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.6rem 1rem;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 12px 32px rgba(255, 215, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.announcement-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: translateX(-100%);
  animation: announcement-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

.announcement-bar::after {
  content: "";
  position: absolute;
  inset: -40% -10% -40% -10%;
  background: radial-gradient(
    circle at 30% 50%,
    rgba(255, 255, 255, 0.22),
    transparent 60%
  );
  opacity: 0.35;
  pointer-events: none;
}

.announcement-bar > * {
  position: relative;
  z-index: 1;
}

@keyframes announcement-shimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.announcement-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  animation: pulse-icon 2s ease-in-out infinite;
}

.announcement-icon i {
  color: #1a1a2e;
  font-size: 0.8rem;
}

@keyframes pulse-icon {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.announcement-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.announcement-scroll {
  display: flex;
  gap: 4rem;
  animation: scroll-left 25s linear infinite;
  white-space: nowrap;
}

.announcement-scroll span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 500;
}

@keyframes scroll-left {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* === 🏆 中獎排行榜 === */
.leaderboard-section {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.12) 0%,
    rgba(255, 165, 0, 0.08) 100%
  ) !important;
  border-color: rgba(255, 215, 0, 0.3) !important;
}

.leaderboard-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.5rem;
}

.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  padding: 2rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-fast);
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(5px);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
  background: linear-gradient(135deg, #ffd700, #ffb800);
  color: #1a1a2e;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
  background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
  color: #1a1a2e;
  box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #fff;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

.leaderboard-item:nth-child(n + 4) .leaderboard-rank {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.leaderboard-item.rank-1 .leaderboard-rank,
.leaderboard-item.rank-2 .leaderboard-rank,
.leaderboard-item.rank-3 .leaderboard-rank {
  width: auto;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.rank-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 6px rgba(255, 255, 255, 0.25),
    0 6px 14px rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
}

.rank-badge-gold {
  background: linear-gradient(135deg, #ffe28a, #ffb800);
  color: #2b1f06;
}

.rank-badge-silver {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: #1f2937;
}

.rank-badge-bronze {
  background: linear-gradient(135deg, #e0a96d, #b87333);
  color: #2c1b0a;
}

.rank-number {
  font-weight: 800;
  letter-spacing: 0.5px;
}

.leaderboard-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.leaderboard-username {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.leaderboard-stats {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.leaderboard-prize {
  text-align: right;
}

.leaderboard-prize-amount {
  font-weight: 700;
  font-size: 1rem;
  color: #ffd700;
}

.leaderboard-prize-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.leaderboard-wins {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 215, 0, 0.15);
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
}

.leaderboard-wins i {
  color: #ffd700;
  font-size: 0.75rem;
}

.leaderboard-wins span {
  font-weight: 700;
  color: #ffd700;
  font-size: 0.85rem;
}

/* 今日投注號碼 */
.leaderboard-today-bet {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.8rem;
}

.today-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  background: rgba(79, 70, 229, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

.today-label-none {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

.today-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

/* 手機版排行榜改為兩行布局 */
@media (max-width: 600px) {
  .leaderboard-item {
    flex-wrap: wrap;
    padding: 0.6rem 0.8rem;
    gap: 0.5rem;
  }

  .leaderboard-rank {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    margin-right: 0.6rem;
  }

  .leaderboard-info {
    flex: 1;
    min-width: 0;
  }

  .leaderboard-username {
    font-size: 0.85rem;
  }

  .leaderboard-stats {
    font-size: 0.7rem;
  }

  .leaderboard-today-bet {
    order: 4;
    width: 100%;
    justify-content: flex-start;
    margin-right: 0;
    margin-top: 0.3rem;
    padding-left: 34px; /* 對齊名字 */
  }

  .today-ball {
    width: 22px;
    height: 22px;
    font-size: 0.6rem;
  }

  .today-label {
    font-size: 0.6rem;
    padding: 2px 5px;
  }

  .today-label-none {
    font-size: 0.65rem;
  }

  .leaderboard-wins {
    padding: 0.25rem 0.5rem;
  }

  .leaderboard-wins i {
    font-size: 0.7rem;
  }

  .leaderboard-wins span {
    font-size: 0.8rem;
  }
}

/* === 📊 號碼冷熱分析圖表 === */
.number-analysis-section {
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.1) 0%,
    rgba(139, 92, 246, 0.06) 100%
  ) !important;
  border-color: rgba(79, 70, 229, 0.25) !important;
}

.analysis-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 0.5rem;
}

.analysis-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-item.hot .legend-dot {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.legend-item.warm .legend-dot {
  background: linear-gradient(135deg, #ffd700, #ffb800);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.legend-item.cold .legend-dot {
  background: linear-gradient(135deg, #64b5f6, #42a5f5);
  box-shadow: 0 0 8px rgba(100, 181, 246, 0.4);
}

.number-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  padding: 0.5rem;
}

.heatmap-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  padding: 2rem;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: 2px solid transparent;
}

.heatmap-cell:hover {
  transform: scale(1.15);
  z-index: 10;
}

.heatmap-cell .cell-number {
  font-size: 0.9rem;
  font-weight: 700;
}

.heatmap-cell .cell-count {
  font-size: 0.55rem;
  opacity: 0.8;
  margin-top: 1px;
}

/* 熱號 (>=5次) */
.heatmap-cell.hot {
  background: linear-gradient(145deg, #ff6b6b, #ee5a52);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  animation: pulse-hot 2s ease-in-out infinite;
}

.heatmap-cell.hot:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

@keyframes pulse-hot {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
  }
}

/* 溫號 (3-4次) */
.heatmap-cell.warm {
  background: linear-gradient(145deg, #ffd700, #ffb800);
  color: #1a1a2e;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.heatmap-cell.warm:hover {
  box-shadow: 0 6px 18px rgba(255, 215, 0, 0.5);
}

/* 冷號 (<=2次) */
.heatmap-cell.cold {
  background: linear-gradient(145deg, #64b5f6, #42a5f5);
  color: white;
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.heatmap-cell.cold:hover {
  box-shadow: 0 6px 18px rgba(100, 181, 246, 0.5);
}

/* 零次出現 */
.heatmap-cell.zero {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.heatmap-cell.zero:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 已選中 */
.heatmap-cell.selected {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* 跑馬燈圖標樣式 */
.announcement-scroll span i {
  margin-right: 6px;
  font-size: 0.8rem;
}

.announcement-scroll span i.fa-party-horn,
.announcement-scroll span i.fa-champagne-glasses {
  color: #ffd700;
}

.announcement-scroll span i.fa-sack-dollar {
  color: #10b981;
}

.announcement-scroll span i.fa-clock {
  color: #64b5f6;
}

.announcement-scroll span i.fa-fire {
  color: #ff6b6b;
}

/* 響應式 */
@media (max-width: 768px) {
  .number-heatmap {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 5px;
  }

  .heatmap-cell {
    border-radius: 6px;
    padding: 4px 2px;
  }

  .heatmap-cell .cell-number {
    font-size: 0.75rem;
    line-height: 1;
  }

  .heatmap-cell .cell-count {
    font-size: 0.55rem;
    opacity: 0.9;
    line-height: 1;
    margin-top: 2px;
    display: block !important;
  }

  .analysis-legend {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .announcement-bar {
    padding: 0.4rem 0.5rem;
    margin: 0 0.35rem 0.5rem !important;
  }

  .announcement-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-right: 0.5rem;
  }

  .announcement-scroll span {
    font-size: 0.7rem;
  }

  .number-heatmap {
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 3px;
  }

  .heatmap-cell .cell-number {
    font-size: 0.65rem;
  }

  .heatmap-cell .cell-count {
    display: block !important;
    font-size: 0.45rem;
    opacity: 0.85;
  }

  .analysis-legend {
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .legend-item {
    font-size: 0.7rem;
  }

  .analysis-subtitle,
  .hot-numbers-subtitle,
  .leaderboard-subtitle {
    display: none;
  }
}

/* ==========================================
   🌟 金寶539競猜活動 - 2026全新視覺與排版優化 🌟
   ========================================== */

/* === 🖥️ 桌面端三欄式儀表板佈局 === */
@media (min-width: 1024px) {
  body {
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #0a0e17 0%, #05070c 100%);
  }

  .container {
    max-width: 1440px;
  }

  /* 移除原有的各個網格間距，統一由大三欄接管 */
  .main-grid,
  .analysis-grid,
  .extras-grid,
  .records-grid {
    display: contents !important; /* 忽略舊版型容器 */
  }

  .desktop-columns {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
  }

  .desktop-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0; /* 防止 SVG 等子元素撐開網格列寬 */
  }

  /* 調整中間核心數據欄略寬 */
  .col-middle {
    grid-column: 2;
  }

  /* PC 端隱藏手機底部導航欄 */
  .mobile-tab-bar {
    display: none !important;
  }

  /* PC 端卡片質感升級 (毛玻璃與黃金懸浮流光) */
  .card {
    position: relative;
    background: rgba(18, 25, 41, 0.65) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  }

  .card:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.3) !important; /* 金邊 */
    box-shadow: 
      0 20px 40px rgba(0, 0, 0, 0.6),
      0 0 25px rgba(212, 175, 55, 0.06);
  }

  /* 精緻的頂部發光飾線 */
  .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .card:hover::before {
    opacity: 1;
  }
}

/* === 📱 手機端排版與 Tab 分頁過濾 === */
@media (max-width: 1023px) {
  body {
    padding: 0 0 85px 0 !important; /* 為底部浮動導航留白 */
    background: #090d15;
  }

  .container {
    padding: 0;
  }

  /* 頁首手機端排版優化：改為垂直居中佈局，防止文字與統計卡片擠壓導致的折行 */
  .header.luxury {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1.8rem 1rem 1.5rem !important;
    gap: 1rem !important;
  }

  .header-main {
    text-align: center !important;
    width: 100% !important;
  }

  .header.luxury .title-sub {
    justify-content: center !important;
  }

  .header.luxury .subtitle {
    margin-top: 0.5rem !important;
    text-align: center !important;
  }

  .header-tags {
    justify-content: center !important;
    margin-top: 0.75rem !important;
    gap: 0.4rem !important;
  }

  .header-tag {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
  }

  .header-stats {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 0.5rem !important;
    margin-top: 0.5rem !important;
  }

  .stat-item {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 110px !important;
    padding: 0.6rem 0.4rem !important;
  }

  .stat-item span {
    font-size: 1.2rem !important;
  }

  .announcement-bar,
  .lottery-display,
  .countdown-section {
    margin: 0 0.75rem 0.75rem !important;
    border-radius: 16px !important;
  }

  .desktop-columns {
    display: block;
    padding: 0 0.75rem;
  }

  .desktop-col {
    display: contents; /* 讓子卡片能夠直接被 data-tab 過濾 */
  }

  /* 隱藏所有 data-tab 卡片 */
  .card[data-tab] {
    display: none !important;
  }

  /* 顯示當前啟用分頁的卡片 */
  body.tab-predict .card[data-tab="predict"],
  body.tab-ai .card[data-tab="ai"],
  body.tab-trend .card[data-tab="trend"],
  body.tab-records .card[data-tab="records"] {
    display: block !important;
    margin-bottom: 0.75rem;
    animation: tabSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  }

  /* 分頁載入淡入動畫 */
  @keyframes tabSlideUp {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* === 🌟 手機端浮動毛玻璃 Bottom Tab Bar (極致仿圖美化) === */
.mobile-tab-bar {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 20px; /* 懸浮離底 */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px); /* 留左右邊距，仿膠囊 */
    max-width: 480px;
    height: 64px;
    background: rgba(10, 15, 26, 0.75); /* 深色高透玻璃底 */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px; /* 兩端全圓角 */
    box-shadow: 
      0 12px 35px rgba(0, 0, 0, 0.7),
      inset 0 1px 0 rgba(255, 255, 255, 0.12); /* 頂部高光線 */
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .mobile-tab-bar.mobile-tab-bar--hidden {
    transform: translate(-50%, 100px) !important;
    opacity: 0 !important;
    pointer-events: none;
  }

  .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 1;
    height: 100%;
    color: rgba(255, 255, 255, 0.45); /* 未選中低明度 */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
  }

  /* 膠囊背景 (仿圖樣式：僅包裹 Icon 區塊) */
  .tab-icon-wrapper {
    width: 58px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px; /* 膠囊圓角 */
    font-size: 1.2rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
  }

  .tab-label {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 2px;
    opacity: 0.5;
    transition: all 0.25s ease;
  }

  /* 當前點選中狀態 */
  .tab-item.active {
    color: #ffd700; /* 金色標誌 */
  }

  .tab-item.active .tab-icon-wrapper {
    background: rgba(255, 255, 255, 0.12); /* 圖中的灰色高光膠囊 */
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #ffd700; /* 圖標變金 */
    transform: translateY(-2px); /* 輕微浮動提拉 */
  }

  .tab-item.active .tab-label {
    opacity: 1;
    color: #ffd700;
    font-weight: 700;
  }
}

/* === 🔄 橫向滾動外殼 (Option A - 完整保留圖表與熱圖) === */
.scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* iOS 滑動流暢 */
  padding-bottom: 8px;
}

/* 美化滾動條 */
.scroll-wrapper::-webkit-scrollbar {
  height: 5px;
}

.scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.25);
  border-radius: 10px;
}

.scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.45);
}

/* 當手機端觸發滾動時，確保內容不會被壓縮 */
@media (max-width: 768px) {
  #trendChart {
    min-width: 620px; /* 走勢小圖固定寬度，支持橫滾 */
  }

  #numberHeatmap {
    min-width: 520px; /* 熱力圖固定寬度，支持橫滾 */
  }

  #leaderboardContainer {
    min-width: 320px;
  }
}

/* === 🌌 粒子背景 canvas 固定定位 === */
#particlesBg canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* === 🖱️ 選號盤按鈕觸控反饋 === */
.picker-btn {
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.picker-btn:active {
  transform: scale(0.85); /* 按壓彈跳效果 */
}

/* 未選中號碼在選滿時的樣式 */
.number-picker-grid.selection-full .picker-btn:not(.selected) {
  opacity: 0.35;
  transform: scale(0.95);
}

/* 選中號碼發光效果 */
.picker-btn.selected {
  box-shadow: 
    0 0 15px rgba(212, 175, 55, 0.8),
    inset 0 0 8px rgba(255, 255, 255, 0.5) !important;
  animation: ballGlow 1.5s ease-in-out infinite alternate;
}

@keyframes ballGlow {
  from {
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
  }
  to {
    box-shadow: 0 0 20px rgba(212, 175, 55, 1);
  }
}
