/* 
 * 香港六合彩結果網站 - 現代化樣式系統
 * Material Design 3.0 + 紫紅漸變色調
 * 完全響應式設計
 */

/* ===== CSS 變量系統 ===== */
:root {
  /* 紫紅漸變色調主題 */
  --primary-50: #faf5ff;
  --primary-100: #f3e8ff;
  --primary-200: #e9d5ff;
  --primary-300: #d8b4fe;
  --primary-400: #c084fc;
  --primary-500: #a855f7;
  --primary-600: #9333ea;
  --primary-700: #7c3aed;
  --primary-800: #6b21a8;
  --primary-900: #581c87;

  /* 漸變色組合 */
  --gradient-primary: linear-gradient(135deg, #8b5cf6, #d946ef);
  --gradient-secondary: linear-gradient(135deg, #f3e8ff, #fdf2f8);
  --gradient-accent: linear-gradient(135deg, #ec4899, #f97316);
  --gradient-hero: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);

  /* 中性色系 */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* 功能色彩 */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* 彈出廣告專用色彩 */
  --popup-overlay: rgba(0, 0, 0, 0.8);
  --popup-bg: #ffffff;
  --popup-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --popup-border: rgba(139, 92, 246, 0.2);

  /* 間距系統 (基於8px網格) */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */

  /* 圓角系統 */
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-3xl: 2rem;      /* 32px */
  --radius-full: 9999px;

  /* 陰影系統 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* 字體系統 */
  --font-family-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* 過渡動畫 */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.3s ease-out;
  --transition-slow: 0.5s ease-out;

  /* Z-index 層級 */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===== 基礎重置和設置 ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== 容器系統 ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

/* ===== 現代化Header ===== */
.modern-header,
.header {
  background: var(--gradient-primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
  min-height: 70px;
}

/* Logo 設計 */
.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  transition: var(--transition-normal);
}

.logo:hover {
  transform: scale(1.05);
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  backdrop-filter: blur(10px);
}

/* 桌面導航 */
.nav-menu {
  display: none;
  align-items: center;
  gap: var(--spacing-sm);
}

@media (min-width: 1024px) {
  .nav-menu {
    display: flex;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.85rem !important;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition-normal);
}

.nav-link:hover::before,
.nav-link.active::before {
  left: 0;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.nav-icon {
  font-size: 1rem;
}

/* App下載按鈕 */
.app-download-buttons {
  display: none;
  gap: var(--spacing-sm);
}

@media (min-width: 1024px) {
  .app-download-buttons {
    display: flex;
  }
}

.app-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
}

.app-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.app-btn i {
  font-size: 1.1rem;
}

/* 移動端菜單按鈕 */
.mobile-menu-toggle,
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
  flex-direction: column;
  gap: 3px;
}

.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: var(--transition-normal);
}

@media (min-width: 1024px) {
  .mobile-menu-toggle,
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu-toggle:hover,
.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* 移動端菜單 */
.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--gradient-primary);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-menu {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  transition: var(--transition-normal);
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* ===== 現代化卡片系統 ===== */
.modern-card {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: var(--transition-normal);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.modern-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  padding: var(--spacing-xl);
  background: var(--gradient-secondary);
  border-bottom: 1px solid var(--gray-200);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.card-title-icon {
  width: 2rem;
  height: 2rem;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.card-description {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.card-content {
  padding: var(--spacing-xl);
}

/* ===== 按鈕系統 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.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: var(--transition-normal);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon {
  font-size: 0.9rem;
}

/* CTA按鈕樣式 */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, #8b5cf6, #d946ef) !important;
  color: white !important;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.cta-button::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: var(--transition-normal);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: white !important;
}

.cta-button:hover::before {
  left: 100%;
}

/* 確保CTA按鈕文字在所有情況下都是白色 */
.cta-button,
.cta-button:link,
.cta-button:visited,
.cta-button:hover,
.cta-button:active,
.cta-button:focus {
  color: white !important;
}

.cta-button i {
  color: white !important;
}

/* ===== 現代化Footer ===== */
.modern-footer,
.footer {
  background: var(--gradient-primary);
  color: white;
  margin-top: var(--spacing-3xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  padding: var(--spacing-3xl) 0 var(--spacing-xl);
}

.footer-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  color: white;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition-normal);
  padding: var(--spacing-xs) 0;
}

.footer-links a:hover {
  color: white;
  padding-left: var(--spacing-sm);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: var(--spacing-xl) 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

/* ===== 動畫系統 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.bounce-in {
  animation: bounceIn 0.6s ease-out forwards;
}

.slide-in {
  animation: slideIn 0.6s ease-out forwards;
}

/* 延遲動畫類 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    --spacing-3xl: 2.5rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .header-content {
    padding: var(--spacing-sm) 0;
  }

  .card-header,
  .card-content {
    padding: var(--spacing-lg);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  /* 移動端CTA按鈕強制白色文字 */
  .cta-button,
  .cta-button:link,
  .cta-button:visited,
  .cta-button:hover,
  .cta-button:active,
  .cta-button:focus {
    color: white !important;
  }

  .cta-button i {
    color: white !important;
  }

  /* 移動端球樣式 */
  .ball-3d {
    width: 38px;
    height: 38px;
    font-size: 17px;
    margin: 0 4px 8px;
  }

  .ball-3d.small {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .ball-3d.special {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }
}

@media (max-width: 480px) {
  .card-header,
  .card-content {
    padding: var(--spacing-md);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }

  .cta-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    color: white !important;
  }

  /* 小屏幕CTA按鈕強制白色文字 */
  .cta-button,
  .cta-button:link,
  .cta-button:visited,
  .cta-button:hover,
  .cta-button:active,
  .cta-button:focus {
    color: white !important;
  }

  .cta-button i {
    color: white !important;
  }

  .ball-3d {
    width: 34px;
    height: 34px;
    font-size: 15px;
    margin: 0 3px 6px;
  }

  .ball-3d.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .ball-3d.special {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .plus-sign, .special-number-plus {
    font-size: 18px;
    margin: 0 4px;
  }
}

/* ===== 輔助類 ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ===== 六合彩號碼球樣式 ===== */
.ball-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 4px 8px;
  font-weight: bold;
  font-size: 15px;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background-color: #8b5cf6;
  transition: transform 0.2s ease-out;
}

.ball-3d:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 香港六合彩波色 */
/* 红波 */
.ball-3d[data-number="1"], .ball-3d[data-number="2"], .ball-3d[data-number="7"], .ball-3d[data-number="8"],
.ball-3d[data-number="12"], .ball-3d[data-number="13"], .ball-3d[data-number="18"], .ball-3d[data-number="19"],
.ball-3d[data-number="23"], .ball-3d[data-number="24"], .ball-3d[data-number="29"], .ball-3d[data-number="30"],
.ball-3d[data-number="34"], .ball-3d[data-number="35"], .ball-3d[data-number="40"], .ball-3d[data-number="45"],
.ball-3d[data-number="46"] {
  background-color: #ef4444;
}

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

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

/* 特別號碼球 */
.ball-3d.special {
  background-color: #f59e0b;
  font-weight: 700;
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* 加號樣式 */
.plus-sign {
  font-size: 20px;
  font-weight: bold;
  margin: 0 8px;
  color: #f59e0b;
}

.special-number-container {
  display: inline-flex;
  align-items: center;
}

.special-number-plus {
  font-size: 20px;
  font-weight: bold;
  margin: 0 4px;
  color: #f59e0b;
}

/* 號碼球容器 */
.number-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 1rem 0;
}

/* 小尺寸球（用於歷史記錄） */
.ball-3d.small {
  width: 32px;
  height: 32px;
  font-size: 14px;
  margin: 0 2px 4px;
}

/* 動畫效果 */
@keyframes ballPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.ball-3d.new {
  animation: ballPop 0.5s ease-out forwards;
}

/* ===== 最高優先級CTA按鈕顏色修復 ===== */
/* 確保CTA按鈕在所有設備和狀態下都顯示正確的紫紅漸變背景和白色文字 */
.cta-button,
.cta-button:link,
.cta-button:visited,
.cta-button:hover,
.cta-button:active,
.cta-button:focus,
.cta-button:target {
  background: linear-gradient(135deg, #8b5cf6, #d946ef) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.cta-button i,
.cta-button .fas,
.cta-button .far,
.cta-button .fab {
  color: #ffffff !important;
}

/* 移動端特別強化 */
@media (max-width: 768px) {
  .cta-button,
  .cta-button:link,
  .cta-button:visited,
  .cta-button:hover,
  .cta-button:active,
  .cta-button:focus,
  .cta-button:target {
    background: linear-gradient(135deg, #8b5cf6, #d946ef) !important;
    color: #ffffff !important;
    text-decoration: none !important;
  }

  .cta-button i,
  .cta-button .fas,
  .cta-button .far,
  .cta-button .fab {
    color: #ffffff !important;
  }
}

@media (max-width: 480px) {
  .cta-button,
  .cta-button:link,
  .cta-button:visited,
  .cta-button:hover,
  .cta-button:active,
  .cta-button:focus,
  .cta-button:target {
    background: linear-gradient(135deg, #8b5cf6, #d946ef) !important;
    color: #ffffff !important;
    text-decoration: none !important;
  }

  .cta-button i,
  .cta-button .fas,
  .cta-button .far,
  .cta-button .fab {
    color: #ffffff !important;
  }
}

/* ===== 終極修復：最高優先級CTA按鈕樣式 ===== */
/* 使用非常具體的選擇器確保樣式不被覆蓋 */
html body .container a.cta-button,
html body a.cta-button,
body a.cta-button,
a.cta-button {
  background: linear-gradient(135deg, #8b5cf6, #d946ef) !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
}

html body .container a.cta-button:hover,
html body a.cta-button:hover,
body a.cta-button:hover,
a.cta-button:hover {
  background: linear-gradient(135deg, #7c3aed, #c026d3) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

html body .container a.cta-button i,
html body a.cta-button i,
body a.cta-button i,
a.cta-button i,
html body .container a.cta-button .fas,
html body a.cta-button .fas,
body a.cta-button .fas,
a.cta-button .fas {
  color: #ffffff !important;
}

/* ===== 最終解決方案：強制覆蓋所有可能的樣式衝突 ===== */
/* 針對所有可能的選擇器組合 */
*[class*="cta-button"],
*.cta-button,
a[class*="cta-button"],
a.cta-button,
[href*="history"] a.cta-button,
div a.cta-button,
main a.cta-button,
section a.cta-button,
.container a.cta-button,
.card-content a.cta-button {
  background: linear-gradient(135deg, #8b5cf6, #d946ef) !important;
  background-color: #8b5cf6 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

*[class*="cta-button"]:hover,
*.cta-button:hover,
a[class*="cta-button"]:hover,
a.cta-button:hover,
[href*="history"] a.cta-button:hover,
div a.cta-button:hover,
main a.cta-button:hover,
section a.cta-button:hover,
.container a.cta-button:hover,
.card-content a.cta-button:hover {
  background: linear-gradient(135deg, #7c3aed, #c026d3) !important;
  background-color: #7c3aed !important;
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15) !important;
}

*[class*="cta-button"] i,
*.cta-button i,
a[class*="cta-button"] i,
a.cta-button i,
*[class*="cta-button"] .fas,
*.cta-button .fas,
a[class*="cta-button"] .fas,
a.cta-button .fas {
  color: #ffffff !important;
}

/* ===== 彈出廣告樣式 ===== */
.app-popup-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: var(--popup-overlay) !important;
  backdrop-filter: blur(5px) !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.3s ease !important;
  margin: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.app-popup-overlay.show {
  opacity: 1 !important;
  visibility: visible !important;
}

.app-popup {
  background: var(--popup-bg) !important;
  border-radius: var(--radius-3xl) !important;
  box-shadow: var(--popup-shadow) !important;
  border: 1px solid var(--popup-border) !important;
  max-width: 480px !important;
  width: 90% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  position: relative !important;
  transform: scale(0.8) translateY(20px) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.app-popup-overlay.show .app-popup {
  transform: scale(1) translateY(0) !important;
}

/* 強制重置所有可能的定位干擾 */
.app-popup-overlay * {
  box-sizing: border-box !important;
}

.app-popup-overlay {
  /* 覆蓋所有可能的定位樣式 */
  inset: 0 !important;
  transform: none !important;
  translate: none !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

.app-popup-header {
  background: var(--gradient-hero);
  color: white;
  padding: var(--spacing-2xl);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  text-align: center;
  position: relative;
}

.app-popup-close {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.app-popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.app-popup-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  margin: 0 auto var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
}

.app-popup-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.app-popup-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 0;
}

.app-popup-body {
  padding: var(--spacing-2xl);
}

.app-popup-description {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.app-popup-features {
  display: grid;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.app-popup-feature {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.app-popup-feature-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.app-popup-feature-text {
  color: var(--gray-700);
  font-weight: 500;
}

.app-popup-buttons {
  display: grid;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.app-popup-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.app-popup-download-btn.ios {
  background: linear-gradient(135deg, #007AFF, #5856D6);
  color: white;
}

.app-popup-download-btn.android {
  background: linear-gradient(135deg, #34A853, #4285F4);
  color: white;
}

.app-popup-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.app-popup-download-btn i {
  font-size: 1.5rem;
}

.app-popup-learn-more {
  text-align: center;
  margin-top: var(--spacing-lg);
}

.app-popup-learn-more-btn {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.app-popup-learn-more-btn:hover {
  border-bottom-color: var(--primary-600);
}

/* 響應式設計 */
@media (max-width: 768px) {
  .app-popup {
    width: 95%;
    margin: var(--spacing-lg);
  }

  .app-popup-header {
    padding: var(--spacing-xl);
  }

  .app-popup-body {
    padding: var(--spacing-xl);
  }

  .app-popup-title {
    font-size: 1.5rem;
  }

  .app-popup-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
}
