:root {
  --paper: #f7f3ea;
  --paper-deep: #efe8da;
  --card: #fffdf8;
  --ink: #1b2233;
  --muted: #646b7a;
  --line: rgba(27, 34, 51, 0.12);
  --blue: #2a5bd7;
  --blue-deep: #1b3fa0;
  --blue-pale: #e7eeff;
  --amber: #9a5f0e;
  --amber-pale: #fbf0dc;
  --green: #1d7c5f;
  --on-accent: #ffffff;
  --shadow: 0 24px 70px rgba(38, 40, 47, 0.12);
  --page: #f4efe4;
  --page-ink: #3a3326;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #14171e;
  --paper-deep: #1b1f28;
  --card: #1e2330;
  --ink: #e8eaf0;
  --muted: #9aa1b2;
  --line: rgba(232, 234, 240, 0.12);
  --blue: #7c9dff;
  --blue-deep: #a9bdff;
  --blue-pale: #232c47;
  --amber: #e5a650;
  --amber-pale: #33291a;
  --green: #5cc6a0;
  --on-accent: #10162a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --page: #262219;
  --page-ink: #d9cfbb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; }
h1, h2 { font-family: Georgia, "Noto Serif TC", "PMingLiU", serif; letter-spacing: -0.02em; }
code { font-family: Consolas, "SFMono-Regular", monospace; font-size: 0.9em; }
.wrap { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 50; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 16px; }

/* 頁首 */
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--blue); font-family: Georgia, "Noto Serif TC", serif; font-size: 18px; }
.nav-right { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--blue); }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.theme-toggle svg { width: 16px; height: 16px; }

/* 首屏 */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 48px; padding: 72px 0 64px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--amber-pale); color: var(--amber); font-size: 13px; font-weight: 700; margin-bottom: 20px; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero h1 { font-size: clamp(38px, 5.4vw, 60px); margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--blue); }
.lead { font-size: 18px; color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 8px; font-weight: 700; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--blue); color: var(--on-accent); box-shadow: 0 10px 26px rgba(42, 91, 215, 0.28); }
.btn-primary:hover { background: var(--blue-deep); color: var(--on-accent); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: 14px; }
.facts li::before { content: "·"; margin-right: 6px; color: var(--green); font-weight: 900; }

/* 手機示意：閱讀頁與段評 */
.phone { justify-self: center; width: min(300px, 100%); aspect-ratio: 9 / 18.5; padding: 12px; border-radius: 40px; background: #1b2233; box-shadow: var(--shadow); }
.screen { height: 100%; border-radius: 30px; background: var(--page); color: var(--page-ink); padding: 26px 20px 18px; display: flex; flex-direction: column; overflow: hidden; }
.screen-top { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.6; margin-bottom: 18px; }
.screen h3 { font-family: Georgia, "Noto Serif TC", "PMingLiU", serif; font-size: 17px; margin-bottom: 14px; }
.screen p { font-family: Georgia, "Noto Serif TC", "PMingLiU", serif; font-size: 13px; line-height: 1.95; margin-bottom: 10px; text-indent: 2em; }
.screen .marked { position: relative; background: rgba(42, 91, 215, 0.1); border-radius: 4px; }
.bubble { display: inline-grid; place-items: center; min-width: 20px; height: 17px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--blue); color: #fff; font-family: "Segoe UI", sans-serif; font-size: 10px; font-weight: 700; text-indent: 0; vertical-align: 1px; }
.comment { margin-top: auto; padding: 12px; border-radius: 14px; background: var(--card); color: var(--ink); font-size: 12px; line-height: 1.6; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.comment b { color: var(--blue); }
.comment span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

/* 區塊 */
section { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 12px; }
.section-head p { color: var(--muted); margin-bottom: 0; }
.alt { background: var(--paper-deep); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--muted); margin-bottom: 0; font-size: 15px; }
.icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-pale); color: var(--blue); margin-bottom: 16px; }
.icon svg { width: 20px; height: 20px; }

/* 版本比較與下載 */
.versions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.version { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.version.beta { border-color: var(--amber); }
.tag { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--blue-pale); color: var(--blue); margin-bottom: 12px; }
.beta .tag { background: var(--amber-pale); color: var(--amber); }
.version h3 { font-size: 24px; margin-bottom: 8px; }
.version > p { color: var(--muted); }
.version ul { padding-left: 1.2em; margin: 0 0 24px; }
.version li { margin-bottom: 4px; }
.file { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.file .btn { width: 100%; margin-bottom: 14px; }
.beta .btn-primary { background: var(--amber); box-shadow: 0 10px 26px rgba(154, 95, 14, 0.25); }
.beta .btn-primary:hover { background: var(--amber); filter: brightness(0.9); }
.meta { font-size: 13px; color: var(--muted); line-height: 1.6; }
.meta code { display: block; margin-top: 4px; word-break: break-all; color: var(--ink); font-size: 12px; }
.note { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* 安裝步驟 */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0; margin: 0 0 24px; list-style: none; }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; font-size: 15px; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: Georgia, serif; font-size: 22px; color: var(--blue); margin-bottom: 8px; }
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 700; }
details p, details ul { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* 文件頁（隱私權政策） */
.doc { padding: 56px 0 72px; }
.doc article { max-width: 760px; }
.doc h1 { font-size: clamp(32px, 4.4vw, 44px); margin-bottom: 12px; }
.doc h2 { font-size: 22px; margin: 36px 0 10px; }
.doc p, .doc li { color: var(--ink); }
.doc .muted { color: var(--muted); }

/* 頁尾 */
footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot nav { display: flex; gap: 18px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--blue); }

/* 手機與平板：區塊往下折行，按鈕滿版 */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 48px 0; }
  .grid, .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .grid, .steps, .versions { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
  section { padding: 48px 0; }
  .foot { flex-direction: column; }
}
