/* ============================================================================
   storefront/storefront.css
   宇宙市集 — 合併產品「漏斗前臉」視覺層。
   暗色霓虹宇宙風（青/金/紫），純黑底，3D canvas 永遠當發光背景。

   安全：純前端靜態樣式。無外部字型/追蹤資源，系統字型即可。
   全檔不含任何後端位址、金鑰或本機絕對路徑。

   段落：
     0  設計權杖（tokens）與 keyframes
     1  根/背景/氛圍覆蓋層（vignette + scanlines + aurora）
     2  舞台層級（#universe-scene / #app / pointer-events 鐵規則）
     3  落地英雄區（動態炫感、glow-word、CTA）
     4  共用設計系統：按鈕 / 面板 / 卡片 / 表單 / dropzone / ring / seg / tag / muted
     5  漏斗導航 / toast / 下載 CTA
     6  響應式（1280 桌面、390 手機）＋ prefers-reduced-motion
   ========================================================================== */

/* ── 0 · 設計權杖 ─────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --bg: #02030a;
  --ink: #dceaff;
  --text: #cfe3ff;
  --muted: #7f93b8;
  --faint: #56678c;

  --line: rgba(120, 170, 255, 0.16);
  --line-strong: rgba(130, 190, 255, 0.34);

  --panel: rgba(7, 11, 20, 0.74);
  --panel-strong: rgba(8, 12, 22, 0.9);
  --panel-soft: rgba(70, 230, 255, 0.04);

  /* 霓虹主色 */
  --cyan: #46e6ff;
  --gold: #ffcf57;
  --mag: #ff6fae;
  --grn: #57e6a8;
  --vio: #b98bff;
  --red: #ff5d6c;

  /* 發光 RGB（用於可調透明度的 glow） */
  --cyan-rgb: 70, 230, 255;
  --gold-rgb: 255, 207, 87;
  --vio-rgb: 185, 139, 255;
  --grn-rgb: 87, 230, 168;

  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-panel: 0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 1px 30px rgba(var(--cyan-rgb), 0.05);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "Noto Sans Mono CJK TC", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Noto Sans TC",
    "PingFang TC", sans-serif;

  font-family: var(--sans);
  background: var(--bg);
}

* { box-sizing: border-box; }

/* 進場：淡入 + 上浮 */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes riseScale {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 英雄漸層流動 */
@keyframes flowGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* glow-word 呼吸 */
@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 24px rgba(var(--gold-rgb), 0.55), 0 0 48px rgba(var(--gold-rgb), 0.22); }
  50%      { text-shadow: 0 0 40px rgba(var(--gold-rgb), 0.85), 0 0 78px rgba(var(--gold-rgb), 0.4); }
}
/* 極光氛圍緩慢漂移 */
@keyframes auroraDrift {
  0%   { transform: translate3d(-4%, -2%, 0) scale(1.05); opacity: 0.7; }
  50%  { transform: translate3d(4%, 3%, 0) scale(1.12);  opacity: 1; }
  100% { transform: translate3d(-4%, -2%, 0) scale(1.05); opacity: 0.7; }
}
/* 狀態點閃爍 */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
/* 進度條掃光 */
@keyframes segShimmer { 0% { background-position: -160% 0; } 100% { background-position: 260% 0; } }
/* dropzone 邊框跑動 */
@keyframes dashSpin { to { background-position: 200% 0, 0 200%, 0 0, 100% 100%; } }

/* ── 1 · 根 / 背景 / 氛圍覆蓋層 ──────────────────────────────────────── */
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(1200px 900px at 50% 42%, #060c1a 0%, #02030a 60%, #01020600 100%),
    #02030a;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }

/* 邊緣壓暗：聚焦中央發光腦 */
.vignette {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 1;
  background: radial-gradient(120% 120% at 50% 46%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

/* 掃描線 + 角落極光暈：靠 ::before/::after 疊在 vignette 上，全程 pointer-events:none */
.vignette::before {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(var(--cyan-rgb), 0.025) 0px,
    rgba(var(--cyan-rgb), 0.025) 1px,
    transparent 2px,
    transparent 4px
  );
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
.vignette::after {
  content: "";
  position: absolute; inset: -10%;
  background:
    radial-gradient(40% 38% at 16% 18%, rgba(var(--cyan-rgb), 0.12), transparent 70%),
    radial-gradient(46% 42% at 86% 78%, rgba(var(--vio-rgb), 0.12), transparent 70%),
    radial-gradient(34% 30% at 78% 12%, rgba(var(--gold-rgb), 0.08), transparent 72%);
  filter: blur(8px);
  animation: auroraDrift 26s ease-in-out infinite;
}

/* ── 2 · 舞台層級（pointer-events 鐵規則：勿動） ──────────────────────── */
#universe-scene {
  position: fixed; inset: 0;
  z-index: 0;                 /* 3D 永遠在最底層當前臉 */
  width: 100vw; height: 100vh;
  display: block;
  cursor: grab;
}
#universe-scene:active { cursor: grabbing; }

#app {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;       /* 預設讓滑鼠穿透到 3D canvas */
}
#app > * { pointer-events: auto; }  /* 可互動子元素自行接管 */

/* ── 3 · 落地英雄區 ─────────────────────────────────────────────────── */
#hero {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  padding: clamp(20px, 5vw, 56px);
  /* 讓英雄本身可穿透點擊 3D，只有文字/按鈕攔截（見 .hero-inner） */
  pointer-events: none;
}
#hero[hidden] { display: none; }

.hero-inner {
  position: relative;
  max-width: 780px;
  pointer-events: auto;       /* 文字區可選取/可點 CTA */
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  /* 文字面板：較實的暗色中心 + 柔邊 + 微模糊，壓住背後 3D 核心強光，確保字清楚可讀 */
  padding: clamp(22px, 4vw, 44px) clamp(20px, 4vw, 48px);
  border-radius: 24px;
  background: radial-gradient(120% 130% at 50% 44%, rgba(2, 4, 12, 0.84), rgba(2, 4, 12, 0.3) 68%, rgba(2, 4, 12, 0) 100%);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-transform: uppercase;
  margin: 0 0 18px;
  animation: rise 0.7s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: blink 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(34px, 6.4vw, 72px);
  line-height: 1.06;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  /* 實色白 + 暗描邊 + 青色霓虹暈：可靠顯示，不依賴 background-clip:text（與 animation 合成層相衝會變透明） */
  color: #f2f8ff;
  -webkit-text-fill-color: #f2f8ff;
  text-shadow: 0 2px 18px rgba(2, 4, 12, 0.95), 0 0 30px rgba(var(--cyan-rgb), 0.3);
  animation: rise 0.7s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 招牌發光字：金色 + 呼吸光暈（純 text-shadow，不依賴 background-clip） */
.glow-word {
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  text-shadow: 0 0 26px rgba(var(--gold-rgb), 0.72), 0 0 54px rgba(var(--gold-rgb), 0.36);
  animation: glowPulse 4.2s ease-in-out infinite;
}

.hero-sub {
  font-size: clamp(16px, 2.3vw, 21px);
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.96;
  margin: 0 auto 30px;
  max-width: 620px;
  text-shadow: 0 1px 12px rgba(2, 4, 12, 0.9);
  animation: rise 0.7s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-benefit {
  font-size: clamp(14px, 1.9vw, 17px);
  line-height: 1.6;
  color: var(--gold);
  margin: -4px auto 20px;
  max-width: 600px;
  text-shadow: 0 1px 10px rgba(2, 4, 12, 0.9);
  animation: rise 0.7s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-trust {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 18px 0 0;
  animation: rise 0.7s 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* 上傳後「你的星已亮」狀態：縮小、靠上、降遮罩，讓被聚焦的星露出畫面中央 */
.hero-inner.hero-lit {
  max-width: 560px;
  align-self: start;
  margin-top: clamp(48px, 12vh, 140px);
  background: radial-gradient(120% 130% at 50% 30%, rgba(2, 4, 12, 0.72), rgba(2, 4, 12, 0) 70%);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}
.hero-cta {
  display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
  animation: rise 0.7s 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── 4 · 共用設計系統 ──────────────────────────────────────────────── */

/* 4.1 按鈕 ----------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 13px 26px;
  font-size: 16px; font-weight: 700; line-height: 1;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform 0.16s ease, box-shadow 0.22s ease,
    background 0.22s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* 主要：青→紫流動漸層 + 發光，hover 加亮 */
.btn-primary {
  color: #02030a;
  border-color: transparent;
  font-weight: 800;
  background-image: linear-gradient(120deg, var(--cyan), var(--vio), var(--cyan));
  background-size: 200% 100%;
  box-shadow: 0 10px 34px rgba(var(--cyan-rgb), 0.32);
  animation: flowGradient 6s ease-in-out infinite;
}
.btn-primary:hover {
  box-shadow: 0 14px 44px rgba(var(--cyan-rgb), 0.5);
}

/* 幽靈：玻璃底，hover 染青光 */
.btn-ghost { background: var(--panel); color: var(--text); }
.btn-ghost:hover { background: rgba(var(--cyan-rgb), 0.08); color: var(--cyan); }

/* 小尺寸變體（卡片內動作用） */
.btn.btn-sm { padding: 9px 16px; font-size: 14px; }

/* 4.2 面板 ----------------------------------------------------------------- */
.panel {
  position: absolute; inset: 0;
  overflow: auto;
  padding: clamp(20px, 5vw, 64px);
  padding-top: clamp(74px, 9vw, 104px);   /* 讓開固定頂部漏斗導航 */
  background: linear-gradient(180deg, rgba(2, 4, 12, 0.72), rgba(2, 4, 12, 0.92));
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
  animation: rise 0.4s ease-out both;
  -webkit-overflow-scrolling: touch;
}
.panel[hidden] { display: none; }

.panel-head {
  margin: 0 auto 22px;
  max-width: 1120px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #ffffff, #9fd2ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.panel-head .muted { font-size: 14px; }
/* 面板內容置中包覆，供模組塞入 */
.panel > .panel-body { max-width: 1120px; margin: 0 auto; }

/* 4.3 卡片 + 卡片網格 ------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}
/* 防止 grid item 被內容撐爆/溢出 */
.card-grid > * { min-width: 0; }

.card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(var(--cyan-rgb), 0.05), rgba(7, 11, 20, 0.72));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: var(--shadow-panel);
  cursor: pointer;
  overflow: hidden;
  animation: riseScale 0.45s ease-out both;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease;
}
/* 頂緣霓虹細線 */
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--vio), transparent);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(var(--cyan-rgb), 0.18),
    inset 0 1px 30px rgba(var(--cyan-rgb), 0.08);
}
.card:hover::before { opacity: 1; }
.card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.card-title {
  margin: 0 0 6px;
  font-size: 17px; font-weight: 700; line-height: 1.3;
  color: #eaf4ff;
  overflow-wrap: anywhere;
}
.card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.card-meta b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

/* 標籤（tag） */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(var(--cyan-rgb), 0.06);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  color: var(--cyan);
  white-space: nowrap;
}
.tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.tag.tag-gold { color: var(--gold); background: rgba(var(--gold-rgb), 0.08); }
.tag.tag-vio  { color: var(--vio);  background: rgba(var(--vio-rgb), 0.08); }
.tag.tag-grn  { color: var(--grn);  background: rgba(var(--grn-rgb), 0.08); }
.tag.tag-plain { color: var(--muted); background: transparent; }
.tag.tag-plain::before { display: none; }

/* 4.4 表單欄位 ------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); opacity: 0.92;
}
.field > input,
.field > textarea,
.field > select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  background: rgba(2, 6, 14, 0.6);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field > textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.field > input::placeholder,
.field > textarea::placeholder { color: var(--faint); }
.field > input:focus,
.field > textarea:focus,
.field > select:focus {
  outline: none;
  border-color: rgba(var(--cyan-rgb), 0.55);
  background: rgba(2, 8, 18, 0.78);
  box-shadow: 0 0 0 3px rgba(var(--cyan-rgb), 0.14), 0 0 22px rgba(var(--cyan-rgb), 0.12);
}
.field .field-hint { font-size: 12px; color: var(--muted); }

/* 4.5 拖放區 dropzone ------------------------------------------------------ */
.dropzone {
  position: relative;
  display: grid; place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 32px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--text);
  background: rgba(2, 6, 14, 0.5);
  /* 四邊虛線（用漸層畫，方便 hover/dragover 變色與跑動） */
  background-image:
    linear-gradient(90deg, var(--line-strong) 50%, transparent 50%),
    linear-gradient(90deg, var(--line-strong) 50%, transparent 50%),
    linear-gradient(0deg, var(--line-strong) 50%, transparent 50%),
    linear-gradient(0deg, var(--line-strong) 50%, transparent 50%);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 16px 1.5px, 16px 1.5px, 1.5px 16px, 1.5px 16px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  transition: background-color 0.2s ease, box-shadow 0.22s ease, transform 0.18s ease;
}
.dropzone .dz-icon { font-size: 34px; line-height: 1; filter: drop-shadow(0 0 14px rgba(var(--cyan-rgb), 0.5)); }
.dropzone .dz-title { font-size: 18px; font-weight: 700; color: #eaf4ff; }
.dropzone .dz-hint { font-size: 13px; color: var(--muted); }
.dropzone:hover {
  background-color: rgba(var(--cyan-rgb), 0.05);
  box-shadow: inset 0 0 40px rgba(var(--cyan-rgb), 0.08);
}
/* dragover：JS 切換 .is-dragover → 高亮 + 虛線跑動 + 微放大 */
.dropzone.is-dragover {
  background-color: rgba(var(--cyan-rgb), 0.12);
  background-image:
    linear-gradient(90deg, var(--cyan) 50%, transparent 50%),
    linear-gradient(90deg, var(--cyan) 50%, transparent 50%),
    linear-gradient(0deg, var(--cyan) 50%, transparent 50%),
    linear-gradient(0deg, var(--cyan) 50%, transparent 50%);
  background-size: 16px 2px, 16px 2px, 2px 16px, 2px 16px;
  box-shadow: 0 0 0 1px rgba(var(--cyan-rgb), 0.4), inset 0 0 60px rgba(var(--cyan-rgb), 0.16),
    0 20px 60px rgba(var(--cyan-rgb), 0.2);
  transform: scale(1.01);
  animation: dashSpin 0.9s linear infinite;
}

/* 4.6 撮合分數環 ring（conic 漸層，用 --v: 0~100） ------------------------- */
.ring {
  --v: 0;                      /* 由 JS 設 style="--v:78" */
  --ring-size: 84px;
  --ring-thick: 9px;
  --ring-color: var(--cyan);
  position: relative;
  width: var(--ring-size); height: var(--ring-size);
  border-radius: 50%;
  display: grid; place-items: center;
  flex: 0 0 auto;
  background:
    conic-gradient(var(--ring-color) calc(var(--v) * 1%), rgba(255, 255, 255, 0.06) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(50% - var(--ring-thick)), #000 calc(50% - var(--ring-thick) + 0.5px));
  mask: radial-gradient(farthest-side, transparent calc(50% - var(--ring-thick)), #000 calc(50% - var(--ring-thick) + 0.5px));
  filter: drop-shadow(0 0 10px rgba(var(--cyan-rgb), 0.45));
}
/* 數字疊在環中心：包一層 .ring-wrap 即可，環本身被 mask 鏤空 */
.ring-wrap {
  position: relative;
  display: inline-grid; place-items: center;
  width: var(--ring-size, 84px); height: var(--ring-size, 84px);
}
.ring-wrap .ring { position: absolute; inset: 0; }
.ring-wrap .ring-val {
  font-family: var(--mono); font-weight: 700;
  font-size: 22px; line-height: 1;
  color: #eaf4ff; font-variant-numeric: tabular-nums;
}
.ring-wrap .ring-val small { display: block; font-size: 9px; letter-spacing: 0.14em; color: var(--muted); margin-top: 3px; }
/* 分數色階：高分轉綠、中分金、低分洋紅（JS 加 modifier 即可） */
.ring.ring-high { --ring-color: var(--grn); filter: drop-shadow(0 0 10px rgba(var(--grn-rgb), 0.45)); }
.ring.ring-mid  { --ring-color: var(--gold); filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), 0.45)); }
.ring.ring-low  { --ring-color: var(--mag); }

/* 4.7 分段進度條 seg（多段 + 掃光） --------------------------------------- */
.seg {
  position: relative;
  width: 100%; height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--line);
}
/* 填充：用 --v (0~100) 控制寬度；漸層 + 掃光 */
.seg > .seg-fill {
  --v: 0;
  position: absolute; inset: 0;
  width: calc(var(--v) * 1%);
  border-radius: inherit;
  background-image: linear-gradient(90deg, var(--cyan), var(--vio));
  box-shadow: 0 0 14px rgba(var(--cyan-rgb), 0.45);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.seg > .seg-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: segShimmer 2.2s linear infinite;
}
/* 離散步驟版：.seg.seg-steps 內放多個 .seg-step，.done 點亮 */
.seg.seg-steps {
  height: auto; padding: 0; border: 0; background: none;
  display: flex; gap: 6px; overflow: visible;
}
.seg.seg-steps .seg-step {
  flex: 1; height: 6px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.seg.seg-steps .seg-step.done {
  background: linear-gradient(90deg, var(--cyan), var(--vio));
  box-shadow: 0 0 12px rgba(var(--cyan-rgb), 0.5);
}

/* 4.8 muted 與通用文字工具 ------------------------------------------------- */
.muted { color: var(--muted); }
.mono  { font-family: var(--mono); }
.center { text-align: center; }

/* ── 5 · 漏斗導航 / toast / 下載 CTA ────────────────────────────────── */

/* 5.1 漏斗導航：固定頂部置中膠囊 */
.funnel-nav {
  position: fixed; top: calc(18px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 28px);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.fn-chip {
  border: 0; background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.fn-chip:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.fn-chip.active {
  background: rgba(var(--cyan-rgb), 0.16);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(var(--cyan-rgb), 0.3), 0 0 16px rgba(var(--cyan-rgb), 0.18);
}
.fn-chip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* 5.2 toast */
.toast-host {
  position: fixed; bottom: calc(26px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  max-width: calc(100vw - 28px);
  pointer-events: none;       /* 容器穿透；單顆 toast 自行可選 */
}
.toast {
  pointer-events: auto;
  max-width: 90vw;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: rgba(var(--grn-rgb), 0.5); box-shadow: 0 0 24px rgba(var(--grn-rgb), 0.18), 0 18px 50px rgba(0, 0, 0, 0.55); }
.toast-error   { border-color: rgba(255, 93, 108, 0.5); box-shadow: 0 0 24px rgba(255, 93, 108, 0.18), 0 18px 50px rgba(0, 0, 0, 0.55); }
.toast-info    { border-color: var(--line-strong); }

/* 5.3 下載 CTA（漏斗末端） */
/* :not([hidden]) 確保 id 選擇器的 display 不會蓋過 hidden 屬性（否則 view 切換時 panel 不隱藏）。 */
#download-cta:not([hidden]) { display: grid; place-items: center; text-align: center; }
/* 全域防護：hidden 一律隱藏，避免未來 id 規則再度蓋過 hidden。 */
[hidden] { display: none !important; }
.dl-inner {
  max-width: 620px;
  animation: rise 0.5s ease-out both;
  padding: clamp(20px, 4vw, 40px);
  border-radius: 24px;
  background: radial-gradient(120% 120% at 50% 30%, rgba(2, 4, 12, 0.7), rgba(2, 4, 12, 0) 75%);
}
.dl-inner h2 {
  font-size: clamp(24px, 4vw, 40px);
  margin: 0 0 14px; font-weight: 800; line-height: 1.15;
  background: linear-gradient(180deg, #ffffff, #9fd2ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dl-inner p { color: var(--ink); opacity: 0.92; line-height: 1.6; margin: 0 0 22px; }
.dl-note { color: var(--muted); font-size: 13px; margin-top: 14px; }
.dl-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 8px auto 0; max-width: 480px; }
.dl-form input {
  flex: 1 1 220px; min-width: 0; max-width: 320px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--panel); color: var(--text);
}
.dl-form input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.bs-benefit { color: var(--ink); margin: 6px 0 16px; line-height: 1.6; }

/* ── 6 · 響應式 ─────────────────────────────────────────────────────── */

/* 桌面 1280：限制英雄/面板最大寬，已用 max-width 處理。窄一點時收斂網格。 */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* 手機 390：單欄、縮間距、導航可橫向捲、面板讓更多頂部空間 */
@media (max-width: 560px) {
  .hero-inner { padding: 20px 14px; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { flex: 1 1 auto; min-width: 0; }

  .panel { padding: 16px; padding-top: 86px; }
  .panel-head { flex-direction: column; align-items: flex-start; gap: 6px; }

  .card-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 導航：橫向捲動，不換行不溢出 */
  .funnel-nav {
    top: calc(12px + env(safe-area-inset-top));
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    max-width: calc(100vw - 20px);
    -ms-overflow-style: none; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .funnel-nav::-webkit-scrollbar { display: none; }
  .fn-chip { padding: 8px 12px; font-size: 13px; }

  .toast-host { bottom: 18px; }
  .ring { --ring-size: 72px; }
}

/* 尊重「減少動態」偏好：關掉所有裝飾動畫，保留可讀性 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .glow-word { text-shadow: 0 0 26px rgba(var(--gold-rgb), 0.6); }
  .vignette::after { opacity: 0.85; transform: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* ── 體驗增強：下載成功態 / 市集示意橫幅 / 發布預覽 ── */
.dl-note-ok { color: var(--grn) !important; }
.dl-input-ok { border-color: rgba(var(--grn-rgb), .5) !important; color: #9af0c6 !important; background: rgba(var(--grn-rgb), .06) !important; }
.dl-btn-ok { opacity: .85; cursor: default; }
.mk-demo-banner { margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  border: 1px solid rgba(255,178,76,.35); background: rgba(255,178,76,.08); color: #ffd9a0; }
.mk-demo-banner b { color: #fff; }
.mk-pub-preview { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.2); }
.mk-pub-line { font-size: 14px; margin-bottom: 6px; }
