/*
 * Threads Downloader — 對外揭露頁設計系統
 * 日式簡約風，對齊 extension 內部 UI 視覺語彙（src/ui/shared/theme.css）
 *
 * 色票對應：
 *   --color-bg      #F3EFE6  暖米底
 *   --color-surface #FBF8F1  淺色區塊（highlight、表頭）
 *   --color-text    #2E1F14  深褐主文字
 *   --color-muted   #8C7B6E  次要文字
 *   --color-accent  #C49A5A  金棕，節制使用（CTA、連結、kicker）
 *   --color-rule    #E2DACE  髮絲線分隔
 */

/* ─── 0. Reset ─────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── 1. Design Tokens ──────────────────────────────────── */

:root {
  --color-bg:      #F3EFE6;
  --color-surface: #FBF8F1;
  --color-text:    #2E1F14;
  --color-muted:   #8C7B6E;
  --color-accent:  #C49A5A;
  --color-rule:    #E2DACE;

  --font-serif: 'Noto Serif TC', 'Shippori Mincho', Georgia, serif;
  --font-sans:  'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'SFMono-Regular', ui-monospace, monospace;

  --max-width: 760px;
}

/* ─── 2. Base Typography ────────────────────────────────── */

html {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
}

body {
  background-color: var(--color-bg);
  padding: 0 1.5rem;
}

a {
  color: var(--color-accent);
  text-underline-offset: 3px;
  transition: opacity .2s ease;
}
a:hover { opacity: .6; }

strong { color: var(--color-text); }

em { font-style: italic; }

p {
  color: var(--color-muted);
  margin-bottom: .6rem;
}
p:last-child { margin-bottom: 0; }

code {
  font-family: var(--font-mono);
  font-size: .81rem;
  background: rgba(196, 154, 90, .12);
  color: #9A742E;
  padding: .12em .42em;
  border-radius: 3px;
  word-break: break-all;
}

/* ─── 3. Layout ─────────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ─── 4. Kicker（mono 小標，出現在 h2 上方）────────────── */

.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: .75rem;
}

/* ─── 5. Reveal Animation ───────────────────────────────── */
/*
 * 需要 HTML 根元素有 .js class（由 reveal.js 前的 inline script 設定）。
 * 無 JS 時，html.no-js 保持 → [data-reveal] 元素始終可見。
 * prefers-reduced-motion：動畫完全關閉，元素直接顯示。
 */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .75s ease, transform .75s ease;
  transition-delay: calc(var(--reveal-i, 0) * .08s);
  will-change: opacity, transform;
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    transition-delay: 0s;
  }
}

/* ─── 6. Hero ───────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 7rem 0 6.5rem;
}

.hero-icon {
  display: inline-block;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 2rem;
  opacity: .88;
}

.hero .kicker {
  margin-bottom: 1.1rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: 1.2rem;
}

.hero .tagline {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* ─── 7. CTA Button ─────────────────────────────────────── */

.btn-cws {
  display: inline-block;
  padding: .8rem 2.4rem;
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  background: transparent;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .06em;
  transition: background .25s ease, color .25s ease, opacity .25s ease;
}

.btn-cws:hover,
.btn-cws:focus-visible {
  background: var(--color-accent);
  color: var(--color-bg);
  opacity: 1;
  outline: none;
}

.btn-note {
  display: block;
  margin-top: .9rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--color-muted);
}

/* ─── 8. Placeholder Note ───────────────────────────────── */

.placeholder-note {
  margin-top: 1.5rem;
  padding: .85rem 1.2rem;
  background: var(--color-surface);
  border-left: 2px solid var(--color-accent);
  font-size: .8rem;
  color: var(--color-muted);
  text-align: left;
  line-height: 1.65;
}

.placeholder-note strong { color: var(--color-text); }

/* ─── 9. Main Content Sections ──────────────────────────── */

.main-content {
  padding-bottom: 7rem;
}

.section {
  padding-top: 5.5rem;
  border-top: 1px solid var(--color-rule);
}

.section-heading {
  margin-bottom: 2.8rem;
}

.section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

/* ─── 10. Feature List ──────────────────────────────────── */

.feature-list {
  list-style: none;
}

.feature-list > li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0 1.4rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--color-rule);
  align-items: start;
}

.feature-list > li:first-child {
  border-top: 1px solid var(--color-rule);
}

.feat-num {
  font-family: var(--font-serif);
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-rule);
  padding-top: .25rem;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.feature-list h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .4rem;
  line-height: 1.35;
}

.feature-list p {
  font-size: .875rem;
  color: var(--color-muted);
  line-height: 1.78;
  margin: 0;
}

/* ─── 11. Step List ─────────────────────────────────────── */

.step-list {
  list-style: none;
}

.step-list > li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0 1.4rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-rule);
  align-items: start;
}

.step-list > li:first-child {
  border-top: 1px solid var(--color-rule);
}

.step-num {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-rule);
  padding-top: .15rem;
  line-height: 1.2;
  letter-spacing: .01em;
}

.step-list strong {
  display: block;
  font-family: var(--font-serif);
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .35rem;
  line-height: 1.35;
}

.step-list span {
  font-size: .875rem;
  color: var(--color-muted);
  line-height: 1.78;
}

/* ─── 12. Editorial Table ───────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin-top: 1.8rem;
}

thead tr {
  border-bottom: 1.5px solid var(--color-text);
}

th {
  padding: .6rem 0;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-align: left;
  vertical-align: bottom;
}

th + th,
td + td {
  padding-left: 1.6rem;
}

tbody tr {
  border-bottom: 1px solid var(--color-rule);
}

td {
  padding: .85rem 0;
  color: var(--color-text);
  vertical-align: top;
  line-height: 1.72;
}

td em {
  display: block;
  margin-top: .25rem;
  color: var(--color-muted);
  font-style: italic;
  font-size: .83rem;
}

.table-note {
  margin-top: 1.2rem;
  font-size: .82rem;
  color: var(--color-muted);
  line-height: 1.65;
}

/* ─── 13. FAQ ───────────────────────────────────────────── */

.faq-list {
  /* dl container */
}

.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.faq-item:first-child {
  border-top: 1px solid var(--color-rule);
}

.faq-item dt {
  font-family: var(--font-serif);
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .5rem;
  line-height: 1.4;
}

.faq-item dd {
  font-size: .875rem;
  color: var(--color-muted);
  line-height: 1.78;
}

/* ─── 14. Footer ────────────────────────────────────────── */

footer {
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-rule);
  font-size: .75rem;
  color: var(--color-muted);
  text-align: center;
  padding-bottom: 4rem;
  line-height: 1.9;
}

footer a {
  color: var(--color-muted);
  text-decoration: underline;
}

footer a:hover {
  color: var(--color-text);
  opacity: 1;
}

/* ─── 15. Privacy Page Specific ─────────────────────────── */

/* 標頭區（隱私政策頁） */
.policy-header {
  text-align: left;
  padding: 7rem 0 5rem;
}

.policy-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: .6rem;
}

.policy-header .subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.policy-header .updated {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--color-muted);
  margin: 0;
}

/* 重點聲明框（資料不蒐集） */
.highlight {
  margin-bottom: 1.2rem;
  padding: 1.1rem 1.4rem;
  background: var(--color-surface);
  border-left: 2px solid var(--color-accent);
}

.highlight p {
  color: var(--color-text);
  font-weight: 500;
  margin: 0;
  font-size: .9375rem;
  line-height: 1.75;
}

/* ─── 16. Responsive ────────────────────────────────────── */

@media (max-width: 600px) {
  body { padding: 0 1.2rem; }

  .hero { padding: 5rem 0 4.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: .9375rem; }
  .btn-cws { padding: .75rem 2rem; }

  .section { padding-top: 4rem; }

  .feature-list > li,
  .step-list > li {
    grid-template-columns: 2.6rem 1fr;
    gap: 0 1rem;
  }

  .policy-header { padding: 4.5rem 0 3.5rem; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.75rem; }
  .feature-list > li,
  .step-list > li {
    grid-template-columns: 1fr;
    gap: .4rem 0;
  }
  .feat-num, .step-num {
    font-size: .82rem;
    padding: 0;
  }
  table { font-size: .8rem; }
}
