/* 數獨人生官網（index.html / index-en.html 共用）。圖片由 tools/site_images.py 產生。
   /assets/* 在 _headers 是 immutable 一年：改這檔要同步改 HTML 裡的 ?v= */
:root {
  --bg: #0b1428;
  --bg-2: #101c38;
  --card: #15233f;
  --line: rgba(255, 255, 255, .09);
  --text: #f4f6fb;
  --muted: #a9b3c9;
  --amber: #ffd54f;
  --orange: #ff7a2f;
  --blue: #3b8bff;
  --green: #34c46a;
  --red: #ff5a3c;
  --violet: #c86bff;
  --radius: 22px;
  --wrap: 1140px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC",
        "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
:lang(en) body, body:lang(en) { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ── 導覽列 ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 20, 40, .72);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; background: #fff; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 15px; padding: 8px 10px; border-radius: 10px; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.nav-links .lang { border: 1px solid var(--line); }
.nav-links .cta-mini {
  color: #1a1200; background: var(--amber); font-weight: 700; padding: 8px 14px;
}
.nav-links .cta-mini:hover { background: #ffe082; color: #1a1200; }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ── 迷霧背景 ── */
.fog { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.fog i {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.fog i:nth-child(1) { width: 520px; height: 420px; left: -120px; top: -80px; background: rgba(59,139,255,.35); }
.fog i:nth-child(2) { width: 560px; height: 460px; right: -160px; top: -60px; background: rgba(255,179,0,.28); animation-duration: 26s; }
.fog i:nth-child(3) { width: 620px; height: 420px; left: 30%; bottom: -220px; background: rgba(200,107,255,.24); animation-duration: 30s; }
.fog i:nth-child(4) { width: 380px; height: 300px; left: 45%; top: 18%; background: rgba(255,255,255,.07); animation-duration: 18s; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(60px,40px,0) scale(1.12); } }

/* ── Hero ── */
/* overflow:hidden：旋轉的手機與光暈會超出右緣，手機上會把版面撐寬（375 → 392） */
.hero { position: relative; padding: 72px 0 40px; isolation: isolate; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  color: var(--amber); background: rgba(255,213,79,.1); border: 1px solid rgba(255,213,79,.28);
  padding: 6px 12px; border-radius: 999px;
}
.eyebrow b { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); font-weight: 900; margin: 20px 0 18px; }
.hero h1 .glow {
  background: linear-gradient(92deg, #ffe082 0%, #ff9d3c 45%, #ff5a8a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 34em; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 14px;
  padding: 10px 20px 10px 16px; min-width: 190px; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.store:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.6); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.store svg { width: 28px; height: 28px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: 11px; opacity: .85; letter-spacing: .02em; }
.store strong { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.trust li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 6px; }

.stage { position: relative; height: 600px; }
.phone {
  position: absolute; width: 268px; border-radius: 40px; overflow: hidden; background: #000;
  box-shadow: 0 40px 80px rgba(0,0,0,.55), 0 0 0 9px #1b2746, 0 0 0 10px rgba(255,255,255,.16);
}
.phone img { width: 100%; height: auto; }
.stage .p1 { left: 2%; top: 70px; transform: rotate(-8deg); z-index: 1; animation: float 7s ease-in-out infinite; }
.stage .p2 { left: 31%; top: 0; z-index: 3; animation: float 6s ease-in-out -2s infinite; }
.stage .p3 { right: 0; top: 90px; transform: rotate(8deg); z-index: 2; animation: float 8s ease-in-out -4s infinite; }
@keyframes float { 50% { translate: 0 -12px; } }
.burst {
  position: absolute; z-index: 4; font-weight: 900; font-style: italic; letter-spacing: .02em;
  padding: 8px 16px; border-radius: 14px; color: #fff; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: pop 3.6s ease-in-out infinite;
}
.burst.b1 { left: -2%; top: 40px; background: linear-gradient(135deg,#3b8bff,#1f5fd6); }
.burst.b2 { right: 4%; top: 30px; background: linear-gradient(135deg,#ff9d3c,#ff4d2e); animation-delay: -1.2s; }
.burst.b3 { left: 28%; bottom: 40px; background: linear-gradient(135deg,#c86bff,#7a3cff); animation-delay: -2.4s; }
@keyframes pop { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.08) rotate(2deg); } }

/* ── 一般區塊 ── */
section { position: relative; }
.block { padding: 96px 0; }
.block.alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.kicker { color: var(--amber); font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.title { font-size: clamp(30px, 4.2vw, 48px); font-weight: 900; margin: 10px 0 16px; }
.sub { color: var(--muted); font-size: 18px; max-width: 40em; }
.center { text-align: center; }
.center .sub { margin-inline: auto; }

/* 定義區（AEO：一段可被直接引用的回答） */
.answer {
  margin-top: 36px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: stretch;
}
.answer .def {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px;
  font-size: 18px; color: #dbe2f0;
}
.answer .def strong { color: #fff; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px;
  display: flex; flex-direction: column; justify-content: center;
}
.stat b { font-size: 34px; font-weight: 900; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; margin-top: 4px; }
.stat:nth-child(1) b { color: var(--blue); }
.stat:nth-child(2) b { color: #cfd8ea; }
.stat:nth-child(3) b { color: var(--orange); }
.stat:nth-child(4) b { color: var(--amber); }

/* ── 特色展示 ── */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 56px 0; }
.feature + .feature { border-top: 1px solid var(--line); }
.feature:nth-child(even) .shot { order: -1; }
.feature .num { font-size: 15px; font-weight: 800; color: var(--accent, var(--amber)); letter-spacing: .1em; }
.feature h3 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 900; margin: 8px 0 12px; }
.feature .tag { color: var(--accent, var(--amber)); font-size: 19px; font-weight: 600; margin-bottom: 14px; }
.feature p.desc { color: var(--muted); }
.feature ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.feature li { padding-left: 26px; position: relative; color: #d3dbea; }
.feature li::before {
  content: ""; position: absolute; left: 4px; top: .62em; width: 10px; height: 10px; border-radius: 3px;
  background: var(--accent, var(--amber)); transform: rotate(45deg);
}
.feature .shot { display: flex; justify-content: center; position: relative; }
.feature .shot::before {
  content: ""; position: absolute; width: 74%; aspect-ratio: 1; border-radius: 50%;
  background: var(--accent, var(--amber)); opacity: .2; filter: blur(70px); top: 18%;
}
.feature .phone { position: relative; width: min(300px, 78vw); }
.f-combo { --accent: var(--blue); }
.f-fog { --accent: #9fb4d6; }
.f-fever { --accent: var(--orange); }
.f-perfect { --accent: var(--violet); }
.f-result { --accent: var(--amber); }

/* ── 怎麼玩 ── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 44px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px;
  counter-increment: s; position: relative;
}
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  font-weight: 900; color: #1a1200; background: var(--amber); margin-bottom: 16px;
}
.steps h3 { font-size: 20px; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 15.5px; }

/* 難度階梯 */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.level { border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); background: var(--card); position: relative; overflow: hidden; }
.level::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--c); }
.level .name { display: inline-block; font-weight: 800; color: var(--c); font-size: 15px; letter-spacing: .06em; }
.level h3 { font-size: 24px; margin: 8px 0 8px; }
.level p { color: var(--muted); font-size: 15.5px; }
.lv1 { --c: var(--blue); } .lv2 { --c: var(--green); } .lv3 { --c: var(--red); }
.rules { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.rules span { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14.5px; color: #d3dbea; }

/* 評價 */
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.grade { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-align: center; }
.grade b {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  border: 4px solid var(--g); color: var(--g); font-size: 32px; font-weight: 900; font-style: italic; transform: rotate(-10deg);
}
.grade p { color: var(--muted); font-size: 15px; margin-top: 12px; }
.gS { --g: #ffb300; } .gA { --g: #e53935; } .gB { --g: #1e88e5; } .gC { --g: #8a94a6; }

/* ── FAQ ── */
.faq { max-width: 860px; margin: 40px auto 0; display: grid; gap: 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 0 24px; }
.faq details[open] { border-color: rgba(255,213,79,.35); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 32px 20px 0; font-weight: 700; font-size: 18px; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%; font-size: 26px; font-weight: 400; color: var(--amber); transition: rotate .2s;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { color: #c9d2e3; padding: 0 0 22px; }

/* ── 收尾 CTA ── */
.final { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: 110px 0; }
.final .wrap { position: relative; z-index: 1; }
.final .stores { justify-content: center; }
.final .icon { width: 96px; height: 96px; border-radius: 24px; background: #fff; margin: 0 auto 24px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }

/* ── 頁尾 ── */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); text-decoration: underline; }

/* 語言建議列（不自動轉址：自動轉址會讓 Googlebot（en-US）看不到中文頁） */
.lang-hint {
  display: none; background: #1d2b4f; border-bottom: 1px solid var(--line); font-size: 14.5px; color: #dbe2f0;
}
.lang-hint.show { display: block; }
.lang-hint .wrap { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 10px 0; flex-wrap: wrap; }
.lang-hint a { color: var(--amber); font-weight: 700; }
.lang-hint button { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 6px; }

/* 進場動畫：預設可見，只有 site.js 判定「在第一屏以下」的元素才加 .pending 藏起來。
   反過來寫（預設隱藏、JS 揭露）時，沒跑 IntersectionObserver 的爬蟲／截圖工具會看到整頁空白 */
.reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal.pending { opacity: 0; transform: translateY(24px); }

/* ── 響應式 ── */
@media (max-width: 980px) {
  .hero { padding-top: 48px; }
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .lede { margin-inline: auto; }
  .hero .stores, .hero .trust { justify-content: center; }
  .stage { height: 520px; max-width: 560px; width: 100%; margin: 0 auto; }
  .phone { width: 230px; }
  .answer { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 36px; text-align: center; padding: 48px 0; }
  .feature:nth-child(even) .shot { order: 0; }
  .feature ul { justify-items: center; }
  .feature li { text-align: left; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .levels { grid-template-columns: 1fr; }
  .grades { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .block { padding: 68px 0; }
  .stage { height: 420px; }
  .phone { width: 178px; border-radius: 30px; box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 0 0 6px #1b2746, 0 0 0 7px rgba(255,255,255,.16); }
  .stage .p1 { left: -2%; top: 60px; }
  .stage .p2 { left: 50%; margin-left: -89px; }
  .stage .p3 { right: -2%; top: 70px; }
  .burst { font-size: 14px; padding: 6px 12px; }
  .store { min-width: 0; flex: 1 1 160px; justify-content: center; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .answer .def { padding: 24px; font-size: 17px; }
  .feature .phone { width: min(260px, 72vw); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* 評價區的 S 印章裝飾（結算截圖下半是空白，用印章補畫面；在截圖外，不冒充 UI） */
.stamp {
  position: absolute; z-index: 2; left: calc(50% + 70px); bottom: 14%;
  display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%;
  border: 7px solid #ffb300; color: #e68a00; background: radial-gradient(circle at 35% 30%, #fffbe8, #ffe48a 70%);
  font-size: 92px; font-weight: 900; font-style: italic; line-height: 1;
  transform: rotate(-14deg); box-shadow: 0 0 0 3px rgba(255,179,0,.25), 0 20px 50px rgba(0,0,0,.45);
  animation: stamp 4s ease-in-out infinite;
}
@keyframes stamp { 50% { transform: rotate(-8deg) scale(1.05); } }
@media (max-width: 560px) { .stamp { width: 104px; height: 104px; font-size: 62px; border-width: 5px; left: calc(50% + 30px); } }
