/*
 * Veilpin 官網樣式（ADR-0020 設計系統）：深色為主、淺色跟隨系統，青綠主色。
 * 只用系統字型、不載入任何外部資源（CSP default-src 'self'）；共用於官網各頁與 /s/device 確認頁。
 * 不負責：插圖內容（/site/img/*.svg 自帶底色，深淺色皆可讀）。
 */
:root {
  color-scheme: dark light;
  --bg: #0b1220;
  --surface: #0f172a;
  --surface-2: #15203a;
  --line: rgba(148, 163, 184, 0.2);
  --text: #e5e7eb;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-line: rgba(45, 212, 191, 0.4);
  --on-accent: #042f2e;
  --btn-bg: #2dd4bf;
  --btn-bg-hover: #5eead4;
  --header-bg: rgba(11, 18, 32, 0.82);
  --glow: rgba(45, 212, 191, 0.14);
  --warn-bg: rgba(251, 191, 36, 0.1);
  --warn-line: rgba(251, 191, 36, 0.45);
  --warn-text: #fde68a;
  --radius: 24px;
  --radius-sm: 16px;
  --gutter: 16px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --line: #e2e8f0;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #475569;
    --accent: #0f766e;
    --accent-soft: #ccfbf1;
    --accent-line: rgba(15, 118, 110, 0.35);
    --on-accent: #ffffff;
    --btn-bg: #0f766e;
    --btn-bg-hover: #115e59;
    --header-bg: rgba(248, 250, 252, 0.88);
    --glow: rgba(20, 184, 166, 0.12);
    --warn-bg: #fffbeb;
    --warn-line: #f59e0b;
    --warn-text: #78350f;
  }
}

/* ---- 基礎 ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 600px at 85% -10%, var(--glow), transparent 60%), var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1080px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 20; padding: 8px 14px; border-radius: 999px; background: var(--btn-bg); color: var(--on-accent); font-weight: 600; }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main { flex: 1; }

/* ---- 頁首與頁尾 ---- */
header.top { position: sticky; top: 0; z-index: 10; background: var(--header-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: 0.02em; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
nav.menu { display: flex; gap: 4px; font-size: 0.95rem; }
nav.menu a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px; }
nav.menu a:hover { color: var(--text); background: var(--surface-2); }
nav.menu a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* ---- 按鈕與標籤 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  color: var(--on-accent); background: var(--btn-bg);
}
.btn:hover { background: var(--btn-bg-hover); }
.btn.ghost { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent-line); }
.btn[aria-disabled="true"] { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); cursor: default; }
button.btn { border: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.feat-ico { display: block; width: 48px; height: 48px; margin-bottom: 12px; }
.use-img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); margin-bottom: 14px; }

/* ---- 區塊 ---- */
section { padding: 56px 0; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.04em; }
section h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.3; margin: 0 0 10px; }
.section-lead { color: var(--muted); max-width: 680px; margin: 0 0 28px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; line-height: 1.4; }
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.card ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.95rem; }
.card li + li { margin-top: 4px; }
.card .badge { display: inline-block; font-size: 0.78rem; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; padding: 2px 10px; margin-bottom: 10px; }

/* Hero */
.hero { display: grid; gap: 32px; align-items: center; padding: 64px 0 40px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.18; margin: 14px 0 14px; letter-spacing: -0.01em; }
.hero .tag { color: var(--accent); font-weight: 600; margin: 14px 0 0; }
.hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 600px; margin: 0 0 28px; }
.hero figure { margin: 0; justify-self: center; width: min(320px, 80vw); }
.hero figure img { display: block; width: 100%; }

/* 畫面示意（手機） */
.screens { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); margin-top: 32px; }
.screens figure { margin: 0; text-align: center; }
.screens img { display: block; width: min(260px, 100%); margin-inline: auto; }
figcaption { margin-top: 10px; color: var(--muted); font-size: 0.9rem; }

/* 隱私：資料在哪裡 */
.diagram { margin: 0 0 28px; }
.diagram img { display: block; width: 100%; border-radius: var(--radius); }
.facts .card { border-top: 4px solid var(--line); }
.facts .card.e2ee { border-top-color: var(--accent); }
.facts .card.server { border-top-color: var(--warn-line); }

/* FAQ */
.faq { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq details + details { margin-top: 10px; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding: 12px 18px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--text-2); }

/* 下載 CTA 帶 */
.cta { text-align: center; background: linear-gradient(135deg, var(--accent-soft), transparent), var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 40px 22px; }
.cta p { color: var(--muted); max-width: 560px; margin: 0 auto 22px; }
.cta .actions { justify-content: center; }

/* 下載頁步驟 */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.steps h3 { margin: 0 0 2px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* 文件頁（隱私權、條款、下載、404、/s/device） */
.doc { max-width: 780px; padding: 48px 0 64px; }
.doc h1 { font-size: clamp(1.7rem, 4.5vw, 2.2rem); line-height: 1.3; margin: 0 0 6px; }
.doc .meta { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; }
.doc h2 { font-size: 1.25rem; margin: 36px 0 12px; }
.doc p, .doc li { color: var(--text-2); }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 12px 0; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 120px; }
.doc th { color: var(--muted); font-weight: 600; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; color: var(--text-2); font-size: 0.95rem; }
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.lost { width: 160px; margin: 0 0 20px; }
.download-cta { margin: 20px 0 8px; }

/* ---- 響應式 ---- */
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.25fr 1fr; padding: 88px 0 56px; }
  section { padding: 72px 0; }
}
@media (max-width: 640px) {
  header.top .wrap { height: 56px; }
  nav.menu { font-size: 0.9rem; gap: 0; }
  nav.menu a { padding: 6px 8px; }
  .hero { padding: 40px 0 24px; }
  .hero .actions .btn { flex: 1 1 100%; }
  section { padding: 44px 0; }
}
@media (max-width: 380px) {
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
