/* ============================================================
   設計變數:顏色和間距集中在這裡
   要改整站配色,只改這一段就好,不用全檔搜尋替換
   ============================================================ */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f6f7f9;
  --text:      #16181d;
  --text-dim:  #5c626e;
  --border:    #e3e5ea;
  --accent:    #2563eb;
  --accent-fg: #ffffff;
  --radius:    12px;
  --maxw:      1000px;   /* 內容最大寬度,超過這個就置中留白 */
}

/* 使用者系統設成深色模式時,自動換一組變數。
   不用寫 JS,也不用做切換按鈕 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0f1115;
    --bg-alt:   #161a21;
    --text:     #e8eaee;
    --text-dim: #9aa1ae;
    --border:   #262b34;
    --accent:   #5b8cff;
  }
}

/* ============================================================
   基本重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;        /* 指令太長時自己橫向捲,不會把整頁撐爆 */
}
pre code { background: none; border: none; padding: 0; }

/* ============================================================
   導覽列
   ============================================================ */
.nav {
  position: sticky;        /* 捲動時黏在頂端 */
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.nav__links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav__links a { color: var(--text-dim); font-size: 0.92rem; }
.nav__links a:hover { color: var(--text); text-decoration: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}
.hero__badge {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-dim);
  font-size: 0.8rem;
}
.hero__title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 6vw, 3.25rem);   /* 隨螢幕寬度縮放,手機不會爆版 */
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.hero__sub {
  max-width: 34rem;
  margin: 0 auto 2rem;
  color: var(--text-dim);
  font-size: 1.05rem;
}
.hero__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   按鈕
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { opacity: 0.9; }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { background: var(--bg-alt); }
.btn--lg { padding: 0.95rem 2rem; font-size: 1.05rem; }

/* ============================================================
   區塊
   ============================================================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
/* --alt 是「換底色」的變體,讓相鄰區塊有視覺分隔 */
.section--alt {
  max-width: none;
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
/* 這裡要扣掉 3rem(左右內距各 1.5rem)。
   .section 的 max-width 是連內距一起算的(border-box),實際內容只有
   1000-48=952px;--alt 的子元素沒有內距,不扣的話會比別區寬 48px,
   標題就對不齊上下相鄰的區塊。 */
.section--alt > * {
  max-width: calc(var(--maxw) - 3rem);
  margin-inline: auto;
}

/* 這裡故意用 margin-block(只管上下)而不是 margin 簡寫。
   簡寫會連左右一起重設成 0,把上面 .section--alt > * 的
   margin-inline:auto 蓋掉,標題就會掉到滿版區塊的最左邊。 */
.section__title {
  margin-block: 0 2rem;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

/* ============================================================
   特色卡片
   auto-fit + minmax:寬度夠就並排,不夠就自己換行。
   不用寫任何 @media query
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.card {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card__icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.94rem; }

/* ============================================================
   下載區
   ============================================================ */
.download {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.download__meta { margin: 0.85rem 0 0; color: var(--text-dim); font-size: 0.88rem; }

.specs { margin: 0; display: grid; gap: 0.6rem; }
.specs > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.specs > div:last-child { border-bottom: none; padding-bottom: 0; }
.specs dt { color: var(--text-dim); font-size: 0.88rem; }
.specs dd { margin: 0; font-size: 0.88rem; text-align: right; word-break: break-all; }

.note { margin-top: 1.25rem; color: var(--text-dim); font-size: 0.88rem; }

/* ============================================================
   教學步驟
   ============================================================ */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 2rem 3.25rem;
  border-left: 2px solid var(--border);
  margin-left: 1rem;
}
.step:last-child { border-left-color: transparent; padding-bottom: 0; }
/* 用 CSS counter 自動編號,新增步驟不用手改數字 */
.step::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.9rem;
  font-weight: 700;
}
.step h3 { margin: 0.15rem 0 0.4rem; font-size: 1.05rem; }
.step p { margin: 0 0 0.75rem; color: var(--text-dim); }

/* ============================================================
   FAQ(瀏覽器原生摺疊)
   ============================================================ */
.faq {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq[open] summary { margin-bottom: 0.5rem; }
.faq p { margin: 0; color: var(--text-dim); }

/* ============================================================
   頁尾
   ============================================================ */
.footer {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
}
.footer p { margin: 0.2rem 0; }
.footer__small { font-size: 0.8rem; opacity: 0.75; }

/* 使用者開了「減少動態效果」就關掉動畫 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
