/* ============================================================
   东南亚AI面相/手相 — Design System
   Theme: Mystic Dark × Modern Minimal
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Primary Colors */
  --color-primary: #6C3CE1;
  --color-primary-light: #8B5CF6;
  --color-primary-dark: #5428C0;
  --color-primary-glow: rgba(108, 60, 225, 0.4);

  /* Accent / Gold */
  --color-gold: #D4A843;
  --color-gold-light: #F0D68A;
  --color-gold-dark: #B8922E;
  --color-gold-glow: rgba(212, 168, 67, 0.35);

  /* Background */
  --bg-deep: #0D0B1A;
  --bg-card: #1A1733;
  --bg-card-hover: #221F42;
  --bg-elevated: #252147;
  --bg-surface: #13112A;
  --bg-overlay: rgba(13, 11, 26, 0.85);

  /* Text */
  --text-primary: #F0ECF9;
  --text-secondary: #A9A2C3;
  --text-tertiary: #6B6490;
  --text-gold: #D4A843;
  --text-inverse: #0D0B1A;

  /* Status */
  --color-success: #34D399;
  --color-warning: #FBBF24;
  --color-error: #F87171;
  --color-info: #60A5FA;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6C3CE1 0%, #8B5CF6 50%, #A78BFA 100%);
  --gradient-gold: linear-gradient(135deg, #D4A843 0%, #F0D68A 100%);
  --gradient-mystic: linear-gradient(180deg, #1A1733 0%, #0D0B1A 100%);
  --gradient-card: linear-gradient(145deg, rgba(108, 60, 225, 0.08) 0%, rgba(26, 23, 51, 0.95) 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(108, 60, 225, 0.25) 0%, transparent 70%);
  --gradient-glow: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--color-primary-glow);
  --shadow-gold: 0 0 20px var(--color-gold-glow);

  /* Border */
  --border-subtle: 1px solid rgba(108, 60, 225, 0.15);
  --border-card: 1px solid rgba(108, 60, 225, 0.2);
  --border-gold: 1px solid rgba(212, 168, 67, 0.3);
  --border-radius-sm: 6px;
  --border-radius-md: 10px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans TC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.8125rem;  /* 13px */
  --font-size-base: 0.9375rem;/* 15px */
  --font-size-md: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.375rem;   /* 22px */
  --font-size-2xl: 1.75rem;   /* 28px */
  --font-size-3xl: 2.25rem;   /* 36px */
  --font-size-4xl: 3rem;      /* 48px */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Layout */
  --navbar-height: 56px;
  --bottom-nav-height: 64px;
  --max-width-mobile: 480px;
  --max-width-content: 800px;
  --max-width-wide: 1200px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-gold); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol { list-style: none; }

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

/* ---------- Utility Classes ---------- */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page {
  min-height: 100vh;
  padding-top: var(--navbar-height);
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + var(--space-lg));
}

.page--no-nav {
  padding-top: 0;
  padding-bottom: 0;
}

.page--no-bottom {
  padding-bottom: var(--space-lg);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.text-center { text-align: center; }
.text-gold { color: var(--text-gold); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.w-full { width: 100%; }
.hidden { display: none !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Keyframe Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--color-primary-glow); }
  50% { box-shadow: 0 0 25px var(--color-primary-glow), 0 0 50px rgba(108,60,225,0.15); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

@keyframes ripple {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeUp { animation: fadeUp 0.5s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-glow { animation: glow 3s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

.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; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(108, 60, 225, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 60, 225, 0.5);
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  :root {
    --navbar-height: 64px;
    --bottom-nav-height: 0px;
  }
  .page {
    padding-bottom: var(--space-2xl);
  }
  .mobile-only { display: none !important; }
}

@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}

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