/* ══════════════════════════════════════════════════════
   DECK — 「顧問簡報」元件庫（只有中文行銷頁載入）
   視覺 spec：docs/superpowers/specs/2026-10-19-visual-redesign-consulting-deck-design.md §3–§4、§9
   色彩只用 variables.css 的九個 deck token；守衛 scripts/check-deck-palette.mjs 會掃這支檔。
   只放元件，不放頁面專屬樣式（頁面樣式放 css/pages/deck-*.css）。
   載入順序在 components.css 之後：同名的 .btn* 靠這裡覆寫。
   ══════════════════════════════════════════════════════ */

:root {
  --deck-max: 1344px;   /* 1440 − 48 × 2 */
  --deck-gutter: 48px;  /* 桌機左右邊距；平板 32px、手機 16px */
  --deck-gap: 64px;     /* 兩欄欄距 */

  /* 記號：同一套 1.5/16 筆劃的 SVG 遮罩，顏色由 background-color: currentColor 決定（SVG 內只用 black 關鍵字） */
  --mk-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E");
  --mk-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M4 4 12 12M12 4 4 12'/%3E%3C/svg%3E");
  --mk-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M3 8H13'/%3E%3C/svg%3E");
  --mk-stamp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Crect x='2.75' y='2.75' width='10.5' height='10.5'/%3E%3Crect x='6' y='6' width='4' height='4' fill='black' stroke='none'/%3E%3C/svg%3E");
  --mk-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M8 3V13M3 8H13'/%3E%3C/svg%3E");
  --mk-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M3 8H13'/%3E%3C/svg%3E");
  --mk-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M8 3.5 13 12.25H3Z'/%3E%3C/svg%3E");
  --mk-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M3 3.75H13L8 12.5Z'/%3E%3C/svg%3E");
  --mk-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='miter'%3E%3Crect x='3.75' y='7.75' width='8.5' height='6.5'/%3E%3Cpath d='M5.75 7.75V5.5A2.25 2.25 0 0 1 10.25 5.5V7.75'/%3E%3C/svg%3E");
}

body {
  counter-reset: slide;
}

/* ── 頁 section.slide ── */
.slide {
  counter-increment: slide;
  position: relative;
  padding-block: 96px;
  padding-inline: max(var(--deck-gutter), calc((100% - var(--deck-max)) / 2));
}

.slide__kicker {
  display: block;
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.slide__q {
  margin-top: 16px;
  max-width: 720px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
}

.slide__a {
  margin-top: 8px;
  max-width: 720px;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}

.slide__body {
  margin-top: 48px;
}

.slide__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: 56px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 400;
  font-stretch: 85%;
  line-height: 1.5;
  color: var(--ink-2);
}

.slide__source {
  flex: 1 1 auto;
  min-width: 0;
}

.slide__source a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.slide__source a:hover {
  color: var(--ink);
}

.slide__page {
  flex: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* data-total 放在 .slide__page 本身：attr() 只讀得到自己的屬性 */
.slide__page::after {
  content: counter(slide) " / " attr(data-total);
}

/* ── 引言與兩欄 ── */
.lead {
  margin-top: 24px;
  max-width: 520px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink-2);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--deck-gap);
  row-gap: 48px;
  align-items: start;
}

/* ── Exhibit 面板 ── */
.exhibit {
  position: relative;
  padding: 24px 28px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
}

.exhibit__label {
  display: block;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: var(--ink-2);
}

.exhibit__caption {
  margin-top: 16px;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 400;
  font-stretch: 85%;
  line-height: 1.5;
  color: var(--ink-2);
}

.exhibit__stat {
  display: block;
  font-family: var(--font-latin);
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.exhibit__stat-source {
  display: block;
  margin-top: 8px;
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 400;
  font-stretch: 85%;
  line-height: 1.5;
  color: var(--ink-2);
}

.exhibit__stat-source a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ── 標註 .callout ──
   桌機：絕對定位在 exhibit 右側或下方，位置由頁面用 --callout-* 自訂屬性給；
   ::before 是 60px 的 1px 引線，往左接到被標註的元素。 */
.callout {
  position: absolute;
  z-index: 1;
  top: var(--callout-top, auto);
  right: var(--callout-right, -8px);
  bottom: var(--callout-bottom, 24px);
  left: var(--callout-left, auto);
  width: var(--callout-width, 220px);
  padding: 12px 14px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.callout::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -60px;
  width: 60px;
  border-top: 1px solid var(--ink);
  transform-origin: left center;
  transition: transform 300ms ease-out;
}

/* 有 deck.js 時引線從被標註的元素畫向標註框；沒有 JS 時引線直接在 */
.deck-js .callout:not(.callout--on)::before {
  transform: scaleX(0);
}

.callout--on::before {
  transform: scaleX(1);
}

/* ── 螢光筆 .hl ──
   預設 100%：沒有 deck.js（或 JS 失敗）時也看得到筆條。
   deck.js 先在 <html> 加 .deck-js，未進視窗的 .hl 歸零，進視窗加 .hl--on 畫過。 */
.hl {
  color: inherit;
  background-image: linear-gradient(transparent 55%, var(--highlight) 55%, var(--highlight) 92%, transparent 92%);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 100% 100%;
  transition: background-size 300ms ease-out;
}

.deck-js .hl:not(.hl--on) {
  background-size: 0% 100%;
  transition: none;
}

.hl--on {
  background-size: 100% 100%;
}

/* ── 按鈕：覆寫 components.css 同名 .btn 的 pill 圓角、hover 位移、陰影 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:none; /* 不加空格：契約測試的 box-shadow 正規式會把「: none」誤判 */
  transform: none;
  transition: background-color 80ms linear, color 80ms linear;
}

.btn:hover {
  background: color-mix(in oklch, var(--ink), black 12%);
  border-color: color-mix(in oklch, var(--ink), black 12%);
  color: var(--on-ink);
  box-shadow:none;
  transform: none;
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: var(--ink-2);
  background: var(--ink-2);
  color: var(--on-ink);
  cursor: not-allowed;
}

.btn--outline {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn--outline:hover {
  border-color: var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  transform: none;
}

.btn--outline:disabled,
.btn--outline[aria-disabled="true"] {
  border-color: var(--rule);
  background: transparent;
  color: var(--ink-2);
}

.btn--lg {
  height: 56px;
  padding: 0 28px;
  font-size: 16px;
}

/* ── 輸入框 ── */
.input {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

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

/* base.css 的 :where(input):focus-visible 會加 8px 圓角，這裡蓋回 0 */
.input:focus-visible {
  outline: 2px solid var(--highlight-deep);
  outline-offset: 2px;
  border-radius: 0;
}

/* 錯誤時框不變色（狀態用記號），錯誤文字用 .mark--error */

/* 輸入框與 .btn--lg 接合成一列：輸入框不畫右框，按鈕左側 0 圓角 */
.input-row {
  display: flex;
  align-items: stretch;
  max-width: 560px;
}

.input-row .input {
  flex: 1 1 auto;
  border-right: 0;
}

.input-row .btn {
  flex: none;
  border-radius: 0 2px 2px 0;
}

.input-row .btn:focus-visible {
  border-radius: 0 2px 2px 0;
}

/* ── 長條圖 ── */
.bar {
  position: relative;
  display: block;
  height: 10px;
  overflow: hidden;
  background: var(--rule);
}

.bar__fill {
  display: block;
  height: 100%;
  width: var(--bar-value, 0%);
  background: var(--ink);
}

.bar__fill--hl {
  background: var(--highlight);
}

/* ── 狀態記號：✓ 完成、— 劃線鎖定、▣ 章（待付費）、✕ 錯誤；一律 --ink，不靠顏色 ── */
.mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.mark::before {
  content: "";
  flex: none;
  align-self: center;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: var(--mk-dash) center / contain no-repeat;
  mask: var(--mk-dash) center / contain no-repeat;
}

.mark--done::before {
  -webkit-mask-image: var(--mk-check);
  mask-image: var(--mk-check);
}

.mark--locked {
  color: var(--ink-2);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.mark--locked::before {
  -webkit-mask-image: var(--mk-dash);
  mask-image: var(--mk-dash);
}

.mark--stamp {
  padding: 2px 8px;
  border: 1px solid var(--ink);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.mark--stamp::before {
  -webkit-mask-image: var(--mk-stamp);
  mask-image: var(--mk-stamp);
}

.mark--error::before {
  -webkit-mask-image: var(--mk-cross);
  mask-image: var(--mk-cross);
}

/* ── 表格：只有橫線 ── */
.deck-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.deck-table th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-align: left;
  vertical-align: bottom;
}

.deck-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.deck-table__row--hl > th,
.deck-table__row--hl > td {
  background: var(--highlight);
  color: var(--ink);
  font-weight: 700;
}

/* ── 閱讀版內文容器（Read 頁） ── */
.read {
  width: min(72ch, 100% - 2 * var(--deck-gutter));
  margin-inline: auto;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
}

.read p,
.read li {
  color: var(--ink);
  line-height: 1.8;
}

.read > * + * {
  margin-top: 1em;
}

.read h2 {
  margin-top: 2.5em;
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.read h3 {
  margin-top: 2em;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}

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

/* ── FAQ 分組：可見問答用 <details> ── */
.faq-group {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.faq-group details {
  border-bottom: 1px solid var(--rule);
}

.faq-group summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.6;
  list-style: none;
  cursor: pointer;
}

.faq-group summary::-webkit-details-marker {
  display: none;
}

.faq-group summary::after {
  content: "";
  flex: none;
  align-self: center;
  width: 0.9em;
  height: 0.9em;
  color: var(--ink-2);
  background-color: currentColor;
  -webkit-mask: var(--mk-plus) center / contain no-repeat;
  mask: var(--mk-plus) center / contain no-repeat;
}

.faq-group details[open] summary::after {
  -webkit-mask-image: var(--mk-minus);
  mask-image: var(--mk-minus);
}

.faq-group summary:focus-visible {
  outline: 2px solid var(--highlight-deep);
  outline-offset: 2px;
}

.faq-group details > :not(summary) {
  padding-bottom: 16px;
  color: var(--ink);
}

/* ── 促銷橫幅（到期由 deck.js 加 hidden） ── */
.promo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 14px 20px;
  border: 1px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

/* display:flex 會蓋掉 [hidden] 的 UA 樣式，明確補回 */
.promo[hidden],
.input-row[hidden] {
  display: none;
}

/* ── 頁尾 ── */
.deck-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px 32px;
  padding-block: 32px 48px;
  padding-inline: max(var(--deck-gutter), calc((100% - var(--deck-max)) / 2));
  border-top: 1px solid var(--rule);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-2);
}

.deck-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.deck-footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.deck-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ── 斷點 ── */
@media (max-width: 1024px) {
  :root {
    --deck-gutter: 32px;
  }

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

  /* 標註改為流式，置於 exhibit 內容下方；引線改為框外上方一條 16px 的 1px 直線，接回上方內容 */
  .callout {
    position: relative;
    inset: auto;
    width: auto;
    margin-top: 16px;
  }

  .callout::before,
  .deck-js .callout:not(.callout--on)::before {
    top: -16px;
    left: 16px;
    width: 0;
    height: 16px;
    border-top: 0;
    border-left: 1px solid var(--ink);
    transform: none;
  }
}

@media (max-width: 768px) {
  :root {
    --deck-gutter: 16px;
  }

  .slide {
    padding-block: 56px;
  }

  .exhibit {
    padding: 20px;
  }

  .slide__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  /* 手機寬度放不下一列：輸入框與按鈕上下接合 */
  .input-row {
    flex-direction: column;
  }

  .input-row .input {
    border-right: 1px solid var(--ink);
    border-bottom: 0;
  }

  .input-row .btn,
  .input-row .btn:focus-visible {
    width: 100%;
    border-radius: 0 0 2px 2px;
  }
}

/* ── 動態偏好：所有動作直接呈現最終狀態（必須是本檔最後一個區塊） ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .deck-js .hl:not(.hl--on),
  .hl {
    background-size: 100% 100%;
    transition: none;
  }

  .deck-js .callout:not(.callout--on)::before {
    transform: none;
  }
}
