/* 數位生活探險 3D｜UI 樣式（全部是 DOM overlay，玻璃擬態＋房間主題色）
   --theme／--accent 由 JS 依目前場景設定；--on-theme 是主題色上的文字色。

   ── 層級表（z-index；#ui 本身是 5，下面的數字都是 #ui 裡面的）──────────────────────────────
   規則：「浮動提示類」一律在所有面板「下面」；任何面板／展示／對話打開時，浮動提示由 html.panel-open 一律收起
   （game.js 主迴圈掛這個 class；進館說明與鍵盤提示收了就不再回來，面板開之前跳出來的 toast 直接移除）。
   新增元件請照這張表放，並跑 fin-layers.mjs（每種提示 × 每種面板逐一組合驗證）。

   層               z      元件
   ───────────────  ─────  ─────────────────────────────────────────────────────────────────
   浮動提示（HUD）   auto   HUD 按鈕列、購物袋鈕、左上場景資訊
                    6      .hud-keys 鍵盤提示、.act 互動按鈕、.door-card 門口卡片、.finale 全破膠囊、.legend-tip 進館說明
   對話              7      .dialog（NPC 對話）
   商品展示          9      .sc（展示台面板、看實拍圖的入口）
   面板              10–19  .dv 我的筆電 10/11、.sheet 購物袋／結算／圖鑑 10/11、.info 看詳細 12/13、
                           .menu 選單／.hw 設定我的筆電／.quiz 測驗 14/15、.kc 知識卡 18/19
   慶祝橫幅          20     .banner（館完成、全館完成；本來就是全畫面演出）
   回饋提示          30     .toasts——例外：面板開著時「在面板裡做的事」的回饋（已放入購物袋、清單已複製）要看得到；
                           面板開之前就跳出來的 toast 會在面板打開時移除（ui.onPanelOpen）
   最上層            40+    #transition 40、.award／.qr-zoom 44、.confirm 45、.lightbox 46、#loading 50、.fly 60
*/

:root {
  --bg3d-css-ok: 1;          /* 啟動看門狗（js/boot-guard.js）用這個變數確認 ui.css 有載到、有生效，不要刪 */
  --theme: #8f7bff;
  --accent: #ffd23f;
  --on-theme: #ffffff;
  --ink: #f7f4ff;
  --ink-2: rgba(247, 244, 255, .74);
  --ink-3: rgba(247, 244, 255, .5);
  --glass: rgba(22, 18, 48, .64);
  --glass-strong: rgba(24, 20, 54, .86);
  --line: rgba(255, 255, 255, .15);
  --line-soft: rgba(255, 255, 255, .08);
  --gold: #ffd23f;
  --ok: #58e6a0;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #0b0a1f; color: var(--ink); font-family: var(--font);
  overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
/* overflow: clip＝連「用程式捲動」都不行（鍵盤焦點、scrollIntoView 不會把整個畫面捲歪）；不支援的舊瀏覽器退回 hidden＋ui.js 的防呆 */
#app { position: fixed; inset: 0; overflow: hidden; overflow: clip; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#css-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 52%, rgba(4, 3, 14, .5) 100%); }
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#ui > * { pointer-events: auto; }
button { font-family: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
.scrollable { touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
[hidden] { display: none !important; }
svg { display: block; }

/* ───────── 共用元件 ───────── */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line);
  box-shadow: 0 14px 44px rgba(3, 2, 16, .42), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-size: 16px; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
  color: var(--on-theme);
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme) 80%, #fff) 0%, var(--theme) 62%);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--theme) 58%, #000), 0 12px 26px color-mix(in srgb, var(--theme) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--theme) 58%, #000), 0 4px 10px color-mix(in srgb, var(--theme) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.gold { --theme: #ffcf3d; --on-theme: #3d2600; }
.btn.ghost {
  color: var(--ink); background: rgba(255, 255, 255, .1); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn.ghost:active { transform: translateY(2px); background: rgba(255, 255, 255, .16); box-shadow: none; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { filter: saturate(.5) brightness(.8); pointer-events: none; }
.btn .ic { width: 20px; height: 20px; }
.ibtn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 8px 22px rgba(3, 2, 16, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: transform .14s var(--ease-out), background .15s;
}
.ibtn:active { transform: scale(.92); background: var(--glass-strong); }
.ibtn svg { width: 22px; height: 22px; }
.ibtn.wide { width: auto; padding: 0 16px 0 13px; border-radius: 999px; display: inline-flex; gap: 7px; align-items: center; font-size: 14px; font-weight: 800; letter-spacing: .04em; }
kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px;
  font: 800 12px/1 var(--font); color: var(--on-theme); background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .28);
}
.touch kbd { display: none; }

/* ───────── 載入畫面 ───────── */
#loading {
  position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(120% 90% at 50% 40%, #2b1f6b 0%, #120e33 55%, #07061a 100%);
  transition: opacity .7s ease, visibility .7s;
}
#loading.done { opacity: 0; visibility: hidden; pointer-events: none; }
.ld-gem { width: 64px; height: 84px; position: relative; margin-bottom: 14px; animation: ld-float 1.8s ease-in-out infinite; filter: drop-shadow(0 0 22px rgba(255, 210, 63, .7)); }
.ld-gem i { position: absolute; inset: 0; background: linear-gradient(160deg, #fff6c2 0%, #ffd23f 45%, #ff9d00 100%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); animation: ld-spin 1.8s linear infinite; }
@keyframes ld-float { 50% { transform: translateY(-9px); } }
@keyframes ld-spin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.18); } }
.ld-title { font-size: clamp(28px, 7vw, 44px); font-weight: 900; letter-spacing: .14em; text-indent: .14em; color: #fff7e2; text-shadow: 0 3px 0 #5a3fd6, 0 6px 0 #2a1c7a, 0 10px 26px rgba(0, 0, 0, .5); }
.ld-sub { font-size: 14px; font-weight: 700; letter-spacing: .5em; text-indent: .5em; color: var(--ink-2); }
.ld-bar { width: min(240px, 60vw); height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 22px; }
.ld-bar i { display: block; height: 100%; width: 8%; border-radius: 99px; background: linear-gradient(90deg, #7a5cff, #ffd23f); transition: width .35s var(--ease-out); }
.ld-tip { font-size: 13px; color: var(--ink-3); margin-top: 6px; letter-spacing: .06em; }
.ld-error { color: #ff9aa8; max-width: 80vw; text-align: center; line-height: 1.6; }

/* ───────── 轉場 ───────── */
#transition { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; visibility: hidden; }
#transition.on { visibility: visible; pointer-events: auto; }
#transition .tr-iris {
  position: absolute; left: 50%; top: 50%; width: 240vmax; height: 240vmax; margin: -120vmax 0 0 -120vmax; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tr-color, #2a1f6b) 55%, #0b0920) 0%, #0b0920 70%);
  transform: scale(0); transition: transform .5s cubic-bezier(.7, 0, .3, 1);
}
#transition.cover .tr-iris { transform: scale(1); }
#transition .tr-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px;
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .3s ease .12s, transform .45s var(--ease-out) .12s;
}
#transition.cover .tr-card { opacity: 1; transform: none; }
.tr-emoji { font-size: 64px; line-height: 1; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .4)); animation: tr-bob 1.4s ease-in-out infinite; }
@keyframes tr-bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.tr-title { font-size: clamp(30px, 8vw, 52px); font-weight: 900; letter-spacing: .12em; text-indent: .12em; color: #fff; text-shadow: 0 4px 0 color-mix(in srgb, var(--tr-color, #7a5cff) 70%, #000), 0 10px 30px rgba(0, 0, 0, .45); }
.tr-hook { font-size: 15px; color: var(--ink-2); letter-spacing: .08em; max-width: 28em; line-height: 1.6; }
.tr-dots { display: flex; gap: 8px; margin-top: 14px; }
.tr-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--tr-accent, #ffd23f); animation: tr-dot 1s ease-in-out infinite; }
.tr-dots i:nth-child(2) { animation-delay: .15s; } .tr-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tr-dot { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }

/* ───────── 虛擬搖桿 ───────── */
.joystick { position: absolute; width: 0; height: 0; pointer-events: none !important; opacity: 0; transition: opacity .16s; z-index: 2; display: none; }
/* 手指碰到螢幕時才畫搖桿；滑鼠／觸控板拖曳一樣能走，只是不畫（見 ui.js 的 _bindPointerKind） */
html.ptr-touch .joystick { display: block; }
.joystick.on { opacity: 1; }
.joy-base { position: absolute; left: -62px; top: -62px; width: 124px; height: 124px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .06) 40%, rgba(255, 255, 255, .16) 100%); border: 2px solid rgba(255, 255, 255, .34); box-shadow: 0 0 0 6px rgba(255, 255, 255, .05); }
.joy-knob { position: absolute; left: -27px; top: -27px; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--theme) 55%, #fff) 60%, var(--theme)); box-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 -4px 8px rgba(0, 0, 0, .15); }

/* ───────── HUD ───────── */
.hud { position: absolute; inset: 0; pointer-events: none !important; opacity: 0; transition: opacity .4s ease; }
.hud.on { opacity: 1; }
.hud > * { pointer-events: auto; }
.hud.off-input > * { pointer-events: none; }
.hud-tl {
  position: absolute; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t));
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; max-width: calc(100% - 190px - var(--safe-l) - var(--safe-r));
}
.hud-emoji { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: linear-gradient(160deg, color-mix(in srgb, var(--theme) 70%, #fff), var(--theme)); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .18), 0 4px 10px color-mix(in srgb, var(--theme) 45%, transparent); }
.hud-meta { min-width: 0; }
.hud-title { font-size: 16px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.hud-prog { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; font-weight: 800; color: var(--ink-2); letter-spacing: .04em; white-space: nowrap; }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 15px; height: 15px; color: rgba(255, 255, 255, .22); transition: color .3s, transform .4s var(--ease-back); }
.stars svg.on { color: var(--gold); filter: drop-shadow(0 0 5px rgba(255, 210, 63, .7)); }
.stars svg.pop { animation: star-pop .6s var(--ease-back); }
@keyframes star-pop { 0% { transform: scale(.2) rotate(-40deg); } 60% { transform: scale(1.7) rotate(10deg); } 100% { transform: none; } }
.pbar { width: 64px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .5s var(--ease-out); }
.hud-tr { position: absolute; right: calc(12px + var(--safe-r)); top: calc(12px + var(--safe-t)); display: flex; gap: 8px; align-items: center; }
.bag-btn {
  position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(18px + var(--safe-b));
  width: 66px; height: 66px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(165deg, color-mix(in srgb, var(--theme) 55%, #fff) 0%, var(--theme) 60%, color-mix(in srgb, var(--theme) 75%, #000) 100%);
  color: var(--on-theme);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--theme) 52%, #000), 0 16px 30px rgba(3, 2, 16, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .14s var(--ease-out), box-shadow .14s;
}
.bag-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--theme) 52%, #000), 0 6px 14px rgba(3, 2, 16, .4), inset 0 1px 0 rgba(255, 255, 255, .55); }
.bag-btn svg { width: 32px; height: 32px; }
.bag-btn.bump { animation: bag-bump .5s var(--ease-back); }
@keyframes bag-bump { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-6deg); } 100% { transform: scale(1); } }
.badge {
  position: absolute; right: -7px; top: -8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center;
  font-size: 14px; font-weight: 900; color: #3d2600; background: linear-gradient(180deg, #fff1a8, #ffd23f); border: 2px solid #1a1436;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transform: scale(0); transition: transform .3s var(--ease-back);
}
.badge.show { transform: scale(1); }

/* 互動按鈕（靠近調查點／NPC／出口時浮現） */
.act {
  position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translate(-50%, 24px) scale(.9); opacity: 0; pointer-events: none !important;
  transition: transform .28s var(--ease-back), opacity .2s ease;
}
.act.on { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto !important; }
.act .btn { min-height: 56px; padding: 0 28px; font-size: 18px; }
.act .btn::before { content: ""; position: absolute; inset: -6px; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--theme) 70%, #fff); opacity: 0; animation: act-ring 1.6s ease-out infinite; pointer-events: none; }
@keyframes act-ring { 0% { opacity: .7; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.18, 1.4); } }

/* 門口館名卡（廣場） */
.door-card {
  position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); width: min(360px, calc(100vw - 110px - var(--safe-l) - var(--safe-r)));
  transform: translate(-50%, 30px) scale(.92); opacity: 0; pointer-events: none !important;
  border-radius: var(--r-lg); padding: 14px 14px 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center;
  transition: transform .32s var(--ease-back), opacity .2s ease;
  border-color: color-mix(in srgb, var(--dc, var(--theme)) 60%, transparent);
  box-shadow: 0 14px 44px rgba(3, 2, 16, .45), 0 0 0 1px color-mix(in srgb, var(--dc, var(--theme)) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.door-card.on { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto !important; }
.dc-emoji { grid-row: 1 / span 2; width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: linear-gradient(160deg, color-mix(in srgb, var(--dc) 70%, #fff), var(--dc)); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .2), 0 6px 14px color-mix(in srgb, var(--dc) 40%, transparent); }
.dc-title { font-size: 20px; font-weight: 900; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-done { font-size: 11px; font-weight: 900; letter-spacing: .08em; padding: 3px 8px; border-radius: 99px; color: #06301c; background: var(--ok); }
.dc-soon { font-size: 11px; font-weight: 900; letter-spacing: .08em; padding: 3px 8px; border-radius: 99px; color: #1a1436; background: #9fd8ff; }
.dc-hook { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.dc-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.dc-foot .hud-prog { font-size: 13px; margin: 0; }
.dc-foot .btn { --theme: var(--dc); min-height: 46px; padding: 0 22px; }

/* ───────── 對話框 ───────── */
.dialog {
  z-index: 7;
  position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); width: min(640px, calc(100vw - 24px - var(--safe-l) - var(--safe-r)));
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none !important; transition: transform .3s var(--ease-out), opacity .22s ease;
  border-radius: var(--r-lg); padding: 26px 22px 20px; cursor: pointer;
}
.dialog.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto !important; }
.dlg-name {
  position: absolute; left: 18px; top: -16px; padding: 6px 16px; border-radius: 999px; font-size: 15px; font-weight: 900; letter-spacing: .1em;
  color: var(--on-theme); background: linear-gradient(180deg, color-mix(in srgb, var(--theme) 78%, #fff), var(--theme));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--theme) 58%, #000), 0 8px 18px rgba(0, 0, 0, .3);
}
.dlg-text { font-size: 17px; line-height: 1.7; font-weight: 600; min-height: 3.4em; letter-spacing: .03em; }
.dlg-next { position: absolute; right: 18px; bottom: 12px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .08em; }
.dlg-next svg { width: 14px; height: 14px; color: var(--accent); animation: dlg-bounce .9s ease-in-out infinite; }
@keyframes dlg-bounce { 50% { transform: translateY(4px); } }
.dlg-count { position: absolute; right: 20px; top: 12px; font-size: 12px; font-weight: 800; color: var(--ink-3); }

/* ───────── 商品展示面板 ───────── */
.sc { position: absolute; inset: 0; z-index: 9; pointer-events: none !important; visibility: hidden; }
.sc.on { visibility: visible; }
.sc-scrim { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease; background: linear-gradient(180deg, rgba(6, 4, 20, .0) 30%, rgba(6, 4, 20, .78) 100%); }
.sc.on .sc-scrim { opacity: 1; }
.sc-close { position: absolute; right: calc(12px + var(--safe-r)); top: calc(12px + var(--safe-t)); pointer-events: auto; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .3s var(--ease-back); z-index: 3; }
.sc.on .sc-close { opacity: 1; transform: none; }
.sc-label {
  position: absolute; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); max-width: calc(100% - 84px);
  padding: 9px 16px 9px 12px; border-radius: 999px; display: flex; align-items: center; gap: 9px; font-weight: 900; letter-spacing: .08em; font-size: 15px;
  opacity: 0; transform: translateY(-14px); transition: opacity .3s .1s, transform .4s var(--ease-out) .1s; pointer-events: none;
}
.sc.on .sc-label { opacity: 1; transform: none; }
.sc-label i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #3d2600; }
.sc-label i svg { width: 14px; height: 14px; }
.sc-panel {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column; overflow: hidden;
  left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); bottom: calc(10px + var(--safe-b));
  max-height: 60%; border-radius: 28px; padding: 16px 0 12px;
  transform: translateY(105%); transition: transform .5s var(--ease-out);
  background: var(--glass-strong);
}
.sc.on .sc-panel { transform: none; }
.sc-head { padding: 0 18px 10px; }
.sc-story { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); min-height: 3.2em; letter-spacing: .02em; }
.sc-story b { color: var(--ink); font-weight: 800; }
/* 類別分頁（可橫向捲動、不換行） */
.sc-tabs {
  display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 18px 10px; scrollbar-width: none; touch-action: pan-x; flex: 0 0 auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent 100%);
}
.sc-tabs::-webkit-scrollbar { display: none; }
.sc-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 8px 0 14px; border-radius: 99px; white-space: nowrap;
  font-size: 14px; font-weight: 800; letter-spacing: .05em; color: var(--ink-2);
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line-soft);
  transition: background .2s, color .2s, transform .2s var(--ease-back), border-color .2s;
}
.sc-tab em { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .14); color: var(--ink); }
.sc-tab:active { transform: scale(.95); }
.sc-tab.cur { color: var(--on-theme); border-color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--theme) 80%, #fff), var(--theme)); box-shadow: 0 3px 0 color-mix(in srgb, var(--theme) 58%, #000), 0 8px 18px color-mix(in srgb, var(--theme) 40%, transparent); }
.sc-tab.cur em { background: rgba(0, 0, 0, .22); color: var(--on-theme); }
.sc-tab.up:not(.cur) { border-style: dashed; border-color: rgba(160, 215, 255, .45); color: #bfe6ff; }
.sc-rail { position: relative; flex: 1 1 auto; min-height: 0; }
.sc-carousel.swap-r { animation: swap-r .38s var(--ease-out) both; }
.sc-carousel.swap-l { animation: swap-l .38s var(--ease-out) both; }
@keyframes swap-r { from { opacity: 0; transform: translateX(36px); } }
@keyframes swap-l { from { opacity: 0; transform: translateX(-36px); } }
.sc-carousel {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 6px 18px 10px; scrollbar-width: none;
  touch-action: pan-x; height: 100%; align-items: stretch;
}
.sc-carousel::-webkit-scrollbar { display: none; }
.pcard {
  position: relative; flex: 0 0 min(100%, 330px); scroll-snap-align: center; border-radius: 22px; padding: 14px 14px 14px;
  display: flex; flex-direction: column; gap: 8px; min-height: 176px;
  background: linear-gradient(165deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: transform .3s var(--ease-out), opacity .3s, border-color .3s;
  opacity: .5; transform: scale(.955);
}
.pcard.cur { opacity: 1; transform: none; border-color: color-mix(in srgb, var(--pc, var(--theme)) 70%, #fff 0%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 0 0 1px color-mix(in srgb, var(--pc, var(--theme)) 35%, transparent), 0 10px 26px rgba(0, 0, 0, .25); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--ink); background: rgba(255, 255, 255, .12); border: 1px solid var(--line-soft); }
.tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--pc, var(--accent)); box-shadow: 0 0 8px var(--pc, var(--accent)); }
.pc-idx { font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .06em; }
.pc-body { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 auto; min-height: 0; }
/* 實拍圖縮圖（點了開燈箱） */
.pc-img { position: relative; flex: 0 0 76px; width: 76px; height: 76px; border-radius: 16px; background: #fff; padding: 5px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); overflow: hidden; transition: transform .15s var(--ease-out); }
.pc-img:active { transform: scale(.94); }
.pc-img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 11px; pointer-events: none; }
.pc-img i { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(20, 16, 44, .72); }
.pc-img i svg { width: 12px; height: 12px; }
/* 客訂徽章 */
.badge-order { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 900; letter-spacing: .06em; color: #3d2600; background: linear-gradient(180deg, #ffd98a, #ffb347); box-shadow: 0 3px 10px rgba(255, 170, 60, .35); white-space: nowrap; }
.badge-order svg { width: 13px; height: 13px; }
.pcard.order { border-color: rgba(255, 190, 100, .4); }
.pcard.order.cur { border-color: rgba(255, 200, 120, .9); }
.tag-order { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 900; letter-spacing: .08em; color: #3d2600; background: #ffc266; vertical-align: 1px; white-space: nowrap; }
/* 實拍圖燈箱 */
.lightbox { position: absolute; inset: 0; z-index: 46; display: grid; place-items: center; padding: calc(56px + var(--safe-t)) 18px calc(28px + var(--safe-b)); background: rgba(6, 4, 20, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.lightbox.on { opacity: 1; visibility: visible; }
.lb-box { max-width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; transform: scale(.9); transition: transform .3s var(--ease-back); }
.lightbox.on .lb-box { transform: none; }
.lb-box img { max-width: 100%; max-height: min(64vh, 560px); object-fit: contain; background: #fff; border-radius: 22px; padding: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-cap { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-align: center; color: var(--ink); }
.lb-close { position: absolute; right: calc(12px + var(--safe-r)); top: calc(12px + var(--safe-t)); }
.pc-txt { min-width: 0; flex: 1 1 auto; }
.pc-name { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.35; letter-spacing: .02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-pitch { margin: 5px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 22px; font-weight: 900; letter-spacing: .01em; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price small { font-size: 12px; font-weight: 800; color: var(--ink-2); margin-right: 4px; letter-spacing: .06em; }
.price.range { font-size: 17px; color: #bfe6ff; }
.pc-bottom .btn { min-height: 44px; padding: 0 18px; font-size: 15px; flex: 0 0 auto; }
.btn.added { --theme: #2a6b4a; --on-theme: #c9ffe1; box-shadow: 0 5px 0 #17402b, inset 0 1px 0 rgba(255, 255, 255, .25); background: linear-gradient(180deg, #37855d, #2a6b4a); }
.btn.soon { color: #cfeaff; background: rgba(140, 200, 255, .12); border: 1px dashed rgba(160, 215, 255, .5); box-shadow: none; pointer-events: none; font-size: 13px; padding: 0 14px; letter-spacing: .04em; }
/* 即將登場：流光緞帶徽章＋全像色卡片 */
.pcard.upcoming { background: linear-gradient(165deg, rgba(120, 200, 255, .16), rgba(120, 140, 255, .06)); border-style: dashed; border-color: rgba(160, 215, 255, .38); }
.pcard.upcoming.cur { border-color: rgba(170, 225, 255, .85); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 24px rgba(110, 200, 255, .22), 0 10px 26px rgba(0, 0, 0, .25); }
.ribbon {
  position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px 5px 10px; border-radius: 8px 99px 99px 8px; overflow: hidden;
  font-size: 12.5px; font-weight: 900; letter-spacing: .14em; color: #031a30;
  background: linear-gradient(100deg, #58c4ff 0%, #a995ff 52%, #5fdcff 100%); box-shadow: 0 3px 12px rgba(110, 200, 255, .45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.ribbon > * { position: relative; z-index: 1; }
.ribbon svg { width: 13px; height: 13px; }
.ribbon::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .5) 50%, transparent 60%); background-size: 250% 100%; animation: shine 2.6s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -130% 0; } }
.pc-divider { flex: 0 0 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; scroll-snap-align: none; }
.pc-divider::before, .pc-divider::after { content: ""; width: 2px; flex: 1 1 auto; border-radius: 2px; background: linear-gradient(180deg, transparent, rgba(160, 215, 255, .7), transparent); }
.pc-divider span { writing-mode: vertical-rl; font-size: 12px; font-weight: 900; letter-spacing: .3em; color: #bfe6ff; text-shadow: 0 0 10px rgba(110, 200, 255, .7); }
.pc-empty { flex: 1 0 100%; display: grid; place-items: center; text-align: center; color: var(--ink-2); font-size: 15px; line-height: 1.7; padding: 20px; border-radius: 22px; border: 1px dashed var(--line); }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 18px 0; min-height: 40px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; max-width: 60%; }
.dots i { width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .24); transition: width .25s var(--ease-out), background .25s; }
.dots i.up { background: rgba(140, 205, 255, .4); }
.dots i.cur { width: 22px; background: var(--accent); }
.dots i.up.cur { background: #8fd8ff; }
.dots i.gap { width: 2px; height: 12px; background: rgba(160, 215, 255, .5); margin: 0 2px; }
.sc-nav { display: flex; align-items: center; gap: 8px; }
.sc-nav .ibtn { width: 40px; height: 40px; }
.sc-nav .ibtn svg { width: 18px; height: 18px; }
.sc-nav .ibtn[disabled] { opacity: .3; pointer-events: none; }
.sc-hint { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; }

/* 橫式：面板在右側，模型在左 */
@media (min-aspect-ratio: 1/1) {
  .sc-scrim { background: linear-gradient(90deg, rgba(6, 4, 20, 0) 35%, rgba(6, 4, 20, .7) 100%); }
  .sc-panel {
    left: auto; top: 50%; bottom: auto; right: calc(18px + var(--safe-r)); width: min(430px, 46vw);
    max-height: calc(100% - 150px); padding: 20px 0 14px; transform: translate(110%, -50%);
  }
  .sc.on .sc-panel { transform: translate(0, -50%); }
  .sc-head { padding: 0 22px 12px; }
  .sc-story { font-size: 15px; min-height: 3.4em; }
  .sc-carousel { padding: 8px 22px 12px; }
  .pcard { flex-basis: 100%; min-height: 230px; padding: 18px; gap: 12px; }
  .pc-name { font-size: 20px; -webkit-line-clamp: 3; }
  .pc-pitch { font-size: 15px; -webkit-line-clamp: 4; }
  .pc-img { flex-basis: 96px; width: 96px; height: 96px; }
  .sc-tabs { padding: 2px 22px 12px; flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .price { font-size: 26px; }
  .sc-foot { padding: 4px 22px 0; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .sc-panel { top: 50%; max-height: calc(100% - 20px); padding-top: 12px; }
  .pcard { min-height: 0; }
  .sc-story { min-height: 0; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pcard { padding: 12px; gap: 6px; }
  .pc-name { font-size: 16px; -webkit-line-clamp: 2; } .pc-pitch { font-size: 13px; -webkit-line-clamp: 2; }
  .pc-img { flex-basis: 60px; width: 60px; height: 60px; }
  .sc-tabs { flex-wrap: nowrap; padding-bottom: 8px; } .sc-tab { min-height: 32px; font-size: 13px; }
  .sc-close { right: calc(min(430px, 46vw) + 28px + var(--safe-r)); }
}

/* ───────── 面板（購物袋／結算） ───────── */
.sheet-mask { position: absolute; inset: 0; background: rgba(6, 4, 20, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; z-index: 10; }
.sheet-mask.on { opacity: 1; visibility: visible; }
.sheet {
  position: absolute; z-index: 11; left: 50%; bottom: 0; width: min(560px, 100%); max-height: min(88%, 760px);
  display: flex; flex-direction: column; border-radius: 30px 30px 0 0; padding: 10px 0 calc(14px + var(--safe-b));
  background: var(--glass-strong); transform: translate(-50%, 104%); visibility: hidden; transition: transform .45s var(--ease-out), visibility .45s;
}
.sheet.on { transform: translate(-50%, 0); visibility: visible; }
.sheet::before { content: ""; width: 44px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .28); margin: 0 auto 8px; flex: 0 0 auto; }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 20px 12px; }
.sh-title { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: .1em; display: flex; align-items: center; gap: 10px; }
.sh-title svg { width: 24px; height: 24px; color: var(--accent); }
.sh-title small { font-size: 13px; font-weight: 800; color: var(--ink-3); letter-spacing: .04em; }
.sh-body { flex: 1 1 auto; overflow-y: auto; padding: 2px 16px 10px; min-height: 80px; touch-action: pan-y; }
.sh-foot { flex: 0 0 auto; padding: 12px 20px 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.sh-total { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; font-weight: 800; color: var(--ink-2); letter-spacing: .06em; }
.sh-total b { font-size: 26px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.sh-actions { display: flex; gap: 10px; }
.sh-actions .btn { flex: 1 1 0; padding: 0 12px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 18px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); transition: opacity .25s, background .2s, transform .3s var(--ease-out);
}
.item.off { opacity: .45; }
.item.off .it-name { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .4); }
.item.leaving { opacity: 0; transform: translateX(40px); }
.it-chip { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); background: var(--c, #666); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .4); overflow: hidden; }
.it-chip img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.it-name { font-size: 15px; font-weight: 800; line-height: 1.4; letter-spacing: .02em; }
.it-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; font-weight: 700; }
.it-price { font-size: 15px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.it-del { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #ff9aa8; background: rgba(255, 120, 140, .12); margin-left: 4px; }
.it-del svg { width: 18px; height: 18px; }
.it-right { display: flex; align-items: center; gap: 4px; }
.check { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .35); color: transparent; transition: all .2s var(--ease-out); }
.item:not(.off) .check { background: var(--ok); border-color: var(--ok); color: #06301c; }
.check svg { width: 16px; height: 16px; }
.empty { text-align: center; padding: 34px 20px 30px; color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.empty svg { width: 56px; height: 56px; margin: 0 auto 10px; color: var(--ink-3); }

/* 探險完成證書（純通關紀念，不含任何優惠承諾） */
.cert-wrap { margin: 6px 4px 10px; }
.cert {
  position: relative; display: grid; grid-template-columns: 104px 1fr; min-height: 176px; color: #4a2c00; border-radius: 6px; overflow: hidden;
  background: linear-gradient(118deg, #f5b93a 0%, #ffe9a6 22%, #f7c64a 42%, #fff4c9 58%, #eba92c 78%, #ffdf86 100%);
  -webkit-mask:
    radial-gradient(circle 7px at left 0 top 50%, #0000 96%, #000) left top / 51% 20px repeat-y,
    radial-gradient(circle 7px at right 0 top 50%, #0000 96%, #000) right top / 51% 20px repeat-y;
  mask:
    radial-gradient(circle 7px at left 0 top 50%, #0000 96%, #000) left top / 51% 20px repeat-y,
    radial-gradient(circle 7px at right 0 top 50%, #0000 96%, #000) right top / 51% 20px repeat-y;
  filter: drop-shadow(0 10px 22px rgba(255, 180, 40, .28));
  animation: cert-in .7s var(--ease-back) both;
}
@keyframes cert-in { 0% { transform: scale(.7) rotate(-5deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cert::before { content: ""; position: absolute; inset: 7px 13px; border: 1.5px solid rgba(120, 72, 0, .35); border-radius: 4px; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%); background-size: 260% 100%; animation: shine 3s ease-in-out infinite; }
.ct-stub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-right: 2px dashed rgba(90, 52, 0, .4); padding: 12px 6px 12px 18px; text-align: center; }
.ct-avatar { width: 62px; height: 62px; border-radius: 50%; box-shadow: 0 0 0 3px #fff7dc, 0 0 0 5px rgba(120, 72, 0, .45), 0 5px 10px rgba(90, 52, 0, .35); }
.ct-stub b { font-size: 12px; letter-spacing: .24em; text-indent: .24em; font-weight: 900; margin-top: 5px; }
.ct-stub small { font-size: 9px; font-weight: 800; letter-spacing: .18em; text-indent: .18em; opacity: .7; }
.ct-main { padding: 16px 24px 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.ct-head { font-size: 13px; font-weight: 900; letter-spacing: .12em; opacity: .85; }
.ct-name { font-size: 23px; font-weight: 900; letter-spacing: .1em; line-height: 1.25; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.ct-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; font-weight: 800; line-height: 1.6; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ct-meta i { font-style: normal; font-weight: 700; opacity: .62; margin-right: 5px; font-size: 11.5px; }
.ct-badge { display: flex; align-items: center; gap: 7px; margin-top: 7px; padding-top: 8px; border-top: 1px solid rgba(90, 52, 0, .25); font-size: 12.5px; font-weight: 900; letter-spacing: .06em; color: rgba(74, 44, 0, .5); }
.ct-badge em { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed rgba(74, 44, 0, .38); background: rgba(74, 44, 0, .08); font-style: normal; }
.ct-badge em svg { width: 14px; height: 14px; }
.ct-badge small { font-size: 11px; font-weight: 700; opacity: .8; margin-left: auto; }
.ct-badge.got { color: #4a2c00; }
.ct-badge.got em { border: 2px solid #b36b00; background: linear-gradient(160deg, #fff3b0, #ffb300); color: #7a4300; box-shadow: 0 2px 6px rgba(120, 72, 0, .4); }
/* 證書＋優惠券 */
.cert.coupon { min-height: 0; }
.ct-offer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; line-height: 1.1; margin: 2px 0 1px; }
.ct-offer span { font-size: 17px; font-weight: 900; letter-spacing: .1em; }
.ct-offer b { font-size: 38px; font-weight: 900; letter-spacing: .02em; color: #b3261e; text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 3px 8px rgba(160, 60, 0, .25); }
.ct-offer em { font-style: normal; font-size: 13px; font-weight: 900; letter-spacing: .14em; padding: 3px 9px; border-radius: 6px; color: #fff; background: #6b6b6b; align-self: center; }
.ct-sub { font-size: 12.5px; font-weight: 900; letter-spacing: .14em; opacity: .75; }
.ct-terms { margin: 5px 0 0; padding: 0 0 0 1.15em; font-size: 12px; font-weight: 700; line-height: 1.6; }
.ct-terms li::marker { color: rgba(74, 44, 0, .55); }
.ct-foot { font-size: 12px; font-weight: 900; letter-spacing: .08em; margin-top: 6px; padding: 5px 10px; border-radius: 6px; background: rgba(74, 44, 0, .1); text-align: center; }
.cert.expired { background: linear-gradient(118deg, #a9a9a9 0%, #dcdcdc 30%, #b9b9b9 55%, #e6e6e6 75%, #b0b0b0 100%); color: #3b3b3b; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25)); }
.cert.expired::after { display: none; }
.cert.expired .ct-offer b { color: #6b6b6b; text-decoration: line-through; text-shadow: none; }
.cert.expired .ct-avatar { filter: grayscale(1); }
.cert-wrap .restart { display: flex; margin: 10px auto 0; --theme: #ffcf3d; --on-theme: #3d2600; }
.sh-totals { display: flex; flex-direction: column; gap: 2px; }
.sh-total.sub { font-size: 13px; }
.sh-total.sub s { font-size: 16px; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.off-tag { font-style: normal; margin-left: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 900; letter-spacing: .06em; color: #3d2600; background: linear-gradient(180deg, #fff1a8, #ffd23f); }
.sh-hint { font-size: 12.5px; font-weight: 800; color: var(--accent); letter-spacing: .04em; text-align: right; }
.no-promo { margin-left: 8px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; color: var(--ink-2); border: 1px dashed var(--line); white-space: nowrap; }
/* 價格區：門市加購價（主）＋網路價刪除線＋省多少（有 webPrice 才有後兩者） */
.price.dual { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.price.dual small { margin: 0 0 1px; font-size: 11.5px; }
.price.dual strong { font-size: 22px; font-weight: 900; }
.price.dual .web { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.price.dual .web s { text-decoration-thickness: 1.5px; }
.price.dual .web em { font-style: normal; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 900; color: #06301c; background: var(--ok); white-space: nowrap; }
/* 卡片右上角的「看詳細」 */
.pc-tags { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.pc-more { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 0 6px 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--ink); background: rgba(255, 255, 255, .12); border: 1px solid var(--line); white-space: nowrap; transition: transform .14s var(--ease-out), background .15s; }
.pc-more:active { transform: scale(.94); background: rgba(255, 255, 255, .2); }
.pc-more svg { width: 13px; height: 13px; }
/* 分頁列＋選購指南按鈕 */
.sc-tabrow { display: flex; align-items: flex-start; flex: 0 0 auto; min-width: 0; }
.sc-tabrow .sc-tabs { flex: 1 1 auto; min-width: 0; }
.sc-tabrow.solo { justify-content: flex-end; padding-bottom: 10px; }
.sc-guide { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 38px; margin: 2px 18px 0 0; padding: 0 12px 0 10px; border-radius: 99px; font-size: 13px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .14s var(--ease-out); }
.sc-guide:active { transform: scale(.94); }
.sc-guide svg { width: 16px; height: 16px; }
.sc-tabrow:not(.solo) .sc-tabs { padding-right: 8px; }
/* 說明面板（看詳細／選購指南）：手機＝bottom sheet，橫式＝右側面板 */
.info-mask { position: absolute; inset: 0; z-index: 12; background: rgba(6, 4, 20, .5); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.info-mask.on { opacity: 1; visibility: visible; }
.info {
  position: absolute; z-index: 13; left: 0; right: 0; bottom: 0; max-height: 84%; display: flex; flex-direction: column;
  border-radius: 28px 28px 0 0; padding: 14px 0 calc(12px + var(--safe-b)); background: var(--glass-strong);
  transform: translateY(104%); visibility: hidden; transition: transform .42s var(--ease-out), visibility .42s;
}
.info.on { transform: none; visibility: visible; }
.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 2px 16px 10px 20px; flex: 0 0 auto; }
.info-heading { min-width: 0; }
.info-kicker { font-size: 12px; font-weight: 900; letter-spacing: .16em; color: var(--accent); }
.info-title { margin: 3px 0 0; font-size: 19px; font-weight: 900; line-height: 1.35; letter-spacing: .02em; overflow-wrap: anywhere; }
.info-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 20px 14px; touch-action: pan-y; overflow-wrap: anywhere; }
.info-badges { margin-bottom: 10px; }
.info-lead { margin: 0 0 8px; font-size: 15.5px; font-weight: 800; line-height: 1.6; color: var(--ink); }
.info-text { margin: 0 0 4px; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); letter-spacing: .02em; }
.info-sec { margin-top: 16px; }
.info-sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .16em; color: var(--ink-3); }
.info-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.info-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; padding: 9px 12px; border-radius: 14px; }
.info-list i { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 14px; }
.info-list i svg { width: 13px; height: 13px; }
.info-list.pros li { background: rgba(88, 230, 160, .1); border: 1px solid rgba(88, 230, 160, .26); }
.info-list.pros i { background: var(--ok); color: #06301c; }
.info-list.cons li { background: rgba(255, 190, 90, .1); border: 1px solid rgba(255, 190, 90, .3); }
.info-list.cons i { background: #ffb84d; color: #3d2600; }
.info-best { margin-top: 16px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--theme) 18%, transparent); border: 1px solid color-mix(in srgb, var(--theme) 45%, transparent); font-size: 14.5px; line-height: 1.6; }
.info-best b { flex: 0 0 auto; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 900; letter-spacing: .1em; color: var(--on-theme); background: var(--theme); white-space: nowrap; margin-top: 1px; }
.info-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cmp { padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 5px; }
.cmp b { font-size: 14px; font-weight: 900; color: var(--accent); letter-spacing: .04em; }
.cmp span { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.info-faq { display: flex; flex-direction: column; gap: 7px; }
.info-faq details { border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); overflow: hidden; }
.info-faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; font-size: 14.5px; font-weight: 800; line-height: 1.5; cursor: pointer; }
.info-faq summary::-webkit-details-marker { display: none; }
.info-faq summary svg { flex: 0 0 auto; width: 12px; height: 12px; color: var(--ink-3); transition: transform .2s; }
.info-faq details[open] summary svg { transform: rotate(180deg); }
.info-faq p { margin: 0; padding: 0 14px 12px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.info-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 0; border-top: 1px solid var(--line-soft); }
.info-foot .btn { flex: 0 0 auto; min-height: 48px; }
.info-foot .btn.soon { font-size: 13px; }
@media (min-aspect-ratio: 1/1) {
  .info { left: auto; right: calc(18px + var(--safe-r)); bottom: auto; top: 50%; width: min(430px, 46vw); max-height: calc(100% - 36px); border-radius: 28px; padding: 18px 0 16px; transform: translate(112%, -50%); }
  .info.on { transform: translate(0, -50%); }
  .info-mask { background: rgba(6, 4, 20, .28); }
}
.list-note { text-align: center; font-size: 12.5px; font-weight: 800; letter-spacing: .1em; color: var(--ink-3); margin: 12px 0 4px; }
.cert.locked {
  display: flex; align-items: center; gap: 14px; min-height: 0; padding: 16px 22px; color: var(--ink-2); background: rgba(255, 255, 255, .06);
  filter: none; animation: none; border-radius: 6px; outline: 1px dashed var(--line); outline-offset: -5px;
}
.cert.locked::after, .cert.locked::before { display: none; }
.cert.locked svg { width: 30px; height: 30px; flex: 0 0 auto; color: var(--ink-3); }
.cl-txt { flex: 1 1 auto; font-size: 14px; font-weight: 800; line-height: 1.5; letter-spacing: .03em; }
.cl-txt .pbar { width: 100%; height: 8px; margin-top: 8px; }
.cl-num { font-size: 20px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.sec-label { font-size: 12px; font-weight: 900; letter-spacing: .2em; color: var(--ink-3); margin: 14px 8px 8px; }

/* ───────── 提示／慶祝 ───────── */
.toasts { position: absolute; left: 50%; top: calc(72px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none !important; z-index: 30; width: max-content; max-width: calc(100vw - 28px); }
/* 廣場全破提示出現時，提示訊息往下讓位 */
body:has(.finale.on) .toasts { top: calc(126px + var(--safe-t)); }
.toast { padding: 10px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 800; letter-spacing: .05em; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(3, 2, 16, .45); animation: toast-in .4s var(--ease-back) both; display: flex; align-items: center; gap: 8px; text-align: center; }
.toast.out { animation: toast-out .3s ease forwards; }
.toast svg { width: 18px; height: 18px; color: var(--ok); flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.95); } }
.banner {
  position: absolute; left: 50%; top: 28%; transform: translate(-50%, -50%); z-index: 20; pointer-events: none !important; text-align: center; width: max-content; max-width: 92vw;
  animation: banner-in .7s var(--ease-back) both;
}
.banner.out { animation: banner-out .4s ease forwards; }
@keyframes banner-in { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-6deg); } }
@keyframes banner-out { to { opacity: 0; transform: translate(-50%, -70%) scale(.9); } }
.bn-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.bn-stars svg { width: 38px; height: 38px; color: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 210, 63, .8)); animation: star-pop .7s var(--ease-back) both; }
.bn-stars svg:nth-child(2) { animation-delay: .12s; transform-origin: center; } .bn-stars svg:nth-child(3) { animation-delay: .24s; }
.bn-title { font-size: clamp(26px, 7.4vw, 46px); font-weight: 900; letter-spacing: .1em; color: #fff; text-shadow: 0 4px 0 color-mix(in srgb, var(--theme) 65%, #000), 0 0 30px color-mix(in srgb, var(--theme) 80%, transparent), 0 12px 30px rgba(0, 0, 0, .5); }
.bn-sub { margin-top: 6px; font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: .1em; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.fly { position: fixed; z-index: 60; width: 26px; height: 26px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 60%, #ff9d00); box-shadow: 0 0 18px var(--gold); transition: transform .7s cubic-bezier(.5, -0.3, .7, 1), opacity .7s ease-in; }

/* 全破提示（廣場） */
.finale {
  position: absolute; left: 50%; top: calc(74px + var(--safe-t)); transform: translate(-50%, -20px); opacity: 0; pointer-events: none !important; z-index: 6;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; transition: opacity .4s, transform .5s var(--ease-back);
  border-color: rgba(255, 210, 63, .55); box-shadow: 0 14px 40px rgba(3, 2, 16, .45), 0 0 30px rgba(255, 210, 63, .25); max-width: calc(100vw - 24px);
}
.finale.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto !important; }
.finale span { font-size: 14.5px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
.finale .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ───────── 標題畫面 ───────── */
.title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(34px + var(--safe-t)) 18px calc(26px + var(--safe-b)); opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; pointer-events: none !important; }
.title.on { opacity: 1; visibility: visible; }
.title > * { pointer-events: auto; }
.title::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 6, 26, .62) 0%, rgba(8, 6, 26, 0) 34%, rgba(8, 6, 26, 0) 56%, rgba(8, 6, 26, .78) 100%); }
.logo { position: relative; text-align: center; pointer-events: none; }
.logo-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 99px; font-size: 13px; font-weight: 900; letter-spacing: .34em; text-indent: .34em; color: #1a1436; background: linear-gradient(180deg, #fff1a8, #ffd23f); box-shadow: 0 4px 0 #b88600, 0 10px 24px rgba(0, 0, 0, .35); opacity: 0; animation: kicker-in .6s var(--ease-back) .9s forwards; }
@keyframes kicker-in { from { opacity: 0; transform: translateY(12px) scale(.8); } to { opacity: 1; transform: none; } }
.logo-main { margin: 14px 0 0; display: flex; justify-content: center; flex-wrap: nowrap; font-size: clamp(40px, 12.4vw, 104px); font-weight: 900; line-height: 1.05; letter-spacing: .02em; }
.logo-main span {
  display: inline-block; color: #fffaf0; opacity: 0;
  text-shadow: 0 .035em 0 #cdbfff, 0 .07em 0 #7a5cff, 0 .105em 0 #5a3fd6, 0 .14em 0 #3a2596, 0 .2em .3em rgba(8, 4, 40, .65), 0 0 .6em rgba(160, 130, 255, .55);
  animation: logo-drop .8s var(--ease-back) forwards;
}
.logo-main span:nth-child(1) { animation-delay: .10s; --rot: -5deg; } .logo-main span:nth-child(2) { animation-delay: .18s; --rot: 3deg; }
.logo-main span:nth-child(3) { animation-delay: .26s; --rot: -2deg; } .logo-main span:nth-child(4) { animation-delay: .34s; --rot: 4deg; }
.logo-main span:nth-child(5) { animation-delay: .42s; --rot: -4deg; } .logo-main span:nth-child(6) { animation-delay: .50s; --rot: 3deg; }
.logo-main span:nth-child(n+5) { color: #ffe9a0; text-shadow: 0 .035em 0 #ffd23f, 0 .07em 0 #f0a400, 0 .105em 0 #c77800, 0 .14em 0 #8f4f00, 0 .2em .3em rgba(8, 4, 40, .65), 0 0 .6em rgba(255, 200, 80, .6); }
@keyframes logo-drop { 0% { opacity: 0; transform: translateY(-70%) rotate(calc(var(--rot) * 4)) scale(.5); } 100% { opacity: 1; transform: rotate(var(--rot)); } }
.logo-sub { margin-top: 12px; font-size: clamp(14px, 3.6vw, 20px); font-weight: 800; letter-spacing: .5em; text-indent: .5em; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .7); opacity: 0; animation: kicker-in .6s var(--ease-out) 1.1s forwards; }
.title-bottom { position: relative; width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; animation: kicker-in .7s var(--ease-out) 1.4s forwards; }
.pick-label { font-size: 13px; font-weight: 900; letter-spacing: .3em; text-indent: .3em; color: var(--ink-2); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.picks { display: flex; gap: 10px; width: 100%; justify-content: center; }
.pick {
  flex: 1 1 0; max-width: 132px; padding: 10px 6px 10px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--glass); border: 2px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform .25s var(--ease-back), border-color .2s, background .2s, box-shadow .2s;
}
.pick i { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -5px 8px rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .5), 0 0 0 3px var(--c2); }
.pick b { font-size: 15px; font-weight: 900; letter-spacing: .14em; text-indent: .14em; }
.pick.cur { transform: translateY(-6px); border-color: var(--gold); background: var(--glass-strong); box-shadow: 0 10px 26px rgba(0, 0, 0, .4), 0 0 22px rgba(255, 210, 63, .35); }
.title-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; align-items: center; }
.title-actions .btn.big { min-height: 60px; font-size: 21px; letter-spacing: .2em; text-indent: .2em; width: min(320px, 100%); }
.title-actions .btn.ghost { min-height: 42px; font-size: 14px; }
.title-foot { font-size: 11.5px; color: var(--ink-3); letter-spacing: .1em; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); text-align: center; }
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .title { padding-top: calc(12px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .logo-main { font-size: clamp(34px, 13vh, 72px); margin-top: 6px; }
  .logo-sub { margin-top: 4px; } .title-bottom { gap: 8px; flex-direction: row; width: min(760px, 100%); align-items: flex-end; }
  .pick-label, .title-foot { display: none; } .pick { padding: 6px; flex-direction: row; justify-content: center; } .pick i { width: 22px; height: 22px; }
  .title-actions .btn.big { min-height: 50px; font-size: 18px; }
}

/* 確認框 */
.confirm { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(6, 4, 20, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; padding: 20px; }
.confirm.on { opacity: 1; visibility: visible; }
.confirm-box { width: min(360px, 100%); border-radius: var(--r-lg); padding: 24px 22px 20px; text-align: center; background: var(--glass-strong); transform: scale(.9); transition: transform .3s var(--ease-back); }
.confirm.on .confirm-box { transform: none; }
.confirm-box h3 { margin: 0 0 8px; font-size: 20px; font-weight: 900; letter-spacing: .08em; }
.confirm-box p { margin: 0 0 18px; font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }
.confirm-box .sh-actions { justify-content: center; }

/* 除錯面板（?debug=1） */
.debug { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); padding: 8px 12px; border-radius: 12px; font: 700 12px/1.5 ui-monospace, Menlo, monospace; color: #b9ffdc; background: rgba(0, 0, 0, .6); pointer-events: none !important; white-space: pre; z-index: 35; }

/* 小螢幕微調 */
@media (max-width: 520px), (max-height: 520px) {
  .ibtn { width: 40px; height: 40px; }
  .ibtn svg { width: 20px; height: 20px; }
  .ibtn.wide { padding: 0; width: 40px; justify-content: center; } .ibtn.wide span { display: none; }
  .hud-tl { max-width: calc(100% - 164px - var(--safe-l) - var(--safe-r)); padding: 5px 12px 5px 5px; gap: 8px; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); }
  .hud-tr { top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); gap: 6px; }
  .hud-emoji { width: 34px; height: 34px; font-size: 19px; }
  .hud-title { font-size: 14px; }
  .hud-prog { font-size: 11px; margin-top: 1px; }
  .stars svg { width: 13px; height: 13px; }
  .bag-btn { width: 54px; height: 54px; border-radius: 19px; right: calc(12px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); box-shadow: 0 4px 0 color-mix(in srgb, var(--theme) 52%, #000), 0 12px 22px rgba(3, 2, 16, .42), inset 0 1px 0 rgba(255, 255, 255, .55); }
  .bag-btn svg { width: 26px; height: 26px; }
  .badge { min-width: 22px; height: 22px; font-size: 12px; right: -6px; top: -7px; padding: 0 6px; }
  .act .btn { min-height: 50px; font-size: 16px; padding: 0 22px; }
  .finale { top: calc(58px + var(--safe-t)); padding: 6px 6px 6px 14px; gap: 8px; }
  .finale span { font-size: 13px; }
  .finale .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .toasts { top: calc(60px + var(--safe-t)); }
  .door-card { width: min(360px, calc(100vw - 20px - var(--safe-l) - var(--safe-r))); bottom: calc(78px + var(--safe-b)); }
}
@media (max-width: 520px) and (max-aspect-ratio: 1/1) {
  .sc-close { top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); }
  .sc-label { top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); font-size: 14px; padding: 7px 14px 7px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .ribbon::after, .cert::after, .act .btn::before, .ld-gem, .ld-gem i { animation: none; }
}

/* ===== 學堂／圖鑑／測驗 ===== */
/* 知識卡（.kc）、知識圖鑑（.gl-*）、隨堂測驗（.quiz／.qz-*）、開機之旅字幕（.bt）、徽章取得演出（.award）。
   配色：全像青 --holo、金 --gold。字要大、句子短，小朋友也看得懂。 */
:root { --holo: #5fe0ff; --holo-2: #9fd0ff; }

/* HUD：多一顆圖鑑按鈕，左上資訊膠囊讓出寬度 */
.hud-tl { max-width: calc(100% - 248px - var(--safe-l) - var(--safe-r)); }
.gl-btn { position: relative; color: var(--holo); border-color: color-mix(in srgb, var(--holo) 45%, transparent); }
.gl-btn.full { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.gl-btn.bump { animation: bag-bump .5s var(--ease-back); }
.gl-count {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 1px 6px; border-radius: 99px; white-space: nowrap;
  font-size: 10.5px; font-weight: 900; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.35;
  color: #04202e; background: linear-gradient(180deg, #c9f6ff, var(--holo)); border: 1.5px solid #1a1436; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.gl-btn.full .gl-count { color: #3d2600; background: linear-gradient(180deg, #fff1a8, var(--gold)); }

/* ───────── 知識卡 ───────── */
.kc-mask { position: absolute; inset: 0; z-index: 18; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; background: linear-gradient(180deg, rgba(6, 4, 20, 0) 34%, rgba(6, 4, 20, .62) 100%); }
.kc-mask.on { opacity: 1; visibility: visible; }
.kc-mask.review { background: rgba(6, 4, 20, .58); }
.kc {
  position: absolute; z-index: 19; left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); max-height: 57%;
  display: flex; flex-direction: column; border-radius: 26px; padding: 14px 0 12px; background: var(--glass-strong);
  border-color: color-mix(in srgb, var(--holo) 42%, transparent);
  box-shadow: 0 14px 44px rgba(3, 2, 16, .5), 0 0 0 1px rgba(95, 224, 255, .12), 0 0 34px rgba(95, 224, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .16);
  transform: translateY(108%); visibility: hidden; transition: transform .45s var(--ease-out), visibility .45s;
}
.kc.on { transform: none; visibility: visible; }
.kc.review { max-height: 80%; }
.kc-head { display: flex; align-items: center; gap: 12px; padding: 0 14px 10px 16px; flex: 0 0 auto; }
.kc-icon {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; font-size: 32px; line-height: 1;
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .34), rgba(95, 224, 255, .2) 45%, rgba(40, 70, 190, .34));
  border: 1px solid rgba(160, 235, 255, .5); box-shadow: 0 0 18px rgba(95, 224, 255, .3), inset 0 -5px 10px rgba(0, 0, 0, .22);
}
.kc-heading { flex: 1 1 auto; min-width: 0; }
.kc-kicker { font-size: 12px; font-weight: 900; letter-spacing: .14em; color: var(--holo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-name { margin: 2px 0 0; font-size: 23px; font-weight: 900; line-height: 1.25; letter-spacing: .05em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.kc-en { font-size: 14px; font-weight: 800; letter-spacing: .06em; color: var(--ink-2); padding: 1px 9px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-soft); white-space: nowrap; }
.kc-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 16px 10px; touch-action: pan-y; overflow-wrap: anywhere; }
.kc-analogy {
  position: relative; padding: 11px 14px 12px 16px; border-radius: 18px; margin-bottom: 11px; overflow: hidden;
  background: linear-gradient(120deg, rgba(255, 210, 63, .2), rgba(255, 170, 60, .08)); border: 1px solid rgba(255, 210, 63, .45);
}
.kc-analogy::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gold); }
.kc-analogy small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #ffe9a0; opacity: .9; }
.kc-analogy strong { display: block; margin-top: 1px; font-size: 24px; font-weight: 900; line-height: 1.3; letter-spacing: .05em; color: #fff6d6; text-shadow: 0 2px 10px rgba(255, 190, 40, .35); }
.kc-what { margin: 0 0 10px; font-size: 16px; line-height: 1.75; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.kc-more { border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); margin-bottom: 10px; overflow: hidden; }
.kc-more summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px; font-size: 14.5px; font-weight: 800; letter-spacing: .06em; color: var(--holo-2); cursor: pointer; }
.kc-more summary::-webkit-details-marker { display: none; }
.kc-more summary svg { flex: 0 0 auto; width: 12px; height: 12px; transition: transform .2s; }
.kc-more[open] summary svg { transform: rotate(180deg); }
.kc-more p { margin: 0; padding: 0 14px 12px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.kc-tip { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 16px; margin-bottom: 10px; background: rgba(88, 230, 160, .1); border: 1px solid rgba(88, 230, 160, .32); font-size: 15px; line-height: 1.65; }
.kc-tip b { flex: 0 0 auto; margin-top: 2px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 900; letter-spacing: .08em; color: #06301c; background: var(--ok); white-space: nowrap; }
.kc-rel h4 { margin: 4px 0 7px; font-size: 12.5px; font-weight: 900; letter-spacing: .16em; color: var(--ink-3); }
.kc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.kc-chip { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; border-radius: 14px; background: rgba(95, 224, 255, .09); border: 1px solid rgba(95, 224, 255, .3); }
.kc-chip b { font-size: 14.5px; font-weight: 900; letter-spacing: .04em; color: #d9f8ff; }
.kc-chip small { font-size: 12px; font-weight: 700; color: var(--ink-2); line-height: 1.45; }
.kc-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 0; border-top: 1px solid var(--line-soft); }
.kc-foot .btn { --theme: #2aa8d8; --on-theme: #ffffff; min-height: 46px; padding: 0 26px; flex: 0 0 auto; }
.kc-status { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--ink-2); min-width: 0; }
.kc-status i { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #06301c; }
.kc-status i svg { width: 13px; height: 13px; }
.kc-miss { color: var(--ink-3); }
/* 收集演出：蓋章 */
.kc-stamp {
  position: absolute; right: 62px; top: -16px; padding: 5px 14px 5px 12px; border-radius: 12px; display: flex; align-items: baseline; gap: 6px; pointer-events: none;
  color: #3d2600; background: linear-gradient(180deg, #fff3b0, var(--gold)); box-shadow: 0 4px 0 #b88600, 0 10px 24px rgba(255, 190, 40, .45);
  opacity: 0; transform: scale(2.2) rotate(-18deg);
}
.kc-stamp b { font-size: 14px; font-weight: 900; letter-spacing: .1em; }
.kc-stamp span { font-size: 15px; font-weight: 900; letter-spacing: .04em; font-style: italic; }
.kc.fresh .kc-stamp { animation: kc-stamp .55s var(--ease-back) forwards; }
.kc.fresh .kc-icon { animation: kc-pop .7s var(--ease-back); }
@keyframes kc-stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-20deg); } 60% { opacity: 1; transform: scale(.92) rotate(-7deg); } 100% { opacity: 1; transform: scale(1) rotate(-6deg); } }
@keyframes kc-pop { 0% { transform: scale(.5) rotate(-14deg); } 55% { transform: scale(1.22) rotate(6deg); } 100% { transform: none; } }
@media (min-aspect-ratio: 1/1) {
  .kc-mask { background: linear-gradient(90deg, rgba(6, 4, 20, 0) 38%, rgba(6, 4, 20, .6) 100%); }
  .kc { left: auto; right: calc(18px + var(--safe-r)); bottom: auto; top: 50%; width: min(430px, 46vw); max-height: calc(100% - 44px); padding: 18px 0 16px; transform: translate(112%, -50%); }
  .kc.on { transform: translate(0, -50%); }
  .kc.review { max-height: calc(100% - 44px); }
  .kc-head { padding: 0 16px 12px 20px; } .kc-body { padding: 2px 20px 12px; } .kc-foot { padding: 12px 20px 0; }
  .kc-analogy strong { font-size: 26px; } .kc-what { font-size: 16.5px; }
}

/* ───────── 知識圖鑑 ───────── */
.gl-sheet { width: min(680px, 100%); max-height: min(92%, 860px); }
.gl-sheet .sh-title svg { color: var(--holo); }
.gl-badge {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px; margin: 2px 2px 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .06); border: 1px dashed var(--line);
}
.gl-medal { flex: 0 0 auto; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: rgba(255, 255, 255, .07); border: 2px dashed rgba(255, 255, 255, .28); filter: grayscale(1) brightness(.8); }
.gl-badge-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gl-badge-txt b { font-size: 17px; font-weight: 900; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-badge-txt b em { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; color: var(--ink-2); background: rgba(255, 255, 255, .12); }
.gl-badge-txt small { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.gl-req { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 3px; }
.gl-req span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); letter-spacing: .03em; }
.gl-req i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.gl-req i svg { width: 11px; height: 11px; }
.gl-req span.ok { color: #b9ffdc; } .gl-req span.ok i { background: var(--ok); color: #06301c; }
.gl-badge.got { border: 1px solid rgba(255, 210, 63, .7); background: linear-gradient(120deg, rgba(255, 210, 63, .22), rgba(255, 150, 40, .08)); box-shadow: 0 0 26px rgba(255, 200, 60, .18); }
.gl-badge.got .gl-medal { filter: none; border: 2px solid #ffcf3d; background: radial-gradient(circle at 35% 28%, #fff7d0, #ffc933 58%, #e89600); box-shadow: 0 0 20px rgba(255, 200, 60, .55), inset 0 -5px 8px rgba(120, 60, 0, .3); }
.gl-badge.got .gl-badge-txt b em { color: #3d2600; background: linear-gradient(180deg, #fff1a8, var(--gold)); }
.gl-sec { display: flex; align-items: center; justify-content: space-between; margin: 14px 6px 8px; font-size: 13px; font-weight: 900; letter-spacing: .14em; color: var(--holo-2); }
.gl-sec em { font-style: normal; font-variant-numeric: tabular-nums; padding: 1px 9px; border-radius: 99px; color: var(--ink); background: rgba(255, 255, 255, .12); letter-spacing: .04em; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.gl-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px 10px; min-height: 112px; border-radius: 18px; text-align: center;
  background: rgba(255, 255, 255, .04); border: 1px dashed rgba(255, 255, 255, .16); transition: transform .14s var(--ease-out), background .15s;
}
.gl-card:active { transform: scale(.95); }
.gl-ic { font-size: 34px; line-height: 1.15; height: 42px; color: transparent; text-shadow: 0 0 0 rgba(170, 190, 255, .22); }
.gl-card b { font-size: 14.5px; font-weight: 900; letter-spacing: .05em; line-height: 1.3; color: var(--ink-3); }
.gl-card small { font-size: 11px; font-weight: 700; line-height: 1.35; color: var(--ink-3); letter-spacing: .02em; }
.gl-card.got { border: 1px solid rgba(95, 224, 255, .42); background: linear-gradient(165deg, rgba(95, 224, 255, .16), rgba(90, 110, 255, .07)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.gl-card.got .gl-ic { color: inherit; text-shadow: none; filter: drop-shadow(0 3px 8px rgba(95, 224, 255, .35)); }
.gl-card.got b { color: var(--ink); } .gl-card.got small { color: var(--holo-2); font-size: 11.5px; }

/* ───────── 隨堂測驗 ───────── */
.quiz-mask { position: absolute; inset: 0; z-index: 14; background: rgba(6, 4, 20, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.quiz-mask.on { opacity: 1; visibility: visible; }
.quiz {
  position: absolute; z-index: 15; left: 50%; bottom: 0; width: min(560px, 100%); max-height: 88%; display: flex; flex-direction: column;
  border-radius: 30px 30px 0 0; padding: 16px 0 calc(14px + var(--safe-b)); background: var(--glass-strong);
  border-color: color-mix(in srgb, var(--holo) 40%, transparent);
  transform: translate(-50%, 104%); visibility: hidden; transition: transform .45s var(--ease-out), visibility .45s;
}
.quiz.on { transform: translate(-50%, 0); visibility: visible; }
.qz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px 8px 20px; flex: 0 0 auto; }
.qz-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.qz-emoji { font-size: 24px; line-height: 1; }
.qz-title b { font-size: 20px; font-weight: 900; letter-spacing: .1em; }
.qz-title small { font-size: 13px; font-weight: 800; color: var(--holo-2); letter-spacing: .06em; padding: 2px 10px; border-radius: 99px; background: rgba(95, 224, 255, .12); white-space: nowrap; }
.qz-dots { display: flex; gap: 6px; padding: 0 20px 10px; flex: 0 0 auto; }
.qz-dots i { flex: 1 1 0; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .16); transition: background .25s; }
.qz-dots i.cur { background: var(--holo); box-shadow: 0 0 10px rgba(95, 224, 255, .6); }
.qz-dots i.ok { background: var(--ok); } .qz-dots i.ng { background: #ff8a9a; }
.qz-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 18px 12px; touch-action: pan-y; }
.qz-q { font-size: 20px; font-weight: 900; line-height: 1.55; letter-spacing: .03em; margin: 2px 2px 14px; }
.qz-opts { display: flex; flex-direction: column; gap: 9px; }
.qz-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; min-height: 58px; padding: 9px 14px 9px 10px; border-radius: 18px;
  font-size: 17px; font-weight: 800; line-height: 1.45; letter-spacing: .02em; color: var(--ink);
  background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .16); box-shadow: 0 4px 0 rgba(0, 0, 0, .22);
  transition: transform .12s var(--ease-out), background .2s, border-color .2s, opacity .2s, box-shadow .12s;
}
.qz-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.qz-opt i { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 16px; font-weight: 900; color: #04202e; background: linear-gradient(180deg, #c9f6ff, var(--holo)); }
.qz-opt span { min-width: 0; overflow-wrap: anywhere; }
.qz-opt[disabled] { cursor: default; }
.qz-opt.right { border-color: var(--ok); background: rgba(88, 230, 160, .2); }
.qz-opt.right i { background: var(--ok); color: #06301c; }
.qz-opt.wrong { border-color: #ff8a9a; background: rgba(255, 120, 140, .18); animation: qz-shake .4s ease; }
.qz-opt.wrong i { background: #ff8a9a; color: #4a0714; }
.qz-opt.dim { opacity: .45; }
@keyframes qz-shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } }
.qz-fb { display: none; margin-top: 12px; padding: 13px 14px; border-radius: 18px; }
.qz-fb.on { display: block; animation: toast-in .35s var(--ease-back) both; }
.qz-fb.ok { background: rgba(88, 230, 160, .12); border: 1px solid rgba(88, 230, 160, .4); }
.qz-fb.ng { background: rgba(255, 150, 120, .12); border: 1px solid rgba(255, 150, 130, .45); }
.qz-verdict { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.qz-verdict i { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.qz-verdict i svg { width: 16px; height: 16px; }
.qz-fb.ok .qz-verdict i { background: var(--ok); color: #06301c; } .qz-fb.ng .qz-verdict i { background: #ff8a9a; color: #4a0714; }
.qz-verdict b { font-size: 19px; font-weight: 900; letter-spacing: .08em; }
.qz-verdict span { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.qz-fb p { margin: 8px 0 0; font-size: 15.5px; line-height: 1.7; color: var(--ink); }
.qz-review { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 99px; font-size: 14px; font-weight: 800; letter-spacing: .04em; color: #d9f8ff; background: rgba(95, 224, 255, .12); border: 1px solid rgba(95, 224, 255, .4); }
.qz-review:active { transform: scale(.96); }
.qz-review span { font-size: 18px; }
.qz-foot { flex: 0 0 auto; display: flex; gap: 10px; padding: 10px 18px 0; min-height: 60px; }
.qz-foot .btn { flex: 1 1 0; --theme: #2aa8d8; --on-theme: #fff; }
.qz-foot .btn.ghost { --theme: initial; }
.qz-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 6px 6px 4px; }
.qz-ring {
  --p: 0; width: 148px; height: 148px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
  background: conic-gradient(var(--qc, var(--holo)) calc(var(--p) * 360deg), rgba(255, 255, 255, .12) 0);
  animation: cert-in .7s var(--ease-back) both;
}
.qz-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #1b173c; box-shadow: inset 0 4px 14px rgba(0, 0, 0, .5); }
.qz-ring b { position: relative; font-size: 58px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.qz-ring small { position: relative; font-size: 14px; font-weight: 800; color: var(--ink-2); margin-top: 2px; }
.qz-result.pass .qz-ring { --qc: var(--gold); filter: drop-shadow(0 0 22px rgba(255, 210, 63, .45)); }
.qz-result.fail .qz-ring { --qc: #ff9aa8; }
.qz-verdict.big { justify-content: center; }
.qz-verdict.big b { font-size: 30px; letter-spacing: .14em; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.qz-result.pass .qz-verdict.big b { color: #ffe9a0; }
.qz-marks { display: flex; gap: 6px; }
.qz-marks i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.qz-marks i svg { width: 16px; height: 16px; }
.qz-marks i.ok { background: var(--ok); color: #06301c; } .qz-marks i.ng { background: rgba(255, 138, 154, .9); color: #4a0714; }
.qz-result p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.7; color: var(--ink); max-width: 26em; }
.qz-best { font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--ink-2); padding: 3px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
@media (min-aspect-ratio: 1/1) {
  .quiz { bottom: auto; top: 50%; width: min(600px, 62vw); max-height: calc(100% - 40px); border-radius: 30px; padding: 20px 0 18px; transform: translate(-50%, -46%) scale(.94); opacity: 0; transition: transform .35s var(--ease-back), opacity .25s, visibility .35s; }
  .quiz.on { transform: translate(-50%, -50%); opacity: 1; }
}

/* ───────── 開機之旅：字幕面板 ───────── */
.bt {
  position: absolute; z-index: 8; left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); max-height: 46%;
  display: flex; flex-direction: column; border-radius: 26px; padding: 12px 0 12px; background: var(--glass-strong);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow: 0 14px 44px rgba(3, 2, 16, .5), 0 0 30px rgba(255, 200, 60, .12), inset 0 1px 0 rgba(255, 255, 255, .16);
  transform: translateY(110%); visibility: hidden; transition: transform .45s var(--ease-out), visibility .45s;
}
.bt.on { transform: none; visibility: visible; }
.bt-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px 16px; flex: 0 0 auto; }
.bt-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 9px; border-radius: 99px; font-size: 13px; font-weight: 900; letter-spacing: .12em; color: #3d2600; background: linear-gradient(180deg, #fff1a8, var(--gold)); white-space: nowrap; }
.bt-count { font-size: 13px; font-weight: 900; color: var(--ink-2); letter-spacing: .06em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bt-segs { flex: 1 1 auto; display: flex; gap: 4px; min-width: 0; }
.bt-segs i { flex: 1 1 0; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; position: relative; }
.bt-segs i.done { background: var(--gold); }
.bt-segs i.cur { background: rgba(255, 255, 255, .22); }
.bt-segs i.cur::after { content: ""; position: absolute; inset: 0; background: var(--gold); transform-origin: left; transform: scaleX(var(--k, 1)); }
.bt-head .ibtn { width: 40px; height: 40px; }
.bt-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 18px 8px; touch-action: pan-y; }
.bt-title { font-size: 23px; font-weight: 900; line-height: 1.3; letter-spacing: .06em; color: #fff6d6; text-shadow: 0 2px 12px rgba(255, 190, 40, .3); }
.bt-text { margin: 6px 0 0; font-size: 16.5px; line-height: 1.75; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.bt-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.bt-parts span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 99px; font-size: 13px; font-weight: 800; letter-spacing: .04em; color: #d9f8ff; background: rgba(95, 224, 255, .12); border: 1px solid rgba(95, 224, 255, .34); }
.bt-parts span.arrow { padding: 0; border: 0; background: none; color: var(--gold); font-size: 15px; }
.bt-body.swap > * { animation: swap-r .4s var(--ease-out) both; }
.bt-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 14px 0; }
.bt-foot .btn { min-height: 46px; padding: 0 18px; font-size: 15.5px; }
.bt-foot .btn.next { flex: 1 1 auto; --theme: #ffcf3d; --on-theme: #3d2600; }
.bt-auto { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 13px; border-radius: 99px; font-size: 13.5px; font-weight: 800; letter-spacing: .04em; color: var(--ink-2); background: rgba(255, 255, 255, .08); border: 1px solid var(--line); white-space: nowrap; }
.bt-auto i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.bt-auto.on { color: #06301c; background: var(--ok); border-color: transparent; }
.bt-auto.on i { background: #06301c; animation: tr-dot 1s ease-in-out infinite; }
@media (min-aspect-ratio: 1/1) {
  .bt { left: auto; right: calc(18px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); width: min(430px, 44vw); max-height: calc(100% - 110px); padding: 16px 0 16px; transform: translateX(112%); }
  .bt.on { transform: none; }
  .bt-title { font-size: 26px; } .bt-text { font-size: 17px; }
}

/* ───────── 徽章取得演出 ───────── */
.award { position: absolute; inset: 0; z-index: 44; display: grid; place-items: center; padding: 20px; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(60, 36, 4, .72), rgba(6, 4, 20, .9) 70%); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
.award.on { opacity: 1; visibility: visible; }
.aw-rays { position: absolute; left: 50%; top: 42%; width: 190vmax; height: 190vmax; margin: -95vmax 0 0 -95vmax; pointer-events: none; opacity: .5; background: repeating-conic-gradient(from 0deg, rgba(255, 210, 63, .22) 0deg 9deg, transparent 9deg 22deg); -webkit-mask-image: radial-gradient(circle, #000 0, transparent 46%); mask-image: radial-gradient(circle, #000 0, transparent 46%); animation: aw-spin 26s linear infinite; }
@keyframes aw-spin { to { transform: rotate(360deg); } }
.aw-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 420px; }
.award.on .aw-box > * { animation: kicker-in .6s var(--ease-back) both; }
.award.on .aw-box > :nth-child(2) { animation: aw-medal .9s var(--ease-back) .1s both; }
.award.on .aw-box > :nth-child(3) { animation-delay: .5s; } .award.on .aw-box > :nth-child(4) { animation-delay: .65s; }
.award.on .aw-box > :nth-child(5) { animation-delay: .8s; } .award.on .aw-box > :nth-child(6) { animation-delay: 1s; }
@keyframes aw-medal { 0% { opacity: 0; transform: scale(.2) rotate(-200deg); } 70% { opacity: 1; transform: scale(1.14) rotate(8deg); } 100% { opacity: 1; transform: none; } }
.aw-kicker { font-size: 15px; font-weight: 900; letter-spacing: .5em; text-indent: .5em; color: #ffe9a0; }
.aw-medal {
  position: relative; width: 168px; height: 168px; margin: 8px 0 10px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 26%, #fffbe0 0%, #ffd84a 42%, #f0a000 78%, #b36b00 100%);
  box-shadow: 0 0 0 7px #fff3b0, 0 0 0 11px #c98a00, 0 0 70px rgba(255, 205, 60, .7), inset 0 -12px 22px rgba(120, 60, 0, .35), inset 0 6px 10px rgba(255, 255, 255, .6);
}
.aw-medal span { font-size: 92px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(90, 40, 0, .4)); }
.aw-medal i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 2px; background: #fff7c8; box-shadow: 0 0 12px #ffd23f; transform: rotate(calc(var(--i) * 60deg + 30deg)) translateY(-112px) rotate(45deg); animation: aw-tw 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * .18s); }
.aw-medal i:nth-of-type(1) { --i: 0; } .aw-medal i:nth-of-type(2) { --i: 1; } .aw-medal i:nth-of-type(3) { --i: 2; }
.aw-medal i:nth-of-type(4) { --i: 3; } .aw-medal i:nth-of-type(5) { --i: 4; } .aw-medal i:nth-of-type(6) { --i: 5; }
@keyframes aw-tw { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.aw-name { font-size: clamp(34px, 10vw, 52px); font-weight: 900; letter-spacing: .14em; text-indent: .14em; color: #fff8dc; text-shadow: 0 4px 0 #b36b00, 0 0 34px rgba(255, 205, 60, .7), 0 12px 28px rgba(0, 0, 0, .5); }
.aw-desc { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: .06em; line-height: 1.6; }
.aw-note { font-size: 13.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; margin-bottom: 10px; }
.aw-box .btn { min-height: 54px; padding: 0 40px; font-size: 18px; }

/* 證書上的徽章：取得後亮起；還沒全破時，鎖住的證書下方也看得到徽章欄位 */
.ct-badge.got em { font-size: 16px; animation: aw-glow 2.2s ease-in-out infinite; }
@keyframes aw-glow { 50% { box-shadow: 0 2px 6px rgba(120, 72, 0, .4), 0 0 16px rgba(255, 190, 40, .95); } }
.ct-badge.got small { opacity: 1; padding: 1px 8px; border-radius: 99px; color: #fff8dc; background: #a35f00; }
.ct-badge.solo { margin: 8px 2px 0; padding: 10px 14px; border-top: 0; border-radius: 14px; color: var(--ink-3); background: rgba(255, 255, 255, .05); border: 1px dashed var(--line); }
.ct-badge.solo em { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); }
.ct-badge.solo.got { color: #ffe9a0; border: 1px solid rgba(255, 210, 63, .6); background: linear-gradient(120deg, rgba(255, 210, 63, .2), rgba(255, 150, 40, .07)); }
.ct-badge.solo.got small { color: #3d2600; background: var(--gold); }

@media (max-width: 520px), (max-height: 520px) {
  .hud-tl { max-width: calc(100% - 168px - var(--safe-l) - var(--safe-r)); }
  .gl-count { font-size: 9.5px; bottom: -8px; padding: 0 5px; }
  .kc-icon { width: 52px; height: 52px; font-size: 28px; border-radius: 17px; }
  .kc-name { font-size: 21px; } .kc-analogy strong { font-size: 22px; }
  .aw-medal { width: 140px; height: 140px; } .aw-medal span { font-size: 76px; } .aw-medal i { transform: rotate(calc(var(--i) * 60deg + 30deg)) translateY(-96px) rotate(45deg); }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .bt { max-height: calc(100% - 20px); bottom: calc(10px + var(--safe-b)); } .bt-title { font-size: 20px; } .bt-text { font-size: 14.5px; line-height: 1.6; }
  .kc-analogy strong { font-size: 20px; } .kc-what { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .aw-rays, .aw-medal i, .ct-badge.got em { animation: none; } }
/* ===== 學堂／圖鑑／測驗（結束） ===== */

/* ===== 我的筆電 ===== */
/* 客人掃展示機 QR 帶入機型後才會出現的 UI：適配徽章、標題卡片、HUD 按鈕、「我的筆電」面板。
   沒有機型時這一段的元素都不會顯示（.hud.dv-on／.title.has-device 也不會掛上）。 */
:root { --fit: #5dffc8; --fit-2: #c9ff8a; --fit-ink: #04291f; }

/* ── 「適合你的筆電」徽章（商品卡／詳細面板共用） ── */
.fit-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 99px; white-space: nowrap;
  font-size: 12px; font-weight: 900; letter-spacing: .06em; color: var(--fit-ink);
  background: linear-gradient(100deg, var(--fit-2), var(--fit)); box-shadow: 0 3px 12px rgba(93, 255, 200, .38), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.fit-badge svg { width: 14px; height: 14px; flex: 0 0 auto; }
.fit-badge b { font-weight: 900; }

/* ── 商品展示面板 ── */
.pcard.fit { border-color: rgba(93, 255, 200, .42); background: linear-gradient(165deg, rgba(93, 255, 200, .15), rgba(255, 255, 255, .05) 58%); }
.pcard.fit.cur { border-color: var(--fit); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 1px rgba(93, 255, 200, .32), 0 0 26px rgba(93, 255, 200, .2), 0 10px 26px rgba(0, 0, 0, .25); }
.pc-fit {
  margin: 0; display: flex; align-items: flex-start; gap: 7px; padding: 7px 10px; border-radius: 12px;
  font-size: 13px; font-weight: 800; line-height: 1.45; letter-spacing: .02em; color: #dcfff2;
  background: rgba(93, 255, 200, .12); border: 1px solid rgba(93, 255, 200, .3);
}
.pc-fit svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; color: var(--fit); }
.pc-fit span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-tab .fit-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-left: -5px; border-radius: 50%; background: var(--fit); box-shadow: 0 0 0 3px rgba(93, 255, 200, .22), 0 0 10px var(--fit); }
.sc-tab.cur .fit-dot { box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); }
.dots i.fit { background: rgba(93, 255, 200, .5); }
.dots i.fit.cur { background: var(--fit); }
/* 手機直式：適合的商品卡多一行理由，名稱與文案各收一行，確保價格與按鈕不被擠出面板 */
@media (max-aspect-ratio: 1/1) {
  .pcard.fit { gap: 7px; }
  .pcard.fit .pc-pitch { -webkit-line-clamp: 1; margin-top: 3px; }
  /* 多出來的那一行理由，讓面板在需要時可以多長高一點（內容不夠高時不會變高），價格與按鈕才不會被切到 */
  .sc:has(.pcard.fit) .sc-panel { max-height: calc(60% + 48px); }
}
@media (max-aspect-ratio: 1/1) and (max-height: 720px) { .pcard.fit .pc-name { -webkit-line-clamp: 1; } }
/* 手機橫式（高度很小）：面板沒有空間再長高，適合的商品卡改成精簡版（理由與名稱各一行、不顯示文案；完整內容在「看詳細」） */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .pcard.fit .pc-fit { padding: 4px 8px; font-size: 12px; }
  .pcard.fit .pc-fit span, .pcard.fit .pc-name { -webkit-line-clamp: 1; }
  .pcard.fit .pc-pitch { display: none; }
}

/* ── 商品詳細面板頂部的適配說明 ── */
.info-fit { margin: 0 0 12px; padding: 11px 13px 12px; border-radius: 16px; background: linear-gradient(135deg, rgba(93, 255, 200, .18), rgba(201, 255, 138, .06)); border: 1px solid rgba(93, 255, 200, .42); }
.info-fit p { margin: 8px 0 0; font-size: 14.5px; font-weight: 800; line-height: 1.55; letter-spacing: .02em; color: #e8fff7; }

/* ── 標題畫面：「你的筆電」卡片 ── */
.title.has-device { justify-content: flex-start; }
.title.has-device .title-bottom { margin-top: auto; }
.title-device { position: relative; width: min(420px, 100%); margin-top: 12px; flex: 0 0 auto; }
.tdv {
  display: flex; flex-direction: column; gap: 8px; padding: 11px 13px 8px; border-radius: 20px; text-align: left; cursor: pointer;
  background: var(--glass-strong); border-color: rgba(93, 255, 200, .5);
  box-shadow: 0 14px 40px rgba(3, 2, 16, .5), 0 0 24px rgba(93, 255, 200, .14), inset 0 1px 0 rgba(255, 255, 255, .16);
  opacity: 0; animation: kicker-in .7s var(--ease-out) 1.25s forwards; transition: border-color .2s;
}
.tdv:active { border-color: var(--fit); }
.tdv:focus-visible { outline: 2px solid var(--fit); outline-offset: 3px; }
.tdv-top { display: flex; align-items: center; gap: 11px; }
.tdv-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--fit-ink); background: linear-gradient(150deg, var(--fit-2), var(--fit)); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .14), 0 4px 12px rgba(93, 255, 200, .32); }
.tdv-ico svg { width: 23px; height: 23px; }
.tdv-id { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.tdv-id small { font-size: 11px; font-weight: 900; letter-spacing: .22em; color: var(--fit); }
.tdv-id b { font-size: 16px; font-weight: 900; line-height: 1.35; letter-spacing: .02em; overflow-wrap: anywhere; }
.tdv-id em { font-style: normal; display: inline-block; margin-left: 7px; padding: 0 8px; border-radius: 7px; font-size: 12.5px; font-weight: 900; letter-spacing: .04em; color: var(--fit); background: rgba(93, 255, 200, .14); border: 1px solid rgba(93, 255, 200, .4); vertical-align: 1px; overflow-wrap: anywhere; }
.tdv-go { flex: 0 0 auto; color: var(--ink-3); }
.tdv-go svg { width: 16px; height: 16px; }
.tdv-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tdv-chips span { padding: 3px 9px; border-radius: 9px; font-size: 12.5px; font-weight: 800; letter-spacing: .01em; background: rgba(255, 255, 255, .09); border: 1px solid var(--line-soft); white-space: nowrap; }
.tdv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.tdv-clear { flex: 0 0 auto; min-height: 32px; padding: 0 2px 0 8px; font-size: 12px; font-weight: 800; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
/* 橫式／桌機：卡片移到右側中間，不擋中央的角色 */
@media (min-aspect-ratio: 1/1) {
  .title.has-device { justify-content: space-between; }
  .title.has-device .title-bottom { margin-top: 0; }
  .title-device { position: absolute; right: calc(28px + var(--safe-r)); top: 32%; width: min(312px, 30vw); margin: 0; }
  .tdv { padding: 14px 15px 10px; gap: 10px; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .title-device { top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); width: 236px; }
  .tdv { padding: 9px 11px 5px; gap: 5px; border-radius: 16px; }
  .tdv-chips { display: none; }
  .tdv-foot > span { display: none; } .tdv-foot { justify-content: flex-end; }
  .tdv-id b { font-size: 14px; } .tdv-ico { width: 32px; height: 32px; border-radius: 10px; } .tdv-ico svg { width: 19px; height: 19px; }
}

/* ── HUD：筆電按鈕（圖示＋機種碼），與圖鑑等按鈕同一排 ── */
.ibtn.dv-hud {
  width: auto; min-width: 46px; max-width: 190px; padding: 0 14px 0 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  color: var(--fit); border-color: rgba(93, 255, 200, .45); font-size: 13px; font-weight: 900; letter-spacing: .04em;
}
.dv-hud svg { flex: 0 0 auto; }
.dv-hud span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
/* 左上館名膠囊的最大寬度跟著右上按鈕列的實際寬度（JS 量測後寫進 --hud-tr-w），按鈕再多也不會互相蓋到 */
.hud.dv-on .hud-tl { max-width: calc(100% - var(--hud-tr-w, 300px) - 34px - var(--safe-l) - var(--safe-r)); }
@media (max-width: 520px), (max-height: 520px) {
  .ibtn.dv-hud { min-width: 40px; max-width: 72px; height: 40px; padding: 4px 6px 3px; flex-direction: column; justify-content: center; gap: 1px; border-radius: 14px; }
  .dv-hud svg { width: 17px; height: 17px; }
  .dv-hud span { max-width: 100%; font-size: 9px; letter-spacing: 0; line-height: 1.15; }
  .hud.dv-on .hud-tl { max-width: calc(100% - var(--hud-tr-w, 230px) - 28px - var(--safe-l) - var(--safe-r)); }
}

/* ── 「我的筆電」面板：手機＝bottom sheet，橫式／桌機＝置中的兩欄視窗 ── */
.dv-mask { position: absolute; inset: 0; z-index: 10; background: rgba(6, 4, 20, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
.dv-mask.on { opacity: 1; visibility: visible; }
.dv {
  position: absolute; z-index: 11; left: 0; right: 0; bottom: 0; height: min(88%, 780px); display: flex; flex-direction: column;
  border-radius: 28px 28px 0 0; padding: 14px 0 calc(10px + var(--safe-b)); background: var(--glass-strong); border-color: rgba(93, 255, 200, .28);
  transform: translateY(104%); visibility: hidden; transition: transform .42s var(--ease-out), visibility .42s;
}
.dv.on { transform: none; visibility: visible; }
.dv-side, .dv-main { display: contents; }
.dv-close { position: absolute; right: 12px; top: 12px; z-index: 2; }
.dv-head { order: 0; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 2px 64px 12px 18px; }
.dv-art { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: var(--fit-ink); background: linear-gradient(150deg, var(--fit-2), var(--fit)); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .14), 0 6px 16px rgba(93, 255, 200, .3); }
.dv-art svg { width: 29px; height: 29px; }
.dv-heading { min-width: 0; }
.dv-kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; letter-spacing: .2em; color: var(--fit); }
.dv-kicker svg { display: none; }
.dv-name { margin: 2px 0 0; font-size: 19px; font-weight: 900; line-height: 1.3; letter-spacing: .02em; overflow-wrap: anywhere; }
.dv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.dv-tags:empty { display: none; }
.dv-code { padding: 1px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 900; letter-spacing: .04em; color: var(--fit); background: rgba(93, 255, 200, .14); border: 1px solid rgba(93, 255, 200, .4); overflow-wrap: anywhere; }
.dv-line { padding: 1px 9px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--ink-2); background: rgba(255, 255, 255, .08); border: 1px solid var(--line-soft); white-space: nowrap; }
.dv-chips, .dv-pros.side { display: none; }
.dv-tabs { order: 2; flex: 0 0 auto; display: flex; gap: 6px; padding: 0 14px 10px; }
.dv-tab {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 6px; border-radius: 13px; white-space: nowrap;
  font-size: 13.5px; font-weight: 800; letter-spacing: .03em; color: var(--ink-2); background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft);
  transition: background .2s, color .2s, transform .15s var(--ease-out);
}
.dv-tab:active { transform: scale(.96); }
.dv-tab em { font-style: normal; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-size: 11.5px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--fit); background: rgba(93, 255, 200, .18); }
.dv-tab.none em { color: var(--ink-3); background: rgba(255, 255, 255, .1); }
.dv-tab.cur { color: var(--fit-ink); border-color: transparent; background: linear-gradient(180deg, var(--fit-2), var(--fit)); box-shadow: 0 3px 0 #1f9a78, 0 8px 18px rgba(93, 255, 200, .22); }
.dv-tab.cur em { color: var(--fit-ink); background: rgba(0, 0, 0, .16); }
.dv-body { order: 3; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 14px; touch-action: pan-y; overflow-wrap: anywhere; }
.dv-foot { order: 4; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px 0 18px; border-top: 1px solid var(--line-soft); }
.dv-sku { min-width: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: var(--ink-3); overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.dv-clear { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border-radius: 99px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); background: rgba(255, 255, 255, .08); border: 1px solid var(--line-soft); white-space: nowrap; }
.dv-clear:active { background: rgba(255, 255, 255, .16); }

/* 規格表 */
.dv-rows { display: flex; flex-direction: column; gap: 6px; }
.dv-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line-soft); }
.dv-rl { padding-top: 2px; font-size: 12.5px; font-weight: 900; letter-spacing: .06em; color: var(--fit); }
.dv-rv b { display: block; font-size: 14.5px; font-weight: 900; line-height: 1.45; letter-spacing: .01em; }
.dv-rv span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.dv-note { margin: 12px 4px 2px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.dv-note.warn { font-size: 12.5px; font-weight: 800; color: #ffd98a; }
.dv-note.center { text-align: center; margin-top: 0; }
.dv-lead { margin: 2px 4px 12px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.dv-pros h4 { margin: 0 0 7px; font-size: 12px; font-weight: 900; letter-spacing: .16em; color: var(--ink-3); }
.dv-pros ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dv-pros li { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 8px; border-radius: 99px; font-size: 13px; font-weight: 800; line-height: 1.35; color: #fff3c4; background: rgba(255, 210, 63, .12); border: 1px solid rgba(255, 210, 63, .35); }
.dv-pros li svg { flex: 0 0 auto; width: 13px; height: 13px; color: var(--gold); }
.dv-pros.inline { margin: 0 0 12px; }
.dv-empty { text-align: center; padding: 38px 20px 30px; color: var(--ink-2); font-size: 14.5px; line-height: 1.75; }
.dv-empty svg { width: 52px; height: 52px; margin: 0 auto 10px; color: var(--ink-3); }
.dv-empty p { margin: 0; }

/* 適合這台的配件 */
.dv-room { margin-bottom: 14px; }
.dv-room header { display: flex; align-items: center; gap: 8px; margin: 0 2px 7px; min-height: 32px; }
.dv-room header i { flex: 0 0 auto; font-style: normal; width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 70%, #fff), var(--rc)); box-shadow: inset 0 -2px 5px rgba(0, 0, 0, .18); }
.dv-room header b { font-size: 15px; font-weight: 900; letter-spacing: .06em; }
.dv-room header em { font-style: normal; margin-right: auto; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.dv-go { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 6px 0 12px; border-radius: 99px; font-size: 12.5px; font-weight: 900; letter-spacing: .06em; color: var(--ink); background: color-mix(in srgb, var(--rc) 28%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 62%, transparent); transition: transform .14s var(--ease-out); }
.dv-go:active { transform: scale(.94); }
.dv-go svg { width: 13px; height: 13px; }
.dv-here { flex: 0 0 auto; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; color: var(--ink-3); border: 1px dashed var(--line); }
.dv-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.dv-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; text-align: left; padding: 11px 32px 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); transition: transform .14s var(--ease-out), background .15s; }
.dv-item:active { transform: scale(.985); background: rgba(255, 255, 255, .12); }
.dv-it-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dv-flag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }
.dv-flag svg { width: 11px; height: 11px; }
.dv-flag.up { color: #031a30; background: linear-gradient(100deg, #58c4ff, #a995ff); }
.dv-flag.order { color: #3d2600; background: #ffc266; }
.dv-flag.in { color: #c9ffe1; background: rgba(88, 230, 160, .18); border: 1px solid rgba(88, 230, 160, .4); }
.dv-it-name { font-size: 15px; font-weight: 900; line-height: 1.4; letter-spacing: .02em; }
.dv-it-why { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 800; line-height: 1.5; color: #dcfff2; }
.dv-it-why svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 3px; color: var(--fit); }
.dv-it-meta { display: flex; align-items: center; gap: 5px; width: 100%; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.dv-it-meta svg { flex: 0 0 auto; width: 13px; height: 13px; }
.dv-it-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-it-meta strong { flex: 0 0 auto; margin-left: auto; padding-left: 8px; font-size: 14px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dv-chev { position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--ink-3); }

/* 原廠活動 */
.dv-promo { padding: 13px 14px; margin-bottom: 9px; border-radius: 18px; background: linear-gradient(150deg, rgba(255, 210, 63, .13), rgba(255, 255, 255, .05)); border: 1px solid rgba(255, 210, 63, .32); }
.dv-promo h4 { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 15px; font-weight: 900; line-height: 1.45; letter-spacing: .02em; }
.dv-promo h4 svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: var(--gold); }
.dv-gift { margin: 8px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.dv-promo-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-top: 11px; }
.dv-period { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: #ffe9a0; font-variant-numeric: tabular-nums; }
.dv-period svg { flex: 0 0 auto; width: 14px; height: 14px; }
.dv-link { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 900; letter-spacing: .04em; color: #3d2600; text-decoration: none; background: linear-gradient(180deg, #ffe07a, #ffcf3d); box-shadow: 0 3px 0 #b88600; }
.dv-link:active { transform: translateY(2px); box-shadow: 0 1px 0 #b88600; }
.dv-link svg { width: 14px; height: 14px; }

/* 橫式／桌機：置中的兩欄視窗（左＝這台筆電的名片，右＝分頁內容） */
@media (min-aspect-ratio: 1/1) {
  .dv {
    left: 50%; right: auto; top: 50%; bottom: auto; width: min(920px, calc(100% - 48px - var(--safe-l) - var(--safe-r))); height: min(660px, calc(100% - 44px));
    display: grid; grid-template-columns: 300px minmax(0, 1fr); padding: 0; border-radius: 28px; overflow: hidden;
    transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .36s var(--ease-out), opacity .24s ease, visibility .36s;
  }
  .dv.on { transform: translate(-50%, -50%); opacity: 1; }
  .dv-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding: 22px 18px 16px 22px; border-right: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(93, 255, 200, .11), rgba(93, 255, 200, 0) 62%); }
  .dv-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-top: 18px; }
  .dv-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 0; }
  .dv-art {
    width: 100%; height: 128px; border-radius: 20px; color: var(--fit);
    background:
      linear-gradient(rgba(93, 255, 200, .1) 1px, transparent 1px) 0 0 / 100% 16px,
      linear-gradient(90deg, rgba(93, 255, 200, .1) 1px, transparent 1px) 0 0 / 16px 100%,
      radial-gradient(120% 100% at 50% 100%, rgba(93, 255, 200, .28), rgba(10, 30, 44, .5) 70%);
    border: 1px solid rgba(93, 255, 200, .35); box-shadow: inset 0 0 30px rgba(93, 255, 200, .12);
  }
  .dv-art svg { width: 82px; height: 82px; filter: drop-shadow(0 0 12px rgba(93, 255, 200, .7)); }
  .dv-name { font-size: 22px; }
  .dv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .dv-chips span { padding: 4px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 800; background: rgba(255, 255, 255, .09); border: 1px solid var(--line-soft); white-space: nowrap; }
  .dv-pros.side { display: block; }
  .dv-pros.inline { display: none; }
  .dv-foot { margin-top: auto; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 0 0; }
  .dv-tabs { padding: 0 70px 12px 18px; gap: 8px; }
  .dv-tab { flex: 0 0 auto; padding: 0 16px; min-height: 42px; font-size: 14px; }
  .dv-body { padding: 2px 18px 18px; }
  .dv-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dv-row { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 3px; padding: 11px 13px; }
  .dv-rl { padding: 0; }
  .dv-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .dv { width: calc(100% - 20px - var(--safe-l) - var(--safe-r)); height: calc(100% - 16px); grid-template-columns: 216px minmax(0, 1fr); border-radius: 20px; }
  .dv-side { padding: 12px 10px 10px 14px; gap: 9px; }
  .dv-art, .dv-pros.side { display: none; }
  .dv-name { font-size: 17px; }
  .dv-main { padding-top: 10px; }
  .dv-tabs { padding: 0 58px 8px 12px; } .dv-tab { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .dv-body { padding: 2px 12px 10px; }
  .dv-close { right: 8px; top: 8px; }
}
@media (max-width: 760px) and (min-aspect-ratio: 1/1) { .dv-rows, .dv-items { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tdv { animation: none; opacity: 1; } }
/* ===== 我的筆電（結束） ===== */


/* ===== 整合階段：桌機橫式體驗、結算 QR 交接、硬體偵測、選單、清除資料 ===== */
:root { --danger: #ff6b7d; }
.btn.danger { --theme: #e5484d; --on-theme: #ffffff; }

/* ── HUD：全螢幕／選單按鈕、桌機操作提示 ── */
.hud-keys {
  position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(16px + var(--safe-b)); display: flex; align-items: center; gap: 14px;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--ink-2); pointer-events: none !important;
  background: rgba(22, 18, 48, .5);
}
.hud-keys span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hud-keys kbd { color: var(--ink); background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .26); margin-right: 1px; }
.hud-keys span kbd:last-of-type { margin-right: 5px; }
.touch .hud-keys { display: none; }
@media (max-width: 760px) { .hud-keys { display: none; } }
@media (max-width: 1080px) { .hud-keys .hk-tap { display: none; } }
/* 互動提示出現時（畫面下方中間），窄一點的視窗讓操作提示讓位 */
@media (max-width: 1000px) { .hud:has(.door-card.on) .hud-keys, .hud:has(.act.on) .hud-keys { opacity: 0; } }
.hud-keys { transition: opacity .2s; }
/* 對話框開著時（畫面下方中間，比較寬）操作提示先收起來，避免在 1280 寬的視窗互相蓋到 */
#ui:has(.dialog.on) .hud-keys { opacity: 0; }
.ibtn.dv-hud.unset { color: var(--ink-2); border-color: var(--line); border-style: dashed; }
.ibtn.dv-hud.unset span { color: var(--ink-2); }
@media (max-width: 520px), (max-height: 520px) {
  /* 窄畫面：音效、全螢幕、「設定筆電」都收進選單，右上角只留 筆電（已設定時）／圖鑑／選單／回廣場 */
  .hud-tr > .ibtn[aria-label="音效開關"], .hud-tr > .full-btn, .hud-tr > .dv-hud.unset { display: none; }
}

/* ── 標題畫面：全螢幕、清除資料、「這是你的新筆電嗎？」卡片 ── */
.title-full { position: absolute; right: calc(14px + var(--safe-r)); top: calc(14px + var(--safe-t)); z-index: 2; }
.touch .title-full { display: none; }      /* 手機／平板：全螢幕收在遊戲內的選單裡 */
.title-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.title-clear { min-height: 30px; padding: 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.title-clear:hover { color: var(--ink); }
.thw {
  display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 11px; border-radius: 20px; text-align: left;
  background: var(--glass-strong); border-color: rgba(95, 224, 255, .5);
  box-shadow: 0 14px 40px rgba(3, 2, 16, .5), 0 0 24px rgba(95, 224, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .16);
  opacity: 0; animation: kicker-in .7s var(--ease-out) .4s forwards;
}
.thw.still, .tdv.still { animation: none; opacity: 1; }
.thw-top { display: flex; align-items: center; gap: 11px; }
.thw-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #04202e; background: linear-gradient(150deg, #c9f6ff, var(--holo)); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .14), 0 4px 12px rgba(95, 224, 255, .32); }
.thw-ico svg { width: 23px; height: 23px; }
.thw-id { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.thw-id b { font-size: 17px; font-weight: 900; letter-spacing: .04em; line-height: 1.3; }
.thw-id small { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.thw-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.thw-chips span { padding: 3px 9px; border-radius: 9px; font-size: 13px; font-weight: 800; background: rgba(255, 255, 255, .09); border: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.thw-actions { display: flex; align-items: center; gap: 12px; }
.thw-actions .btn { --theme: #2aa8d8; --on-theme: #ffffff; flex: 1 1 auto; min-height: 42px; }
.thw-skip { flex: 0 0 auto; min-height: 42px; padding: 0 8px; font-size: 14px; font-weight: 800; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.thw-note { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; font-weight: 700; line-height: 1.45; color: var(--ink-3); }
.thw-note svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; color: var(--ok); }
.thw-mini {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px; font-size: 14px; font-weight: 800; letter-spacing: .04em; color: var(--ink);
  background: var(--glass); border: 1px dashed var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.thw-mini svg { width: 19px; height: 19px; color: var(--holo); }
.title.has-mini .title-device { position: absolute; left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); width: auto; margin: 0; }
@media (max-aspect-ratio: 1/1) { .thw { animation-delay: 1.2s; } .thw-note { display: none; } }
/* 手機直式：左上角的「設定我的筆電」小按鈕跟 Logo 疊在一起 → Logo 往下讓一點 */
@media (max-aspect-ratio: 1/1) { .title.has-mini .logo { margin-top: 40px; } }
@media (min-aspect-ratio: 1/1) and (max-height: 660px) {
  .title-device:has(.thw) { top: calc(64px + var(--safe-t)); right: calc(14px + var(--safe-r)); width: 268px; }
  .thw { padding: 10px 12px 9px; gap: 7px; border-radius: 18px; }
  .thw-id b { font-size: 15.5px; } .thw-ico { width: 34px; height: 34px; border-radius: 11px; } .thw-ico svg { width: 20px; height: 20px; }
  .thw-actions .btn { min-height: 38px; } .thw-skip { min-height: 38px; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  /* 矮視窗的標題：按鈕列改成橫排時，操作提示與清除資料放回最下面一行 */
  /* 放在按鈕列「下面那一條留白」裡（.title 的 padding-bottom），不貼在按鈕列底下——不然會疊到選角卡與「開始探險」
     （手機橫拿 844×390、桌機瀏覽器放大 150% 的 1024×487 都會遇到） */
  .title-foot { display: flex; position: absolute; left: 0; right: 0; bottom: calc(-34px - var(--safe-b)); flex-direction: row; justify-content: center; gap: 14px; }
  .title-foot > span { display: none; }
  .title { padding-bottom: calc(36px + var(--safe-b)); }
  .title-clear { min-height: 28px; }
}
/* 更矮的橫式（手機橫拿 844×390 這種，高度 < 480）：開始／重新開始改成並排、按鈕壓扁一點 */
@media (min-aspect-ratio: 1/1) and (max-height: 479px) {
  .title-actions { flex-direction: row; justify-content: center; align-items: stretch; }
  .title-actions .btn.big { min-height: 46px; width: auto; flex: 1 1 auto; padding: 0 22px; }
  .title-actions .btn.ghost { min-height: 46px; flex: 0 1 auto; white-space: normal; line-height: 1.25; font-size: 13px; }
  .title-bottom { align-items: center; }
  /* 「你的筆電是哪一台？」卡片：放在 Logo 下面、角色右側的空位（原本貼右上角，會跟 Logo 疊在一起） */
  .title-device:has(.thw), .title-device:has(.tdv) { top: calc(112px + var(--safe-t)); width: min(236px, 27vw); }
  html:not(.touch) .title-device:has(.thw), html:not(.touch) .title-device:has(.tdv) { top: calc(112px + var(--safe-t)); }
  .thw-note { display: none; }
}

/* ── 結算畫面：兩欄（桌機）＋給店員掃的 QR ── */
.sum-sheet .sh-body { display: flex; flex-direction: column; }
.sum-side { display: contents; }
.sum-sheet .cert-wrap { order: 1; }
.sum-main { order: 2; }
.sum-sheet .ho { order: 3; }
.sum-clear { order: 4; }
.item[role="checkbox"] { cursor: pointer; }
.ho {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: center; margin: 10px 4px 0; padding: 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
}
.ho.none { display: block; padding: 12px 14px; }
.ho-none { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-3); line-height: 1.5; }
.ho-none svg { flex: 0 0 auto; width: 22px; height: 22px; }
.ho-qr { position: relative; display: grid; place-items: center; min-width: 120px; min-height: 120px; padding: 0; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .15s var(--ease-out); }
.ho-qr:active { transform: scale(.97); }
.ho-qr canvas { display: block; opacity: 0; transition: opacity .25s; }
.ho-qr.ready canvas { opacity: 1; }
.ho-qr i { position: absolute; right: 5px; bottom: 5px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(20, 16, 44, .82); }
.ho-qr i svg { width: 14px; height: 14px; }
.ho-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ho-txt b { font-size: 17px; font-weight: 900; letter-spacing: .08em; color: var(--gold); }
.ho-txt p { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.55; color: var(--ink); }
.ho-txt small { font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink-3); }
.ho-warn { margin: 2px 0 0; padding: 6px 9px; border-radius: 10px; font-size: 13px !important; font-weight: 700 !important; line-height: 1.5; color: #ffe1a6 !important; background: rgba(255, 190, 90, .12); border: 1px dashed rgba(255, 190, 90, .45); }
.ho-warn a { display: inline-block; margin-left: 4px; font-weight: 900; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ho-fail { grid-column: 1 / -1; font-size: 14px; font-weight: 700; line-height: 1.6; color: #ffd3a6; }
.sum-clear { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 4px 2px; padding: 8px 8px 8px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); background: rgba(88, 230, 160, .08); border: 1px solid rgba(88, 230, 160, .26); }
.sum-clear b { color: var(--ok); margin-right: 6px; font-weight: 900; }
.sum-clear .btn { flex: 0 0 auto; min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.sum-clear .btn .ic { width: 16px; height: 16px; }
/* QR 放大 */
.qr-zoom { position: absolute; inset: 0; z-index: 44; display: grid; place-items: center; padding: 20px; background: rgba(6, 4, 20, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s; cursor: zoom-out; }
.qr-zoom.on { opacity: 1; visibility: visible; }
.qz-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 14px 12px; border-radius: 22px; background: #fff; color: #1d1838; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); transform: scale(.92); transition: transform .28s var(--ease-back); max-width: 100%; max-height: 100%; }
.qr-zoom.on .qz-card { transform: none; }
.qz-card canvas { display: block; max-width: 100%; }
.qz-card b { font-size: 17px; font-weight: 900; letter-spacing: .06em; }
.qz-card small { font-size: 13px; font-weight: 700; color: #6b6690; }
.qz-x { position: absolute; right: calc(14px + var(--safe-r)); top: calc(14px + var(--safe-t)); }

@media (min-width: 860px) and (min-aspect-ratio: 1/1) {
  /* 桌機：置中的寬視窗，左＝清單（自己捲）、右＝證書＋QR；合計與按鈕排成一列，矮視窗也一頁看得到重點 */
  .sum-sheet { width: min(1020px, calc(100% - 32px)); bottom: auto; top: 50%; max-height: calc(100% - 20px); height: min(700px, calc(100% - 20px)); border-radius: 28px; padding: 14px 0 14px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .36s var(--ease-out), opacity .24s ease, visibility .36s; }
  .sum-sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .sum-sheet::before { display: none; }
  .sum-sheet .sh-head { padding: 0 18px 10px 22px; }
  .sum-sheet .sh-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 0 14px; overflow: hidden; padding: 0 16px 0 18px; min-height: 0; }
  .sum-main { order: 0; overflow-y: auto; min-height: 0; padding-right: 4px; }
  .sum-main .sec-label { margin-top: 4px; }
  .sum-side { order: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding: 0 2px 8px; }
  .sum-sheet .cert-wrap, .sum-sheet .ho, .sum-clear { margin: 0; flex: 0 0 auto; }
  .sum-sheet .cert-wrap { margin-top: 2px; }
  .sum-sheet .sh-foot { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 22px 0; }
  .sum-sheet .sh-totals { flex: 1 1 auto; flex-direction: row; align-items: baseline; gap: 6px 22px; flex-wrap: wrap; }
  .sum-sheet .sh-total { gap: 12px; }
  .sum-sheet .sh-hint { text-align: left; }
  .sum-sheet .sh-actions { flex: 0 0 auto; }
  .sum-sheet .sh-actions .btn { flex: 0 0 auto; min-width: 132px; }
  .sum-sheet .cert { min-height: 0; }
}
@media (min-width: 860px) and (min-aspect-ratio: 1/1) and (max-height: 820px) {
  /* 矮視窗（1536×730、1280×620 這一級）：證書壓扁一點，右欄不用捲就看得到證書＋QR */
  .sum-sheet { height: calc(100% - 16px); max-height: calc(100% - 16px); padding: 10px 0 12px; }
  .sum-sheet .sh-head { padding-bottom: 6px; } .sum-sheet .sh-head .ibtn { width: 40px; height: 40px; }
  .sum-sheet .cert { grid-template-columns: 84px 1fr; }
  .sum-sheet .ct-stub { padding: 8px 4px 8px 16px; } .sum-sheet .ct-avatar { width: 50px; height: 50px; }
  .sum-sheet .ct-stub small { display: none; }
  .sum-sheet .ct-main { padding: 11px 22px 10px 14px; gap: 1px; }
  .sum-sheet .ct-offer b { font-size: 32px; } .sum-sheet .ct-offer span { font-size: 16px; }
  .sum-sheet .ct-sub { display: none; }
  .sum-sheet .ct-terms { margin-top: 3px; padding: 0; list-style: none; line-height: 1.5; }
  .sum-sheet .ct-terms li { display: inline; }
  .sum-sheet .ct-terms li + li::before { content: "・"; opacity: .6; }
  .sum-sheet .ct-badge { margin-top: 5px; padding-top: 5px; } .sum-sheet .ct-badge em { width: 26px; height: 26px; }
  .sum-sheet .ct-foot { margin-top: 5px; padding: 3px 10px; }
  /* 省高度：完成證書一定是全部探索完成，「探索進度 18/18」不必再寫；有效的優惠券底部那句與條款重複，也收起來（逾期的提示保留） */
  .sum-sheet .ct-prog, .sum-sheet .cert.coupon:not(.expired) .ct-foot { display: none; }
  .sum-sheet .ho { padding: 10px; gap: 8px 12px; }
  .sum-sheet .ho-txt p { font-size: 13.5px; line-height: 1.5; } .sum-sheet .ho-txt b { font-size: 16px; }
  .sum-clear { padding: 5px 6px 5px 12px; }
  .sum-sheet .sh-foot { padding-top: 9px; }
  .sum-sheet .item { padding: 9px 12px; margin-bottom: 6px; }
}

/* ── 「這是你的新筆電嗎？」設定面板 ── */
.hw-mask { position: absolute; inset: 0; z-index: 14; background: rgba(6, 4, 20, .62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
.hw-mask.on { opacity: 1; visibility: visible; }
.hw {
  position: absolute; z-index: 15; left: 0; right: 0; bottom: 0; max-height: 90%; display: flex; flex-direction: column;
  border-radius: 28px 28px 0 0; padding: 14px 0 calc(12px + var(--safe-b)); background: var(--glass-strong); border-color: rgba(95, 224, 255, .34);
  transform: translateY(104%); visibility: hidden; transition: transform .42s var(--ease-out), visibility .42s;
}
.hw.on { transform: none; visibility: visible; }
.hw-head { display: flex; align-items: center; gap: 12px; padding: 0 14px 10px 18px; flex: 0 0 auto; }
.hw-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #04202e; background: linear-gradient(150deg, #c9f6ff, var(--holo)); }
.hw-ico svg { width: 24px; height: 24px; }
.hw-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 20px; font-weight: 900; letter-spacing: .05em; line-height: 1.3; overflow-wrap: anywhere; }
.hw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 18px 10px; touch-action: pan-y; display: flex; flex-direction: column; gap: 16px; }
.hw-sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .16em; color: var(--holo); }
.hw-p { margin: 0 0 8px; font-size: 14px; font-weight: 600; line-height: 1.65; color: var(--ink-2); }
.hw-p.none { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px dashed var(--line); color: var(--ink); }
.hw-p.more, .hw-p.hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }
.hw-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 8px; }
.hw-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 10px; align-items: baseline; padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); }
.hw-line span { font-size: 13px; font-weight: 900; letter-spacing: .08em; color: var(--holo-2); white-space: nowrap; }
.hw-line b { font-size: 15.5px; font-weight: 900; line-height: 1.4; overflow-wrap: anywhere; }
.hw-line small { grid-column: 1 / -1; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--ink-3); }
.hw-privacy { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; line-height: 1.55; color: #d6ffe9; background: rgba(88, 230, 160, .1); border: 1px solid rgba(88, 230, 160, .3); }
.hw-privacy svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; color: var(--ok); }
.hw-loading { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.hw-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.hw-bar i { display: block; height: 100%; width: 4%; border-radius: 99px; background: linear-gradient(90deg, var(--holo), var(--gold)); transition: width .25s var(--ease-out); }
.hw-brands { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.hw-brands span { flex: 1 0 100%; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.hw-brand { min-height: 36px; padding: 0 14px; border-radius: 99px; font-size: 14px; font-weight: 800; color: var(--ink-2); background: rgba(255, 255, 255, .08); border: 1px solid var(--line-soft); }
.hw-brand.cur { color: #04202e; background: linear-gradient(180deg, #c9f6ff, var(--holo)); border-color: transparent; }
.hw-cands, .hw-results, .hw-vars { display: flex; flex-direction: column; gap: 7px; }
.hw-results:empty { display: none; }
.hw-cand, .hw-var {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center; width: 100%; text-align: left; padding: 10px 10px 10px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); transition: background .15s, border-color .15s, transform .12s var(--ease-out);
}
.hw-cand:hover, .hw-var:hover { background: rgba(95, 224, 255, .12); border-color: rgba(95, 224, 255, .5); }
.hw-cand:active, .hw-var:active { transform: scale(.985); }
.hw-cand-id { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.hw-cand-id b { font-size: 16px; font-weight: 900; letter-spacing: .02em; overflow-wrap: anywhere; }
.hw-cand-id em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.hw-cand-why { grid-column: 1; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--ink-3); }
.hw-cand-why:empty { display: none; }
.hw-cand-n { grid-column: 2; grid-row: 1 / span 2; padding: 3px 9px; border-radius: 99px; font-size: 13px; font-weight: 800; color: var(--holo); background: rgba(95, 224, 255, .12); white-space: nowrap; }
.hw-chev { grid-column: 3; grid-row: 1 / span 2; width: 16px; height: 16px; color: var(--ink-3); }
.hw-var { grid-template-columns: minmax(0, 1fr) auto; }
.hw-var b { font-size: 15.5px; font-weight: 900; line-height: 1.4; overflow-wrap: anywhere; }
.hw-var-chips { grid-column: 1; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.hw-var-chips i { font-style: normal; padding: 2px 8px; border-radius: 8px; font-size: 13px; font-weight: 800; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-soft); white-space: nowrap; }
.hw-var em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; padding: 6px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 900; color: #04202e; background: linear-gradient(180deg, #c9f6ff, var(--holo)); white-space: nowrap; }
.hw-input { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; font: 700 16px/1.2 var(--font); color: var(--ink); background: rgba(255, 255, 255, .1); border: 1.5px solid var(--line); outline: none; -webkit-user-select: text; user-select: text; margin-bottom: 8px; }
.hw-input::placeholder { color: var(--ink-3); font-weight: 600; }
.hw-input:focus { border-color: var(--holo); box-shadow: 0 0 0 4px rgba(95, 224, 255, .18); }
.hw-foot { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px; padding: 10px 18px 0; border-top: 1px solid var(--line-soft); }
.hw-foot .btn { min-height: 44px; }
@media (min-aspect-ratio: 1/1) {
  .hw { left: 50%; right: auto; top: 50%; bottom: auto; width: min(640px, calc(100% - 40px)); max-height: calc(100% - 28px); border-radius: 28px; padding: 18px 0 14px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .36s var(--ease-out), opacity .24s ease, visibility .36s; }
  .hw.on { transform: translate(-50%, -50%); opacity: 1; }
  .hw-head { padding: 0 16px 12px 22px; } .hw-body { padding: 2px 22px 12px; } .hw-foot { padding: 12px 22px 0; }
}

/* ── 選單 ── */
.menu-mask { position: absolute; inset: 0; z-index: 14; background: rgba(6, 4, 20, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
.menu-mask.on { opacity: 1; visibility: visible; }
.menu {
  position: absolute; z-index: 15; left: 0; right: 0; bottom: 0; max-height: 90%; display: flex; flex-direction: column;
  border-radius: 28px 28px 0 0; padding: 14px 0 calc(12px + var(--safe-b)); background: var(--glass-strong);
  transform: translateY(104%); visibility: hidden; transition: transform .4s var(--ease-out), visibility .4s;
}
.menu.on { transform: none; visibility: visible; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 8px 20px; flex: 0 0 auto; }
.menu-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; letter-spacing: .1em; }
.menu-head h3 svg { width: 22px; height: 22px; color: var(--accent); }
.menu-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 14px 4px; touch-action: pan-y; display: flex; flex-direction: column; gap: 8px; }
.menu-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px 10px 10px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); transition: background .15s, transform .12s var(--ease-out); }
.menu-row:hover { background: rgba(255, 255, 255, .12); }
.menu-row:active { transform: scale(.985); }
.menu-row > i { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--accent); }
.menu-row > i svg { width: 21px; height: 21px; }
.menu-row span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.menu-row b { font-size: 15.5px; font-weight: 900; letter-spacing: .04em; }
.menu-row small { font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--ink-3); overflow-wrap: anywhere; }
.menu-row em { font-style: normal; min-width: 44px; text-align: center; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 900; color: var(--ink-2); background: rgba(255, 255, 255, .1); }
.menu-row em.on { color: #06301c; background: var(--ok); }
.menu-chev { width: 16px; height: 16px; color: var(--ink-3); }
.menu-row.danger > i { color: var(--danger); background: rgba(255, 107, 125, .14); }
.menu-row.danger b { color: #ffc2ca; }
.menu-help { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); }
.menu-help h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: .16em; color: var(--ink-3); }
.menu-help h4 svg { width: 18px; height: 18px; }
.menu-help dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px; font-size: 14px; line-height: 1.5; }
.menu-help dt { font-weight: 900; color: var(--ink); white-space: nowrap; }
.menu-help dd { margin: 0; font-weight: 600; color: var(--ink-2); }
.menu-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 2px 6px 4px; font-size: 13px; font-weight: 600; line-height: 1.55; color: var(--ink-3); }
.menu-note svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; color: var(--ok); }
@media (min-aspect-ratio: 1/1) {
  .menu { left: auto; right: calc(14px + var(--safe-r)); top: calc(66px + var(--safe-t)); bottom: auto; width: min(560px, calc(100% - 28px)); max-height: calc(100% - 80px - var(--safe-t)); border-radius: 24px; padding: 14px 0 12px; transform: translateY(-12px) scale(.97); transform-origin: top right; opacity: 0; transition: transform .26s var(--ease-out), opacity .2s ease, visibility .26s; }
  .menu.on { transform: none; opacity: 1; }
  .menu-help dl { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); }
}
@media (min-aspect-ratio: 1/1) and (max-height: 700px) {
  .menu { top: calc(60px + var(--safe-t)); max-height: calc(100% - 68px - var(--safe-t)); padding: 10px 0 10px; }
  .menu-body { gap: 6px; }
  .menu-row { padding: 6px 12px 6px 8px; } .menu-row > i { width: 34px; height: 34px; }
  .menu-help { padding: 8px 12px; } .menu-help dl { gap: 3px 14px; }
  .menu-head { padding-bottom: 4px; } .menu-head .ibtn { width: 40px; height: 40px; }
}

/* ── 知識卡：「你的這台」 ── */
.kc-mine { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px 11px; border-radius: 16px; margin-bottom: 10px; background: linear-gradient(135deg, rgba(93, 255, 200, .16), rgba(201, 255, 138, .05)); border: 1px solid rgba(93, 255, 200, .42); }
.kc-mine[data-source="detected"] { background: linear-gradient(135deg, rgba(95, 224, 255, .14), rgba(95, 224, 255, .04)); border-color: rgba(95, 224, 255, .4); border-style: dashed; }
.kc-mine-ico { flex: 0 0 auto; font-size: 22px; line-height: 1.25; }
.kc-mine > div { min-width: 0; }
.kc-mine b { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; letter-spacing: .14em; color: var(--fit); }
.kc-mine[data-source="detected"] b { color: var(--holo); }
.kc-mine b em { font-style: normal; padding: 1px 8px; border-radius: 99px; font-size: 13px; letter-spacing: .04em; color: #04202e; background: var(--holo); }
.kc-mine p { margin: 2px 0 0; font-size: 15.5px; font-weight: 700; line-height: 1.6; color: #eafff7; overflow-wrap: anywhere; }
.kc-mine small { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--ink-3); line-height: 1.5; }

/* ── 桌機：文字不小於 13px（手機的小字級不動） ── */
@media (min-width: 860px) and (min-aspect-ratio: 1/1) {
  kbd { font-size: 13px; }
  .hud-prog, .dc-done, .dc-soon, .dlg-next, .dlg-count, .sc-tab em, .tag, .pc-idx, .badge-order, .tag-order, .price small, .ribbon, .pc-divider span, .sc-hint,
  .it-sub, .ct-stub b, .ct-stub small, .ct-meta, .ct-meta i, .ct-badge, .ct-badge small, .ct-sub, .ct-terms, .ct-foot, .off-tag, .sh-hint, .no-promo,
  .price.dual small, .price.dual .web, .price.dual .web em, .pc-more, .info-kicker, .info-best b, .list-note, .sec-label, .title-foot,
  .gl-count, .kc-kicker, .kc-analogy small, .kc-tip b, .kc-rel h4, .kc-chip small, .gl-badge-txt b em, .gl-req span, .gl-card small, .gl-card.got small,
  .fit-badge, .tdv-id small, .tdv-id em, .tdv-chips span, .tdv-foot, .tdv-clear,
  .dv-kicker, .dv-code, .dv-line, .dv-tab em, .dv-sku, .dv-clear, .dv-rl, .dv-note, .dv-note.warn, .dv-pros h4, .dv-room header em, .dv-go, .dv-here, .dv-flag, .dv-it-meta, .dv-period, .dv-chips span {
    font-size: 13px;
  }
  .ct-stub small { letter-spacing: .06em; text-indent: .06em; }
  .gl-count { bottom: -11px; }
  .hud-tr { gap: 9px; }
}


/* ── 第二輪：設定我的筆電（搜尋為主）、效能資訊開關 ── */
.hw-search { display: flex; flex-direction: column; gap: 6px; }
.hw-search .hw-input { margin: 0; min-height: 52px; font-size: 18px; }
.hw-search .hw-p { margin: 0; }
.hw-list { display: flex; flex-direction: column; gap: 7px; }
.hw-list:empty { display: none; }
.hw-h { margin: 0 0 2px; font-size: 13px; font-weight: 900; letter-spacing: .16em; color: var(--holo); }
.hw-cand.sel { background: rgba(95, 224, 255, .14); border-color: rgba(95, 224, 255, .7); box-shadow: 0 0 0 1px rgba(95, 224, 255, .35); }
.hw-cand-id em { overflow-wrap: anywhere; }
.hw-detected { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); }
.hw-detected svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }
.hw-detected p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--ink-3); }
.hw-detected-hw { color: var(--ink-2); }
.hw-var-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; background: rgba(95, 224, 255, .08); border: 1px solid rgba(95, 224, 255, .28); }
.hw-var-head b { font-size: 16px; font-weight: 900; line-height: 1.4; overflow-wrap: anywhere; }
.hw-var-head span { font-size: 13.5px; font-weight: 700; color: var(--ink-2); line-height: 1.5; }
.hw-var b { font-size: 17px; }
.hw-var small { grid-column: 1; font: 600 13px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-3); overflow-wrap: anywhere; }
.thw-id small { line-height: 1.4; }
/* 效能資訊開著時，左下角的鍵盤提示先收起來（同一個位置） */
html.perf-on .hud-keys { display: none; }
@media (min-width: 860px) and (min-aspect-ratio: 1/1) { .debug { font-size: 13px; } }


/* ── 第三輪：商品展示面板在矮視窗放得下（showcase-panel.js 的 _fit() 依需要加上 fit-1 … fit-6，一次只多收一點） ── */
@media (min-aspect-ratio: 1/1) and (min-height: 521px) {
  /* 上下各留 66px（左上的調查點名稱、右上的關閉鈕都在這個範圍內） */
  .sc-panel { max-height: calc(100% - 132px); }
}
.sc-panel.fit-1 .pcard { min-height: 0; padding: 13px 15px; gap: 8px; }
.sc-panel.fit-1 .pc-img { flex-basis: 72px; width: 72px; height: 72px; }
.sc-panel.fit-1 .pc-pitch { -webkit-line-clamp: 3; }
.sc-panel.fit-1 .sc-head { padding-bottom: 8px; }
.sc-panel.fit-1 .sc-tabs { padding-bottom: 8px; }
.sc-panel.fit-1 .sc-carousel { padding-top: 4px; padding-bottom: 8px; }
.sc-panel.fit-1 .pc-fit { padding: 5px 9px; }
.sc-panel.fit-2 .pc-pitch { -webkit-line-clamp: 2; }
.sc-panel.fit-2 .pc-name { font-size: 18px; -webkit-line-clamp: 2; }
.sc-panel.fit-2 .price.dual strong { font-size: 21px; }
.sc-panel.fit-3 .sc-tabs { flex-wrap: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 26px), transparent 100%); }
.sc-panel.fit-4 .sc-story { min-height: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-panel.fit-5 { padding-top: 14px; }
.sc-panel.fit-5 .sc-story { -webkit-line-clamp: 1; }
.sc-panel.fit-5 .pc-pitch { -webkit-line-clamp: 1; margin-top: 3px; }
.sc-panel.fit-5 .pc-fit span { -webkit-line-clamp: 1; }
.sc-panel.fit-5 .pc-img { flex-basis: 58px; width: 58px; height: 58px; }
.sc-panel.fit-5 .sc-foot { min-height: 36px; }
.sc-panel.fit-6 .sc-head, .sc-panel.fit-6 .pc-pitch { display: none; }
.sc-panel.fit-6 .pc-name { -webkit-line-clamp: 1; }

/* 桌機的鍵盤提示：預設看不到；進場後 ui.showKeysHint() 加上 .on 顯示幾秒，玩家移動就淡出（不再一直佔著左下角） */
.hud-keys { opacity: 0; transition: opacity .7s ease; }
.hud-keys.on { opacity: 1; }

/* ── 收尾：注音輸入法提示（設定我的筆電的搜尋框下方） ── */
.hw-search .hw-ime { margin: 2px 0 0; padding: 7px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; line-height: 1.55; color: #04202e; background: var(--holo); }
.hw-search .hw-ime[data-kind="hanzi"] { color: #3d2600; background: #ffd966; }

/* ── 收尾：啟動失敗（沒有 3D 顯示能力、資料讀不到）與 3D 畫面中斷 ── */
#loading.failed .ld-bar, #loading.failed .ld-gem { display: none; }
#loading.failed .ld-tip { max-width: min(560px, 88vw); font-size: 17px; font-weight: 800; line-height: 1.7; letter-spacing: .02em; color: #fff3f5; text-align: center; margin-top: 14px; }
.ld-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 10px; max-width: min(560px, 92vw); }
/* 看門狗的「載入花太久了」：還在等，所以進度條與寶石照常動；文字與按鈕跟失敗畫面同一種樣式 */
#loading.slow .ld-tip { max-width: min(560px, 88vw); font-size: 16px; font-weight: 800; line-height: 1.7; color: #fff3f5; text-align: center; margin-top: 14px; }
#loading .ld-actions .btn.ghost { white-space: normal; text-align: center; line-height: 1.35; min-height: 40px; padding: 6px 16px; }
.ld-detail { max-width: min(560px, 88vw); margin-top: 18px; font-size: 13px; line-height: 1.6; color: var(--ink-3); text-align: center; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.gl-lost {
  position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center;
  background: rgba(7, 6, 26, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gl-lost b { font-size: 20px; font-weight: 900; letter-spacing: .06em; color: #fff7e2; }
.gl-lost p { margin: 0; max-width: 30em; font-size: 15px; line-height: 1.7; color: var(--ink-2); }

/* ── 收尾：購物點（暖色＋購物袋）與知識點（冷色＋晶片）分清楚 ──
   色碼集中在這裡；3D 標記（js/kit／js/scenes/room-scene.js）定案後只要改這幾個變數。
   色弱也要分得出：顏色之外一律帶圖示（購物袋／晶片）與文字（購物點／知識卡、看商品／收集知識）。 */
:root {
  --shop: #ffb020; --shop-2: #ffd77a; --shop-ink: #3a2200;     /* 購物點：暖金／橘 */
  --know: #38d5ff; --know-2: #a8f0ff; --know-ink: #032838;     /* 知識點：冷青／藍 */
}
/* 互動按鈕：依 data-kind 換色、換圖示，前面加一個種類小標 */
.act[data-kind="shop"] .btn { --theme: var(--shop); --on-theme: var(--shop-ink); }
.act[data-kind="know"] .btn { --theme: var(--know); --on-theme: var(--know-ink); }
.act-kind { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 900; letter-spacing: .06em; color: var(--on-theme); background: rgba(255, 255, 255, .42); border: 1.5px solid color-mix(in srgb, var(--on-theme) 40%, transparent); }
.act-kind[hidden] { display: none; }
.act-done { font-size: 13px; font-weight: 800; opacity: .8; }
/* HUD／門口卡片的進度：兩個小膠囊 */
.hud-prog .pg { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 99px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-soft); }
.hud-prog .pg svg { width: 15px; height: 15px; flex: 0 0 auto; }
.hud-prog .pg b { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink); }
.hud-prog .pg[data-kind="shop"] { border-color: color-mix(in srgb, var(--shop) 55%, transparent); }
.hud-prog .pg[data-kind="shop"] svg { color: var(--shop); }
.hud-prog .pg[data-kind="know"] { border-color: color-mix(in srgb, var(--know) 55%, transparent); }
.hud-prog .pg[data-kind="know"] svg { color: var(--know); }
.hud-prog .pg.full[data-kind="shop"] { background: color-mix(in srgb, var(--shop) 26%, transparent); }
.hud-prog .pg.full[data-kind="know"] { background: color-mix(in srgb, var(--know) 22%, transparent); }
.dc-foot .hud-prog { gap: 6px; flex-wrap: wrap; }
/* 說明：第一次進館的提示（上方中間，幾秒後淡出）＋選單裡的同一段 */
/* 進館說明：畫面下方中央、互動按鈕（.act）的上面——不擋上方的館名牌與房間裡的標記；點一下就收起來 */
.legend-tip {
  position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 6; width: min(520px, calc(100vw - 24px - var(--safe-l) - var(--safe-r)));
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none !important; transition: opacity .35s ease, transform .4s var(--ease-out);
  padding: 10px 14px 12px 16px; border-radius: 20px; cursor: pointer;
}
.legend-tip.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto !important; }
.legend-tip p { margin: 0 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 800; line-height: 1.5; color: var(--ink); }
.lg-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255, 255, 255, .1); }
.lg-x svg { width: 16px; height: 16px; }
.legend-rows { display: grid; gap: 6px; }
.lg-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.lg-row > i { width: 36px; height: 36px; display: grid; place-items: center; }
.lg-row > i svg { width: 20px; height: 20px; }
.lg-row > i canvas { display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.lg-row b { color: var(--ink); font-weight: 900; }
.lg-row[data-kind="shop"] b { color: var(--shop-2); }
.lg-row[data-kind="know"] b { color: var(--know-2); }
.menu-legend { padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); }
.menu-legend h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; letter-spacing: .08em; color: var(--ink-2); }
.menu-legend h4 svg { width: 18px; height: 18px; }
@media (max-width: 520px), (max-height: 520px) {
  .legend-tip { bottom: calc(84px + var(--safe-b)); padding: 9px 11px 10px 12px; }
  .legend-tip p, .lg-row { font-size: 13px; }
  .hud-prog .pg { padding: 0 6px 0 4px; gap: 3px; }
  .hud-prog .pg svg { width: 13px; height: 13px; }
  .act-kind { font-size: 12px; padding: 1px 7px; }
}
.hud-prog .pg.pop { animation: bag-bump .5s var(--ease-back); }

/* 購物點／知識點圖示（dom.js 的 markerIcon：跟 3D 標記同一支畫法的 canvas） */
canvas.mk { display: block; flex: 0 0 auto; }
.act .ic-wrap { display: inline-grid; place-items: center; margin: -6px 0; }
.act .ic-wrap canvas.mk { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.hud-prog .pg canvas.mk { margin: -1px 0; }
.gl-sec-mk { display: inline-block; vertical-align: -4px; margin-right: 6px; }
@media (max-width: 520px), (max-height: 520px) { .act .ic-wrap canvas.mk { width: 26px !important; height: 26px !important; } }

/* 標題選角卡：色點換成角色小頭像（bag.js 的 avatar） */
.pick i { overflow: hidden; display: block; }
.pick i canvas { display: block; width: 100%; height: 100%; }

/* 煙火整段演出（game.js 掛 html.fw-show）：畫面只留煙火，膠囊／提示／門口卡片／互動按鈕／鍵盤提示先收起來，演出結束淡回來 */
html.fw-show .finale, html.fw-show .toasts, html.fw-show .door-card, html.fw-show .act, html.fw-show .hud-keys, html.fw-show .legend-tip { opacity: 0 !important; pointer-events: none !important; transition: opacity .4s ease; }

/* ── 收尾：遮罩／浮層「關閉動畫期間」不攔截點擊 ──
   這些浮層關閉時是 opacity／transform 淡出＋visibility 延遲（.25–.35 秒）才藏起來；淡出期間它們還蓋在畫面上，
   會把「剛關掉面板馬上點地面／點標記」的那一下吃掉（QA：剛關掉知識卡馬上點下一顆晶片沒反應）。
   沒有 .on（已經在關、或本來就關著）的一律不接點擊，連裡面的按鈕也不接。#ui > * 預設是 auto，所以要用 !important 蓋過去。
   新增會淡出的浮層時，把它的根元素 class 加進這個清單。 */
#ui :is(.sheet-mask, .sheet, .info-mask, .info, .confirm, .kc-mask, .kc, .quiz-mask, .quiz, .award, .dv-mask, .dv, .qr-zoom, .hw-mask, .hw, .menu-mask, .menu, .lightbox, .sc, .legend-tip):not(.on),
#ui :is(.sheet-mask, .sheet, .info-mask, .info, .confirm, .kc-mask, .kc, .quiz-mask, .quiz, .award, .dv-mask, .dv, .qr-zoom, .hw-mask, .hw, .menu-mask, .menu, .lightbox, .sc, .legend-tip):not(.on) * { pointer-events: none !important; }

/* 面板／展示／對話開著（game.js 掛 html.panel-open）：浮動提示類一律收起（層級表見檔頭） */
html.panel-open .finale, html.panel-open .legend-tip, html.panel-open .hud-keys, html.panel-open .act, html.panel-open .door-card { opacity: 0 !important; pointer-events: none !important; }

/* academy.json 讀不到時 HUD／學堂入口的說明（不顯示 0/0） */
.hud-prog .pg.pg-fail { color: var(--ink-2); font-weight: 700; border-style: dashed; white-space: normal; }

/* 標題畫面：中等高度的橫式（561–660，例如瀏覽器放大 125% 的 1229×584、1280×620）選角卡改成一行（頭像在左），
   不再蓋住 3D 角色的上半身；「選擇你的探險角色」小標拿掉（選角卡本身就說得很清楚） */
@media (min-aspect-ratio: 1/1) and (min-height: 561px) and (max-height: 660px) {
  .title .pick-label { display: none; }
  .title .pick { flex-direction: row; justify-content: center; gap: 8px; padding: 7px 14px; }
  .title .pick i { width: 28px; height: 28px; }
}
/* 矮橫式（≤ 560）且有全螢幕鈕（桌機）：機型卡往左讓出右上角的全螢幕鈕（1024×487＝瀏覽器放大 150% 時兩個疊在一起） */
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  html:not(.touch) .title-device:has(.tdv), html:not(.touch) .title-device:has(.thw) { top: calc(62px + var(--safe-t)); right: calc(14px + var(--safe-r)); }
}

/* 畫面下方那一排提示（ui.toast 的 place:'low'）：操作提示／互動按鈕上面，不擋廣場上方的 3D 招牌；標題畫面時 JS 會把 bottom 設到選角卡上方 */
.toasts.toasts-low { top: auto; bottom: calc(100px + var(--safe-b)); flex-direction: column-reverse; }
body:has(.finale.on) .toasts.toasts-low { top: auto; }
@media (max-width: 520px), (max-height: 520px) { .toasts.toasts-low { bottom: calc(84px + var(--safe-b)); } }
/* 矮橫式（手機橫拿 844×390 等）的商品展示：分頁列跟「選購指南」放同一行時，第三個分頁會被擠到按鈕底下（看起來像被蓋住）。
   改成兩行：分頁列獨佔一行（可以橫向捲動），「選購指南」縮小放在下一行右邊；放不下時 showcase-panel 的 _fit() 會自動收緊其他區塊 */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .sc-tabrow:not(.solo) { flex-direction: column; align-items: stretch; }
  .sc-tabrow:not(.solo) .sc-tabs { padding-right: 18px; padding-bottom: 4px; }
  .sc-tabrow:not(.solo) .sc-guide { align-self: flex-end; min-height: 30px; margin: 0 18px 6px 0; padding: 0 10px 0 8px; font-size: 12.5px; }
}
/* 商品展示的分頁列：邊緣淡出改由 JS 依捲動位置決定（showcase-panel _tabEdges）。
   還有分頁的那一邊才淡出，淡出寬度 34px——被裁到的分頁會淡掉，不會在「選購指南」按鈕邊緣硬生生切斷；放得下就完全不加漸層。
   分頁列與按鈕之間另留 6px 間隔。直式、橫式、桌機都適用（換行顯示時不會溢出，自然不加漸層） */
.sc-panel .sc-tabs.edge { -webkit-mask-image: none; mask-image: none; }
.sc-panel .sc-tabs.edge.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent 100%); }
.sc-panel .sc-tabs.edge.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34px); mask-image: linear-gradient(90deg, transparent 0, #000 34px); }
.sc-panel .sc-tabs.edge.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%); }
.sc-tabrow:not(.solo) .sc-guide { margin-left: 6px; }
@media (min-aspect-ratio: 1/1) and (max-height: 520px) { .sc-tabrow:not(.solo) .sc-guide { margin-left: 0; } }
