/* 追星指數 — design tokens */
:root {
  /* 黑色舞台：近黑的底、微微偏紫的表面，聚光燈只打在頁面最上方 */
  --canvas: #09090E;
  --surface: #14131C;
  --surface-2: #1C1A28;
  --accent: #8A3FD1;          /* 按鈕底色（配白字） */
  --accent-bright: #B07AF0;   /* 進度、細節 */
  --accent-text: #C79BFF;     /* 深色底上的強調文字 */
  --accent-weak: rgba(176, 122, 240, .14);
  --ink: #F4F1FA;
  --ink-2: #BDB8D2;
  --ink-3: #8F8AAA;
  --line: #2A2838;
  --pink: #FF5C9D;
  --pink-text: #FF8DBA;
  --cyan: #3CC4DA;
  --cyan-text: #6FD9EB;
  --gold: #FFB62E;
  --gold-text: #FFD070;
  --cyan-weak: rgba(60, 196, 218, .10);

  --r-sm: .5rem;
  --r-md: .875rem;
  --r-lg: 1.25rem;
  --r-full: 999px;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 4px 16px -4px rgba(0, 0, 0, .6);
  --sh-3: 0 24px 48px -12px rgba(0, 0, 0, .7);

  --wrap: 560px;
}

* { box-sizing: border-box; }

html { background: var(--canvas); color-scheme: dark; }
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  /* 演唱會的聚光燈：正上方一道暖白，左右各一道淡粉與淡青，只打在最上面 620px，往下就是純黑 */
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse 44% 54% at 50% -10%, rgba(255, 236, 200, .24), rgba(255, 236, 200, 0) 72%),
    radial-gradient(ellipse 24% 62% at 12% -8%, rgba(255, 92, 157, .16), rgba(255, 92, 157, 0) 72%),
    radial-gradient(ellipse 24% 62% at 88% -8%, rgba(60, 196, 218, .13), rgba(60, 196, 218, 0) 72%);
  background-repeat: no-repeat;
  background-size: 100% 640px;
}
/* 細顆粒：黑色看起來才有質感，不會像一片死黑的螢幕。只是疊在最上層的雜訊，不吃點擊。 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* 不要在內文用 text-wrap: pretty／balance。
   Chrome 只拿它調整最後一行，Safari 會重排整段——實機上每行只用到約三分之二寬度就換行，
   看起來像整頁的字都擠在左邊。Chromium 上的檢查完全測不出這件事。 */

body { overflow-x: hidden; }

h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.icon { width: 20px; height: 20px; flex: none; }

/* ── 畫面切換 ─────────────────────────────── */
.screen { display: none; }
.screen.is-active { display: block; animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 按鈕 ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border: none; border-radius: var(--r-full);
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 17px; cursor: pointer;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
  box-shadow: 0 6px 22px -6px rgba(176, 122, 240, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line); box-shadow: none; font-weight: 500;
}
.btn-block { width: 100%; }
a.btn { text-decoration: none; }
:where(button, a, input, [tabindex]):focus-visible {
  outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm);
}

/* ── Landing ──────────────────────────────── */
.hero { padding: 40px 0 56px; text-align: center; }
.hero-art { max-width: 400px; margin: 0 auto 20px; }
.hero h1 { font-size: clamp(32px, 8.6vw, 44px); }
.hero-sub { margin-top: 18px; color: var(--ink-2); font-size: 17px; }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero .btn { margin-top: 28px; }
/* 封面要一眼說清楚測的是哪三件事：跟 OG 預覽圖同一行字、同三個顏色 */
.hero-measure { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; color: var(--ink-2); font-size: 15px; }
.hero-measure span { margin-right: 4px; }
.hero-measure .m { padding: 5px 15px; border-radius: var(--r-full); font-size: 14.5px; font-weight: 700; }
.hero-measure .m-heart { background: var(--pink); color: #fff; }
.hero-measure .m-bond { background: var(--cyan); color: #06303A; }
.hero-measure .m-power { background: var(--gold); color: #3D2700; }
.hero-meta { margin-top: 14px; color: var(--ink-3); font-size: 13.5px; }

.brand { display: flex; align-items: center; justify-content: center; gap: 9px; padding-top: 26px; }
.brand-mark { width: 26px; height: 26px; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .02em; }

.pitch { padding: 8px 0 48px; }
.pitch-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 22px 6px;
}
.pitch h2 { font-size: 19px; margin-bottom: 12px; }
.story { color: var(--ink-2); font-size: 15.5px; line-height: 1.75; margin-bottom: 18px; }
.story-after { margin: 20px 0 0; }

.formula { margin-top: 20px; padding: 18px 20px 20px; background: var(--accent-weak); border-radius: var(--r-md); }
.formula-head { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.formula-row { display: flex; gap: 10px; align-items: baseline; font-size: 15.5px; padding: 3px 0; }
.formula-row .op { color: var(--accent-text); font-weight: 700; width: 18px; flex: none; font-size: 17px; }
.circle-row { display: flex; gap: 13px; padding: 15px 0; border-top: 1px solid var(--line); }
.circle-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 9px; flex: none; background: var(--line); }
.circle-dot.dot-1 { background: var(--pink); }
.circle-dot.dot-2 { background: var(--cyan); }
.circle-dot.dot-3 { background: var(--gold); }
.circle-row b { display: block; font-size: 15.5px; }
.circle-row span { color: var(--ink-2); font-size: 14.5px; }

/* ── 取代號 ───────────────────────────────── */
.intro { padding: 32px 0 40px; }
.intro-art { max-width: 300px; margin: 0 auto 4px; }
.intro h2 { font-size: 24px; text-align: center; }
.intro-note { text-align: center; color: var(--ink-2); font-size: 15px; margin-top: 10px; }
.field { margin-top: 26px; }
.field label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.field input {
  width: 100%; min-height: 54px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 17px;
  transition: border-color .16s ease;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-full); padding: 7px 14px; font-size: 14px; cursor: pointer;
  min-height: 36px; transition: all .14s ease;
}
.privacy-note {
  margin-top: 22px; padding: 13px 15px; background: var(--cyan-weak);
  border-radius: var(--r-md); color: var(--ink-2); font-size: 13.5px; line-height: 1.6;
}

/* ── 測驗 ─────────────────────────────────── */
.quiz-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 9, 14, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.quiz-top-inner { display: flex; align-items: center; gap: 12px; padding: 13px 20px 12px; max-width: var(--wrap); margin: 0 auto; }
.progress-track { flex: 1; height: 6px; background: var(--line); border-radius: var(--r-full); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent-bright); border-radius: var(--r-full); transition: width .35s cubic-bezier(.4, 0, .2, 1); }
.progress-count { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.step-label { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 11px; font-size: 13px; color: var(--accent-text); font-weight: 600; }

.q { padding: 30px 0 40px; }
.q-num { font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: .06em; }
.q-text { font-size: clamp(21px, 5.4vw, 25px); font-weight: 700; margin-top: 8px; }
.q-hint { margin-top: 9px; color: var(--ink-2); font-size: 14.5px; }
.options { margin-top: 24px; display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 12px 16px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); cursor: pointer; font-size: 16px; line-height: 1.5;
  transition: border-color .14s ease, background .14s ease, transform .1s ease;
}
.opt:active { transform: scale(.994); }
.opt.is-picked { border-color: var(--accent); background: var(--accent-weak); }
.opt-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--ink-3); background: transparent;
  display: grid; place-items: center; color: #fff;
}
.opt.is-picked .opt-mark { background: var(--accent); border-color: var(--accent); }
.opt-mark svg { width: 13px; height: 13px; opacity: 0; }
.opt.is-picked .opt-mark svg { opacity: 1; }

/* 「這題不適用」的選項：虛線邊、與上面五個選項拉開，讓它讀起來是另一種答案而不是第六個程度 */
.opt-skip { margin-top: 6px; border-style: dashed; color: var(--ink-2); font-size: 15px; min-height: 50px; }
.opt-skip.is-picked { border-style: solid; }

/* Slider 題 */
.slider-wrap { margin-top: 30px; }
.slider-value { text-align: center; font-size: 52px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; line-height: 1; }
.slider-hint { text-align: center; color: var(--ink-2); font-size: 14.5px; margin-top: 8px; min-height: 24px; }
input[type=range] { width: 100%; margin: 22px 0 6px; -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: var(--r-full); background: linear-gradient(90deg, var(--cyan) 0%, var(--pink) 100%); }
input[type=range]::-moz-range-track { height: 8px; border-radius: var(--r-full); background: linear-gradient(90deg, var(--cyan) 0%, var(--pink) 100%); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--accent);
  box-shadow: var(--sh-2); cursor: grab;
}
input[type=range]::-moz-range-thumb { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: var(--sh-2); cursor: grab; }
.slider-ends { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 13px; }
.slider-ends span { max-width: 46%; }
.slider-ends span:last-child { text-align: right; }

.q-nav { display: flex; gap: 10px; margin-top: 26px; align-items: center; }
.q-back { min-height: 44px; padding: 0 16px; background: none; border: none; color: var(--ink-3); cursor: pointer; font-size: 15px; }

/* ── Loading ──────────────────────────────── */
.loading { min-height: 78vh; display: grid; place-content: center; text-align: center; padding: 20px; }
.loading-art { width: 260px; margin: 0 auto; }
.loading-line { margin-top: 12px; font-size: 18px; font-weight: 600; min-height: 30px; }
.loading-dots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; }
.loading-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); animation: bob 1s infinite ease-in-out; }
.loading-dots i:nth-child(2) { animation-delay: .16s; }
.loading-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes bob { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-6px); } }

/* ── 結果 ─────────────────────────────────── */
.result { padding-bottom: 60px; }
.result-hero { text-align: center; padding: 26px 0 8px; }
.sm-scene { border-radius: var(--r-lg); }
.result-hero .sm-scene { max-width: 400px; margin: 0 auto; }
.result-target { color: var(--ink-2); font-size: 15px; }
.result-score { font-size: clamp(76px, 22vw, 104px); font-weight: 700; line-height: .95; color: var(--ink); text-shadow: 0 0 36px rgba(255, 226, 170, .4), 0 0 80px rgba(176, 122, 240, .35); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.result-score small { font-size: .3em; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.result-stage { display: inline-block; margin-top: 14px; padding: 7px 18px; border-radius: var(--r-full); background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; }
.result-body { margin-top: 10px; color: var(--ink-2); font-size: 16px; max-width: 30em; margin-inline: auto; }

.sec { margin-top: 44px; }
.sec-title { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--accent-text); margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }

.persona-head { display: flex; align-items: center; gap: 14px; }
.persona-head .persona-art { width: 72px; height: 72px; }
.persona-name { font-size: 23px; font-weight: 700; }
.persona-tagline { margin-top: 14px; font-size: 16.5px; font-weight: 600; }
.persona-body { margin-top: 10px; color: var(--ink-2); }
.persona-traits { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.trait { flex: 1 1 160px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; }
.trait span { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: .05em; }
.trait b { font-size: 14.5px; font-weight: 600; }

.venn { display: block; width: 100%; max-width: 340px; margin: 0 auto; }
.venn text { font-family: inherit; font-weight: 700; }
.circle-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cc { border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 16px; background: var(--surface); }
.cc-head { display: flex; align-items: baseline; gap: 9px; }
.cc-key { width: 9px; height: 9px; border-radius: 50%; align-self: center; flex: none; }
.cc-name { font-weight: 700; font-size: 16px; }
.cc-score { margin-left: auto; font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.cc-q { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.cc-body { color: var(--ink-2); font-size: 15px; margin-top: 9px; }
.cc-bar { height: 6px; background: var(--line); border-radius: var(--r-full); margin-top: 12px; overflow: hidden; }
.cc-bar i { display: block; height: 100%; border-radius: var(--r-full); }

.cc-factors { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px; display: flex; flex-direction: column; gap: 12px; }
.ccf-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--ink-3); }
.ccf ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ccf li { position: relative; padding-left: 17px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.ccf li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%;
}
.ccf-up li::before { background: var(--accent-bright); }
.ccf-down li::before { background: var(--line); border: 1px solid var(--ink-3); }

.evi-bar { display: flex; height: 40px; border-radius: var(--r-md); overflow: hidden; margin-bottom: 18px; }
.evi-bar div { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
.evi-person { background: #0E7D92; }
.evi-scene { background: #B8246A; }
.evi-cols { display: flex; gap: 14px; flex-wrap: wrap; }
.evi-col { flex: 1 1 180px; }
.evi-col h4 { font-size: 14px; margin: 0 0 9px; display: flex; align-items: center; gap: 7px; }
.evi-col h4 i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.evi-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.evi-col li { font-size: 14.5px; color: var(--ink-2); padding-left: 16px; position: relative; line-height: 1.5; }
.evi-col li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.evi-empty { font-size: 14.5px; color: var(--ink-3); }

.verdict { background: linear-gradient(165deg, #2A1F47 0%, #17141F 70%); border: 1px solid #3B2F63; color: var(--ink); border-radius: var(--r-lg); padding: 26px 24px; }
.verdict h3 { font-size: 19px; }
.verdict p { margin-top: 12px; color: #D5CCEC; font-size: 16px; }

.result-actions { margin-top: 40px; display: flex; flex-direction: column; gap: 10px; }

.share-card-preview { margin-top: 18px; }
.share-card-preview img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); display: block; }
.share-opt { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--ink-2); font-size: 14.5px; cursor: pointer; }
.share-opt input { width: 20px; height: 20px; accent-color: var(--accent); }
.share-tip { margin-top: 10px; font-size: 13px; color: var(--ink-3); }

/* ── 頁尾／法務頁 ─────────────────────────── */
.disclaimer { margin-top: 36px; font-size: 13px; color: var(--ink-3); line-height: 1.65; }
footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 26px 0 40px; }
body.is-focused footer, body.is-focused .brand, body.is-focused .promo-wrap,
body.is-focused .feedback-wrap { display: none; }

/* 戀愛體檢推薦 */
.promo-wrap { margin-top: 56px; }
.promo {
  display: flex; gap: 15px; align-items: flex-start;
  background: var(--cyan-weak); border: 1px solid rgba(60, 196, 218, .28);
  border-radius: var(--r-lg); padding: 20px;
}
.promo-mark {
  width: 42px; height: 42px; border-radius: var(--r-md); flex: none;
  background: var(--surface-2); color: var(--cyan-text); display: grid; place-items: center;
}
.promo-mark svg { width: 24px; height: 24px; }
.promo-body b { font-size: 16.5px; display: block; }
.promo-body p { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; line-height: 1.65; }
.promo-body a {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px;
  color: var(--cyan-text); font-size: 14.5px; font-weight: 600; text-decoration: none;
  border-bottom: 1.5px solid rgba(111, 217, 235, .5);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13.5px; color: var(--ink-3); }
footer a { color: var(--ink-2); text-decoration: none; }
footer .foot-name { font-weight: 700; color: var(--ink); }

/* 只設上下：寫成 padding: 40px 0 20px 會把 .wrap 的左右 20px 一起蓋掉，整頁就貼齊螢幕邊緣了 */
.doc { padding-top: 40px; padding-bottom: 20px; }
.doc h1 { font-size: 30px; }
.doc h2 { font-size: 19px; margin-top: 32px; }
.doc p, .doc li { color: var(--ink-2); font-size: 15.5px; margin-top: 10px; }
.doc ul { padding-left: 20px; }
.doc .updated { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; margin-top: 30px; }

/* ── 人格圖鑑頁 ───────────────────────────── */
.gallery { padding-top: 36px; padding-bottom: 10px; }
.gallery h1 { font-size: clamp(28px, 7vw, 36px); }
.gallery-lead { margin-top: 12px; color: var(--ink-2); }
.gallery-grid { display: grid; gap: 12px; margin-top: 28px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 19px; }
.pcard-head { display: flex; align-items: center; gap: 13px; }
.persona-art { width: 62px; height: 62px; flex: none; display: block; }
.pcard h2 { font-size: 18px; }
.pcard-tag { margin-top: 11px; font-weight: 600; font-size: 15.5px; }
.pcard-body { margin-top: 7px; color: var(--ink-2); font-size: 15px; }
.cta-strip { margin-top: 34px; text-align: center; padding: 30px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.cta-strip p { color: var(--ink-2); margin-bottom: 18px; }

/* ── 動畫 ─────────────────────────────────── */
/* 分享卡是靜態 PNG，所以動畫只動位置與亮度的「常駐」變化（最低不透明度 .55），
   絕不能用「大部分時間 opacity 0」的閃爍——rasterize 出來就整個不見了。 */
.sm-scene { width: 100%; height: auto; display: block; }
.sm-bob { animation: bob2 2.8s ease-in-out infinite; transform-origin: 200px 200px; }
@keyframes bob2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.sm-twinkle { animation: twinkle 2.2s ease-in-out infinite; }
.sm-twinkle:nth-child(2n) { animation-delay: .5s; }
.sm-twinkle:nth-child(3n) { animation-delay: 1.1s; }
@keyframes twinkle { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.sm-float { animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.sm-fall { animation: fall 4s ease-in-out infinite; }
.sm-fall:nth-child(2n) { animation-duration: 5.2s; animation-delay: .6s; }
@keyframes fall { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
.sm-stick { animation: wave 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 90%; }
@keyframes wave { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.sm-shake { animation: shake .5s linear infinite; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (min-width: 640px) {
  .hero { padding: 56px 0 64px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .result-actions { flex-direction: row; }
  .result-actions .btn { flex: 1; }
}

/* hover 一律關在這裡：手機點完選項會自動跳下一題，新按鈕渲染在同一個位置時
   會繼承黏住的 :hover，看起來像「上一題的答案還亮著」。
   觸控裝置不符合 hover: hover，就不會套到這些規則。:active 保留，那是按下去的即時回饋。 */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #9C4DE6; }
  .btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
  .chip:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-weak); }
  .feedback .chip.is-on:hover { border-color: var(--accent); }
  .opt:hover { border-color: var(--accent-bright); background: var(--accent-weak); }
  .q-back:hover { color: var(--ink); }
  footer a:hover { color: var(--accent-text); text-decoration: underline; }
  .promo-body a:hover { border-color: var(--cyan-text); }
  .back-link:hover { color: var(--accent-text); }
}

/* ── 全站分布 ─────────────────────────────── */
.dist-curve { display: block; width: 100%; height: auto; }
.dist-facts { display: flex; gap: 10px; margin-top: 14px; }
.dist-facts div { flex: 1; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 8px; text-align: center; }
.dist-facts span { display: block; font-size: 12px; color: var(--ink-3); }
.dist-facts b { font-size: 16px; }

.my-pr { margin-top: 16px; padding: 14px 16px; background: var(--accent-weak); border-radius: var(--r-md); }
.my-pr-score { font-size: 15px; color: var(--ink-2); }
.my-pr-score b { color: var(--accent-text); font-size: 19px; }
.my-pr-line { margin-top: 3px; font-size: 15px; }
.my-pr-line b { color: var(--accent-text); }

.rank { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.rank-row.is-me .rank-name { color: var(--accent-text); font-weight: 700; }
.rank-no { width: 18px; color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }
.rank-icon { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.rank-icon svg { width: 100%; height: 100%; }
.rank-row.is-me .rank-icon { color: var(--accent-text); }
.rank-name { width: 6.5em; flex: none; }
.rank-bar { flex: 1; height: 8px; background: var(--line); border-radius: var(--r-full); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--accent-bright); border-radius: var(--r-full); }
.rank-row.is-me .rank-bar i { background: var(--accent); }
.rank-pct { width: 2.6em; text-align: right; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }

/* 結果頁的 PR 區塊 */
.pr-card { text-align: center; }
.pr-big { font-size: 40px; font-weight: 700; color: var(--accent-text); line-height: 1.1; }
.pr-label { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.pr-verdict { margin-top: 8px; font-size: 15.5px; font-weight: 600; }
.pr-curve { margin-top: 14px; }
.pr-foot { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.pr-foot a { color: var(--ink-2); }

/* ── 頁面最底下的小回饋 ─────────────────── */
.feedback-wrap { margin-top: 44px; }
.feedback {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px 22px;
}
.feedback h2 { font-size: 19px; }
.feedback label {
  display: block; font-size: 14.5px; font-weight: 600;
  margin: 20px 0 8px;
}
.feedback input, .feedback textarea {
  width: 100%; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--canvas); color: var(--ink);
  font-family: inherit; font-size: 16px; line-height: 1.6;
  transition: border-color .16s ease, background .16s ease;
}
.feedback input { min-height: 52px; padding: 0 16px; }
.feedback textarea { resize: vertical; min-height: 104px; }
.feedback input::placeholder, .feedback textarea::placeholder { color: var(--ink-3); }
.feedback input:focus, .feedback textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}
.feedback .chips { margin-top: 0; }
.feedback label .req {
  margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--accent-text);
  background: var(--accent-weak); border-radius: var(--r-full); padding: 2px 8px;
}
.feedback .chip.is-on {
  border-color: var(--accent); background: var(--accent-weak);
  color: var(--accent-text); font-weight: 600;
}
/* 勾選那一行要蓋掉上面兩條，而且選擇器要夠重才蓋得掉：
   .feedback label 的 display:block 會把勾選框與文字拆成上下兩行，
   .feedback input 的 width:100% 會把勾選框撐成一個大方塊。 */

.fb-msg { margin-top: 12px; font-size: 14px; color: #FF8DBA; font-weight: 600; min-height: 1.1em; }
.feedback .btn { margin-top: 6px; }
.fb-done { text-align: center; padding: 26px 0; font-size: 18px; font-weight: 600; line-height: 1.8; }
.fb-done span { display: inline-block; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }

/* ── 追星小數據：荷包、時間、塌房抗性 ─────── */
.meters { display: grid; gap: 10px; }
.meter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.meter-head { display: flex; align-items: baseline; gap: 10px; }
.meter-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.meter-name { margin-left: auto; font-weight: 700; font-size: 17px; }
.meter-bar { height: 7px; background: var(--line); border-radius: var(--r-full); margin-top: 10px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: var(--r-full); }
.meter-line { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
@media (min-width: 640px) { .meters { grid-template-columns: repeat(3, 1fr); } }

/* ── 結果頁補充 ─────────────────────────── */
.result-tag { margin-top: 10px; color: var(--ink-2); font-size: 16px; max-width: 30em; margin-inline: auto; }
.rel-name { font-size: 20px; font-weight: 700; color: var(--accent-text); }

/* 深色底上的連結：瀏覽器預設的藍色在黑底上幾乎看不見 */
.doc a:not(.back-link), .gallery-lead a, .disclaimer a { color: var(--accent-text); text-underline-offset: 3px; }

/* ── 下半段的 Google 登入牆 ───────────────── */
.linklike {
  border: none; background: none; padding: 0; margin-left: 8px;
  color: var(--ink-2); font-size: inherit; font-family: inherit;
  text-decoration: underline; cursor: pointer;
  /* 觸控目標：純文字連結的行高只有 22-25px，行動裝置至少要 44px 才點得到 */
  min-height: 44px; min-width: 44px;
}
.signed-as {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  margin-top: 18px; color: var(--ink-3); font-size: 14px; text-align: center;
}
/* 上緣那道漸層是「下面還有東西」的視覺線索：直接切齊會像報告到此為止 */
.gate { position: relative; padding-top: 6px; }
.gate-fade {
  height: 92px; margin-bottom: -18px;
  background: linear-gradient(to bottom, rgba(9, 9, 14, 0), var(--canvas) 82%);
  position: relative; z-index: 1; pointer-events: none;
}
.gate-card {
  position: relative; z-index: 2;
  background: var(--surface); border: 1px solid #3B2F63;
  border-radius: var(--r-lg); padding: 24px 22px 8px;
  box-shadow: var(--sh-2), 0 0 60px -20px rgba(176, 122, 240, .35);
}
.gate-title { font-size: 19px; font-weight: 700; }
.gate-body { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; line-height: 1.75; }
.gate-error {
  margin-top: 10px; padding: 10px 14px; border-radius: var(--r-sm);
  background: rgba(255, 92, 157, .12); color: var(--pink-text);
  font-size: 14.5px; line-height: 1.6;
}
.gate-card .btn { margin-top: 16px; }
.gate-card .share-tip { margin-top: 12px; margin-bottom: 14px; line-height: 1.7; }
.gate-card .share-tip a { color: var(--accent-text); }
