/* ===== 共用變數 ===== */
:root {
  --dark-bg: #09090b;
  --glass-blend: #18181b;
  --glow-top: #1e1b4b;
  --glow-bottom: #27272a;
  --text-light: #f0f3fa;
  --text-muted: rgba(255, 255, 255, 0.65);
  --border-glass: rgba(255, 255, 255, 0.06);
  --accent-blue: #3a6ca5;
  --accent-blue-hover: #4a7ab5;
  --accent-glow: #8ab4f8;
  --transition-smooth: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background-color: var(--dark-bg);
  font-family: 'Microsoft JhengHei', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-light);
}

/* ===== 背景光暈 ===== */
.light-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.light-blob-1, .light-blob-2, .light-blob-3 {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}
.light-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-blue), transparent);
  left: -200px; top: -150px;
  animation: floatBlob 18s ease-in-out infinite;
}
.light-blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-blue-hover), transparent);
  right: -150px; bottom: -100px;
  animation: floatBlob 22s ease-in-out infinite reverse;
}
.light-blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #6d8ec0, transparent);
  left: 40%; top: 40%;
  animation: floatBlob 20s ease-in-out infinite 5s;
}
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.1); }
  66% { transform: translate(40px, -20px) scale(0.95); }
}

/* ===== 星星層 + 扭曲光斑 (星星按鈕切換用) ===== */
.stars-layer {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  transition: opacity 1.2s ease;
}
.star {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite alternate;
}
@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}
.lens-distortion {
  position: absolute;
  top: 20%; left: -8%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(100,140,200,0.12) 0%, rgba(60,100,180,0.06) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  z-index: 0;
  transition: opacity 1.2s ease;
}
.lens-distortion-2 {
  top: 45%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(80,120,200,0.10) 0%, rgba(40,70,150,0.05) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  position: absolute;
  z-index: 0;
  transition: opacity 1.2s ease;
}
.obsidian-floor {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 140px;
  background: linear-gradient(to top, rgba(6,6,10,0.6) 0%, transparent 100%);
  z-index: 0; pointer-events: none;
}

/* ===== 玻璃導航列 ===== */
.glass-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 200;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #e0e7ff, #9ab3d5);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 25px;
  align-items: center;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* 付費按鈕 */
.paywall-btn {
  background: rgba(58, 108, 165, 0.2);
  border: 1px solid rgba(58, 108, 165, 0.4);
  border-radius: 40px;
  padding: 0.4rem 1rem !important;
  font-size: 0.85rem !important;
  color: var(--accent-glow) !important;
  transition: var(--transition-smooth);
}
.paywall-btn:hover {
  background: rgba(58, 108, 165, 0.35) !important;
  border-color: var(--accent-blue-hover) !important;
  color: #ffffff !important;
  text-shadow: 0 0 12px rgba(138, 180, 248, 0.6) !important;
}

/* 按鈕通用 */
.lang-btn,
.star-toggle-btn,
.start-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 40px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: 0.2s;
  font-family: inherit;
}
.lang-btn:hover,
.star-toggle-btn:hover,
.start-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.star-toggle-btn {
  margin-left: 5px;
}

/* 下拉選單 */
.start-dropdown, .lang-dropdown {
  position: relative;
  list-style: none;
}
.dropdown-menu {
  position: absolute;
  top: 45px;
  right: 0;
  background: rgba(20, 22, 27, 0.9);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 0.5rem 0;
  min-width: 130px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 210;
}
.lang-dropdown.open .dropdown-menu,
.start-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu li { padding: 0; }
.dropdown-menu a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: #e0e7ff;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
}
.dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.start-menu { min-width: 170px; }
.start-menu li a { white-space: nowrap; }
.start-menu .locked {
  color: rgba(255, 255, 255, 0.3) !important;
  cursor: not-allowed;
  pointer-events: none;
}

/* 滾動條 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #09090b; }
::-webkit-scrollbar-thumb {
  background: #2a2a2c;
  border-radius: 20px;
  border: 2px solid #09090b;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .nav-container {
    padding: 0 16px;
  }
  .nav-links { gap: 15px; }
  .lang-btn, .star-toggle-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }
  .nav-links a { font-size: 0.8rem; }
}

@media (max-width: 640px) {
  .glass-navbar { height: 64px; }
  .nav-logo { font-size: 1.1rem; letter-spacing: 1px; }
  .nav-links { gap: 8px; }
  .lang-btn, .star-toggle-btn, .start-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
  .nav-links a { font-size: 0.75rem; }
  .paywall-btn {
    padding: 0.25rem 0.6rem !important;
    font-size: 0.7rem !important;
  }
}
