/* ══════════════════════════════════════════════════════
   Persuade 頁共用版面：services、geo-report-guide、geo-revamp、geo-new-design、why-geo、about、contact
   視覺 spec §5「完整簡報語法」：每區塊一頁、結論句、exhibit、標註、來源、頁碼。
   只用九個 deck token；scripts/check-deck-palette.mjs 會掃這支檔（css/pages/deck-*.css）。
   載入順序：components.css → deck.css → 本檔。
   ══════════════════════════════════════════════════════ */

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

main {
  padding-top: var(--navbar-height);
}

.slide {
  scroll-margin-top: calc(var(--navbar-height) + 16px);
}

/* 結論句只在空格與標點斷行，放不下才硬斷 */
.slide__a {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.slide__body > .lead {
  margin-top: 0;
  margin-bottom: 32px;
}

.slide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hint {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ── 第 1 頁（首屏）：左欄標題＋引言＋輸入列，右欄 exhibit ── */
.slide--cover {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto auto 1fr auto;
  grid-template-areas:
    "kicker  kicker"
    "title   exhibit"
    "lead    exhibit"
    "form    exhibit"
    "hint    exhibit"
    "foot    foot";
  column-gap: var(--deck-gap);
  padding-block: 56px 40px;
}

.cover__kicker { grid-area: kicker; }

.cover__title {
  grid-area: title;
  margin-top: 16px;
  max-width: 600px;
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 3.75vw, 3.375rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.cover__lead { grid-area: lead; }
.cover__form { grid-area: form; margin-top: 36px; }
.cover__hint { grid-area: hint; align-self: start; }
/* 右欄撐到左欄底為止、圖說貼框底：左右欄上下緣對齊，底線緊接在內容之後（不再用 min-height 撐出空紙） */
.cover__exhibit { grid-area: exhibit; align-self: stretch; display: flex; flex-direction: column; margin-top: 16px; }
.cover__exhibit > .exhibit__caption { margin-top: auto; padding-top: 16px; }
.cover__foot { grid-area: foot; align-self: end; }

.cover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* ── exhibit 右側留標註欄 ── */
.exhibit--annotated { padding-right: 316px; }

.exhibit--annotated > .callout {
  --callout-right: 28px;
  --callout-bottom: auto;
  --callout-top: 50%;
  transform: translateY(-50%);
}

.callout--at-top { --callout-top: 30%; }
.callout--at-low { --callout-top: 72%; }
.callout--at-row3 { --callout-top: 65%; }

/* ── 三個數字 ── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 20px;
}

.stats p {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

/* 首屏右欄較窄：三個數字直排，數字縮小一級 */
.cover__exhibit .stats {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.cover__exhibit .stats > div {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.cover__exhibit .stats > div:last-child { border-bottom: 0; }

.cover__exhibit .exhibit__stat { font-size: clamp(2.5rem, 4vw, 3.5rem); }

.cover__exhibit .stats p { margin-top: 8px; }

/* ── 五步驟流程 ── */
.steps5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid var(--ink);
  counter-reset: step;
}

.steps5--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.steps5__item {
  padding: 20px;
  counter-increment: step;
}

.steps5__item + .steps5__item { border-left: 1px solid var(--ink); }

.steps5__item::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.steps5 h3 {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.steps5 p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

.steps5 .is-key { background: var(--highlight); }
.steps5 .is-key::before { color: var(--ink); }

/* ── 勾選清單 ── */
.gets {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.gets li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.gets li::before {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-top: 0.45em;
  background-color: currentColor;
  -webkit-mask: var(--mk-check) center / contain no-repeat;
  mask: var(--mk-check) center / contain no-repeat;
  color: var(--ink);
}

/* ── 報告截圖 ── */
.shot {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 16px;
  border: 1px solid var(--rule);
}

/* 截圖頁：左欄說明、右欄截圖 */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--deck-gap);
  row-gap: 32px;
  align-items: start;
}

.split > .lead { margin-top: 0; }

/* 報告第 1 章：截圖下方的五維度表 */
.dims { margin-top: 32px; }

/* ── 表格補充 ── */
.deck-table .num {
  font-family: var(--font-latin);
  text-align: right;
  white-space: nowrap;
}

.deck-table tbody th {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
  vertical-align: top;
  padding: 12px 8px;
  min-width: 7em;
}

.deck-table td .mark { font-size: 15px; }

/* ── 自家數據（不是外部統計，不用 .exhibit__stat） ── */
.score-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 20px;
  font-family: var(--font-latin);
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.score-pair__num { font-size: clamp(3rem, 6vw, 5rem); }
.score-pair__arrow { font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; color: var(--ink-2); }

.score-pair__label {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  font-stretch: 100%;
  color: var(--ink-2);
}

/* 上線前後對照：兩欄 */
.before-after {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid var(--ink);
}

.before-after > div { padding: 20px; }
.before-after > div + div { border-left: 1px solid var(--ink); }
.before-after .is-key { background: var(--highlight); }

.before-after h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.before-after p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.before-after .label {
  display: block;
  font-family: var(--font-latin);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.before-after .is-key .label { color: var(--ink); }

/* ── AI 回答示意面板 ── */
.ai-q {
  margin-top: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-2);
}

.ai-a {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 16px;
}

.compare h3 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.serp li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
}

.serp li b {
  margin-right: 8px;
  font-family: var(--font-latin);
  font-weight: 600;
  color: var(--ink);
}

.serp .is-you,
.ai-cites .is-you {
  background: var(--highlight);
  color: var(--ink);
  font-weight: 700;
}

.ai-cites { margin-top: 12px; border-top: 1px solid var(--rule); }

.ai-cites li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink);
}

.ai-cites li span:last-child {
  flex: none;
  font-family: var(--font-latin);
  color: var(--ink-2);
}

.ai-cites .is-you span:last-child { color: var(--ink); }

/* ── 三種代價 ── */
.costs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid var(--ink);
}

.costs > div { padding: 20px; }
.costs > div + div { border-left: 1px solid var(--ink); }
.costs .is-key { background: var(--highlight); }

.costs h3 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.costs p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

/* 促銷：完整交付表或方案卡下方 */
.exhibit + .promo,
.grid-2 + .promo { margin-top: 24px; }

/* ── 方案頁：頂部「先做健檢」提示條 ── */
.topnote {
  padding-block: 12px;
  padding-inline: max(var(--deck-gutter), calc((100% - var(--deck-max)) / 2));
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.topnote a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 方案頁：兩欄方案卡 ── */
.plan h3 {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.plan__price {
  margin-top: 4px;
  font-family: var(--font-latin);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
}

.plan__fit {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

.plan h4 {
  margin-top: 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.plan .deck-table { margin-top: 8px; }
.plan .gets { margin-top: 16px; }
.plan .btn { margin-top: 24px; }

/* 收尾表單 */
.exhibit--form .input-row { margin-top: 16px; }

/* ── 聯絡頁：首屏右欄是預約表單（#contact-form 與欄位 id 由 js/contact.js 使用，不改） ── */
.slide--contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

.contact-pre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 20px 24px;
  border: 1px solid var(--ink);
  background: var(--white);
}

.contact-pre p {
  flex: 1 1 240px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

.contact-pre .btn { flex: none; }

.hint a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form__q {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
}

.contact-form__note {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
}

#contact-form { margin-top: 24px; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}

.field { margin-bottom: 18px; }

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field__req {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-2);
}

.field__control {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

.field__control--area {
  height: auto;
  min-height: 112px;
  padding: 12px 14px;
  line-height: 1.6;
  resize: vertical;
}

.field__control::placeholder {
  color: var(--ink-2);
  opacity: 1;
}

.field__control:focus-visible {
  outline: 2px solid var(--highlight-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* 錯誤：框不變色，欄位下方 13px 墨藍文字加 ✕（視覺 spec §4 輸入框） */
.field__error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field:has(.field__control:user-invalid) .field__error { display: block; }

.cf-turnstile { margin-bottom: 16px; }

.contact-form__submit { width: 100%; }

.contact-form__submit:disabled {
  border-color: var(--rule);
  background: var(--paper-2);
  color: var(--ink-2);
  cursor: progress;
}

.contact-channels {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 40px;
}

.contact-channels .deck-table { flex: 1 1 320px; }

.contact-channels__qr {
  flex: none;
  width: 120px;
  height: 120px;
  border: 1px solid var(--rule);
}

@media (max-width: 1024px) {
  .slide--cover,
  .slide--contact {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "kicker" "title" "lead" "form" "hint" "exhibit" "foot";
    min-height: 0;
    padding-block: 32px 40px;
  }

  .cover__form { margin-top: 24px; }
  .cover__exhibit { margin-top: 32px; }
  .cover__foot { margin-top: 32px; }

  .exhibit--annotated { padding-right: 28px; }
  .exhibit--annotated > .callout { transform: none; }

  .split { grid-template-columns: minmax(0, 1fr); }

  .steps5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps5__item + .steps5__item { border-left: 0; }
  .steps5__item { border-top: 1px solid var(--ink); }
  .steps5__item:nth-child(-n + 2) { border-top: 0; }
  .steps5__item:nth-child(even) { border-left: 1px solid var(--ink); }
}

@media (max-width: 768px) {
  .exhibit--annotated { padding-right: 20px; }

  .field-row { grid-template-columns: minmax(0, 1fr); }

  .stats,
  .compare,
  .costs,
  .before-after,
  .steps5 { grid-template-columns: minmax(0, 1fr); }

  .costs > div + div,
  .before-after > div + div {
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

  .steps5__item,
  .steps5__item:nth-child(even) { border-left: 0; }
  .steps5__item:nth-child(-n + 2) { border-top: 1px solid var(--ink); }
  .steps5__item:first-child { border-top: 0; }

  /* 窄螢幕表格改成逐列堆疊，避免水平捲動 */
  .deck-table--stack thead { display: none; }
  .deck-table--stack tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .deck-table--stack th,
  .deck-table--stack td { display: block; padding: 4px 0; border-bottom: 0; }
  .deck-table--stack .deck-table__row--hl { padding-inline: 8px; background: var(--highlight); }
  .deck-table--stack tbody th { padding-inline: 0; min-width: 0; }
  .deck-table--stack td[data-label]::before {
    content: attr(data-label) "　";
    font-family: var(--font-latin);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--ink-2);
  }
}

/* 手機寬度：keep-all 遇到放不下的長句會把「，」擠到行首，改回一般斷行（瀏覽器會避頭尾） */
@media (max-width: 480px) {
  .cover__title,
  .slide__a { word-break: normal; }
  /* 韓文以空格分詞：normal 會把詞拆開，ko 維持 keep-all（避頭尾問題只發生在中文） */
  html[lang="ko"] .cover__title,
  html[lang="ko"] .slide__a { word-break: keep-all; }
}
