/* ============================================================
   Queen-Memo 文章頁共用基底樣式 — article-base.css
   暗色 data-essay 骨架：tokens / reset / hero / 排版 / 響應式。
   各篇只需在內嵌 <style> 設定 :root{ --theme: <主題色>; } 覆寫，
   以及該篇專屬 scrollytelling / 圖表視覺。元件樣式見 article-components.css。
   ============================================================ */

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

:root {
  /* ── Surface ── */
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-elevated: #222222;

  /* ── Text ── */
  --text: #f0f0f0;
  --text-dim: #888888;
  --text-muted: #555555;

  /* ── Brand Accent（暗底用 hover 變體，更高亮度）── */
  --accent: #5C6BE6;
  --accent-dim: rgba(92, 107, 230, 0.15);

  /* ── Theme（每篇可覆寫；預設＝品牌靛藍）── */
  --theme: var(--accent);

  /* ── Data Semantic Colors ── */
  --teal: #0DD9B5;
  --teal-dim: rgba(13, 217, 181, 0.12);
  --red: #FF4B4B;
  --red-dim: rgba(255, 75, 75, 0.12);
  --blue: #4B9EFF;
  --blue-dim: rgba(75, 158, 255, 0.12);
  --purple: #A78BFA;
  --purple-dim: rgba(167, 139, 250, 0.12);

  /* ── Structure ── */
  --rule: #2a2a2a;
  --prose: 640px;
  --wide: 1000px;

  /* ── Liquid Glass Tokens ── */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-top: rgba(255, 255, 255, 0.15);
  --glass-blur: 20px;
  --glass-saturate: saturate(150%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.35);
  --glass-radius: 16px;
  --glass-radius-pill: 999px;
  --glass-transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* ── 互動位移／陰影（供 stat-card 等元件使用）── */
  --transition-lift: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  --shadow-card-hover: 0 8px 28px rgba(0, 0, 0, 0.35);

  /* ── Political Party Colors（IMMUTABLE）── */
  --kmt: #4B9EFF;
  --dpp: #00C870;
  --tpp: #00C4CC;
  --npp: #FF9E15;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
}

/* 主題化背景光暈：主光暈由 --theme 驅動，輔以低調紫做層次 */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 400px at 15% 20%, color-mix(in srgb, var(--theme) 9%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 80% 60%, color-mix(in srgb, var(--theme) 6%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 85%, var(--purple-dim) 0%, transparent 70%);
}

body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9998;
  pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px 256px;
}

/* ── Back Link + Progress Bar（glass 膠囊版）── */
.blog-back {
  position: fixed; top: 14px; left: 16px; z-index: 9999;
  font-size: 12px; font-weight: 500;
  color: rgba(240, 240, 240, 0.5);
  text-decoration: none; padding: 6px 16px;
  border-radius: var(--glass-radius-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) var(--glass-saturate);
  -webkit-backdrop-filter: blur(var(--glass-blur)) var(--glass-saturate);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  box-shadow: var(--glass-highlight), 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: var(--glass-transition);
}
.blog-back:hover {
  color: #f0f0f0;
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--glass-highlight), 0 4px 16px rgba(0, 0, 0, 0.3);
}

#progress-bar {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--theme);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme) 40%, transparent);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px;
  position: relative;
}
.hero-eyebrow {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--theme); margin-bottom: 32px;
}
.hero h1 {
  font-size: clamp(36px, 7vw, 72px); font-weight: 900;
  line-height: 1.15; letter-spacing: -0.02em;
  max-width: 800px;
  text-shadow: 0 0 80px color-mix(in srgb, var(--theme) 12%, transparent);
}
.hero h1 em { font-style: normal; color: var(--theme); }
.hero-sub {
  font-size: clamp(15px, 2.2vw, 19px); font-weight: 300;
  color: var(--text-dim); max-width: 560px;
  margin-top: 24px; line-height: 1.8;
}
.hero-gradient-line {
  width: 60px; height: 2px;
  margin: 24px auto 0;
  background: linear-gradient(90deg, transparent, var(--theme), transparent);
}
.hero-meta { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.hero-reading-time {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: color-mix(in srgb, var(--theme) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--theme) 25%, transparent);
  font-size: 12px; font-weight: 500; color: var(--theme);
}
.hero-date { font-size: 12px; color: var(--text-muted); letter-spacing: 0.04em; }
.hero-scroll-hint {
  position: absolute; bottom: 40px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted);
}
.hero-scroll-hint::after {
  content: ''; display: block;
  width: 1px; height: 40px;
  background: var(--text-muted); margin: 12px auto 0;
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ── Layout ── */
.prose { max-width: var(--prose); margin: 0 auto; padding: 0 24px; }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 24px; }

.big-text-section {
  min-height: 60vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px; text-align: center;
}
.big-text {
  font-size: clamp(28px, 5vw, 52px); font-weight: 800;
  line-height: 1.3; max-width: 700px; letter-spacing: -0.01em;
}
.big-text em { font-style: normal; color: var(--theme); }
.big-text .dim { color: var(--text-muted); }
.big-text .quote-attr {
  display: block; margin-top: 20px;
  font-size: 14px; font-weight: 400;
  color: var(--text-muted); letter-spacing: 0;
}

/* ── Narrative / Typography ── */
.narrative { padding: 80px 0; }
.narrative p { color: var(--text-dim); margin-bottom: 20px; font-weight: 400; }
.narrative strong { color: var(--text); font-weight: 700; }

.section-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 8px;
}
.section-eyebrow.accent { color: var(--theme); }
.section-eyebrow.teal { color: var(--teal); }
.section-eyebrow.red { color: var(--red); }
.section-eyebrow.purple { color: var(--purple); }
.section-eyebrow.blue { color: var(--blue); }

.section-h2 {
  font-size: 28px; font-weight: 800;
  margin-bottom: 16px; letter-spacing: -0.01em;
}

/* ── 行內文字強調（highlight-*）── */
.highlight-accent { color: var(--theme); font-weight: 700; }
.highlight-teal { color: var(--teal); font-weight: 700; }
.highlight-red { color: var(--red); font-weight: 700; }
.highlight-purple { color: var(--purple); font-weight: 700; }
.highlight-blue { color: var(--blue); font-weight: 700; }

/* ── big-text 區塊分隔線 ── */
.big-text-divider { width: 40px; height: 1px; background: var(--rule); margin: 40px auto; }

/* ── Scroll Animation Helper ── */
.gs { opacity: 0; transform: translateY(20px); }

/* ── 響應式 ── */
@media (max-width: 768px) {
  .hero h1 { font-size: clamp(28px, 6vw, 48px); }
  .hero-scroll-hint { display: none; }
  .section-h2 { font-size: 22px; }
  .blog-back { top: 8px; left: 12px; font-size: 11px; }
  .section-divider { padding: 16px 0; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .prose, .wide { padding: 0 16px; }
  .hero { min-height: 85vh; padding: 32px 16px; }
  .hero h1 { font-size: clamp(24px, 7vw, 34px); }
  .hero-sub { font-size: 14px; line-height: 1.7; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .section-h2 { font-size: 20px; }
  .big-text { font-size: clamp(18px, 5vw, 28px); }
  .big-text .quote-attr { font-size: 12px; }
  .narrative { padding: 48px 0; }
  .blog-back {
    padding: 8px 16px; min-height: 44px; min-width: 44px;
    display: inline-flex; align-items: center;
  }
}

/* ── 尊重減少動態偏好 ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
