/* 佔位頁專用版面；品牌變數與基礎排版在 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;
}

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

.nb {
  white-space: nowrap; /* 「3C 規格與價格，」不在 3C 後斷開（不帶 .keep 的底線高光） */
}

.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);
}

/* ============ 說明文字 ============ */
.note,
.hint {
  margin-top: var(--s3);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.hint {
  font-weight: 700;
}

/* 規格表排序按鈕（比較頁 .cmp 使用） */
.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;
  width: 8px;
  height: 12px;
  background: currentColor;
  clip-path: path("M4 0L8 5H0Z M0 7H8L4 12Z");
  opacity: 0.4;
}

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

th[aria-sort="descending"] .sort-btn::after {
  clip-path: path("M0 4H8L4 9Z");
}

th[aria-sort="ascending"] .sort-btn::after {
  clip-path: path("M4 3L8 8H0Z");
}

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

/* ============ 關於／原則 ============ */
.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);
  }

  /* 左文右圖「聚成一組置中」：兩欄都有上限，justify-content 讓整組水平置中，寬螢幕多出的空間平均留在兩側（放裝飾）。
     插圖欄＝軌道寬 1.44w＋圖示寬 22px，舞台在欄內置中（沿用 .hero-stage 的 margin auto），圖示左右各凸出約 11px，
     欄距最小 1rem 仍不壓文字。欄距隨寬度 1rem → 4.5rem（1280≈53px、≥1600=72px）。各斷點 --w 與欄寬見檔尾軌道段 */
  .hero {
    --hero-gap: clamp(1rem, 6vw - 1.5rem, 4.5rem);
  }

  .hero .wrap {
    grid-template-columns: minmax(0, 34rem) 18.75rem;
    justify-content: center;
    gap: var(--s12) var(--hero-gap);
  }

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

  .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) {
  /* 文字欄最多 34rem（≥1600 為 36rem；標題兩行、副標約兩行）；欄寬規則見檔尾軌道段 */
  .hero h1 {
    font-size: 3rem;
  }

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

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

/* ============ 動態與視差（只動 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;
  }

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

  .br-sm {
    display: inline;
  }

  .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));
  }

  /* 聯絡：全寬主要按鈕 */
  .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 50% 55%, #000 15%, transparent 75%);
    mask-image: url("/tex-grid.svg"), radial-gradient(ellipse at 50% 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");
}

/* 640–767px 沿用上面 192px 舞台：640px 寬時內容區只剩約 577px，256px 舞台＋軌道會擠掉文字欄。
   插圖欄寬＝1.44w＋22px 取整（見 640px 首屏段）。此區間文字欄只剩約 260px，
   標題縮到 2rem：「3C 規格與價格，」（.nb 不換行，約 236px）與「我幫你算過了。」（7 字≈224px）
   都小於 260px 文字欄，不會伸進欄距碰到軌道圖示（2.25rem 時前句約 265px 會溢出） */
@media (min-width: 640px) and (max-width: 767px) {
  .hero h1 {
    font-size: 2rem;
  }
}

/* h1 字級階梯：≤639 手機另計；640–767＝2rem；768–959＝2.25rem；960–1599＝3rem；≥1600＝3.5rem
   （640 起的 2.5rem 基準被本段與 640–767 段蓋掉）。
   768 起舞台變 256px、插圖欄 392px，文字欄僅約 315px（隨寬度每 +1px 約 +0.94px，900≈436）；
   2.5rem 時 .nb 約 332px 會超出 17px，2.25rem 約 299px（<315）。「我幫你算過了。」7 字≈252px 更窄。
   到 959 文字欄約 495px，.nb 299px 綽綽有餘；960 起回 3rem（文字欄≥495、.nb≈398） */
@media (min-width: 768px) and (max-width: 959px) {
  .hero h1 {
    font-size: 2.25rem;
  }
}

@media (min-width: 768px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 34rem) 24.5rem;
  }

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

@media (min-width: 1280px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 34rem) 30.25rem;
  }

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

/* 超寬螢幕（≥1600px）：比比 360px（高約 606px），標題放大到 3.5rem；
   群組＝36rem＋72px＋33.875rem ≈ 1190px（74.4rem），1600 與 1920 都同寬置中，多出的寬度交給兩側裝飾。
   寫在上面的舞台規則之後才會覆蓋 --w */
@media (min-width: 1600px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 36rem) 33.875rem;
  }

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

  .hero-stage {
    --w: 360px;
    --path: path("M439.2 349.2A259.2 79.2 0 0 1 -79.2 349.2A259.2 79.2 0 0 1 439.2 349.2Z");
  }
}

/* 兩側裝飾：左「USB-C 插頭＋走線＋閃電」朝中間插入，右「電量格電池＋插頭＋走線」接收，呼應「充電往中間流」。
   只在群組兩側空間 ≥ 約 170px（≥1440px）時出現；寬度＝(首屏寬 − 群組寬) / 2 − 24px，永遠停在群組外 24px，
   不會壓到文字、比比或軌道圖示（圖示最多凸出插圖欄 11px）。SVG 固定 320×520 貼內側，空間不夠時外側被裁掉，
   再以遮罩讓外緣漸淡。靜態、無動畫；位在 aria-hidden 的 .hero-bg 內，pointer-events 已關 */
.hero-deco {
  display: none;
}

@media (min-width: 1440px) {
  .hero {
    --hero-g: calc(34rem + var(--hero-gap) + 30.25rem); /* 與 1280px 段的欄寬一致 */
  }

  .hero-deco {
    position: absolute;
    top: 0;
    bottom: 0;
    display: block;
    width: max(0px, calc((100% - var(--hero-g)) / 2 - var(--s6)));
    opacity: 0.85;
  }

  .hero-deco-l {
    left: 0;
    background:
      url("/hero-deco-l.svg") right center / 320px 520px no-repeat,
      radial-gradient(ellipse closest-side at 50% 50%, rgb(255 209 102 / var(--glow)), transparent); /* 光暈在容器內衰減到 0，邊界不留硬邊 */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 45%);
    mask-image: linear-gradient(to right, transparent, #000 45%);
  }

  .hero-deco-r {
    right: 0;
    background:
      url("/hero-deco-r.svg") left center / 320px 520px no-repeat,
      radial-gradient(ellipse closest-side at 50% 50%, rgb(0 180 216 / var(--glow)), transparent); /* 同左：邊界 alpha=0 */
    -webkit-mask-image: linear-gradient(to left, transparent, #000 45%);
    mask-image: linear-gradient(to left, transparent, #000 45%);
  }
}

@media (min-width: 1600px) {
  .hero {
    --hero-g: calc(36rem + var(--hero-gap) + 33.875rem); /* 與上面 1600px 段的欄寬一致 */
  }
}

/* 深色主題：亮色線條在深藍底較跳，整體再降一點 */
@media (min-width: 1440px) and (prefers-color-scheme: dark) {
  .hero-deco {
    opacity: 0.65;
  }
}

.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; }
}
