/* 佔位頁專用版面；品牌變數與基礎排版在 brand.css */

:root {
  --bar-h: 56px; /* App Bar 高度（手機）；錨點捲動時預留 */
  --tab-h: 56px; /* 底部 Tab Bar 高度 */
  --glow: 0.22; /* 遠景光暈不透明度；深色主題調低避免刺眼 */
  --tint-blue: #e6f6fb; /* 淡藍色帶 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --glow: 0.14;
    --tint-blue: #0f2a3a;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-tap-highlight-color: transparent;
}

/* 版心左右留出瀏覽器安全區（瀏海、圓角） */
.wrap {
  padding-left: max(var(--s4), env(safe-area-inset-left));
  padding-right: max(var(--s4), env(safe-area-inset-right));
}

/* 只給輔助科技讀的文字／視覺上隱藏但仍可聚焦的 input */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 只有啟用 JS 才有意義的提示 */
.js-only {
  display: none;
}

.js .js-only {
  display: block;
}

.skip-link {
  z-index: 30; /* 高於 sticky App Bar */
}

.disclosure {
  padding-top: calc(var(--s3) + env(safe-area-inset-top));
}

/* App Bar：sticky；揭露列在它上方（頁面最頂端） */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--bar-h);
}

.icon-btn,
.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  transition: transform 120ms var(--ease);
}

.icon-btn svg,
.back svg {
  width: 24px;
  height: 24px;
}

.back {
  gap: var(--s1);
  margin-left: -10px;
  padding-right: var(--s3);
  font-weight: 700;
}

.icon-btn {
  margin-right: -10px;
}

.icon-btn:active,
.back:active {
  transform: scale(0.97);
}

/* 桌機不顯示「返回」與 Tab Bar */
.back,
.tabbar {
  display: none;
}

section[id] {
  scroll-margin-top: calc(var(--bar-h) + var(--s2));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--s6);
  margin-top: var(--s4);
  background: var(--brand-orange);
  color: var(--brand-navy);
  border: 2px solid var(--brand-orange);
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
  transition: transform 120ms var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}

/* ============ 通用圖示：雙色線條（主線＝文字色，點綴＝品牌橘／藍） ============ */
.ic {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic .tint {
  fill: var(--tint-blue);
}

.ic .a1 {
  stroke: var(--brand-orange);
}

.ic .a2 {
  stroke: var(--brand-blue);
}

.ic .fo {
  fill: var(--brand-orange);
  stroke: none;
}

.ic .fy {
  fill: var(--brand-yellow);
}

.ic .nv {
  stroke: var(--brand-navy);
}

/* ============ 首屏 ============ */
.hero {
  background: linear-gradient(135deg, #fff1dc, #e6f6fa);
  border-bottom: 4px solid var(--brand-orange);
  padding: var(--s8) 0 var(--s12);
  position: relative;
  overflow: hidden; /* 裝飾層超出邊界時裁切，避免橫向捲動 */
}

.hero .wrap {
  position: relative;
  z-index: 1; /* 前景：文字與比比在裝飾層之上 */
  display: grid;
  gap: var(--s6);
  align-items: center;
}

.hero h1 {
  font-size: 1.875rem;
  text-wrap: balance; /* 避免最後一行只剩一個字 */
  word-break: keep-all; /* 中文詞（例如「價格」）不拆開 */
  line-break: strict;
}

.br-sm {
  display: none; /* 只在手機顯示：逗號後換行 */
}

.swipe-hint {
  display: none;
}

.spec-wrap {
  overflow-x: auto;
}

.demo-grid > * {
  min-width: 0; /* 讓內部可橫向捲動的表格不撐寬整頁 */
}

.keep {
  white-space: nowrap; /* 「我幫你算過了。」整句不拆行 */
}

.hero-sub {
  margin-top: var(--s4);
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s6);
  padding: var(--s1) var(--s4);
  border: 2px solid var(--text);
  border-radius: 999px;
  font-weight: 700;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s4);
}

.hero-cta .btn {
  margin-top: 0;
}

.hero-art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 舞台：比比＋軌道。--w 是舞台寬（px，見檔尾軌道段） */
.hero-stage {
  position: relative;
  width: var(--w);
  margin: 0 auto;
}

.hero-img {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
}

/* 比比的對話泡泡（裝飾）：用 grid 疊放所有台詞，寬高取最大值，換句時不跳動 */
.bubble {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--s3);
  max-width: min(19rem, 100%);
  margin-bottom: var(--s4);
  padding: var(--s2) var(--s4) var(--s2) var(--s2);
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: 16px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--bg);
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(45deg);
}

.lines {
  display: grid;
}

.ln {
  grid-area: 1 / 1;
}

.ln + .ln {
  display: none; /* 無 JS：只顯示第一句 */
}

.bubble.is-rot {
  cursor: pointer;
}

.bubble.is-rot .ln {
  opacity: 0;
  transition: opacity 350ms var(--ease);
}

.bubble.is-rot .ln + .ln {
  display: block;
}

.bubble.is-rot .ln.is-on {
  opacity: 1;
}

/* ============ 區塊 ============ */
.section {
  padding: var(--s12) 0;
}

/* 區塊標題：比比大頭貼＋標題＋一句短台詞（台詞小尾巴指向大頭貼） */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--s3);
  align-items: center;
  margin-bottom: var(--s4);
}

/* 比比大頭貼：去背頭像，用多層 drop-shadow 沿輪廓做白描邊＋品牌黃輪廓光（靜態，不做動畫） */
.avatar {
  position: relative;
  grid-row: 1 / 3;
  display: block;
  width: 72px;
  height: 72px;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff)
    drop-shadow(0 0 3px rgb(255 209 102 / 0.5)) drop-shadow(0 2px 3px rgb(11 37 69 / 0.15));
}

@media (prefers-color-scheme: dark) {
  .avatar img {
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff)
      drop-shadow(0 0 4px rgb(255 209 102 / 0.4));
  }
}

/* 側面頭像原圖臉朝左；鏡射成朝右，面向旁邊的內容 */
.avatar[data-face="side"] img {
  transform: scaleX(-1);
}

.avatar[hidden] {
  display: none;
}

/* 泡泡裡的小大頭貼 */
.faces {
  flex: none;
}

.faces .avatar {
  grid-row: auto;
  width: 52px;
  height: 52px;
}

.section h2 {
  align-self: end;
  font-size: 1.5rem;
}

.say {
  position: relative;
  align-self: start;
  justify-self: start;
  margin-top: var(--s1);
  padding: 0 var(--s3);
  background: var(--soft);
  border: 1.5px solid var(--brand-orange);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.7;
}

.say::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  background: var(--soft);
  border-left: 1.5px solid var(--brand-orange);
  border-bottom: 1.5px solid var(--brand-orange);
  transform: rotate(45deg);
}

.section-lead {
  margin-top: var(--s2);
  color: var(--text-muted);
}

/* 色帶：淡藍＋電路紋理、淡橘＋點陣紋理（同源 SVG）。放在檔案較前面，讓手機面板規則可沿用 */
.band-blue {
  background-color: var(--tint-blue);
  background-image: url(/tex-circuit.svg);
}

.band-soft {
  background-color: var(--soft);
  background-image: url(/tex-dots.svg);
}

/* 區塊間的流動波浪：容器底色＝上一區塊，波浪填色＝下一個色帶；svg 寬 200%，平移 -50% 無縫循環 */
.wave {
  position: relative;
  height: 40px;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.wave-blue {
  color: var(--tint-blue);
}

.wave-soft {
  color: var(--soft);
}

.wave svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 200%;
  height: 100%;
  opacity: 0.5;
  animation: wave 48s linear infinite reverse;
}

.wave svg + svg {
  opacity: 1;
  animation-duration: 32s;
  animation-direction: normal;
}

@keyframes wave {
  to {
    transform: translateX(-50%);
  }
}

/* ============ 流程（真的有先後順序，所以用數字徽章） ============ */
.steps {
  display: grid;
  gap: var(--s6);
  margin: var(--s6) 0 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 7.5rem;
  background: var(--soft);
  border-radius: 11px 11px 0 0;
  color: var(--text);
}

.step-art svg {
  width: 7.5rem;
  height: 5rem;
}

.step-badge {
  position: absolute;
  top: var(--s3);
  left: var(--s3);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-orange);
  color: var(--brand-navy);
  font-weight: 800;
}

.step-body {
  padding: var(--s4);
}

.step-body h3 {
  font-size: 1.125rem;
}

.step-body p {
  margin-top: var(--s2);
  color: var(--text-muted);
}

/* 步驟之間的虛線（手機：上下；桌機：左右） */
.step + .step::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(-1 * var(--s6));
  height: var(--s6);
  border-left: 2px dashed var(--brand-orange);
}

/* ============ 互動示意 ============ */
.demo-grid {
  display: grid;
  gap: var(--s6);
  margin-top: var(--s6);
}

.demo-card {
  margin: 0;
  padding: var(--s4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.demo-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.demo-head h3 {
  font-size: 1.125rem;
}

.tag-demo {
  padding: 0 var(--s2);
  background: var(--brand-yellow);
  color: var(--brand-navy);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.8;
}

.note,
.hint {
  margin-top: var(--s3);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.hint {
  font-weight: 700;
}

/* 規格表 */
.spec {
  width: 100%;
  margin-top: var(--s3);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.spec thead th:first-child {
  width: 27%;
}

.spec th,
.spec td {
  padding: var(--s2);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.spec thead th {
  padding: 0 var(--s1);
  font-size: 0.9375rem;
}

.spec tbody th {
  font-size: 0.9375rem;
  font-weight: 700;
}

.sort-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s2);
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sort-btn::after {
  content: "";
  flex: none;
  border: 5px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
  opacity: 0.35;
  transition: transform 200ms var(--ease);
}

th[aria-sort="descending"] .sort-btn::after,
th[aria-sort="ascending"] .sort-btn::after {
  opacity: 1;
}

th[aria-sort="ascending"] .sort-btn::after {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .sort-btn:hover {
    background: var(--surface);
  }
}

/* 排序時 JS 只改 --dy（FLIP）；列用 transform 位移 */
.spec tbody tr {
  transform: translateY(var(--dy, 0px));
  transition: transform 520ms var(--ease);
}

.spec.is-prep tbody tr {
  transition: none;
}

.bar {
  display: block;
  height: 12px;
  background: var(--surface);
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  overflow: hidden;
}

.fill {
  display: block;
  height: 100%;
  background: var(--brand-blue);
  transform: scaleX(var(--v, 0));
  transform-origin: left;
  transition: transform 800ms var(--ease);
}

td[data-v="1"] { --v: 0.1; }
td[data-v="2"] { --v: 0.2; }
td[data-v="3"] { --v: 0.3; }
td[data-v="4"] { --v: 0.4; }
td[data-v="5"] { --v: 0.5; }
td[data-v="6"] { --v: 0.6; }
td[data-v="7"] { --v: 0.7; }
td[data-v="8"] { --v: 0.8; }
td[data-v="9"] { --v: 0.9; }
td[data-v="10"] { --v: 1; }

td.is-sorted .fill {
  background: var(--brand-orange);
}

/* 價格走勢：單選按鈕（純 CSS，無 JS 也能切換）。預設「全部」＝靜態完整版 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s3) 0 0;
  padding: 0;
  border: 0;
}

.chips label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s4);
  border: 2px solid var(--text);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.chips input:checked + label {
  background: var(--text);
  color: var(--bg);
}

.chips input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: var(--s3);
  overflow: visible;
}

.chart text {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  fill: var(--brand-navy);
}

.chart .g {
  stroke: var(--border);
  stroke-width: 1;
}

.chart .area {
  fill: var(--brand-blue);
  fill-opacity: 0.12;
}

.chart .trend-line {
  fill: none;
  stroke: var(--brand-blue);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart .avg-line {
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-dasharray: 5 5;
}

.chart .tag {
  fill: var(--brand-yellow);
}

.chart .dot-o {
  fill: var(--brand-orange);
}

.chart .dot-n {
  fill: var(--brand-navy);
  stroke: var(--brand-yellow);
  stroke-width: 2;
}

.chart .hit {
  fill: transparent;
  cursor: pointer;
}

.chart .mk {
  transition: opacity 250ms var(--ease);
}

/* 目前選到（或滑過／點按）哪個標記，其餘淡化；不支援 :has 時維持全部顯示 */
.trend-demo:has(#mk-min:checked, label[for="mk-min"]:hover, .hit-min:hover) .mk:not(.mk-min),
.trend-demo:has(#mk-avg:checked, label[for="mk-avg"]:hover, .hit-avg:hover) .mk:not(.mk-avg),
.trend-demo:has(#mk-cur:checked, label[for="mk-cur"]:hover, .hit-cur:hover) .mk:not(.mk-cur) {
  opacity: 0.15;
}

.read {
  display: none;
  margin-top: var(--s3);
  font-weight: 700;
}

.read-all {
  display: block;
}

.trend-demo:has(#mk-min:checked) .read-all,
.trend-demo:has(#mk-avg:checked) .read-all,
.trend-demo:has(#mk-cur:checked) .read-all {
  display: none;
}

.trend-demo:has(#mk-min:checked) .read-min,
.trend-demo:has(#mk-avg:checked) .read-avg,
.trend-demo:has(#mk-cur:checked) .read-cur {
  display: block;
}

/* 走勢線繪製：只有 JS 啟用時才先隱藏、進入畫面再畫；沒有 JS 就是完整靜態圖 */
.js .chart .trend-line {
  stroke-dasharray: 1 1;
}

.js .chart:not(.is-in) .trend-line {
  stroke-dashoffset: 1;
}

.js .chart.is-in .trend-line {
  animation: trend-draw 1.8s var(--ease) 200ms backwards;
}

.js .chart.is-in .dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: trend-pop 500ms var(--ease-pop) 1.8s backwards;
}

.js .chart:not(.is-in) .dot {
  opacity: 0;
}

@keyframes trend-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes trend-pop {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

/* 規格長條：進入畫面才長出來（無 JS 直接顯示） */
.js .reveal:not(.is-in) .fill {
  transform: scaleX(0);
}

/* ============ 類別地圖 ============ */
.group-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s8);
  font-size: 1.0625rem;
}

.state {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0 var(--s3);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.8;
}

.state-soon {
  background: var(--brand-yellow);
  color: var(--brand-navy);
}

.state-plan {
  border: 1.5px dashed var(--text-muted);
  color: var(--text-muted);
}

.cats {
  display: grid;
  gap: var(--s4);
  margin: var(--s4) 0 0;
  padding: 0;
  list-style: none;
}

/* 翻面卡：勾選框（純 CSS，無 JS 也能翻）。只動 transform */
.cat {
  position: relative;
  perspective: 1000px;
}

.cat-inner {
  position: relative;
  display: grid;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms var(--ease);
}

.cat-in:checked ~ .cat-inner {
  transform: rotateY(180deg);
}

.cat-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  padding: var(--s4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 6px solid var(--bar, var(--brand-orange));
  border-radius: var(--radius);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.cat-back {
  background: var(--soft);
  transform: rotateY(180deg);
}

.cats-a .cat:nth-child(1) { --bar: var(--brand-orange); }
.cats-a .cat:nth-child(2) { --bar: var(--brand-blue); }
.cats-a .cat:nth-child(3) { --bar: var(--brand-yellow); }

/* 規劃中：虛線、透明底、淡化圖示（文字仍維持 AA 對比） */
.cat--plan .cat-front {
  background: transparent;
  border: 1px dashed var(--text-muted);
}

.cat--plan .cat-ico {
  opacity: 0.7;
}

.cat-ico {
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--s2);
  padding: 6px;
  background: var(--surface);
  border-radius: 12px;
  color: var(--text);
}

.cat h4 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.4;
}

.cat .state {
  margin: var(--s2) 0 0;
}

.cat .desc {
  margin-top: var(--s2);
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.fields {
  display: grid;
  gap: 2px;
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.fields li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--s2);
  background: var(--brand-orange);
  border-radius: 2px;
}

.flip-row {
  margin-top: auto;
  padding-top: var(--s3);
}

.flip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s2);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms var(--ease);
}

.flip:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .flip:hover {
    background: var(--text);
    color: var(--bg);
  }
}

.cat-in:focus-visible ~ .cat-inner .flip {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ============ 關於／原則 ============ */
.about {
  display: grid;
  gap: var(--s6);
  margin-top: var(--s6);
}

.prose {
  max-width: 40rem;
}

.prose > p + p {
  margin-top: var(--s3);
}

.principles {
  display: grid;
  gap: var(--s2);
  margin: var(--s6) 0 0;
  padding: 0;
  list-style: none;
}

.principles li {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: var(--s3);
  align-items: start;
  padding: var(--s2) 0;
  border-top: 1px solid var(--border);
}

.principles svg {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  stroke-width: 2;
}

.about-avatar {
  display: none;
  grid-row: auto;
}

/* ============ 常見問題 ============ */
.faq {
  display: grid;
  gap: var(--s3);
  max-width: 44rem;
  margin-top: var(--s6);
}

.faq details {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq details[open] {
  border-color: var(--brand-orange);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 56px;
  padding: var(--s3) var(--s4);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: -4px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  transition: transform 200ms var(--ease);
}

.faq details[open] summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

.faq summary:focus-visible {
  outline-offset: -3px;
}

.ans {
  padding: 0 var(--s4) var(--s4);
  color: var(--text-muted);
}

/* ============ 聯絡／頁尾 ============ */
.contact-mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--s4);
  font-size: 1.25rem;
  font-weight: 700;
}

.site-footer {
  padding: var(--s8) 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s6);
  align-items: flex-end;
  justify-content: space-between;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
}

.foot-bibi {
  grid-row: auto;
  width: 64px;
  height: 64px;
  transform-origin: 50% 90%;
  animation: hello 4s ease-in-out infinite;
}

/* 輕擺：大部分時間靜止，只在一小段時間左右擺動 */
@keyframes hello {
  0%,
  70%,
  100% {
    transform: rotate(0);
  }
  76% {
    transform: rotate(-4deg);
  }
  82% {
    transform: rotate(4deg);
  }
  88% {
    transform: rotate(-3deg);
  }
  94% {
    transform: rotate(2deg);
  }
}

/* 隱私權頁 */
.doc {
  padding: var(--s8) 0 var(--s12);
}

.doc h1 {
  font-size: 1.75rem;
}

.doc h2 {
  margin-top: var(--s8);
  font-size: 1.25rem;
}

.doc p,
.doc ul {
  margin-top: var(--s3);
  max-width: 40rem;
}

.doc ul {
  padding-left: var(--s6);
}

.doc .updated {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============ 平板以上（640px） ============ */
@media (min-width: 640px) {
  .hero {
    padding: var(--s12) 0 var(--s16);
  }

  .hero .wrap {
    grid-template-columns: 1fr 16rem;
    gap: var(--s12);
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .cats {
    grid-template-columns: repeat(3, 1fr);
  }

  .wave {
    height: 56px;
  }

  :root {
    --bar-h: 64px;
  }
}

/* 流程三欄：卡片至少約 220px 寬才好讀，所以在 768px 才並排 */
@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .step + .step::before {
    left: calc(-1 * var(--s6));
    top: 3.75rem;
    width: var(--s6);
    height: 0;
    border-left: 0;
    border-top: 2px dashed var(--brand-orange);
  }

  .about {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--s12);
  }

  .about-avatar {
    display: block;
    width: 12rem;
    height: 12rem;
  }

  .about-avatar img {
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff)
      drop-shadow(0 0 5px rgb(255 209 102 / 0.5)) drop-shadow(0 2px 3px rgb(11 37 69 / 0.15));
  }

  @media (prefers-color-scheme: dark) {
    .about-avatar img {
      filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff)
        drop-shadow(0 0 5px rgb(255 209 102 / 0.4));
    }
  }
}

@media (min-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1fr 20rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .section {
    padding: var(--s16) 0;
  }

  .section h2 {
    font-size: 1.75rem;
  }

  .demo-grid {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }
}

/* ============ 動態與視差（只動 transform / opacity / translate） ============ */

/* 1. 比比：進場只用 transform；之後以腳底為支點輕微擺動 */
.hero-img {
  transform-origin: 50% 100%;
  animation: bibi-in 700ms var(--ease-pop) backwards;
}

.hero-img img {
  transform-origin: 50% 100%;
  animation: bibi-sway 6s ease-in-out 700ms infinite;
}

.bubble {
  animation: bubble-in 500ms var(--ease-pop) 500ms backwards;
}

@keyframes bibi-in {
  from {
    transform: translateY(16px) scale(0.94);
  }
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

@keyframes bibi-sway {
  0%,
  100% {
    transform: rotate(-0.8deg) scale(1);
  }
  50% {
    transform: rotate(0.8deg) scale(1.005);
  }
}

/* 2. 捲動淡入：只有 reveal.js 加上 html.js 才會先隱藏；動畫只用 backwards */
.js .reveal {
  opacity: 0;
}

.js .reveal.is-in {
  opacity: 1;
  animation: reveal var(--dur) var(--ease) backwards;
}

.stagger > .reveal:nth-child(3n + 2) {
  animation-delay: 90ms;
}

.stagger > .reveal:nth-child(3n) {
  animation-delay: 180ms;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* 3. 「準備中」小圓點＋脈動光暈（2s） */
.status::before,
.status::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-orange);
}

.status::before {
  flex: none;
}

.status::after {
  position: absolute;
  left: var(--s4);
  top: 50%;
  margin-top: -5px;
  opacity: 0;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

/* 4. 視差分層：遠景 .px-far（0.2）／中景 .px-mid（0.4）／前景 .hero .wrap（0）。
      捲動位移用 translate 屬性，滑鼠位移用 transform，兩者互不衝突 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.px-layer {
  --n: 0;
  position: absolute;
  inset: 0;
  transform: translate3d(calc(var(--mx, 0) * var(--n) * 1px), calc(var(--my, 0) * var(--n) * 1px), 0);
}

.px-far {
  --k: 0.2;
}

.px-mid {
  --k: 0.4;
}

/* 有 scroll-driven animations 就由 CSS 處理；否則由 reveal.js 設 --p（0–1）驅動 */
@supports (animation-timeline: scroll()) {
  .px-layer {
    animation: px-shift 1s linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 600px;
  }
}

@supports not (animation-timeline: scroll()) {
  .px-layer {
    translate: 0 calc(var(--p, 0) * var(--k) * 600px);
  }
}

@keyframes px-shift {
  to {
    translate: 0 calc(var(--k) * 600px);
  }
}

/* 滑鼠視差：只有桌機（有 hover 的精準指標） */
@media (hover: hover) and (pointer: fine) {
  .px-layer {
    transition: transform 600ms var(--ease);
  }

  .px-far {
    --n: 6;
  }

  .px-mid {
    --n: 14;
  }
}

/* 遠景：品牌色光暈，各自 28–36 秒緩慢漂移變形 */
.blob {
  position: absolute;
  opacity: var(--glow);
  border-radius: 50%;
}

.blob-1 {
  width: 26rem;
  height: 20rem;
  left: -9rem;
  top: -7rem;
  background: radial-gradient(closest-side, var(--brand-orange), transparent);
  animation: drift-a 28s ease-in-out infinite alternate;
}

.blob-2 {
  width: 28rem;
  height: 22rem;
  right: -10rem;
  top: 15%;
  background: radial-gradient(closest-side, var(--brand-blue), transparent);
  animation: drift-b 36s ease-in-out -9s infinite alternate;
}

.blob-3 {
  display: none;
  width: 24rem;
  height: 18rem;
  left: 30%;
  bottom: -9rem;
  background: radial-gradient(closest-side, var(--brand-yellow), transparent);
  animation: drift-c 32s ease-in-out -17s infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate(40px, 24px) rotate(25deg) scale(1.12);
  }
}

@keyframes drift-b {
  to {
    transform: translate(-36px, 30px) rotate(-20deg) scale(0.92);
  }
}

@keyframes drift-c {
  to {
    transform: translate(30px, -26px) rotate(18deg) scale(1.1);
  }
}

/* 中景：小圖示各自浮游。手機版圖示全部移到下半部（比比周圍），避開標題文字區 */
.px-item {
  position: absolute;
  width: 2rem;
  height: 2rem;
  opacity: 0.4;
  animation: float 9s ease-in-out infinite alternate;
}

.i4 { right: 10%; bottom: 5%; animation-duration: 8s; animation-delay: -5s; }
.i6 { display: none; }

@keyframes float {
  from {
    transform: translate(0, 0) rotate(-4deg);
  }
  to {
    transform: translate(6px, -10px) rotate(4deg);
  }
}

/* 平板以上：更多裝飾 */
@media (min-width: 640px) {
  .blob-3 {
    display: block;
  }

  .px-item {
    width: 3rem;
    height: 3rem;
    opacity: 0.45;
  }

  .i4 { right: 8%; bottom: 6%; top: auto; }
  .i6 { display: block; right: 36%; top: 40%; animation-duration: 7s; animation-delay: -4s; }
}

/* ============ 手機（< 640px）：App 式版面 ============ */
@media (max-width: 639px) {
  .px-far {
    --k: 0.1;
  }

  .px-mid {
    --k: 0.2;
  }

  .wave {
    display: none; /* 面板之間已有間距，手機不放波浪 */
  }

  main {
    background: var(--surface);
    padding-bottom: var(--s4);
  }

  /* 區塊 = App 面板（色帶規則在上方，background-color 由 .band-* 決定） */
  .section {
    margin: var(--s4) max(var(--s4), env(safe-area-inset-right)) 0 max(var(--s4), env(safe-area-inset-left));
    padding: var(--s6) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .section:not(.band-blue):not(.band-soft) {
    background: var(--bg);
  }

  .section .wrap {
    padding: 0;
  }

  .avatar {
    width: 60px;
    height: 60px;
  }

  .section h2 {
    font-size: 1.25rem;
  }

  /* 首波三類：橫向滑動，露出下一張邊緣 */
  .cats-a {
    display: flex;
    gap: var(--s3);
    margin: var(--s4) calc(-1 * var(--s4)) 0;
    padding: var(--s2) var(--s4) var(--s3);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--s4);
  }

  .cats-a .cat {
    flex: 0 0 80%;
    scroll-snap-align: start;
  }

  .swipe-hint {
    display: block;
    margin-top: var(--s1);
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
  }

  .br-sm {
    display: inline;
  }

  /* 價格走勢晶片：四顆等寬一列，觸控高度仍 ≥ 44px */
  .chips {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s1);
  }

  .chips label {
    justify-content: center;
    padding: 0 var(--s1);
    font-size: 0.9375rem;
  }

  /* 規格表：表格不縮到欄位標題擠成直排，容器內可橫向捲動 */
  .spec {
    min-width: 18.5rem;
  }

  .sort-btn {
    gap: 4px;
    padding: 0 var(--s1);
    font-size: 0.9375rem;
  }

  /* 首屏底部留出 Tab Bar 與安全區，比比腳部與軌道不被蓋住 */
  .hero {
    padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + var(--s6));
  }

  /* 規劃中六類：兩欄小磚 */
  .cats-b {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s3);
  }

  .cats-b .cat-face {
    padding: var(--s3);
  }

  /* 規格表：欄寬縮小，仍不橫向捲動 */
  .demo-card {
    padding: var(--s3);
  }

  .spec th,
  .spec td {
    padding: var(--s2) var(--s1);
  }

  .spec tbody th {
    font-size: 0.875rem;
  }

  /* 聯絡：全寬主要按鈕 */
  .contact-mail {
    display: flex;
    justify-content: center;
    min-height: 52px;
    background: var(--brand-orange);
    color: var(--brand-navy);
    border-radius: var(--radius);
    font-size: 1.0625rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 120ms var(--ease);
  }

  .contact-mail:active {
    transform: scale(0.97);
  }

  .back {
    display: inline-flex;
  }

  /* 頁尾：右側留白（隱私權頁沒有 Tab Bar，右邊原本貼邊） */
  .site-footer .wrap {
    padding-right: max(var(--s6), env(safe-area-inset-right));
  }

  /* 底部 Tab Bar */
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--bg);
    border-top: 1px solid var(--border);
  }

  .tabbar a {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--tab-h);
    padding: var(--s1) 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 120ms var(--ease);
  }

  .tabbar a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--brand-orange);
    transform: scaleX(0);
    transition: transform 200ms var(--ease);
  }

  .tabbar a[aria-current] {
    color: var(--text);
  }

  .tabbar a[aria-current]::before {
    transform: scaleX(1);
  }

  .tabbar a:active {
    transform: scale(0.97);
  }

  .tabbar a:focus-visible {
    outline-offset: -4px;
  }

  .tabbar svg {
    width: 24px;
    height: 24px;
  }

  /* 內容底部留出 Tab Bar，不遮住頁尾與隱私權連結 */
  .has-tabbar .site-footer {
    padding-bottom: calc(var(--s8) + var(--tab-h) + env(safe-area-inset-bottom));
  }
}

/* 從主畫面開啟（PWA）：更像原生 App；揭露列與隱私權連結仍保留 */
@media (display-mode: standalone) {
  html {
    overscroll-behavior-y: none;
  }

  .back-home {
    display: none; /* App Bar 已有返回 */
  }
}

/* 使用者要求減少動態：全部關閉，直接顯示最終狀態 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
  }

  .px-layer {
    translate: none !important;
    transform: none !important;
  }

  .status::after {
    display: none;
  }
}

/* ============ 首屏背景層次：漸層底＋座標格線＋放射光＋繞行軌道（皆裝飾、只動 transform/opacity） ============ */
@media (prefers-color-scheme: dark) {
  .hero {
    background: linear-gradient(135deg, #0b1622, #12304a);
  }
}

/* 格線：svg 當遮罩、顏色由背景色決定（深淺主題各一色），再疊一層放射遮罩讓邊緣漸淡 */
.hero-grid {
  position: absolute;
  inset: 0;
  background: rgb(11 37 69 / 0.15);
  -webkit-mask-image: url("/tex-grid.svg"), radial-gradient(ellipse at 50% 70%, #000 15%, transparent 72%);
  mask-image: url("/tex-grid.svg"), radial-gradient(ellipse at 50% 70%, #000 15%, transparent 72%);
  -webkit-mask-size: 96px 96px, 100% 100%;
  mask-size: 96px 96px, 100% 100%;
  -webkit-mask-repeat: repeat, no-repeat;
  mask-repeat: repeat, no-repeat;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

@media (min-width: 640px) {
  .hero-grid {
    -webkit-mask-image: url("/tex-grid.svg"), radial-gradient(ellipse at 72% 55%, #000 15%, transparent 75%);
    mask-image: url("/tex-grid.svg"), radial-gradient(ellipse at 72% 55%, #000 15%, transparent 75%);
  }
}

@media (prefers-color-scheme: dark) {
  .hero-grid {
    background: rgb(255 255 255 / 0.12);
  }
}

/* 軌道：套在比比腰部（約 58% 高）的橢圓。後半弧在比比後、前半弧在比比前；
   小圖示是比比的同層兄弟，沿 offset-path 繞行，並用 z-index 在前半圈蓋過比比、後半圈被擋住。
   offset-path 的座標是 px，所以舞台寬 --w 用 px，三個斷點各一條路徑（rx=0.72w、ry=0.22w、中心 (w/2, 0.97w)） */
.hero-stage {
  --w: 192px;
  --path: path("M234 186A138 42 0 0 1 -42 186A138 42 0 0 1 234 186Z");
}

@media (min-width: 640px) {
  .hero-stage {
    --w: 256px;
    --path: path("M312 248A184 56 0 0 1 -56 248A184 56 0 0 1 312 248Z");
  }
}

@media (min-width: 960px) {
  .hero-stage {
    --w: 320px;
    --path: path("M390 310A230 70 0 0 1 -70 310A230 70 0 0 1 390 310Z");
  }
}

.orbit-arc {
  position: absolute;
  left: -22%;
  top: calc(var(--w) * 0.97 - var(--w) * 0.22);
  width: 144%;
  height: calc(var(--w) * 0.44);
  overflow: visible; /* 線寬超出 viewBox 的一半不被裁 */
  pointer-events: none;
}

.orbit-back {
  z-index: 1;
}

.orbit-front {
  z-index: 3;
}

.orbit-item {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  pointer-events: none;
  offset-path: var(--path);
  offset-anchor: 50% 50%;
  offset-rotate: 0deg;
  animation:
    orbit-go 36s linear calc(var(--p) * -36s) infinite,
    orbit-layer 36s linear calc(var(--p) * -36s) infinite;
}

/* 景深放在內層 svg：scale 若放在 offset-path 的元素上會連位移一起縮放，圖示就會離開軌道 */
.orbit-item svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: orbit-depth 36s linear calc(var(--p) * -36s) infinite;
}

.orbit-item:nth-of-type(1) { --p: 0; }
.orbit-item:nth-of-type(2) { --p: 0.25; }
.orbit-item:nth-of-type(3) { --p: 0.5; }
.orbit-item:nth-of-type(4) { --p: 0.75; }

/* 路徑從右端出發、先走下半（前半圈，0–50%）再走上半（後半圈）；z-index 在左右兩端切換 */
@keyframes orbit-go {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}

@keyframes orbit-layer {
  0%, 49.9% { z-index: 3; }
  50%, 99.9% { z-index: 1; }
  100% { z-index: 3; }
}

/* 景深：前半圈正中最大最亮，後半圈正中縮小變淡 */
@keyframes orbit-depth {
  0%, 50%, 100% { scale: 0.85; opacity: 0.85; }
  25% { scale: 1; opacity: 1; }
  75% { scale: 0.7; opacity: 0.55; }
}

@media (max-width: 639px) {
  .orbit-item {
    width: 1.75rem;
    height: 1.75rem;
  }

  .orbit-item:nth-of-type(2),
  .orbit-item:nth-of-type(4) {
    display: none; /* 手機軌道只留 2 個圖示 */
  }
}

/* 減少動態：停止繞行；四個圖示靜態分散在軌道上（後半圈的放後面、縮小變淡） */
@media (prefers-reduced-motion: reduce) {
  .orbit-item {
    offset-distance: calc(var(--p) * 100%);
  }

  .orbit-item:nth-of-type(3),
  .orbit-item:nth-of-type(4) {
    z-index: 1;
  }

  .orbit-item:nth-of-type(3) svg,
  .orbit-item:nth-of-type(4) svg {
    scale: 0.7;
    opacity: 0.55;
  }
}

/* 不支援 offset-path 的瀏覽器：不放繞行圖示與軌道 */
@supports not (offset-path: path("M0 0")) {
  .orbit-item,
  .orbit-arc {
    display: none;
  }
}

/* ============ 指尖放光＋標題亮起（同一個 6 秒週期，用 animation-delay 對齊；reduced-motion 全停） ============
   時間軸（桌機）：t0 指尖光點與星芒 → +0.18s 光束射出 → +0.66s 光束抵達，高光底線由右往左掃過 0.6s，逐字由右到左亮起
   手機：沒有光束，高光在光點後 0.3s 開始。首次放光等進場動畫結束（--t0 = 1.5s），H1 一開始就正常顯示 */
.hero-stage {
  --t0: 1.5s;
}

.hero h1 {
  --t0: 1.5s;
  --hl: 0.3s; /* 高光開始：手機＝光點後 0.3s */
}

@media (min-width: 960px) {
  .hero h1 {
    --hl: 0.66s; /* 桌機＝光束抵達 */
  }
}

.fingertip {
  position: absolute;
  left: 1%;
  top: 41.7%;
  z-index: 4;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ft-glow {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff 10%, var(--brand-yellow) 45%, transparent);
  opacity: 0;
  animation: ft-glow 6s linear var(--t0) infinite backwards;
}

.ft-star {
  --dx: 0px;
  --dy: 0px;
  position: absolute;
  left: -6px;
  top: -6px;
  width: 12px;
  height: 12px;
  color: var(--brand-yellow);
  background:
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  opacity: 0;
  animation: ft-star 6s linear var(--t0) infinite backwards;
}

.ft-star:nth-child(3) { --dx: -14px; --dy: -10px; }
.ft-star:nth-child(4) { --dx: 2px; --dy: -16px; animation-delay: calc(var(--t0) + 0.04s); }
.ft-star:nth-child(5) { --dx: -12px; --dy: 10px; animation-delay: calc(var(--t0) + 0.08s); }
.ft-star:nth-child(6) { --dx: 10px; --dy: 12px; animation-delay: calc(var(--t0) + 0.12s); }

@keyframes ft-glow {
  0% { opacity: 0; transform: scale(0); }
  3% { opacity: 1; transform: scale(1.2); }
  6% { opacity: 1; transform: scale(1); }
  13% { opacity: 0; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes ft-star {
  0% { opacity: 0; translate: 0 0; transform: scale(0.4); }
  3% { opacity: 1; }
  13% { opacity: 0; translate: var(--dx) var(--dy); transform: scale(1); }
  100% { opacity: 0; translate: var(--dx) var(--dy); transform: scale(1); }
}

/* 光束：只有桌機（左文右圖）才有，從指尖往左朝標題第二行射出 */
.ft-beam {
  display: none;
}

@media (min-width: 960px) {
  .ft-beam {
    position: absolute;
    right: 0;
    top: -1.5px;
    display: block;
    width: calc(var(--w) * 1.05);
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(to left, var(--brand-yellow), transparent);
    rotate: 9deg;
    transform-origin: 100% 50%;
    opacity: 0;
    animation: ft-beam 6s linear calc(var(--t0) + 0.18s) infinite backwards;
  }
}

@keyframes ft-beam {
  0% { opacity: 0; transform: translateX(0) scaleX(0.05); }
  4% { opacity: 1; }
  8% { opacity: 1; transform: translateX(0) scaleX(1); }
  16% { opacity: 0; transform: translateX(-12px) scaleX(1); }
  100% { opacity: 0; transform: translateX(-12px) scaleX(1); }
}

/* 標題第二行：螢光筆高光（由右往左掃）＋逐字輕跳亮起（由右到左，間隔 50ms） */
.keep {
  position: relative;
}

.keep::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0.05em;
  left: 0;
  z-index: -1;
  height: 0.35em;
  background: rgb(255 209 102 / 0.65);
  transform: scaleX(1); /* 沒有動畫（reduced-motion、無支援）時直接顯示 */
  transform-origin: 100% 50%;
  animation: hl-sweep 6s linear calc(var(--t0) + var(--hl)) infinite backwards;
}

@media (prefers-color-scheme: dark) {
  .keep::after {
    background: rgb(255 209 102 / 0.3);
  }
}

.chs {
  white-space: nowrap;
}

.ch {
  --i: 0;
  position: relative;
  display: inline-block;
  animation: ch-jump 6s linear calc(var(--t0) + var(--hl) + var(--i) * 50ms) infinite backwards;
}

.ch::after {
  content: attr(data-c);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand-orange);
  opacity: 0;
  animation: ch-light 6s linear calc(var(--t0) + var(--hl) + var(--i) * 50ms) infinite backwards;
}

@media (prefers-color-scheme: dark) {
  .ch::after {
    color: var(--brand-yellow);
  }
}

/* 由右到左：最右一字 i=0 */
.ch:nth-child(7) { --i: 0; }
.ch:nth-child(6) { --i: 1; }
.ch:nth-child(5) { --i: 2; }
.ch:nth-child(4) { --i: 3; }
.ch:nth-child(3) { --i: 4; }
.ch:nth-child(2) { --i: 5; }
.ch:nth-child(1) { --i: 6; }

@keyframes hl-sweep {
  0% { opacity: 1; transform: scaleX(0); }
  10% { opacity: 1; transform: scaleX(1); }
  85% { opacity: 1; transform: scaleX(1); }
  95% { opacity: 0; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0); }
}

@keyframes ch-jump {
  0%, 100% { transform: translateY(0); }
  3% { transform: translateY(-3px); }
  6% { transform: translateY(0); }
}

@keyframes ch-light {
  0%, 100% { opacity: 0; }
  3% { opacity: 1; }
  8% { opacity: 0; }
}
