/* ============================================================
   排桌入座｜行銷頁與內容頁的樣式（/assets/site.css）

   用在：首頁、定價、教學、隱私政策、服務條款、404、部落格。
   變數在 tokens.css，頂欄頁尾在 chrome.css，首頁自己的區塊在 home.css。
   規範：docs/DESIGN.md。黃色＝「這裡」；黃色不當字色；一屏一個黃色焦點（頁尾整塊黃是行銷頁的延伸，待 Jacob 點頭）。
   ============================================================ */

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--yellow); color: var(--ink); }
h1, h2, h3, p, figure, blockquote { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 2px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font-num); font-stretch: 125%; font-weight: 800; font-variant-numeric: tabular-nums; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html { scrollbar-color: var(--ink-4) var(--fill); }
textarea, input { caret-color: var(--ink); }

/* 螢光筆：黃色底刷在字的下半部 */
.hl { position: relative; z-index: 0; white-space: nowrap; }
.hl::before {
  content: ""; position: absolute; left: -.08em; right: -.08em; bottom: .02em; height: .56em; z-index: -1;
  background: var(--yellow); clip-path: polygon(1.5% 14%, 100% 0, 98.5% 86%, 0 100%); transform: rotate(-1.5deg);
}
.sh-name .hl::before { height: auto; top: .55em; bottom: .02em; }

/* 版心：一組外框，全站同一個 */
.wrap { max-width: 90rem; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .55rem 1.4rem; border-radius: var(--r-pill); cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 1rem; font-weight: 700; white-space: nowrap; text-decoration: none;
  transition: background .12s, color .12s, transform .12s;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .i { transition: transform .2s; }
.btn:hover .i { transform: translateX(3px); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #2b2b28; }
.btn-go { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-go:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); color: var(--ink); }
.btn-big { min-height: 56px; padding: .65rem 1.75rem; font-size: 1.08rem; }

/* ---------- 內容頁：定價、教學、隱私、條款、部落格 ---------- */
.doc { max-width: 90rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem) clamp(5rem, 10vw, 9rem); }
.crumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .9rem; color: var(--ink-3); margin-bottom: 1.5rem; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--ink); }
.doc-head { max-width: 52rem; }
.doc-head h1 {
  font-size: clamp(2.4rem, 1.4rem + 4vw, 5rem); font-weight: 900; line-height: 1.08; letter-spacing: -.035em; text-wrap: balance;
}
.doc-lede { margin-top: 1.25rem; font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); line-height: 1.65; max-width: 40rem; }
.draft-note {
  display: flex; gap: .75rem; align-items: flex-start; max-width: 52rem; margin-top: 2rem; padding: 1rem 1.25rem;
  border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-weight: 700;
}
.draft-note svg { width: 22px; height: 22px; flex: none; margin-top: .1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.draft-note span { color: var(--ink); font-weight: 400; }

/* 長文：條款、隱私、文章 */
.prose { max-width: 42rem; font-size: 1.0625rem; line-height: 1.8; }
.prose h2 { margin: 3rem 0 .75rem; font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem); font-weight: 900; line-height: 1.3; letter-spacing: -.02em; }
.prose h3 { margin: 2rem 0 .5rem; font-size: 1.2rem; font-weight: 900; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--ink-3); font-family: var(--font-num); font-weight: 800; }
.prose strong { font-weight: 900; }
.prose a { font-weight: 700; }
.prose code { font-size: .95em; padding: .1em .35em; border-radius: 6px; background: var(--fill); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.5rem; font-size: 1rem; }
.prose th, .prose td { padding: .65rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 900; background: var(--fill); }
.prose .note { padding: 1rem 1.25rem; border-radius: var(--r-md); background: var(--fill); }
.prose .pending { color: var(--warn); font-weight: 700; }

/* 有目錄的長文：左邊目錄、右邊內文 */
.doc-body { display: grid; gap: 2.5rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 64rem) { .doc-body { grid-template-columns: 15rem minmax(0, 42rem); gap: 5rem; } }
.toc { align-self: start; }
@media (min-width: 64rem) { .toc { position: sticky; top: 100px; } }
.toc h2 { font-size: 1rem; font-weight: 900; margin-bottom: .6rem; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .15rem; }
.toc a { display: block; padding: .3rem 0; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.doc-body .prose > h2:first-child { margin-top: 0; }

/* ---------- 部落格 ---------- */
.post .doc-head, .post .prose { margin-left: auto; margin-right: auto; }
.post .doc-head { max-width: 42rem; }
.post .doc-head h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); }
.post-meta { margin-top: 1rem; font-size: .9rem; color: var(--ink-3); }
.post .crumb { max-width: 42rem; margin-left: auto; margin-right: auto; }
.post-cover { max-width: 56rem; margin: clamp(2rem, 5vw, 3.5rem) auto; border-radius: var(--r-lg); overflow: hidden; background: var(--fill); }
.post-cover img, .post-cover svg { width: 100%; height: auto; }
.post-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem;
  max-width: 42rem; margin: 3.5rem auto 0; padding: 1.75rem; border-radius: var(--r-lg); background: var(--ink); color: #fff;
}
.post-cta p { flex: 1 1 18rem; color: rgba(255, 255, 255, .86); }
.post-cta strong { color: #fff; }
.post-next { max-width: 42rem; margin: 4rem auto 0; }
.post-next h2 { font-size: 1.3rem; font-weight: 900; margin-bottom: 1rem; }
.post-next ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.post-next a { display: grid; gap: .25rem; padding: 1.25rem 1.4rem; border-radius: var(--r-lg); background: var(--surface); text-decoration: none; transition: background .12s; }
.post-next a:hover { background: var(--yellow-soft); }
.post-next b { font-size: 1.1rem; font-weight: 900; }
.post-next span { color: var(--ink-2); }

.blog-lead {
  display: grid; gap: 1.5rem; margin-top: clamp(2.5rem, 5vw, 4rem); text-decoration: none;
  border-radius: var(--r-lg); background: var(--surface); padding: clamp(1rem, 2vw, 1.5rem); transition: background .15s;
}
@media (min-width: 56rem) { .blog-lead { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 3rem; } }
.blog-lead:hover, .blog-list a:hover { background: var(--yellow-soft); }
.blog-lead-art, .blog-art { display: block; border-radius: var(--r-md); overflow: hidden; background: var(--fill); }
.blog-lead-art img, .blog-art img { width: 100%; height: auto; }
.blog-lead-t { display: grid; gap: .6rem; padding-right: 1rem; }
.blog-lead-t b { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); font-weight: 900; line-height: 1.2; letter-spacing: -.02em; }
.blog-lead-t > span:not(.post-meta) { font-size: 1.08rem; color: var(--ink-2); }
.blog-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .blog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.blog-list a { display: grid; gap: .5rem; height: 100%; padding: clamp(1rem, 2vw, 1.5rem); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; transition: background .15s; }
.blog-list b { margin-top: .5rem; font-size: 1.35rem; font-weight: 900; line-height: 1.3; }
.blog-list a > span:not(.blog-art):not(.post-meta) { color: var(--ink-2); }
.blog-list .post-meta { margin-top: auto; }

/* ---------- 方案卡（首頁與定價頁共用） ---------- */
.price-grid { display: grid; gap: clamp(.75rem, 1.4vw, 1.25rem); }
@media (min-width: 52rem) { .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan { display: flex; flex-direction: column; gap: 1.25rem; padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: var(--r-lg); background: var(--surface); }
.plan h3, .plan .plan-h { font-size: 1.5rem; font-weight: 900; }
.plan-price { display: grid; gap: .25rem; }
.plan-price .num { font-size: clamp(3rem, 2rem + 3vw, 4.75rem); line-height: 1; letter-spacing: -.02em; }
.plan-price span:last-child { font-weight: 700; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.plan li { position: relative; padding-left: 1.75rem; line-height: 1.55; }
.plan li::before {
  content: ""; position: absolute; left: .1rem; top: .38em; width: .9rem; height: .5rem;
  border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg);
}
.plan .btn { align-self: flex-start; margin-top: auto; }
.plan-paid { background: var(--ink); color: #fff; }
.plan-soon { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; color: rgba(255, 255, 255, .86); }
.plan-soon b { padding: .2rem .8rem; border-radius: var(--r-pill); background: #fff; color: var(--ink); }

/* ---------- 定價頁 ---------- */
.doc-hero { display: grid; gap: 1.5rem 3rem; align-items: center; }
@media (min-width: 56rem) { .doc-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); } }
.doc-art { display: block; width: min(22rem, 70%); justify-self: center; }
.doc-art img, img.doc-art { width: 100%; height: auto; }
img.doc-art { width: min(22rem, 70%); }
.pr-grid { margin-top: clamp(2.5rem, 5vw, 4rem); }
.cmp-wrap { margin-top: clamp(4rem, 8vw, 7rem); }
.cmp-wrap h2, .doc-sec h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 900; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 1.25rem; }
.cmp-scroll { overflow-x: auto; border-radius: var(--r-lg); background: var(--surface); }
.cmp { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: 1rem; }
.cmp th, .cmp td { padding: .9rem 1.1rem; text-align: left; vertical-align: top; }
.cmp thead th { font-size: 1.05rem; font-weight: 900; background: var(--ink); color: #fff; }
.cmp thead th:first-child { border-top-left-radius: var(--r-lg); }
.cmp thead th:last-child { border-top-right-radius: var(--r-lg); }
.cmp tbody tr + tr td, .cmp tbody tr + tr th { box-shadow: inset 0 1px 0 var(--line); }
.cmp tbody th { font-weight: 700; width: 40%; }
.cmp .yes { font-weight: 700; }
.cmp .yes::before { content: ""; display: inline-block; width: .8rem; height: .45rem; margin: 0 .55rem .2rem 0; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg); }
.cmp .no { color: var(--ink-3); }
.doc-sec { margin-top: clamp(4rem, 8vw, 7rem); display: grid; gap: 1.5rem 4rem; }
@media (min-width: 64rem) { .doc-sec { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
.doc-sec .prose { max-width: 44rem; }
.cards-2 { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.box { padding: clamp(1.25rem, 2.5vw, 2rem); border-radius: var(--r-lg); background: var(--surface); }
.box h3 { font-size: 1.3rem; font-weight: 900; margin-bottom: .5rem; }
.box p + p { margin-top: .6rem; }
.box-ink { background: var(--ink); color: #fff; }
.box-ink a { color: #fff; }

/* ---------- 教學頁：四步，每步一張真的畫面 ---------- */
.gsteps { margin: clamp(3rem, 6vw, 5rem) 0 0; padding: 0; list-style: none; display: grid; gap: clamp(4rem, 8vw, 7rem); counter-reset: g; }
.gstep { display: grid; gap: 1.75rem; align-items: center; }
@media (min-width: 64rem) {
  .gstep { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; }
  .gstep:nth-child(even) .gstep-copy { order: 2; }
}
.gstep-k { display: inline-grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: 1.35rem; }
.gstep h2 { margin-top: 1rem; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 900; line-height: 1.15; letter-spacing: -.03em; }
.gstep-copy > p { margin-top: .9rem; font-size: 1.08rem; max-width: 34rem; }
.gstep-copy ul { margin: 1.25rem 0 0; padding: 0; list-style: none; display: grid; gap: .55rem; max-width: 34rem; }
.gstep-copy li { position: relative; padding-left: 1.4rem; }
.gstep-copy li::before { content: ""; position: absolute; left: 0; top: .6em; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ink); }
.gshot { margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--fill); padding: clamp(.6rem, 1.5vw, 1.1rem); }
.gshot img { width: 100%; height: auto; border-radius: var(--r-md); }
.gshot figcaption { padding: .75rem .25rem 0; font-size: .95rem; color: var(--ink-2); }
.band {
  margin-top: clamp(5rem, 10vw, 8rem); padding: clamp(2rem, 5vw, 3.5rem); border-radius: 28px; background: var(--ink); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
}
.band h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); font-weight: 900; line-height: 1.15; letter-spacing: -.03em; }
.band .btn-go:focus-visible { outline-color: #fff; }

/* ---------- 隱私頁：三個事實＋一鍵清除 ---------- */
.facts { display: grid; gap: 1rem; margin-top: clamp(2rem, 4vw, 3rem); }
@media (min-width: 48rem) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fact { padding: 1.5rem; border-radius: var(--r-lg); background: var(--surface); }
.fact b { display: block; font-size: 1.6rem; font-weight: 900; letter-spacing: -.02em; }
.fact span { display: block; margin-top: .35rem; }
.wipe { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin: 1.25rem 0 1.5rem; }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.done { font-weight: 700; color: var(--ok); }
.dlg { max-width: min(28rem, calc(100vw - 2rem)); padding: 1.5rem; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.dlg::backdrop { background: rgba(20, 20, 20, .5); }
.dlg-foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }

/* ---------- 404 ---------- */
.nf { display: grid; gap: 2rem; align-items: center; min-height: calc(100svh - 68px); padding-top: 2rem; padding-bottom: 4rem; }
@media (min-width: 60rem) { .nf { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }
.nf-num { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); color: var(--ink-3); }
.nf-h { margin-top: .5rem; font-size: clamp(2.4rem, 1.4rem + 4vw, 5rem); font-weight: 900; line-height: 1.08; letter-spacing: -.04em; }
.nf-art { border-radius: 28px; overflow: hidden; background: var(--fill); }
.nf-art img { width: 100%; height: auto; }
.nf-acts { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.nf ul { margin: 2rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.nf ul a { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.nw { white-space: nowrap; }
