/* ═══════════════════════════════════
   兩試考期 panel — 獨立 section（從 hero 抽出）
   hairline 風格：無圓角、無底色、純編輯排版
═══════════════════════════════════ */
.edit-exam-panel-section {
  max-width: 880px; margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 5vw, 80px);
  position: relative; z-index: 1;
}
.edit-exam-panel {
  display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0;
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
  padding: 28px 0;
}
.edit-exam-panel::before {
  content: ""; grid-column: 2; background: var(--c-rule);
}
@media (max-width: 600px) {
  .edit-exam-panel {
    grid-template-columns: 1fr;
    padding: 20px 0;
  }
  .edit-exam-panel::before { display: none; }
  .exam-line + .exam-line {
    border-top: 1px solid var(--c-rule);
    padding-top: 18px; margin-top: 18px;
  }
}
.exam-line {
  padding: 0 clamp(16px, 3vw, 28px);
  background: none; border: 0; border-radius: 0;
  display: flex; flex-direction: column; gap: 8px;
  transition: opacity .2s;
}
.exam-line.finished { opacity: .5; }
.exam-line-eyebrow {
  font-family: var(--ff-sans);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-muted);
  margin: 0;
  font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums;
}
.exam-line.primary .exam-line-eyebrow { color: var(--c-ink-2, var(--c-ink)); }
.exam-line-count {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0;
}
.exam-line-count .num {
  font-family: var(--ff-mono);
  font-size: clamp(36px, 5vw, 48px); font-weight: 700;
  line-height: 1; letter-spacing: -.02em;
  color: var(--c-ink);
  font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums;
}
.exam-line.urgent .num,
.exam-line.critical .num { color: var(--c-vermilion); }
.exam-line.critical .num { animation: cd-pulse 2s ease-in-out infinite; }
.exam-line-count .num.finished {
  font-size: clamp(18px, 3vw, 22px); color: var(--c-muted);
  font-weight: 500; letter-spacing: 0; font-family: var(--ff-sans);
}
.exam-line-count .unit {
  font-size: 13px; font-weight: 500; color: var(--c-muted);
  align-self: flex-end; margin-bottom: 4px;
  font-family: var(--ff-sans);
}
.exam-line-flag {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: 10px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 2px 7px; margin-left: auto;
  color: var(--c-vermilion);
  border: 1px solid var(--c-vermilion);
  border-radius: 2px;
  align-self: center;
}
.exam-line-foot {
  font-family: var(--ff-sans);
  font-size: 12.5px; color: var(--c-muted);
  margin: 0;
  font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums;
}

/* Info popover (kept for future use, not currently triggered) */
.exam-info-pop {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  max-width: 360px; width: calc(100vw - 32px);
  padding: 20px 24px; background: var(--c-surface);
  border: 1px solid var(--c-rule); border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  z-index: 1000;
  font-size: 14px; line-height: 1.7; color: var(--c-ink-2, var(--c-muted));
}
.exam-info-pop strong {
  display: block; font-family: var(--ff-serif-cn, var(--ff-serif));
  font-size: 16px; color: var(--c-ink); margin-bottom: 10px;
}
.exam-info-pop p { margin: 0 0 8px; }
.exam-info-pop p:last-child { margin-bottom: 0; }
.exam-info-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: 0; font-size: 22px; line-height: 1;
  color: var(--c-muted); cursor: pointer;
}
.exam-info-close:hover { color: var(--c-vermilion); }

@keyframes cd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* ═══════════════════════════════════
   PWA 安裝 banner（iOS / Android / Desktop 統一）
   底部浮動條，30 天內 dismiss 不再出現
═══════════════════════════════════ */
.lx-install-banner {
  position: fixed;
  /* 必須抬到 #bottom-nav（高 var(--nav-h) + safe-area）之上，
     不然手機 / 平板會把練習・複習・統計・更多 5 個 tab 全遮住 */
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  left: 16px; right: 16px;
  max-width: 560px; margin: 0 auto;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-rule);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 12px;
  z-index: 9998;
  transform: translateY(120%); opacity: 0;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s;
  font-family: var(--ff-sans);
}
.lx-install-banner.show { transform: translateY(0); opacity: 1; }
.lxib-icon {
  font-size: 24px; line-height: 1; flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: color-mix(in oklch, var(--c-vermilion) 8%, transparent);
  border-radius: 10px;
}
.lxib-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.lxib-text strong {
  font-size: 14.5px; font-weight: 700; color: var(--c-ink);
  line-height: 1.3;
}
.lxib-text span {
  font-size: 12.5px; color: var(--c-muted);
  line-height: 1.4;
}
.ios-share-icon {
  display: inline-block;
  font-size: 14px;
  vertical-align: middle;
}
.lxib-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 13.5px; font-weight: 700;
  color: #fff; background: var(--c-vermilion);
  border: 0; border-radius: 8px;
  cursor: pointer;
  transition: filter .15s, transform .15s;
  font-family: inherit;
}
.lxib-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.lxib-btn:active { transform: translateY(0); }
.lxib-close {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: transparent; border: 0;
  font-size: 20px; line-height: 1; color: var(--c-muted);
  cursor: pointer; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.lxib-close:hover { background: color-mix(in oklch, var(--c-muted) 10%, transparent); color: var(--c-ink); }

/* 2026-05-11 dismiss choice 狀態（按 X 後 morph 成選擇）
   兩顆按鈕：[這次關閉] ghost、[不再提醒] 朱印紅實心 */
.lx-install-banner.is-choice .lxib-btn.lxib-once {
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-border);
}
.lx-install-banner.is-choice .lxib-btn.lxib-once:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
  filter: none;
}
.lx-install-banner.is-choice .lxib-btn.lxib-never {
  background: var(--c-vermilion);
  color: #fff;
}

@media (max-width: 420px) {
  .lx-install-banner {
    bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
    left: 12px; right: 12px; padding: 10px 12px; gap: 10px;
  }
  .lxib-icon { width: 36px; height: 36px; font-size: 22px; }
  .lxib-text strong { font-size: 13.5px; }
  .lxib-text span { font-size: 11.5px; }
  .lxib-btn { padding: 7px 14px; font-size: 13px; }
}

/* 桌機 ≥ 1024px：#bottom-nav 變成左側 sidebar，banner 可以靠底 */
@media (min-width: 1024px) {
  .lx-install-banner { bottom: 20px; }
}

/* Standalone 模式偵測：已安裝就完全隱藏 */
@media all and (display-mode: standalone) {
  .lx-install-banner { display: none !important; }
}

/* 2026-05-13 login / signup modal 開啟時 hide install banner — 不擋登入
   :has selector iOS 16.4+ 支援；fallback class .has-modal-open 由 JS 加 */
body:has(#login-modal.open) .lx-install-banner,
body:has(#signup-modal.open) .lx-install-banner,
body.has-modal-open .lx-install-banner {
  display: none !important;
}

/* Countdown odometer — tabular numerals, breathing */
.edit-countdown {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-family: var(--ff-mono); font-size: 12.5px;
  color: var(--c-muted); letter-spacing: .03em;
}
.edit-countdown .num {
  font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums;
  color: var(--c-ink); font-weight: 700; font-size: 14px;
  letter-spacing: 0;
}

/* CTAs */
.edit-hero-ctas {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 56px;
  opacity: 0;
  animation: fade-up .56s 1.05s var(--ease-editorial, cubic-bezier(.2,.8,.2,1)) forwards;
}
/* P2-12: mobile 文案太長易斷成 3 行 — 在小螢幕上保險地不換行（hidden 溢出由 ellipsis 處理）
   並縮 padding 讓寬度可以容納；≥768 恢復原樣 */
.edit-cta-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--ff-sans-en); font-size: 15px; font-weight: 600;
  letter-spacing: .01em;
  background: var(--c-vermilion); color: #FFFAF2;
  border: 1px solid var(--c-vermilion);
  border-radius: 6px; cursor: pointer;
  transition: all .18s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 2px 0 0 rgba(11,18,32,.08);
  animation: cta-breath 2.4s ease-in-out 1.6s infinite;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
@media (min-width: 480px) {
  .edit-cta-primary { padding: 14px 28px; }
}
@keyframes cta-breath {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.008); }
}
@media (hover: hover) {
  .edit-cta-primary:hover {
    background: var(--c-vermilion-h); border-color: var(--c-vermilion-h);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(178,58,43,.4), 0 2px 0 0 rgba(11,18,32,.08);
    letter-spacing: .015em;
    animation: none;
  }
}
.edit-cta-primary svg { width: 14px; height: 14px; }
/* P2-12: mobile 顯示短文案、≥480 顯示完整含考試類別 */
.edit-cta-primary .cta-text-long { display: none; }
.edit-cta-primary .cta-text-short { display: inline; }
@media (min-width: 480px) {
  .edit-cta-primary .cta-text-long { display: inline; }
  .edit-cta-primary .cta-text-short { display: none; }
}

.edit-cta-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  font-family: var(--ff-sans-en); font-size: 15px; font-weight: 500;
  color: var(--c-ink);
  background: transparent; border: 1px solid var(--c-rule);
  border-radius: 6px; cursor: pointer;
  transition: all .18s cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) {
  .edit-cta-ghost:hover { border-color: var(--c-ink); }
}

/* Stamp seal — small "115 考古題" red square stamp ornament beside H1 */
.edit-stamp {
  position: absolute; right: clamp(8px, 4vw, 80px); top: clamp(60px, 11vw, 140px);
  width: clamp(80px, 9vw, 120px); height: clamp(80px, 9vw, 120px);
  border: 2px solid var(--c-vermilion);
  background: var(--c-vermilion);
  color: #FFFAF2;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-serif-cn); font-weight: 800;
  font-size: clamp(14px, 1.6vw, 22px);
  text-align: center; line-height: 1.15;
  transform: rotate(-6deg) scale(0);
  transform-origin: center;
  animation: stamp-press .56s 1.4s cubic-bezier(.2,1.6,.4,1) forwards;
  box-shadow:
    inset 0 0 0 4px var(--c-vermilion),
    inset 0 0 0 5px rgba(255,250,242,.4),
    inset 0 0 0 6px var(--c-vermilion);
  letter-spacing: .04em;
  pointer-events: none;
  user-select: none;
}
@keyframes stamp-press {
  0%   { transform: rotate(-6deg) scale(0); opacity: 0; }
  60%  { transform: rotate(-6deg) scale(1.12); opacity: 1; }
  100% { transform: rotate(-6deg) scale(1); opacity: .92; }
}
/* hide stamp on narrow (≤md) to avoid overlap with hero */
@media (max-width: 767.98px) {
  .edit-stamp { display: none; }
}

/* Dashboard hero action — "今天的 20 分鐘" — for logged-in users
   2026-05-01 重整（3 agent mesh）：字級全 clamp 化、max-width 拉到 960、
   砍 tag 字眼、桌機 grid 重排（title+spec 左、CTA 右）、spec 顏色加深 */
.edit-action {
  max-width: clamp(720px, 92vw, 960px);
  margin: -32px auto 64px;
  padding: 0 clamp(20px, 5vw, 40px);
}
.edit-action-greet {
  font-family: var(--ff-mono);
  font-size: clamp(12px, .85vw, 14px);
  letter-spacing: .08em;
  color: var(--c-muted);
  margin-bottom: 14px;
}
.edit-action-greet strong { color: var(--c-ink); font-weight: 700; }
.edit-action-h2 {
  font-family: var(--ff-serif-cn);
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 700; letter-spacing: -.02em; color: var(--c-ink);
  margin: 0 0 28px;
}
.edit-action-card {
  background: var(--c-paper-2);
  border: 1px solid var(--c-rule);
  border-left: 4px solid var(--c-vermilion);
  padding: clamp(24px, 3vw, 40px) clamp(28px, 3.5vw, 48px);
  position: relative;
}
.edit-action-card::before {
  content: ''; position: absolute; top: 0; right: 0; width: 8px; height: 8px;
  background: var(--c-vermilion);
}
.edit-action-tag {
  font-family: var(--ff-mono);
  font-size: clamp(11px, .8vw, 13px);
  letter-spacing: .12em;
  text-transform: uppercase; color: var(--c-vermilion); font-weight: 600;
  margin-bottom: 10px;
}
.edit-action-title {
  font-family: var(--ff-serif-cn);
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 700;
  color: var(--c-ink); margin: 0 0 10px;
  line-height: 1.25;
}
.edit-action-spec {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-family: var(--ff-mono);
  font-size: clamp(13px, 1vw, 15px);
  color: var(--c-ink-2, var(--c-muted));
  margin-bottom: 24px;
}
.edit-action-spec .num { color: var(--c-ink); font-weight: 700; font-size: 1.05em; }
.edit-action-spec .sep { display: none; }
@media (min-width: 480px) {
  .edit-action-spec .sep { display: inline; opacity: .35; }
}
.edit-action-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: clamp(12px, 1vw, 16px) clamp(24px, 2vw, 32px);
  font-family: var(--ff-sans-en); font-weight: 700;
  font-size: clamp(15px, 1.1vw, 17px);
  background: var(--c-ink); color: #FFFAF2;
  border: none; border-radius: 4px;
  cursor: pointer; transition: all .18s cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) {
  .edit-action-cta:hover { background: var(--c-vermilion); }
}
.edit-action-skip {
  display: inline-block; margin-left: 12px;
  font-family: var(--ff-sans-en);
  font-size: clamp(13px, .95vw, 15px);
  color: var(--c-muted);
  background: none; border: none; cursor: pointer;
}
.edit-action-skip:hover { color: var(--c-ink); text-decoration: underline; }

/* 桌機（≥768px）：title+spec 左、CTA+skip 右；節省垂直空間，CTA 上移到首屏 */
@media (min-width: 768px) {
  .edit-action-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "tag    tag"
      "title  cta"
      "spec   cta";
    column-gap: clamp(24px, 3vw, 40px);
    align-items: center;
  }
  .edit-action-tag { grid-area: tag; margin-bottom: 6px; }
  .edit-action-title { grid-area: title; margin: 0; }
  .edit-action-spec { grid-area: spec; margin: 8px 0 0; }
  .edit-action-card > .edit-action-cta { grid-area: cta; align-self: center; margin: 0; }
  .edit-action-card > .edit-action-skip { grid-area: cta; align-self: end; justify-self: end; margin: 0 0 -28px; transform: translateY(100%); }
}

/* Editorial section header
   2026-05-06 PR-A 統一 vertical rhythm + 全部 header 置中（之前 padding 64 寫死、
   eyebrow/h2/lead 預設 left-align、看起來不一致；改成 responsive padding + 置中
   header 讓全站節奏整齊） */
.edit-section {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(56px, 7vw, 96px) clamp(20px, 5vw, 40px);
}
.edit-section-eyebrow {
  font-family: var(--ff-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--c-muted); margin: 0 auto 14px;
  text-align: center;
}
.edit-section-h2 {
  font-family: var(--ff-serif-cn); font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; letter-spacing: -.018em; color: var(--c-ink);
  margin: 0 auto 16px; max-width: 720px;
  text-align: center;
  text-wrap: pretty;
}
.edit-section-h2 .vermilion { color: var(--c-vermilion, var(--c-primary)); }
.edit-section-lead {
  font-family: var(--ff-sans-cn); font-size: 17px; line-height: 1.65;
  color: var(--c-muted); max-width: 640px; margin: 0 auto 40px;
  text-align: center;
}

/* Trust signals — 3 columns with hairline divider
   P1-7: 用 explicit columns + breakpoints；item 加 min-width:0 防溢出
   P1-8: ≤480 1col / ≤768 2col / ≥768 3col */
.edit-trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0; border-top: 1px solid var(--c-rule); border-bottom: 1px solid var(--c-rule);
}
.edit-trust-item {
  padding: 32px 28px;
  border-bottom: 1px solid var(--c-rule);
  min-width: 0;
}
.edit-trust-item:last-child { border-bottom: none; }
@media (min-width: 480px) {
  /* sm: 2 columns */
  .edit-trust { grid-template-columns: 1fr 1fr; }
  .edit-trust-item { border-right: 1px solid var(--c-rule); }
  .edit-trust-item:nth-child(2n) { border-right: none; }
  /* 倒數兩個 (兩欄時最後一行) 移除下邊框 */
  .edit-trust-item:nth-last-child(-n+2) { border-bottom: none; }
}
@media (min-width: 768px) {
  /* md+: 3 columns */
  .edit-trust { grid-template-columns: repeat(3, 1fr); }
  .edit-trust-item { border-right: 1px solid var(--c-rule); border-bottom: none; }
  .edit-trust-item:nth-child(2n) { border-right: 1px solid var(--c-rule); }
  .edit-trust-item:nth-child(3n),
  .edit-trust-item:last-child { border-right: none; }
}
.edit-trust-num {
  font-family: var(--ff-serif-en); font-size: 56px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink); line-height: 1; letter-spacing: -.02em;
  margin-bottom: 10px;
}
.edit-trust-label {
  font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--c-muted); margin-bottom: 8px;
}
.edit-trust-desc {
  font-family: var(--ff-sans-cn); font-size: 13.5px; line-height: 1.55;
  color: var(--c-ink);
}

/* ═══════════════════════════════════════════════════════════════
   2026-05-07 v4 Sticky Demo（chrome Claude review fixes）
   桌機（≥901）：左 sticky iPhone（修破損）+ 右 6 卡片化 panel（.is-active）
   手機（≤900）：carousel 6 張 slide（scroll-snap + dots + prev/next）
═══════════════════════════════════════════════════════════════ */
.sticky-demo {
  padding-top: clamp(96px, 12vh, 160px);
  padding-bottom: clamp(96px, 12vh, 160px);
  max-width: 1280px;
}
.sticky-demo .edit-section-h2 + .sd-lede { margin-top: 24px; }
.sd-lede {
  font-family: var(--ff-serif-cn);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.75;
  color: var(--c-text);
  max-width: 720px;
  margin: 14px auto 0;       /* 置中：margin-inline auto */
  text-align: center;        /* 文字也置中 */
  text-wrap: balance;        /* balance 比 pretty 更會避開單字、不會在「題庫」/「3 秒」前後切斷 */
}
.sd-lede strong { color: var(--c-ink); font-weight: 700; }
.sd-lede em {
  font-style: normal;
  color: var(--c-vermilion);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sd-layout {
  margin-top: 80px;            /* lede ↔ layout */
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: start;
}

/* === 桌機 ≥901：左 sticky + 右 panels === */
@media (min-width: 901px) {
  .sd-media-col {
    position: sticky;
    top: var(--hdr-h, 56px);
    height: calc(100vh - var(--hdr-h, 56px));
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sd-carousel { display: none; }
}

/* === 手機 ≤900：sd-layout 換成單欄、隱藏 sticky col + panels-col、改 carousel === */
@media (max-width: 900px) {
  .sd-layout { display: block; }
  .sd-media-col,
  .sd-panels-col { display: none; }
}

/* === 左 sticky stage：vertical progress rail + iPhone === */
.sd-stage {
  position: relative;
  width: 100%;
  max-width: 480px;     /* 配合 iPhone 寬到 440 */
}

/* Vertical progress rail — 6 段 hairline + 底部 mono 計數器
   editorial / architectural drawing 風格，取代之前蓋住 iPhone 的大序號 */
.sd-rail {
  position: absolute;
  left: -36px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  user-select: none;
  z-index: 2;     /* 高於 phone-wrap 因為定位在外側 */
}
.sd-rail-tick {
  width: 1px;
  height: 32px;
  background: color-mix(in oklch, var(--c-ink) 12%, transparent);
  border-radius: 1px;
  transition: background .35s ease, height .35s cubic-bezier(.34, 1.4, .64, 1), box-shadow .35s ease;
}
.sd-rail-tick[data-passed] {
  background: color-mix(in oklch, var(--c-vermilion) 35%, transparent);
}
.sd-rail-tick[data-active] {
  background: var(--c-vermilion);
  height: 44px;        /* current 拉長 12px，視覺強化 */
  box-shadow: 0 0 8px color-mix(in oklch, var(--c-vermilion) 50%, transparent);
}
.sd-rail-counter {
  margin-top: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--c-vermilion);
  font-variant-numeric: tabular-nums;
  writing-mode: vertical-rl;       /* 垂直排版，跟 rail 同方向 */
  white-space: nowrap;
}
.sd-rail-counter-of {
  color: color-mix(in oklch, var(--c-ink) 40%, transparent);
  font-weight: 500;
}

/* RWD：rail 在窄桌機可能撞 sticky col 左邊；窄一點就藏 */
@media (max-width: 1099px) {
  .sd-rail { left: -28px; }
  .sd-rail-tick { height: 24px; }
  .sd-rail-tick[data-active] { height: 34px; }
}
@media (max-width: 980px) {
  .sd-rail { display: none; }       /* 太窄就藏（panel caption 已有編號）*/
}

/* iPhone wrap */
.sd-phone-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

/* === iPhone 框 — user 三次回饋累積版
   - 放胖（440 寬 + 9/15 比例）
   - 圓角自然化：用 asymmetric % radius (12% 水平 / 7% 垂直 = 真實 iPhone 圓潤感)
   - dark mode 不同色（避免黑框沒入暗 bg）
   - 內外 highlight 雙層光，看起來像金屬機身不是貼紙 === */
.iphone-frame {
  position: relative;
  width: clamp(360px, 26vw, 440px);
  max-width: 100%;
  aspect-ratio: 9 / 15;
  /* asymmetric radius — 真 iPhone 比例（水平比垂直圓）*/
  border-radius: 12% / 7%;
  background:
    /* 機身漸層：上深下淺微 highlight（金屬反光感）*/
    linear-gradient(165deg, #1a1a1f 0%, #0a0a0d 30%, #0a0a0d 70%, #18181c 100%);
  padding: 2.5%;
  box-shadow:
    /* 浮動陰影 */
    0 30px 60px -20px rgba(0, 0, 0, .35),
    0 60px 120px -40px rgba(0, 0, 0, .2),
    /* 上邊光（鏡面反射）+ 內描邊 */
    inset 0 1.5px 0 rgba(255, 255, 255, .12),
    inset 0 0 0 1.5px rgba(255, 255, 255, .04),
    inset 0 0 0 3px #050507;
  overflow: hidden;
  isolation: isolate;
  /* 2026-05-07 fix(carousel)：iphone-frame 純展示（沒 hover/click），事件直接 fall through
     到 .sd-carousel-track 才能讓 user 在 mockup 上 swipe 切 slide。沒設 pointer-events:none
     時 <img> 會被瀏覽器當 native draggable 攔截觸控/拖曳 → 整個 mockup 區滑不動。
     desktop sticky 版也安全（沒 hover-trigger） */
  pointer-events: none;
  /* 防禦性雙保險：禁止圖片 native drag（部分瀏覽器即使 pointer-events:none 仍會觸發 drag）*/
  -webkit-user-drag: none;
  user-select: none;
}
[data-theme="dark"] .iphone-frame {
  /* dark mode 用「太空灰」石墨色取代純黑（vs 暗 sepia bg 才看得到）*/
  background:
    linear-gradient(165deg, #4a4036 0%, #2e2820 30%, #2e2820 70%, #4a4036 100%);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, .55),
    0 60px 120px -40px rgba(0, 0, 0, .35),
    inset 0 1.5px 0 rgba(255, 255, 255, .1),
    inset 0 0 0 1.5px rgba(255, 255, 255, .05),
    inset 0 0 0 3px #1a1612;
}
.iphone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  /* 螢幕圓角比 frame 內小一截（asymmetric 配合 frame）*/
  border-radius: 9.5% / 5.5%;
  overflow: hidden;
  background: var(--c-surface);
  /* 螢幕邊緣 inset 黑色 hairline 像實機顯示器邊框 */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4);
}
.iphone-screen > img,
.iphone-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: opacity .45s ease;
}
.iphone-frame.is-swapping .iphone-shot { opacity: 0; }

/* === sync mockup：科技感版 ===
   多層複合：grid 背景 + 雷達 + 3 節點脈動 + 沿線封包流 + 終端 log
   全 CSS 動畫、用 currentColor 統一朱印紅 */
.iphone-sync-mockup { display: none; }
.iphone-frame[data-feature="sync"] .iphone-shot { display: none; }
.iphone-frame[data-feature="sync"] .iphone-sync-mockup.tech-sync {
  display: flex;
  flex-direction: column;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at top, color-mix(in oklch, var(--c-vermilion) 4%, var(--c-surface)) 0%, var(--c-surface) 70%),
    var(--c-surface);
  /* user 回饋：占滿手機螢幕、不要留白 */
  padding: 0;
  gap: 0;
  color: var(--c-vermilion);
  font-family: ui-monospace, 'SF Mono', monospace;
  position: relative;
  overflow: hidden;
  /* 效能：contain 讓子層 layout/paint 不擴散到外面 */
  contain: layout paint;
}
/* 整層 scanline 紋理（細微，像螢幕掃描線）*/
.iphone-frame[data-feature="sync"] .iphone-sync-mockup.tech-sync::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 3px,
    color-mix(in oklch, var(--c-vermilion) 4%, transparent) 3px,
    color-mix(in oklch, var(--c-vermilion) 4%, transparent) 4px
  );
  pointer-events: none;
  opacity: .5;
  z-index: 0;
}
.iphone-frame[data-feature="sync"] .iphone-sync-mockup.tech-sync > * { position: relative; z-index: 1; }

/* === 1. 上方 status bar === */
.ts-statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  border-bottom: 1px solid color-mix(in oklch, var(--c-vermilion) 22%, transparent);
  padding: 5% 5%;
  flex-shrink: 0;
}
.ts-statusbar-label { color: var(--c-vermilion); font-weight: 600; }
.ts-statusbar-meta {
  margin-left: auto;
  color: color-mix(in oklch, var(--c-ink) 55%, transparent);
  font-size: 8px;
  letter-spacing: .12em;
}
/* 雷達脈衝 — 中央實心 dot + 兩個外擴環 */
.ts-radar {
  position: relative;
  width: 12px; height: 12px;
  flex-shrink: 0;
}
.ts-radar-core {
  position: absolute;
  inset: 4px;
  background: var(--c-vermilion);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--c-vermilion);
}
.ts-radar-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--c-vermilion);
  border-radius: 50%;
  opacity: 0;
  animation: ts-radar-pulse 1.8s cubic-bezier(.4, 0, .2, 1) infinite;
}
.ts-radar-ring-2 { animation-delay: .9s; }
@keyframes ts-radar-pulse {
  0%   { transform: scale(.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* === 2. 網路 constellation（占滿、無 padding） === */
.ts-network {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
  padding: 0;
}
.ts-network svg {
  width: 100%;
  height: 100%;
  display: block;
  color: var(--c-vermilion);
}
/* 連線：虛線流動 */
.ts-link {
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  opacity: .6;
}
.ts-link-1 { animation: ts-link-flow 1.4s linear infinite; }
.ts-link-2 { animation: ts-link-flow 1.4s linear infinite .35s; }
@keyframes ts-link-flow {
  to { stroke-dashoffset: -12; }
}
/* 沿線飛行的封包 — offset-path（modern browser）*/
.ts-packet {
  filter: drop-shadow(0 0 3px currentColor);
}
.ts-packet-1 {
  offset-path: path('M 32 55 Q 60 100, 100 155');
  animation: ts-packet-fly 1.8s linear infinite;
}
.ts-packet-2 {
  offset-path: path('M 100 155 Q 140 215, 168 260');
  animation: ts-packet-fly 1.8s linear infinite .9s;
}
.ts-packet-3 {
  offset-path: path('M 168 260 Q 130 215, 100 155');
  animation: ts-packet-fly 2.4s linear infinite 1.2s;
}
@keyframes ts-packet-fly {
  0%   { offset-distance: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
/* fallback：不支援 offset-path 的瀏覽器，封包就藏起來 */
@supports not (offset-path: path('M 0 0')) {
  .ts-packet { display: none; }
}
/* 節點 ring + pulse */
.ts-node-ring {
  stroke: currentColor;
  stroke-width: 1.2;
}
.ts-node-pulse {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  animation: ts-node-pulse 2s cubic-bezier(.4, 0, .2, 1) infinite;
}
.ts-node-cloud .ts-node-pulse { animation-delay: .4s; }
.ts-node-laptop .ts-node-pulse { animation-delay: .8s; }
@keyframes ts-node-pulse {
  0%   { transform: scale(1); opacity: .8; }
  100% { transform: scale(1.8); opacity: 0; }
}
.ts-node-icon { fill: var(--c-ink); }
.ts-node-label,
.ts-node-latency { fill: color-mix(in oklch, var(--c-ink) 55%, transparent); }
.ts-node-latency {
  fill: var(--c-vermilion);
  font-weight: 700;
}

/* 右上 / 左上 tickers */
.ts-ticker text { fill: var(--c-vermilion); }
.ts-ticker .ts-ticker-num {
  font-weight: 700;
  font-size: 7px;
}
.ts-ticker text:first-child {
  fill: color-mix(in oklch, var(--c-ink) 50%, transparent);
}
.ts-ticker-2 text {
  text-anchor: start;
}

/* === 3. 終端 log（user 回饋：原本看不清楚、放大） === */
.ts-terminal {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5% 5% 6%;
  border-top: 1px solid color-mix(in oklch, var(--c-vermilion) 22%, transparent);
  background: color-mix(in oklch, var(--c-bg) 50%, transparent);
  font-size: 12px;          /* 9 → 12px、明顯放大 */
  letter-spacing: .03em;
  line-height: 1.4;
}
.ts-log-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  opacity: 0;
  /* 8s loop 比舊 5s 慢、停留時間更長 */
  animation: ts-log-reveal 8s cubic-bezier(.4, 0, .2, 1) infinite;
}
.ts-log-1 { animation-delay: 0s; }
.ts-log-2 { animation-delay: 2s; }
.ts-log-3 { animation-delay: 4s; }
@keyframes ts-log-reveal {
  0%, 2%   { opacity: 0; transform: translateX(-3px); }
  6%, 78%  { opacity: 1; transform: translateX(0); }   /* 持久顯示，看得到 */
  88%      { opacity: .3; }
  100%     { opacity: 0; }
}
.ts-arrow { color: var(--c-vermilion); font-weight: 700; flex-shrink: 0; font-size: 13px; }
.ts-arrow-down { color: color-mix(in oklch, var(--c-ink) 55%, transparent); }
.ts-cmd { color: var(--c-ink); font-weight: 600; }
.ts-dots { color: color-mix(in oklch, var(--c-ink) 22%, transparent); flex: 1; overflow: hidden; min-width: 0; }
.ts-payload { color: color-mix(in oklch, var(--c-ink) 80%, transparent); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ts-status {
  margin-left: auto;
  color: var(--c-vermilion);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 11.5px;
}
.ts-status-success { color: var(--c-vermilion); }

/* === 效能優化（user 回饋：別讓低階電腦 lag）===
   當 sync mockup 不在 viewport 內、或 frame 不是 active sync 時、暫停所有動畫
   只有 frame data-feature="sync" 且在 viewport 內才跑動畫 */
.iphone-sync-mockup.tech-sync * { animation-play-state: paused; }
/* sync 是 active feature 才 run（IO + JS 都會切到 sync） */
.iphone-frame[data-feature="sync"] .iphone-sync-mockup.tech-sync * { animation-play-state: running; }
/* will-change 只 promote 真的在動的元素，且只 sync active 時 */
.iphone-frame[data-feature="sync"] .ts-radar-ring,
.iphone-frame[data-feature="sync"] .ts-link-1,
.iphone-frame[data-feature="sync"] .ts-link-2,
.iphone-frame[data-feature="sync"] .ts-packet,
.iphone-frame[data-feature="sync"] .ts-node-pulse,
.iphone-frame[data-feature="sync"] .ts-log-line {
  will-change: transform, opacity;
}

/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .ts-radar-ring,
  .ts-link-1, .ts-link-2,
  .ts-packet-1, .ts-packet-2, .ts-packet-3,
  .ts-node-pulse,
  .ts-log-line { animation: none !important; opacity: 1 !important; }
}

/* Dynamic Island 已移除（user：擋到畫面）*/

/* 側鈕 — user 回饋：要看得出是手機，把按鈕做明顯
   設計：
   - 寬度從 0.7% → 1.4%（看得到了）
   - 凸出 frame 邊緣 -1.4%（左/右各凸 ~6px）
   - 金屬漸層 + 上下深陰影（不是平面色塊）
   - 圓角小 radius，顯得是物理鍵按下的形狀 */
.iphone-btn {
  position: absolute;
  width: 1.4%;
  background:
    linear-gradient(90deg,
      #0a0a0c 0%,
      #2a2a2e 30%,
      #4a4a4e 50%,
      #2a2a2e 70%,
      #0a0a0c 100%);
  border-radius: 2px;
  z-index: 2;
  box-shadow:
    /* 鍵側邊深陰影（裡邊更深、外邊有 highlight）*/
    inset 1px 0 0 rgba(255, 255, 255, .12),
    inset -1px 0 0 rgba(0, 0, 0, .4),
    /* 鍵浮在 frame 上的微影 */
    0 1px 1px rgba(0, 0, 0, .3);
}
[data-theme="dark"] .iphone-btn {
  background:
    linear-gradient(90deg,
      #2a2620 0%,
      #4a4136 30%,
      #6a5e4e 50%,
      #4a4136 70%,
      #2a2620 100%);
}
.iphone-btn-mute  { left: -1.2%; top: 13%; height: 5%; border-radius: 2px 1px 1px 2px; }
.iphone-btn-vup   { left: -1.2%; top: 21%; height: 9%; }
.iphone-btn-vdn   { left: -1.2%; top: 32%; height: 9%; }
.iphone-btn-power { right: -1.2%; top: 24%; height: 14%; border-radius: 1px 2px 2px 1px; }

/* === 桌機右側 panels — 5 人 mesh 重設計（無 box / chapter heading + 朱印 rule + micro-proof）=== */
.sd-panels-col {
  flex-direction: column;
  gap: clamp(40px, 5vh, 64px);
}
@media (min-width: 901px) {
  .sd-panels-col {
    display: flex;
    /* user 回饋：第 6 panel 一進畫面 sticky 就斷 → 加底部 spacer 讓 sticky 撐滿到 panel 6 中央 */
    padding-bottom: 50vh;
  }
}
.sd-panel {
  position: relative;
  max-width: 540px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 24px;
  padding: 8px 0;
  transition: opacity .4s ease;
}
@media (min-width: 901px) {
  /* user 回饋：panel 太短 → 滑兩下就跳 panel
     拉到 80vh 讓每個 panel 滾過 1 個 viewport 才被下一格取代 */
  .sd-panel { min-height: 80vh; align-content: center; }
}
.sd-panel:not(.is-active) { opacity: .35; }      /* 砍掉 .55、降到 .35 讓 active 更突出 */
.sd-panel.is-active { opacity: 1; }

/* 左 rule + 編號 + 印章 dot */
.sd-panel-rule {
  position: relative;
  height: 100%;
  min-height: 80px;
}
.sd-panel-num {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--c-vermilion);
}
.sd-panel-rule::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 26px;
  bottom: 0;
  width: 4px;
  margin-left: -2px;
  background: color-mix(in oklch, var(--c-vermilion) 30%, transparent);
  border-radius: 2px;
  transition: width .4s cubic-bezier(.34, 1.4, .64, 1), margin-left .4s, background .4s;
}
.sd-panel.is-active .sd-panel-rule::before {
  width: 8px;
  margin-left: -4px;
  background: var(--c-vermilion);
}
.sd-panel-stamp {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--c-vermilion);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--c-bg) 100%, transparent),
              0 0 12px color-mix(in oklch, var(--c-vermilion) 40%, transparent);
}
.sd-panel.is-active .sd-panel-stamp {
  animation: sd-stamp-slide-in .55s cubic-bezier(.34, 1.5, .64, 1) forwards;
}
@keyframes sd-stamp-slide-in {
  0%   { opacity: 0; transform: translate(-50%, -24px) rotate(-12deg); }
  60%  { opacity: 1; transform: translate(-50%, 4px) rotate(8deg); }
  100% { opacity: 1; transform: translate(-50%, 0) rotate(0); }
}

/* Body — H3 + proof + desc */
.sd-panel-body { min-width: 0; }

/* === Micro-proof chips（每 panel 不同視覺證據）=== */
.proof {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 12px;
  font-family: var(--ff-mono);
  font-size: 12px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--c-vermilion) 5%, transparent);
  border: 1px solid color-mix(in oklch, var(--c-vermilion) 20%, transparent);
  color: var(--c-ink);
  flex-wrap: wrap;
}

/* 01 AI 評分 — 分數 badge */
.proof-score .ps-num {
  font-family: var(--ff-serif-cn, serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--c-vermilion);
}
.proof-score .ps-denom { color: var(--c-muted); font-size: 12px; }
.proof-score .ps-grade {
  background: var(--c-vermilion);
  color: var(--c-bg);
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--ff-serif-cn, serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.proof-score .ps-meta { color: var(--c-muted); font-size: 11px; }

/* 02 SRS — 時間軸 */
.proof-timeline .pt-tick {
  padding: 2px 7px;
  border: 1px solid color-mix(in oklch, var(--c-vermilion) 30%, transparent);
  border-radius: 4px;
  color: var(--c-vermilion);
  font-weight: 600;
  font-size: 11px;
}
.proof-timeline .pt-arrow {
  color: var(--c-vermilion);
  font-weight: 600;
}
.proof-timeline .pt-meta { color: var(--c-muted); font-size: 11px; margin-left: 4px; }

/* 03 popover — hover demo */
.proof-hover .ph-link {
  color: var(--c-vermilion);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  font-weight: 600;
}
.proof-hover .ph-arrow { color: var(--c-vermilion); }
.proof-hover .ph-quote {
  color: var(--c-text);
  font-family: var(--ff-serif-cn, serif);
  font-size: 12px;
  font-style: normal;
}

/* 04 TTS — 三 voice chips */
.proof-voices .pv-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--c-vermilion) 12%, transparent);
  border: 1px solid color-mix(in oklch, var(--c-vermilion) 28%, transparent);
  color: var(--c-vermilion);
  font-weight: 600;
  font-size: 11px;
}
.proof-voices .pv-meta { color: var(--c-muted); font-size: 11px; margin-left: 4px; }

/* 05 stats — sparkline */
.proof-spark {
  color: var(--c-vermilion);
}
.proof-spark svg {
  width: 100px;
  height: 28px;
}
.proof-spark .psp-meta { color: var(--c-muted); font-size: 11px; }

/* 06 sync — device flow */
.proof-sync .psy-icon {
  font-size: 16px;
  filter: grayscale(.15);
}
.proof-sync .psy-arrow {
  color: var(--c-vermilion);
  font-weight: 600;
}
.proof-sync .psy-meta { color: var(--c-muted); font-size: 11px; margin-left: 4px; }

/* ═══════════════════════════════════
   sd-anim — 卡片下方動畫填充（user 2026-05-08）
   填充 desc 下空白；只在 .is-active 卡片播放（perf）；reduced-motion → 全靜
   6 種動畫對應 6 panel：grade(柱) / srs(時間軸) / scan(掃描) / wave(聲波) / heat(熱力) / sync(穿梭)
   ═══════════════════════════════════ */
.sd-anim {
  margin: 16px 0 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 28px;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--c-muted);
  text-transform: uppercase;
}
.sd-anim .lbl {
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10.5px;
}
/* play-state 控制：specificity 對齊每條 animation rule（source order 在後） */

/* === 01 ai：4 條評分柱依序拉高 === */
.sda-grade { gap: 8px; height: 32px; align-items: flex-end; }
.sda-grade .b {
  width: 8px;
  flex: 0 0 8px;
  height: 6px;
  background: var(--c-vermilion);
  border-radius: 2px;
  animation: sda-grade-grow 4s ease-in-out infinite;
}
.sda-grade .b:nth-child(1) { --max: 18px; animation-delay: 0s; }
.sda-grade .b:nth-child(2) { --max: 28px; animation-delay: .25s; }
.sda-grade .b:nth-child(3) { --max: 22px; animation-delay: .5s; }
.sda-grade .b:nth-child(4) { --max: 30px; animation-delay: .75s; }
@keyframes sda-grade-grow {
  0%, 100% { height: 4px; opacity: .55; }
  40%, 60% { height: var(--max, 20px); opacity: 1; }
}

/* === 02 srs：3 個 dot 在 timeline 上 7d→21d→60d pulse === */
.sda-srs { gap: 8px; height: 28px; align-items: center; }
.sda-srs .rail {
  position: relative;
  flex: 1;
  height: 1px;
  background: color-mix(in oklch, var(--c-vermilion) 28%, transparent);
}
.sda-srs .pt {
  position: absolute;
  top: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-vermilion);
  transform: translate(-50%, -50%);
  animation: sda-srs-pulse 4.2s ease-in-out infinite;
}
.sda-srs .pt:nth-child(1) { left: 8%;  animation-delay: 0s; }
.sda-srs .pt:nth-child(2) { left: 50%; animation-delay: 1.2s; }
.sda-srs .pt:nth-child(3) { left: 92%; animation-delay: 2.4s; }
@keyframes sda-srs-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 color-mix(in oklch, var(--c-vermilion) 40%, transparent);
  }
  20% {
    transform: translate(-50%, -50%) scale(1.7);
    box-shadow: 0 0 0 5px transparent;
  }
}

/* === 03 popover：水平 hairline + 高光掃描 === */
.sda-scan { gap: 8px; height: 18px; align-items: center; }
.sda-scan .line {
  position: relative;
  flex: 1;
  height: 1px;
  background: color-mix(in oklch, var(--c-vermilion) 25%, transparent);
  overflow: hidden;
}
.sda-scan .line::after {
  content: '';
  position: absolute;
  top: -2px; left: 0;
  width: 35%; height: 5px;
  background: linear-gradient(90deg, transparent 0%, var(--c-vermilion) 50%, transparent 100%);
  filter: blur(1px);
  animation: sda-scan-sweep 3.4s ease-in-out infinite;
}
@keyframes sda-scan-sweep {
  0%   { transform: translateX(-110%); opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(290%); opacity: 0; }
}

/* === 04 tts：聲波 28 條（user 直接點名）=== */
.sda-wave { gap: 2.5px; height: 32px; align-items: center; }
.sda-wave .bar {
  width: 2.5px;
  flex: 0 0 2.5px;
  height: 4px;
  background: var(--c-vermilion);
  border-radius: 2px;
  animation: sda-wave-pulse 1.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.sda-wave .bar:nth-child(4n+1) { --h: 22px; }
.sda-wave .bar:nth-child(4n+2) { --h: 14px; }
.sda-wave .bar:nth-child(4n+3) { --h: 28px; }
.sda-wave .bar:nth-child(4n)   { --h: 18px; }
@keyframes sda-wave-pulse {
  0%, 100% { height: 4px;  opacity: .55; }
  50%      { height: var(--h, 18px); opacity: 1; }
}

/* === 05 stats：45 格熱力 wave === */
.sda-heat {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  width: 100%;
  height: 32px;
  align-items: stretch;
}
.sda-heat .d {
  background: color-mix(in oklch, var(--c-vermilion) 14%, transparent);
  border-radius: 2px;
  animation: sda-heat-pulse 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes sda-heat-pulse {
  0%, 100% { background: color-mix(in oklch, var(--c-vermilion) 12%, transparent); }
  50%      { background: var(--c-vermilion); }
}

/* === 06 sync：軌道 + 兩個 packet 來回穿梭 === */
.sda-sync { gap: 8px; height: 24px; align-items: center; }
.sda-sync .rail {
  position: relative;
  flex: 1;
  height: 1px;
  background: color-mix(in oklch, var(--c-vermilion) 25%, transparent);
}
.sda-sync .pkt {
  position: absolute;
  top: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-vermilion);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px color-mix(in oklch, var(--c-vermilion) 50%, transparent);
  animation: sda-sync-shuttle 2.8s cubic-bezier(.4,0,.6,1) infinite;
}
.sda-sync .pkt:nth-child(2) { animation-delay: 1.4s; opacity: .7; }
@keyframes sda-sync-shuttle {
  0%   { left: 0%; }
  50%  { left: 100%; }
  100% { left: 0%; }
}

/* === play-state：預設 paused，僅 .is-active 卡片內元素 running === */
/* 必須放在所有 animation 宣告之後，且 selector specificity 對齊（source order tiebreak） */
.sda-grade .b,
.sda-srs   .pt,
.sda-scan  .line::after,
.sda-wave  .bar,
.sda-heat  .d,
.sda-sync  .pkt {
  animation-play-state: paused;
}
.sd-panel.is-active .sda-grade .b,
.sd-panel.is-active .sda-srs   .pt,
.sd-panel.is-active .sda-scan  .line::after,
.sd-panel.is-active .sda-wave  .bar,
.sd-panel.is-active .sda-heat  .d,
.sd-panel.is-active .sda-sync  .pkt,
.sd-slide.is-active .sda-grade .b,
.sd-slide.is-active .sda-srs   .pt,
.sd-slide.is-active .sda-scan  .line::after,
.sd-slide.is-active .sda-wave  .bar,
.sd-slide.is-active .sda-heat  .d,
.sd-slide.is-active .sda-sync  .pkt {
  animation-play-state: running;
}

/* reduced-motion → 全靜（仍可見 layout、但無動）*/
@media (prefers-reduced-motion: reduce) {
  .sd-anim, .sd-anim *, .sd-anim *::before, .sd-anim *::after {
    animation: none !important;
  }
  .sda-grade .b { height: 18px; opacity: 1; }
  .sda-wave .bar { height: 14px; opacity: 1; }
}

/* mobile slide 內 sd-anim：縮一點 */
@media (max-width: 900px) {
  .sd-anim { margin-top: 12px; min-height: 24px; }
  .sda-grade { height: 28px; }
  .sda-wave  { height: 28px; }
  .sda-heat  { height: 28px; grid-template-columns: repeat(15, 1fr); }
}

.sd-h {
  font-family: var(--ff-serif-cn);
  font-size: clamp(26px, 3vw, 38px);     /* 拉大、chapter heading 級 */
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.018em;
  color: var(--c-ink);
  margin: 0 0 14px;
}
.sd-desc {
  font-family: var(--ff-serif-cn);
  font-size: clamp(14.5px, 1.1vw, 16px);
  line-height: 1.7;
  color: var(--c-text);
  margin: 0;
  text-wrap: pretty;
}
.sd-desc strong { color: var(--c-ink); font-weight: 700; }

/* ═════════ 手機 carousel（≤900）═════════ */
@media (min-width: 901px) {
  .sd-carousel { display: none; }
}
.sd-carousel { position: relative; }
.sd-carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12vw;
  padding: 8px 12vw;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  outline: none;
  /* 2026-05-11 fix：原本寫 pan-x 想說「吃水平、放垂直 scroll 過」是錯的
     MDN 講明白 pan-x 只允許水平、**禁止垂直** → 手指在 carousel 上下滑被卡死、
     整頁無法往下滑（user 2026-05-11 抱怨「手機看到首頁截圖沒辦法往下滑」）
     改 touch-action: auto 讓瀏覽器自己判方向，犧牲前幾 px 的判斷時間
     避免擋住整頁垂直滑動 */
  touch-action: auto;
}
.sd-carousel-track::-webkit-scrollbar { display: none; }
.sd-carousel-track:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--c-vermilion) 50%, transparent);
  outline-offset: 4px;
  border-radius: 8px;
}

.sd-slide {
  flex: 0 0 78vw;
  max-width: 380px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 只 transition opacity（GPU、不影響佈局）；transform 不 transition —
     class toggle 是 snap 完才打的「拍板」瞬間，不需要動畫 */
  transition: opacity .25s ease;
  will-change: opacity;
}
.sd-slide:not(.is-active) {
  /* 砍 transform: scale —— scale .92 + .4s ease 跟 native scroll-snap 競態，
     是「轉完一直抖」的視覺源頭。改純 opacity 對比，視覺照樣聚焦 active 卡 */
  opacity: .5;
}
/* 2026-05-08 mobile fit fix：iPhone 從 260 縮 220（高度 433→367，省 66px）
   讓 heading + proof + desc + sd-anim 全塞進 viewport 不被底部 navbar 蓋 */
.sd-slide-phone {
  width: 220px;
  max-width: 100%;
}
.sd-slide-phone .iphone-frame {
  width: 220px;
}

/* slide body — 朱印 rule + body grid（仿桌面 chapter heading）*/
.sd-slide-body {
  margin-top: 22px;
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  text-align: left;
  padding: 0 6px;
}

/* slide rule + 編號 + 印章 dot */
.sd-slide-rule {
  position: relative;
  height: 100%;
  min-height: 60px;
}
.sd-slide-num {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--c-vermilion);
}
.sd-slide-rule::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 22px;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  background: color-mix(in oklch, var(--c-vermilion) 30%, transparent);
  border-radius: 2px;
  transition: width .35s, background .35s;
}
.sd-slide.is-active .sd-slide-rule::before {
  width: 6px;
  margin-left: -3px;
  background: var(--c-vermilion);
}
.sd-slide-stamp {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--c-vermilion);
  opacity: 0;
}
.sd-slide.is-active .sd-slide-stamp {
  animation: sd-stamp-slide-in .55s cubic-bezier(.34, 1.5, .64, 1) forwards;
}

/* slide text */
.sd-slide-text { min-width: 0; }
.sd-slide-text h3 {
  font-family: var(--ff-serif-cn, serif);
  font-size: clamp(22px, 5.6vw, 26px);  /* 2026-05-08 fit：28→26、避免 230px 寬下「真人 TTS 朗讀」斷成兩行 */
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.018em;
  color: var(--c-ink);
  margin: 0 0 10px;
  text-wrap: balance;
}
.sd-slide-text p {
  font-family: var(--ff-serif-cn, serif);
  font-size: clamp(13.5px, 3.5vw, 15px);  /* 14.5-16 → 13.5-15，省高度 */
  line-height: 1.65;
  color: var(--c-text);
  margin: 0;
  text-wrap: pretty;
}
.sd-slide-text p strong { color: var(--c-ink); font-weight: 700; }

/* 確保 .proof chip 在 mobile 也好看 */
.sd-slide-text .proof {
  font-size: 11.5px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* === 5. scroll-driven view() animation：micro-proof + desc 進場 fade-in
   只在桌機開（≥901）：手機是水平 carousel，view() 量的是縱向 scroll progress，
   永遠不會 enter cover 範圍 → opacity 卡 0 → proof+desc+sd-anim 整片消失。
   mobile carousel 直接用基礎樣式（永遠可見） === */
@supports (animation-timeline: view()) {
  @media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
    .sd-slide.is-active .proof,
    .sd-slide.is-active .sd-slide-text p {
      animation: sd-slide-reveal linear both;
      animation-timeline: view();
      animation-range: cover 30% cover 60%;
    }
    @keyframes sd-slide-reveal {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }
  }
}

/* === Carousel dots（取代 hairline + counter）===
   user 回報 hairline+counter 視覺醜、看不出在哪張。改一張一個圓點，
   active 朱印紅、其他灰；點擊可直接跳到該 slide。
   無 width transition → indicator 自己不會抖（class toggle 純 color 變） */
.sd-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding: 0 12vw;
}
.sd-dot {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--c-ink) 18%, transparent);
  cursor: pointer;
  /* 加大 tap target 到 32px（W3C 建議）— 透過透明 padding/inset 不影響視覺 */
  position: relative;
  transition: background .18s ease, transform .18s ease;
}
.sd-dot::before {
  content: '';
  position: absolute;
  inset: -12px;          /* 8 + 12*2 = 32px hit area */
}
.sd-dot:hover {
  background: color-mix(in oklch, var(--c-ink) 32%, transparent);
}
.sd-dot:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--c-vermilion) 50%, transparent);
  outline-offset: 4px;
}
.sd-dot.is-active {
  background: var(--c-vermilion);
  transform: scale(1.25);  /* 微放大強調 active */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .iphone-shot,
  .sd-bignum,
  .sd-think,
  .sd-think-text,
  .sd-think-dot,
  .sd-panel,
  .sd-slide { transition: none; animation: none; }
}

