/* ============================================
   main.css — V2 重新設計：全域設計系統

   基於 UI/UX Pro Max 設計系統：
   - 字型：Playfair Display（英文標題）+ Inter（英文內文）
          + Noto Serif/Sans TC（中文）+ IBM Plex Mono（數字）
   - 色彩：深海軍藍底 + 精緻金色 CTA + 品牌紅點綴
   - 效果：Glassmorphism 毛玻璃、微光 glow、優雅過渡
   ============================================ */

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

:root {
  /* ===== 色彩系統 ===== */
  /* 品牌色 */
  --crimson: #B91C3A;
  --crimson-lt: #D42B4E;
  --gold: #CA8A04;
  --gold-lt: #EAB308;
  --gold-muted: rgba(202, 138, 4, 0.15);

  /* 亮色背景層 — 清爽專業感 */
  --bg-base: #FFFFFF;
  --bg-surface: #F5F7FA;
  --bg-elevated: #EFF1F6;
  --bg-overlay: #E8ECEF;

  /* 文字層 — 明亮背景上的深色文字 */
  --text-primary: #0F172A;
  --text-secondary: rgba(15, 23, 42, 0.68);
  --text-muted: rgba(15, 23, 42, 0.45);

  /* 股市漲跌 */
  --up-green: #22C55E;
  --down-red: #EF4444;

  /* 輔助色 */
  --accent-blue: #3B82F6;
  --accent-navy: #1E3A8A;

  /* 邊框與分隔 — 淡灰色邊框 */
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(202, 138, 4, 0.35);
  --border-glass: rgba(15, 23, 42, 0.1);

  /* 漸層 */
  --grad-gold: linear-gradient(135deg, #CA8A04, #EAB308);
  --grad-crimson: linear-gradient(135deg, #B91C3A, #D42B4E);
  --grad-surface: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  --grad-glow-gold: radial-gradient(ellipse at 50% 0%, rgba(202, 138, 4, 0.12) 0%, transparent 60%);
  --grad-glow-crimson: radial-gradient(ellipse at 50% 0%, rgba(185, 28, 58, 0.08) 0%, transparent 60%);

  /* ===== 字型系統 ===== */
  --font-display: 'Playfair Display', 'Noto Serif TC', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  /* ===== 間距 ===== */
  --section-padding: 120px 0;
  --container-width: 1200px;
  --container-padding: 0 32px;

  /* ===== 圓角 ===== */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ===== 陰影 ===== */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow-gold: 0 0 40px rgba(202, 138, 4, 0.12);
  --shadow-glow-crimson: 0 0 40px rgba(185, 28, 58, 0.1);

  /* ===== 過渡 ===== */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 200ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;

  /* ===== Z-index 層級 ===== */
  --z-base: 1;
  --z-elevated: 10;
  --z-sticky: 20;
  --z-overlay: 30;
  --z-modal: 50;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.65;
  overflow-x: hidden;
  /* 細微的噪點紋理增加質感 */
  background-image: radial-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ===== 容器 ===== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

.section {
  padding: var(--section-padding);
  position: relative;
}

/* ===== 區塊裝飾 ===== */
/* 每個區塊頂部的微光漸層，增加深度感 */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===== 文字樣式 ===== */

/* Eyebrow：金色小標籤 */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: inline-block;
}

/* 區塊大標題 — 優雅的襯線字 */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

/* 區塊副標 */
.section-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.8;
}

/* ===== 按鈕樣式 ===== */

/* 主要 CTA — 金色漸層，更高端 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--gold);
  color: #0C0A09;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn-primary:hover {
  background: var(--gold-lt);
  box-shadow: var(--shadow-glow-gold);
  transform: translateY(-1px);
}

.btn-primary:hover::before {
  opacity: 1;
}

/* 次要按鈕 — 精緻邊框 */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid rgba(234, 237, 243, 0.15);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-muted);
}

.btn-arrow {
  transition: transform var(--duration-fast) var(--ease-out);
  display: inline-block;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

/* ===== 滾動觸發動畫 ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group > *:nth-child(1) { transition-delay: 0ms; }
.reveal-group > *:nth-child(2) { transition-delay: 100ms; }
.reveal-group > *:nth-child(3) { transition-delay: 200ms; }
.reveal-group > *:nth-child(4) { transition-delay: 300ms; }
.reveal-group > *:nth-child(5) { transition-delay: 400ms; }
.reveal-group > *:nth-child(6) { transition-delay: 500ms; }
.reveal-group > *:nth-child(7) { transition-delay: 600ms; }
.reveal-group > *:nth-child(8) { transition-delay: 700ms; }
.reveal-group > *:nth-child(9) { transition-delay: 800ms; }

/* ===== 骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

/* ===== 分隔線 ===== */
.divider {
  width: 48px;
  height: 2px;
  background: var(--grad-gold);
  margin: 20px 0;
  border-radius: 1px;
}

/* ===== Glassmorphism 卡片基底 ===== */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow-gold);
  transform: translateY(-2px);
}

/* ===== 選取文字 ===== */
::selection {
  background: rgba(202, 138, 4, 0.3);
  color: #fff;
}

/* ===== 捲軸 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-overlay);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
