/* 紫微斗數 產品網站 — 淺色 / 深色模式皆依系統設定 */

@font-face {
  /* 標題用: 全字庫正楷體 (只含網站標題用到的字), 見 README.md */
  font-family: "TW-Kai-Web";
  src: url("kai-web.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #f7f4fb;
  --surface: #ffffff;
  --surface-2: #efe9f7;
  --text: #221c2e;
  --muted: #625a70;
  --line: #ddd4ea;
  --accent: #6a3fb5;
  --accent-strong: #4f2a92;
  --accent-soft: #ece3fb;
  --cinnabar: #b23a2f;
  --night-1: #1a0f33;
  --night-2: #3a1a6b;
  --night-text: #f1eaff;
  --night-muted: #c9bce6;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(48, 22, 92, 0.12);
  --kai: "TW-Kai-Web", "BiauKai", "DFKai-SB", "標楷體", "Kaiti TC", "STKaiti", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120d1c;
    --surface: #1c1528;
    --surface-2: #241b34;
    --text: #eee8f7;
    --muted: #b1a7c2;
    --line: #362a4b;
    --accent: #b38cf2;
    --accent-strong: #c9aaf7;
    --accent-soft: #2c2142;
    --cinnabar: #ff7b6e;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-inline: 20px;
}

.kai { font-family: var(--kai); font-weight: normal; letter-spacing: 0.04em; }

/* ---------- 導覽列 ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(26, 15, 51, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--night-text);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 22px;
}

.brand img { width: 34px; height: 34px; border-radius: 8px; }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-size: 15px;
}

.nav-links a { color: var(--night-muted); text-decoration: none; }
.nav-links a:hover { color: #fff; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- 首頁主視覺 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--night-text);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(160, 110, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 90% 80%, rgba(110, 60, 200, 0.45), transparent 60%),
    linear-gradient(160deg, var(--night-1), var(--night-2));
}

.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .stars span { animation: none; }
  html { scroll-behavior: auto; }
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding-block: 72px 80px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 104px);
  line-height: 1.1;
  color: #f4ecff;
  text-shadow: 0 0 28px rgba(190, 150, 255, 0.55);
}

.hero .tagline {
  margin: 14px 0 0;
  font-size: clamp(20px, 2.6vw, 26px);
  color: #e3d6ff;
}

.hero .lead {
  margin: 22px 0 0;
  max-width: 34em;
  color: var(--night-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-store { background: #fff; color: #1a0f33; }
.btn-store svg { width: 20px; height: 20px; }

.btn-ghost {
  color: var(--night-text);
  border: 1px solid rgba(241, 234, 255, 0.45);
}

.platforms {
  margin-top: 18px;
  font-size: 14px;
  color: var(--night-muted);
}

.phone {
  justify-self: center;
  width: min(330px, 80vw);
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(145deg, #2b2240, #0d0915);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.phone img { border-radius: 37px; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-block: 56px 64px; }
  .hero .lead { margin-inline: auto; }
  .actions { justify-content: center; }
}

/* ---------- 區塊 ---------- */

section { padding-block: 84px; }
section + section { border-top: 1px solid var(--line); }

.section-head { max-width: 46em; margin-bottom: 40px; }

.section-head h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.25;
}

.section-head p { margin: 14px 0 0; color: var(--muted); }

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.intro {
  font-size: 19px;
  line-height: 2;
  max-width: 44em;
}

/* 特色 */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card .icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}

.card h3 { margin: 0 0 8px; font-size: 24px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }

/* 截圖 */

.gallery {
  display: flex;
  scroll-padding-inline: 4px;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 22px;
  scroll-snap-type: x proximity;
}

.gallery figure {
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: start;
}

.gallery img {
  height: 520px;
  width: auto;
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.gallery figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.gallery.wide img { height: 360px; border-radius: 14px; }

@media (max-width: 600px) {
  .gallery img { height: 440px; }
  .gallery.wide img { height: 220px; }
}

.subhead { margin: 34px 0 14px; font-size: 22px; }

/* 排盤方法 */

.method {
  display: grid;
  gap: 14px;
}

details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 22px;
}

summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-size: 19px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "＋";
  margin-left: auto;
  color: var(--accent);
  font-weight: 400;
}

details[open] summary::after { content: "－"; }

details ul { margin: 0 0 20px; padding-left: 1.2em; color: var(--muted); }
details li + li { margin-top: 6px; }
details p { margin: 0 0 20px; color: var(--muted); }

.legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  display: inline-block;
  padding: 0 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
}

.chip.natal { background: #800000; }
.chip.decade { background: #000080; }
.chip.year { background: #008000; }

/* 方案 */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.plan h3 { margin: 0 0 6px; font-size: 26px; }
.plan .tag { font-size: 14px; color: var(--accent); font-weight: 600; }
.plan ul { margin: 14px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 16px; }

.note { margin-top: 22px; font-size: 15px; color: var(--muted); }

/* 行動呼籲 */

.cta {
  text-align: center;
  color: var(--night-text);
  background: linear-gradient(160deg, var(--night-1), var(--night-2));
  border-top: none !important;
}

.cta h2 { margin: 0; font-size: clamp(34px, 5vw, 50px); }
.cta p { color: var(--night-muted); margin: 12px 0 0; }
.cta .actions { justify-content: center; }

/* 頁尾 */

footer {
  padding-block: 40px 48px;
  font-size: 14px;
  color: var(--muted);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  justify-content: space-between;
}

footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--muted); }
footer .fine { flex-basis: 100%; font-size: 13px; }

/* 圖片放大 */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 6, 18, 0.88);
  cursor: zoom-out;
}

.lightbox img {
  max-height: calc(100vh - 48px);
  max-width: 100%;
  border-radius: 18px;
}

/* 隱私權政策 */

.doc {
  max-width: 46em;
  padding-block: 56px 72px;
}

.doc h1 { margin: 0 0 6px; font-size: clamp(34px, 5vw, 46px); }
.doc .updated { margin: 0 0 32px; color: var(--muted); font-size: 15px; }
.doc h2 { margin: 36px 0 8px; font-size: 21px; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 1.2em; }
