/* =========================================================================
   goodapp.app — 共用樣式
   設計方向：活版印刷式作品目錄（letterpress catalogue）
   紙感底色 · 襯線大標 · 等寬字註記 · 細線分隔 · 條列式索引
   ========================================================================= */

:root {
  /* 紙 */
  --paper:        #f4f1ea;
  --paper-deep:   #ebe6da;
  --paper-card:   #faf8f3;

  /* 墨 */
  --ink:          #1b1917;
  --ink-soft:     #423d36;
  --ink-mute:     #6f685d;
  --ink-faint:    #9a9287;

  /* 線 */
  --rule:         rgba(27, 25, 23, 0.14);
  --rule-strong:  rgba(27, 25, 23, 0.30);

  /* 各應用識別色 */
  --fubao:        #2f7d6e;
  --hunter:       #8a2540;
  --hunter-gold:  #b08a2e;
  --mandala:      #6b76c0;

  /* 目前頁面的主色，由各頁覆寫 */
  --accent:       var(--ink);

  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans:  "Noto Sans TC", "PingFang TC", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 64px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 紙張顆粒感 —— 極淡的雜訊疊層 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: var(--accent); text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }

::selection { background: var(--ink); color: var(--paper); }

/* ---------- 版面容器 ---------- */

.shell { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.shell--narrow { max-width: 800px; }

/* ---------- 等寬字註記 ---------- */

.meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- 頁首 ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.masthead__inner {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 22px 0 18px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span { color: var(--ink-faint); font-weight: 400; }

.masthead nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.masthead nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- 各工具的次級導覽列 ---------- */

.appbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-card);
}
.appbar__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  padding: 13px 0;
}
.appbar__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--accent);
  white-space: nowrap;
}
.appbar__name::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  vertical-align: 1px;
  background: var(--accent);
}
.appbar nav { display: flex; flex-wrap: wrap; gap: 20px; }
.appbar nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.appbar nav a:hover,
.appbar nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.appbar .launch {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--accent);
  padding: 8px 18px;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.appbar .launch:hover { opacity: 0.82; }

@media (max-width: 620px) {
  .appbar .launch { margin-left: 0; }
}

/* ---------- 內頁頁首區 ---------- */

.pagehead { padding: clamp(56px, 9vw, 104px) 0 clamp(30px, 4vw, 48px); }
.pagehead .meta { display: block; margin-bottom: 18px; }
.pagehead h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 5.6vw, 52px);
  line-height: 1.24;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}
.pagehead .standfirst {
  margin: 22px 0 0;
  max-width: 46ch;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.95;
  color: var(--ink-soft);
}
.pagehead::after {
  content: "";
  display: block;
  height: 3px;
  width: 72px;
  margin-top: 34px;
  background: var(--accent);
}

/* ---------- 內文排版 ---------- */

.prose { padding-bottom: 40px; }
.prose > * { max-width: var(--measure); }

.prose h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.5;
  margin: 3.2em 0 0.9em;
  padding-top: 0.9em;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  max-width: none;
}
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }

.prose h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 2.2em 0 0.6em;
  color: var(--ink);
}

.prose p { margin: 0 0 1.35em; color: var(--ink-soft); }
.prose strong { font-weight: 500; color: var(--ink); }

.prose ul, .prose ol { margin: 0 0 1.6em; padding-left: 1.35em; color: var(--ink-soft); }
.prose li { margin-bottom: 0.7em; }
.prose li::marker { color: var(--accent); }

.prose figure { margin: 2.4em 0; max-width: none; }
.prose figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-top: 10px;
}

/* 引言／註記塊 */
.note {
  max-width: var(--measure);
  margin: 2.2em 0;
  padding: 20px 24px;
  background: var(--paper-card);
  border-left: 3px solid var(--accent);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.note strong { color: var(--ink); font-weight: 500; }
.note p { margin: 0 0 0.8em; }
.note p:last-child { margin-bottom: 0; }

/* 步驟清單 */
.steps { list-style: none; padding: 0; margin: 1.8em 0 2.2em; counter-reset: step; max-width: var(--measure); }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.4em 52px;
  margin: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps li + li { padding-top: 1.4em; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.35em;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.steps li + li::before { top: 1.75em; }
.steps b { display: block; font-weight: 500; color: var(--ink); margin-bottom: 2px; }

/* 定義式表格 */
.spec {
  width: 100%;
  max-width: var(--measure);
  border-collapse: collapse;
  margin: 1.8em 0 2.4em;
  font-size: 14.5px;
}
.spec th, .spec td {
  text-align: left;
  vertical-align: top;
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-weight: 300;
}
.spec th {
  width: 30%;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 400;
  white-space: nowrap;
}

/* FAQ */
.faq { max-width: var(--measure); margin: 2em 0 0; }
.faq details {
  border-bottom: 1px solid var(--rule);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 40px 22px 0;
  position: relative;
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  transition: color 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 11px;
  height: 1px;
  background: var(--accent);
}
.faq summary::before {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 1px;
  height: 11px;
  margin-top: -5px;
  background: var(--accent);
  transition: opacity 0.25s, transform 0.25s;
}
.faq details[open] summary::before { opacity: 0; transform: rotate(90deg); }
.faq .answer { padding: 0 0 24px; color: var(--ink-soft); font-size: 15px; }
.faq .answer p { margin: 0 0 1em; }
.faq .answer p:last-child { margin-bottom: 0; }
.faq .answer ul { margin: 0 0 1em; padding-left: 1.3em; }

/* ---------- 行動呼籲 ---------- */

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 2.6em 0 0; max-width: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: background 0.25s, color 0.25s;
}
.btn:hover { background: var(--accent); color: var(--paper); }
.btn--solid { background: var(--accent); color: var(--paper); }
.btn--solid:hover { background: transparent; color: var(--accent); }

/* ---------- 頁尾 ---------- */

.footer {
  margin-top: clamp(72px, 10vw, 128px);
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
  padding: 52px 0 40px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px 32px;
}
.footer h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
  margin: 0 0 16px;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 9px; }
.footer a {
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer__blurb {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-mute);
  margin: 0;
  max-width: 34ch;
}
.footer__bar {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: baseline;
}
.footer__bar .meta { font-size: 10.5px; }

/* ---------- 進場動畫 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.75s cubic-bezier(0.22, 0.68, 0.3, 1) forwards;
  }
  .reveal[data-d="1"] { animation-delay: 0.06s; }
  .reveal[data-d="2"] { animation-delay: 0.14s; }
  .reveal[data-d="3"] { animation-delay: 0.22s; }
  .reveal[data-d="4"] { animation-delay: 0.30s; }
  .reveal[data-d="5"] { animation-delay: 0.38s; }
  .reveal[data-d="6"] { animation-delay: 0.46s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- 響應式 ---------- */

@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 15.5px; }
  .masthead__inner { flex-wrap: wrap; gap: 12px 20px; padding: 18px 0 14px; }
  .masthead nav { margin-left: 0; width: 100%; gap: 16px; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .spec th { width: auto; display: block; padding-bottom: 2px; border-bottom: 0; }
  .spec td { display: block; padding-top: 0; }
}
