/* JCORE webapp — W1 體面（S54f）：奶油紙色系 token + 重繪貓 + chat 美化。零 build。
 * 釘住不變（test_web.py）：data-emotion 規則（happy/excited/thinking/sleepy/sad/alert）
 * ＋ .wave/.nod/.pulse_led 動作類。 */

:root {
  /* 設計 token（W1）：同一份餵 SVG／未來 Rive/3D（ADR-015 渲染演進） */
  --paper: #fff6e9;        /* 底：奶油紙 */
  --card: #fffdf8;         /* 卡面 */
  --ink: #3b3226;          /* 主文字：暖深棕 */
  --ink-dim: #9a8c74;      /* 次文字 */
  --line: #eadfc9;         /* 邊框 */
  --accent: #e8842c;       /* 主色：招財橘 */
  --accent-soft: #fbe8d2;  /* 主色淡底 */
  --me-bubble: #e8842c;    /* user bubble */
  --cat-bubble: #ffffff;   /* assistant bubble */
  --ok: #4caf50;
  --bad: #e5484d;
  /* 貓體色（Kawaii 粉嫩漸層毛——S66c） */
  --fur-1: #fff1df;
  --fur-2: #ffd9b0;
  --fur-line: #e8a878;
  --blush: #ffb3c1;
  --emo-happy: #ff9d2e;
  --emo-sad: #7f9ac4;
  --emo-alert: #e5484d;
  --emo-sleepy: #b0a390;
  --eye: #4a3a26;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Noto Sans TC", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  gap: 10px;
}

/* ---- W1 brandbar：貓名＋心情＋連線點（device id 藏起，test 無依賴） ---- */
.brandbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-bottom: 1px solid var(--line); background: var(--card); }

/* S72 W9：☰ 下拉 menu（開合）——二級功能收納，brandbar 淨留 ☰ 一掣 */
#menu-pop { position: fixed; top: 50px; right: 10px; display: flex;
  flex-direction: column; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  z-index: 60; box-shadow: 0 8px 24px rgba(59, 50, 38, .18); }
#menu-pop[hidden] { display: none; }
/* S95b：menu bar 響應式安全網——直向堆疊永遠唔可以跌出畫面底 */
#menu-pop { max-height: calc(100dvh - 70px); overflow-y: auto; }
.brandbar .cat-badge { font-size: 1.25rem; }
.brandbar .cat-title { font-weight: 700; font-size: 1.05rem; }
/* S95b：窄畫面（車機闊度有限）brandbar 溢位——貓名收窄省略號，唔推走 ☰ */
.brandbar .cat-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brandbar .cat-mood { font-size: 1.05rem; margin-left: 2px; }
.brandbar .status-text { color: var(--ink-dim); font-size: 0.78rem; margin-left: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 38%; text-align: right; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c9bda6; flex: 0 0 auto; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--bad); }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--card); cursor: pointer; font-size: 0.95rem; line-height: 1; color: var(--ink); }
.icon-btn:active { background: var(--accent-soft); }

/* ---- cat stage ---- */
/* S72：貓畫面/對話框 50:50 平衡——svg 由高度驅動（~38vh）、闊度隨比例，
 * chat 區 flex:1 攞返剩低空間；側欄掣照掛 #cat 兩側 */
.cat { display: flex; justify-content: center; flex: 0 0 auto; position: relative; }
.cat svg { height: min(300px, 38vh); width: auto; max-width: min(280px, 74vw); }

.cat .fur { fill: url(#furGrad); stroke: var(--fur-line); stroke-width: 2; }
#furGrad stop:nth-child(1) { stop-color: var(--fur-1); }   /* 屬性值唔食 var()——CSS 規則餵 */
#furGrad stop:nth-child(2) { stop-color: var(--fur-2); }
.cat .cat-belly { fill: #fff3d6; }
.cat .cat-blush { fill: var(--blush); opacity: .75; }
.cat .cat-eye { fill: var(--eye); transition: transform .12s ease, fill .2s; transform-box: fill-box; transform-origin: center; }
.cat .cat-eye.shut { transform: scaleY(0.12); }
.cat .cat-mouth { fill: none; stroke: #b0653a; stroke-width: 2.5; stroke-linecap: round; }
.cat .cat-whiskers line { stroke: var(--fur-line); stroke-width: 1.5; }
.cat .cat-coin { fill: url(#coinGrad); stroke: #c99a12; stroke-width: 2; }
.cat .coin-text { font-size: 13px; fill: #7a4a00; font-weight: bold; }
.cat .cat-led { fill: #d9c8a4; transition: fill .3s; }
/* ---- S66b W4：重畫貓 v2 新增部件（全部非掛鉤，純視覺） ---- */
.cat .cat-shadow { fill: #3b3226; opacity: .08; }
/* ---- S66c W4b：Kawaii 立體感＋pose 系統 ---- */
.cat .cat-hlite { fill: #fff; opacity: .45; }
.cat .cat-shade { fill: var(--fur-2); opacity: .35; }
.cat .cat-inner-ear { fill: #ffc4cf; }
.cat .prop { opacity: 0; transition: opacity .3s; pointer-events: none; }
.cat .prop .z { font-size: 15px; font-weight: 700; fill: var(--ink-dim); font-family: system-ui, sans-serif; }
.cat.pose-sleep .prop-zzz, .cat.pose-fish .prop-fish, .cat.pose-chips .prop-chips,
.cat.pose-burger .prop-burger, .cat.pose-milktea .prop-milktea,
.cat.pose-butterfly .prop-butterfly { opacity: 1; }
/* 瞓覺：閂埋眼＋zzz 飄 */
.cat.pose-sleep .cat-eye, .cat.pose-sleep .cat-eye ~ .cat-glint { transform: scaleY(0.12); }
@keyframes zfloat { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-7px); } }
.cat.pose-sleep .z { animation: zfloat 2.2s ease-in-out infinite; }
.cat.pose-sleep .z2 { animation-delay: .4s; }
.cat.pose-sleep .z3 { animation-delay: .8s; }
/* 食嘢：嘴嚼（重用 talksay）＋食物輕彈 */
.cat.pose-fish .cat-mouth, .cat.pose-chips .cat-mouth,
.cat.pose-burger .cat-mouth, .cat.pose-milktea .cat-mouth { animation: talksay .3s ease-in-out infinite; }
@keyframes nomnom { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.cat.pose-fish .prop-fish, .cat.pose-chips .prop-chips,
.cat.pose-burger .prop-burger, .cat.pose-milktea .prop-milktea { transform-box: fill-box; transform-origin: center; animation: nomnom .6s ease-in-out infinite; }
/* 蝴蝶：翅膀撲＋整隻飄＋左手舉起想掂 */
.cat .wing { transform-box: fill-box; }
.cat .wing-l { transform-origin: right center; }
.cat .wing-r { transform-origin: left center; }
@keyframes flutter { from { transform: scaleX(1); } to { transform: scaleX(.55); } }
.cat.pose-butterfly .wing-l, .cat.pose-butterfly .wing-r { animation: flutter .45s ease-in-out infinite alternate; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.cat.pose-butterfly .prop-butterfly { animation: floaty 2.2s ease-in-out infinite; }
@keyframes wave-r { 0%,100% { transform: rotate(20deg); } 50% { transform: rotate(70deg); } }
.cat.pose-butterfly .right-arm { animation: wave-r .9s ease-in-out infinite; transform-origin: 148px 152px; }

.cat .cat-stripe { fill: none; stroke: var(--fur-line); stroke-width: 3; stroke-linecap: round; opacity: .45; }
.cat .cat-muzzle { fill: #fff8e6; opacity: .95; }
.cat .cat-glint { fill: #fff; opacity: .9; transform-box: fill-box; transform-origin: center; transition: transform .12s ease; }
/* 巨眼眨眼/半瞓：glint（高光係 eye 嘅 sibling）連動縮——唔好浮空 */
.cat .cat-eye.shut ~ .cat-glint { transform: scaleY(0.12); }
.cat[data-emotion="sleepy"] .cat-glint { transform: scaleY(0.4); }
.cat .cat-collar { fill: #e0555a; stroke: #b23c42; stroke-width: 1.5; }
.cat .cat-toes line { stroke: var(--fur-line); stroke-width: 1.5; stroke-linecap: round; }

/* ---- W2 情緒過場：眼色/嘴形漸變＋變情緒彈一下＋brandbar emoji 翻新 ---- */
.cat .cat-eye { transition: fill .4s ease, transform .4s ease; }
.cat .cat-mouth { transition: stroke-width .4s ease; }
@keyframes emopop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.cat.emo-pop { animation: emopop .5s ease; }
@keyframes moodpop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.3); } 100% { transform: scale(1); opacity: 1; } }
.brandbar .cat-mood { display: inline-block; }
.brandbar .cat-mood.mood-pop { animation: moodpop .45s ease; }
/* S62 A3：翻譯模式徽章（點一下退出） */
.translate-badge { border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--ink); border-radius: 999px; font-size: .78rem; padding: 1px 8px;
  margin-left: 4px; cursor: pointer; }

/* ---- S63：功能說明面板（❓）---- */
.help-overlay { position: fixed; inset: 0; background: rgba(59, 50, 38, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 16px; }
.help-card { background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; max-width: 420px; width: 100%; max-height: 80vh;
  overflow-y: auto; padding: 18px 20px; position: relative;
  box-shadow: 0 12px 32px rgba(59, 50, 38, .25); }
.help-card h2 { margin: 0 0 10px; font-size: 1.15rem; }
.help-close { position: absolute; top: 10px; right: 10px; border: none;
  background: none; font-size: 1.05rem; cursor: pointer; color: var(--ink-dim); }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.help-list li b { display: block; font-size: .95rem; }

/* S122：通知設定面板（#push-overlay 複用 .help-card 骨架）——狀態行＋開關掣＋說明 */
#push-body { font-size: .9rem; line-height: 1.65; display: grid; gap: 10px; }
#push-body .push-state { font-weight: 700; font-size: 1rem; }
#push-body .push-state.on { color: var(--accent, #b8860b); }
#push-body button { justify-self: start; padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: .9rem; }
#push-body .push-hint { color: var(--ink-dim); font-size: .82rem; }
.help-list li p { margin: 2px 0 0; font-size: .85rem; color: var(--ink-dim);
  line-height: 1.5; }

/* ---- S64：搜尋面板＋載入更舊 ---- */
.search-input { width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: .95rem; margin-bottom: 10px;
  background: var(--paper); color: var(--ink); }
.search-results { list-style: none; margin: 0; padding: 0; display: grid;
  gap: 10px; max-height: 55vh; overflow-y: auto; }
.search-results li b { display: block; font-size: .78rem; color: var(--ink-dim); }
.search-results li p { margin: 2px 0 0; font-size: .88rem; line-height: 1.45; }

/* W5 換色面板（🎨）——preset tile＋自訂揀色行 */
.color-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.color-presets button { width: 42px; height: 42px; border-radius: 12px;
  border: 2px solid var(--line); cursor: pointer; }
.color-presets button:active { border-color: var(--accent); }
.color-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.color-rows li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.color-rows label { font-size: .85rem; color: var(--ink-dim); }
.color-rows input[type="color"] { width: 52px; height: 32px; border: 1px solid var(--line);
  border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
#color-reset { margin-top: 12px; width: 100%; border: 1px solid var(--line);
  border-radius: 10px; background: none; padding: 8px 10px; font-size: .85rem;
  color: var(--ink-dim); cursor: pointer; }
#color-reset:active { background: var(--accent-soft); }

/* S69 W6：狀態條＋食飽 .full（面＋鈴變大——CSS 獨立 scale 屬性，
 * 同 nod/眨眼等 transform 動畫互唔干擾；契約掛鉤零改動）。
 * S69b：項圈已搬入 cat-head group——.full 頭脹時項圈一齊脹（唔會浮位） */
.cat .cat-head { transform-box: fill-box; transform-origin: center;
  scale: 1; transition: scale .5s ease; }
.cat .cat-led { transform-box: fill-box; transform-origin: center;
  scale: 1; transition: scale .5s ease; }
.cat.full .cat-head { scale: 1.12; }
.cat.full .cat-led { scale: 1.6; }
#pet-bars { display: flex; gap: 8px; justify-content: center; padding: 4px 10px 8px; }
.bar-row { display: flex; align-items: center; gap: 4px; flex: 1; }
.bar-row i { font-style: normal; font-size: .85rem; }
.bar { flex: 1; height: 8px; border-radius: 6px; background: rgba(59, 50, 38, .12);
  overflow: hidden; }
.bar .fill { display: block; height: 100%; width: 50%; border-radius: 6px;
  transition: width .6s ease; }
#fill-satiety { background: var(--accent); }
#fill-mood { background: var(--emo-happy); }
#fill-affection { background: #ff6f9c; }

/* S69b：換色面板唔遮貓——bottom sheet 摺落 chat 區（貓全程可見＝即時預覽先有意義）。
 * 蓋住 .help-overlay 嘅 fullscreen＋暗幕：inset 只留底、背景透明。 */
#color-overlay { inset: auto 0 0 0; align-items: flex-end; background: none; }
#color-overlay .help-card { max-width: 480px; margin: 0 12px 12px; }

/* S71 W8：互動側欄——右手邊食物、左手邊玩具。絕對定位喺 #cat（已 relative）
 * 兩側邊緣：貓居中 280px、app 欄 ≤480px → 兩側各留 ~80px，38px 掣唔遮貓本體。 */
.side-col { position: absolute; top: 10%; display: grid; gap: 10px; z-index: 5; }
#toy-col { left: 2px; }
#food-col { right: 2px; }
.side-col button { width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); font-size: 1.05rem;
  line-height: 1; cursor: pointer; }
.side-col button:active { background: var(--accent-soft); }

/* S70 W7：💗心心動畫（鬧佢掣已移除——#pet-actions 一併刪） */
.cat .heart { position: absolute; bottom: 35%; font-size: 1.15rem;
  pointer-events: none; animation: heartup 2.2s ease-out forwards; }
@keyframes heartup {
  0% { opacity: 0; transform: translateY(0) scale(.5); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.3); }
}
.load-more { text-align: center; }
.load-more button { border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 4px 14px; font-size: .8rem; cursor: pointer;
  color: var(--ink-dim); }

/* idle 生命感：呼吸（身體）＋尾搖（尾巴）——CSS 常駐，零 JS */
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.028); } }
.cat .cat-body { transform-box: fill-box; transform-origin: 50% 90%; animation: breathe 4.2s ease-in-out infinite; }
@keyframes tailsway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
.cat .cat-tail { transform-box: fill-box; transform-origin: 20% 95%; animation: tailsway 3.6s ease-in-out infinite; }
@keyframes talksay { 0%,100% { transform: scaleY(0.6); } 50% { transform: scaleY(1.25); } }
.cat.talking .cat-mouth { transform-box: fill-box; transform-origin: center; animation: talksay .28s ease-in-out infinite; }

/* ---- 情緒（P1a emotion_state → data-emotion；每情緒≥2 特徵）---- */
.cat[data-emotion="happy"] .cat-mouth,
.cat[data-emotion="excited"] .cat-mouth { stroke-width: 4; }
.cat[data-emotion="happy"] .cat-eye,
.cat[data-emotion="excited"] .cat-eye { fill: var(--emo-happy); }
.cat[data-emotion="happy"] .cat-blush,
.cat[data-emotion="excited"] .cat-blush { opacity: 1; }
.cat[data-emotion="thinking"] .cat-eye { fill: #666; }  /* 雙眼同色——.right 單眼版本係「一眼黑一眼灰」bug root cause（S75） */
.cat[data-emotion="thinking"] .cat-tail { animation-play-state: paused; }
.cat[data-emotion="sleepy"] .cat-eye { fill: var(--emo-sleepy); }
.cat[data-emotion="sleepy"] .cat-eye { transform: scaleY(0.4); }
.cat[data-emotion="sad"] .cat-mouth { transform: scaleY(-1) translateY(-226px); }
.cat[data-emotion="sad"] .cat-ear { opacity: .7; }
.cat[data-emotion="alert"] .cat-led,
.cat[data-emotion="excited"] .cat-led { fill: var(--emo-alert); }

/* ---- 動作（P1a action_commands → class）---- */
@keyframes wave { 0%,100% { transform: rotate(-20deg); } 50% { transform: rotate(-70deg); } }
.cat.wave .left-arm { animation: wave 0.5s ease-in-out 3; transform-origin: 52px 162px; }
@keyframes nod { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.cat.nod .cat-head { animation: nod 0.4s ease-in-out 2; }
@keyframes pulse { 0%,100% { fill: #d9c8a4; } 50% { fill: var(--emo-alert); } }
.cat.pulse_led .cat-led { animation: pulse 0.6s ease-in-out 4; }

/* ---- 聊天（W1：bubble＋avatar＋typing）---- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.log li { position: relative; padding: 9px 12px; margin-bottom: 8px; border-radius: 16px;
  max-width: 86%; font-size: 0.95rem; line-height: 1.5; }
.log li.user { background: var(--me-bubble); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.log li.assistant { background: var(--cat-bubble); border: 1px solid var(--line); border-bottom-left-radius: 4px; padding-left: 14px; }
.log li.assistant::before { content: "🐱"; position: absolute; left: -6px; top: 8px;
  font-size: 0.6rem; opacity: .9; }
.log li.typing { background: transparent; border: none; color: var(--ink-dim); padding-left: 18px; }
.log li.typing .dots { display: inline-flex; gap: 4px; }
.log li.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-dim);
  animation: typdots 1.2s ease-in-out infinite; }
.log li.typing .dots i:nth-child(2) { animation-delay: .2s; }
.log li.typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes typdots { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* S74：composer 重組——📷 相機 icon 坐輸入框右內側、🎤 mic 掣最右（圖示掣）；
   icon＝upload/mic.png＋camera.webp 裁切縮放（web/icons/）。Enter 送出（無送出鈕） */
.chat-form { display: flex; align-items: center; gap: 8px; }
.chat-form .input-wrap { flex: 1; position: relative; }
.chat-form input { width: 100%; padding: 11px 50px 11px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1rem; }
.chat-form input:focus { outline: 2px solid var(--accent-soft); }
.chat-form button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center;
  border: none; border-radius: 50%; background: transparent; cursor: pointer; }
.chat-form button:hover:not(:disabled) { background: var(--accent-soft); }
.chat-form button:disabled { opacity: .35; cursor: not-allowed; }
.chat-form button img { width: 27px; height: 27px; display: block; }
.chat-form .input-wrap button { position: absolute; right: 7px; top: 50%;
  transform: translateY(-50%); }
/* S73：icon 掣（mic 左/相機右）——圓角方塊，input flex:1 佔中間 */

/* ---- Onboarding console v2（照舊 iOS 風——與新主題同屬暖色系已協調）---- */
[hidden] { display: none !important; }

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #f2f2f7;
  color: #1c1c1e;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, system-ui, sans-serif;
}

.ob-nav { display: flex; align-items: center; gap: 8px; padding: 18px 20px 0; min-height: 56px; }
.ob-back { border: none; background: none; font-size: 1.6rem; color: #007aff; padding: 4px 10px; cursor: pointer; }
.ob-dots { display: flex; gap: 6px; margin: 0 auto; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d1d1d6; }
.ob-dots i.on { background: #8e8e93; }

.ob-body { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 0 28px; text-align: center;
  overflow-y: auto; min-height: 0; }  /* S98-1：矮屏安全網——內容超高由 body 滾動，footer（下一步掣）永遠喺屏內 */
.ob-body h2 { font-size: 1.45rem; margin: 0 0 10px; }
.ob-sub { color: #666; font-size: .95rem; margin: 0 0 22px; max-width: 340px; }
.ob-list { width: 100%; max-width: 360px; border-radius: 12px; overflow: hidden; background: #fff; }
.ob-row { display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 14px 16px; border: none; background: none; color: #1c1c1e; font-size: 1.05rem; text-align: left; cursor: pointer; }
.ob-row + .ob-row { border-top: 0.5px solid #d1d1d6; }
.ob-row:active { background: #d9d9de; }

#ob-input { width: 100%; max-width: 360px; padding: 15px 16px; border-radius: 12px;
  border: 1px solid #d1d1d6; background: #fff; color: #1c1c1e; font-size: 1.05rem; }
#ob-input.code { text-align: center; font-size: 1.6rem; letter-spacing: .4em; }

.ob-err { margin: 12px 0 0; color: #ff3b30; font-size: .9rem; text-align: center; max-width: 320px; }

.ob-footer { display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 28px calc(20px + env(safe-area-inset-bottom)); }

.ob-primary { width: 100%; max-width: 360px; padding: 16px; border: none; border-radius: 14px;
  background: #007aff; color: #fff; font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.ob-primary:disabled { background: #a8c7e8; }
.ob-primary:active { background: #0062cc; }

.ob-skip { border: none; background: none; color: #007aff; font-size: .95rem; padding: 8px; cursor: pointer; }

/* ---- 語音錄音 ---- */
.chat-form button.rec { background: var(--bad); animation: micpulse 1s ease-in-out infinite; }
/* S96c：mic 錄音紅（使用者裁示：閒置回復原色、淨係錄音紅） */
#mic-btn.rec { background: var(--bad); }
@keyframes micpulse { 50% { opacity: 0.55; } }

/* ---- 配對 modal ---- */
.pair-modal { border: none; border-radius: 14px; padding: 20px; max-width: 320px; width: 86vw;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); color: #1c1c1e; background: #fff; }
.pair-modal::backdrop { background: rgba(0,0,0,.4); }
.pair-modal h3 { margin: 0 0 4px; font-size: 1.1rem; }
.pair-modal p { margin: 0 0 12px; font-size: .9rem; color: #666; }
#pair-input { width: 100%; font-size: 1.6rem; letter-spacing: .4em; text-align: center;
  padding: 8px; border: 1px solid #d1d1d6; border-radius: 8px; }
.pair-err { color: #e5484d !important; }
.pair-actions { display: flex; gap: 8px; margin-top: 14px; }
.pair-actions button { flex: 1; padding: 10px; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; }
#pair-cancel { background: #e9e9eb; color: #333; }
.pair-go { background: #007aff; color: #fff; }
/* S208b：聲紋 modal——四掣 wrap 兩行；錄音中紅脈衝（同 mic .rec） */
#vp-actions { flex-wrap: wrap; }
#vp-actions button { min-width: 44%; }
#vp-rec.rec { background: var(--bad); animation: micpulse 1s ease-in-out infinite; }
#vp-clips { letter-spacing: 4px; color: #007aff; min-height: 1.2em; }

/* ---- S78 Spotify 點歌：brandbar 播放中曲名（<a> 可撳直開 Spotify）---- */
.now-playing { max-width: 34vw; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: .78rem; color: var(--accent, #b8860b);
  text-decoration: none; }
/* ---- S78g：聽歌律動（頭點點＋身搖搖＋尾加速＋♪ 音符飄浮） ---- */
/* S78h：頭搖幅度收細（使用者回報太大）——±7°→±2.5°、下移 5→2px、拍慢少少 */
@keyframes headbop { 0%,100% { transform: rotate(-2.5deg) translateY(0); } 50% { transform: rotate(2.5deg) translateY(2px); } }
@keyframes bodysway { 0%,100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.cat.grooving .cat-head { animation: headbop 0.55s ease-in-out infinite; }
.cat.grooving .cat-body { animation: bodysway 1.1s ease-in-out infinite; }
.cat.grooving .cat-tail { animation: tailsway 0.35s ease-in-out infinite; }
.music-note { position: fixed; bottom: 16%; font-size: 1.5rem;
  color: var(--accent, #b8860b); opacity: 0; pointer-events: none; z-index: 5;
  animation: notefloat 2.8s ease-out forwards; }
@keyframes notefloat { 0% { opacity: 0; transform: translateY(12px) rotate(0deg); }
  18% { opacity: .8; } 100% { opacity: 0; transform: translateY(-150px) rotate(28deg); } }

/* S78d：chat 內 Spotify embed 播放器（官方 iframe） */
.embed-row { padding: 2px 8px; }
.embed-row iframe { border-radius: 10px; border: 1px solid #e5e5ea; display: block; }

/* ---- onboarding 揀靈魂/揀聲 + voice settings ---- */
.ob-row.sel { background: #e8f1ff; }
.ob-row .ob-play, .voice-row .vm-play { float: right; color: #007aff; font-size: .9rem; }
.ob-list { max-height: 46vh; overflow-y: auto; }
#voice-list { max-height: 50vh; overflow-y: auto; margin: 0 0 4px; }
.voice-row { display: block; width: 100%; text-align: left; padding: 10px 12px; border: none;
  background: #fff; border-top: .5px solid #d1d1d6; border-bottom: .5px solid #d1d1d6; font-size: 1rem; cursor: pointer; }
.voice-row:first-child { border-radius: 8px 8px 0 0; }
.voice-row:last-child { border-radius: 0 0 8px 8px; border-bottom: .5px solid #d1d1d6; }
.voice-row.sel { background: #e8f1ff; }
.voice-row small, .ob-row small { color: #8e8e93; font-size: .8rem; }

/* ---- S95 響應式（RWD）：裝置闊度自動排位——純 media query，DOM/JS 零改動 ----
 * <640px：既有手機直欄（唔郁，照舊）。
 * ≥640px（平板/大手機）：欄闊少少、貓大隻少少。
 * ≥920px（桌面/橫屏平板）：兩欄 grid——貓＋狀態條左、chat 右（同 S80 車機同款骨架，
 *   但自動開、可用 :not(.car) 同手動車機模式互斥）。
 * 極矮橫屏（手機橫放）：貓縮細保輸入欄可見。
 * ponytail：car mode（localStorage 手動開）優先於 RWD——所有 desktop 規則帶 :not(.car)。 */
@media (min-width: 640px) {
  .app { max-width: 620px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); gap: 12px; }
  .cat svg { height: min(340px, 42vh); max-width: min(340px, 80vw); }
}
@media (min-width: 920px) {
  .app:not(.car) { max-width: 980px; display: grid; gap: 12px 24px;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto; }
  .app:not(.car) .brandbar { grid-column: 1 / -1; }
  .app:not(.car) #cat { grid-column: 1; grid-row: 2; align-items: center; }
  .app:not(.car) #cat svg { height: min(52vh, 460px); max-width: 100%; }
  .app:not(.car) #pet-bars { grid-column: 1; grid-row: 3; max-width: 360px; }
  .app:not(.car) .chat { grid-column: 2; grid-row: 2 / 4; min-height: 0; }
  .app:not(.car) .chat-form { flex: 0 0 auto; }
}
/* 極矮橫屏（手機橫放打字）：貓縮到 30vh，chat 攞返位 */
@media (max-height: 500px) and (orientation: landscape) {
  .app:not(.car) #cat svg { height: min(200px, 30vh); }
  /* S98-1：onboarding 矮屏（車機實報：list 頂 tall——確認掣跌出屏外撳唔到）。
   * 舊規則把 list 放大到 60vh 反令爆版——改為收細（dvh 跟動態視口）＋收緊留白。 */
  .onboarding .ob-body { justify-content: flex-start; padding-top: 6px; }
  .onboarding .ob-body h2 { font-size: 1.2rem; margin-bottom: 6px; }
  .onboarding .ob-sub { margin-bottom: 10px; }
  .onboarding .ob-list, .onboarding #voice-list { max-height: 32dvh; }
  .onboarding .ob-footer { padding: 8px 28px calc(10px + env(safe-area-inset-bottom)); }
  .onboarding .ob-primary { padding: 12px; }
}

/* ---- S95b：menu bar 響應式（車機實報：直向堆疊喺矮橫屏跌出畫面底，
 * 下層掣（🎨 色板設定）遮住掂唔到）。矮橫屏＋car mode：menu 轉**通闊橫排 wrap**
 * 一條 bar 喺 brandbar 下面——全部掣一屏見齊＋掣加大（車機盲操）；
 * 純 CSS，DOM/JS（開合＋撳外面收）零改動。---- */
@media (orientation: landscape) and (max-height: 640px) {
  #menu-pop { top: 56px; left: 12px; right: 12px; flex-direction: row;
    flex-wrap: wrap; gap: 12px; padding: 14px; }
  #menu-pop .icon-btn { width: 48px; height: 48px; font-size: 1.3rem; }
}
.app.car #menu-pop { top: 56px; left: 12px; right: 12px; flex-direction: row;
  flex-wrap: wrap; gap: 12px; padding: 14px; }
.app.car #menu-pop .icon-btn { width: 52px; height: 52px; font-size: 1.35rem; }

/* ---- S80：車機模式（🚗 ☰ 掣）——橫屏 grid 分欄＋大 🎤；⇄ swap 對調（左軚司機）----
 * ponytail：純 class 切換，DOM 零改動。貓（+pet-bars）左欄、chat 右欄、brandbar 通頂。
 * localStorage 記 jcore_car / jcore_car_swap。窄畫面（直向手機）grid 會侷——用戶自己撳掣開，唔做 media guard。 */
.app.car { max-width: none; display: grid; gap: 8px 16px; padding: 10px 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: auto minmax(0, 1fr) auto; }
.app.car .brandbar { grid-column: 1 / -1; }
.app.car #cat { grid-column: 1; grid-row: 2; align-items: center; }
.app.car #cat svg { height: min(58vh, 420px); max-width: none; }
.app.car #pet-bars { grid-column: 1; grid-row: 3; max-width: 360px; }
.app.car .chat { grid-column: 2; grid-row: 2 / 4; }
/* ⇄ 對調：貓去右、chat 去左（左軚司機——mic 靠近司機手邊） */
.app.car.swap #cat { grid-column: 2; }
.app.car.swap #pet-bars { grid-column: 2; }
.app.car.swap .chat { grid-column: 1; }
/* S80b：車機 chat 面板＝上半 log＋下半一粒大 🎤（使用者裁示——揸車唔打字，純 CSS、DOM 零改動）
 * 文字輸入欄＋📷 相機掣一齊收埋（同喺 .input-wrap）；mic 一次撳＝錄音、再撳＝停（app.js 既有 toggle）。 */
.app.car .chat-form { flex: 0 0 50%; justify-content: center; gap: 0; padding: 10px 0 14px; }
.app.car .chat-form .input-wrap { display: none; }
/* S96b：mic 掣大細由 form 實際高度**自適應**（24:9 超闊短屏——40vh/260px clamp 綁死）：
 * aspect-ratio 1＋height 88%（永遠啱啱好貼 form，無 clamp）；舊 browser 無
 * aspect-ratio 就 fallback 舊式 min()。background 唔喺呢度設（S96 綠由前面規則話事） */
.app.car #mic-btn { width: min(88%, 46vh, 320px); height: min(88%, 46vh, 320px);
  flex: 0 0 auto; border: 3px solid var(--accent); }
@supports (aspect-ratio: 1) {
  .app.car #mic-btn { width: auto; height: 88%; aspect-ratio: 1; max-height: 46vh; }
}
.app.car #mic-btn img { width: 50%; height: 50%; }
.app.car #mic-btn.rec { background: var(--bad); }
/* 矮橫屏（24:9 車機 1280×480 等）：mic 面板分多啲高度（log 讓位）——掣盡用垂直空間 */
@media (orientation: landscape) and (max-height: 560px) {
  .app.car .chat-form { flex: 0 0 58%; }
  .app.car #mic-btn { max-height: none; }
}

/* S97 導航掣：chat 一條 🧭 深連結（目的地＋距離/時間——server 規劃數據） */
.nav-card { list-style: none; }
.nav-btn {
  display: inline-block;
  margin: 4px 0 6px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent, #f5a623);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.nav-btn:active { transform: scale(0.97); }

/* S103 車機版開唔到——揀版本卡（chat 一條問題＋三掣） */
.nav-ask-card {
  list-style: none;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.nav-ask-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.nav-ask-btns button {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: none;
  border-radius: 999px;
  background: var(--accent, #f5a623);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.nav-ask-btns button:active { transform: scale(0.97); }

/* S97e 附近清單：直立 pill 行（撳一個即刻導航）；地址收 tooltip */
.nearby-card { list-style: none; }
.nearby-item {
  display: block;
  margin: 4px 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent-soft, #fbe8d2);
  color: var(--accent, #e8842c);
  font-weight: 600;
  text-decoration: none;
}
.nearby-item:active { transform: scale(0.98); }
/* S141：DJ 候選歌用 button（唔係 <a>）——原生掣歸零（外觀同 nearby-item 一致） */
button.nearby-item { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }

/* ---- S110：AI Core 形態（?ui=core——Gemini Canvas 星球引擎 orb.js；貓形態零改動）----
/* S113：深空背景微調（Gemini 參考）——中心微光 #0a0724 → 58% #040412 → 四周極黑 #020209 */
body.core-form { background: radial-gradient(circle at 50% 42%, #0a0724 0%, #040412 58%, #020209 100%); }
/* S112：硬隱藏（Gemini 建議＋使用者實報「兩個主題疊加」防復發）——!important 免疫任何
   specificity／media query／未來規則覆寫；core 形態下舊 UI 永不殘留 */
.app.core-form #cat, .app.core-form #pet-bars, .app.core-form .chat { display: none !important; }
.app.core-form .chat { display: none; }  /* S109：廢左右分屏——全螢幕只剩星體＋聲波＋字幕 */
/* S110：Core 容器＝fixed 定位 context（canvas 自行 fixed；字幕/HUD/player 絕對定位喺度） */
.app.core-form #ai-core-container { position: fixed; inset: 0; z-index: 5; }
#ai-core-container[hidden] { display: none; }
.app.core-form #ai-core-container[hidden] { display: none; }  /* 雙保險（cat 形態） */

/* S110：Gemini Canvas 星球引擎（orb.js 全螢幕繪——CSS 零球體規則；唯獨畫布）
   S116：width/height 100%（非 100vw/100vh）——fixed 元素百分比＝viewport 實際尺寸，
   同 orb.js clientWidth 讀數一致；杜絕手機 100vh≠innerHeight 嘅非等比例拉伸（橢圓） */
#orb-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  background: transparent; z-index: 1; cursor: pointer; }
/* S164：行動 WebView 撳 orb 成頁反白——tap-highlight 落喺全螢幕 canvas＝成頁閃，全樹禁
   （純視覺屬性，零行為風險）。S165 事故修正：user-select:none **唔准**上 body/core-form
   全樹——user-select 係 inherited，canvas 繼承 none 後 Chromium WebView（Chrome/155
   實證）tap 唔再生成 click＝orb 死火（mic_start 遙測 v80→v81 歸零）。只准上被動
   文字 UI；互動掣（button/input/canvas）一律唔好掂。 */
body.core-form, body.core-form * { -webkit-tap-highlight-color: transparent; }
.core-form .brandbar, .core-form #cinematic-subtitle {
  -webkit-user-select: none; user-select: none; }

/* S109 電影字幕 → S117 動態歌詞／字幕 HUD → S120 Gemini 視覺統一：
 * 深邃紫藍漸變膠囊（999px）＋高光邊框＋純白 Sharp 發光字——同頂部膠囊/HUD 掣同一語言 */
/* S124：HUD 膠囊下移 20px（bottom: 20% → calc(20% - 20px)）——與中央聲波核心
   保持舒適間距，釋放畫面呼吸感（使用者實報太近） */
#cinematic-subtitle { position: absolute; left: 50%; bottom: calc(20% - 20px); transform: translateX(-50%);
  max-width: min(86vw, 680px); margin: 0; text-align: center; z-index: 30;
  padding: 10px 26px; border-radius: 999px; overflow: hidden; white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(135deg, rgba(16, 20, 52, .55), rgba(28, 18, 64, .55));
  border: 1px solid rgba(130, 165, 255, .22);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .10);
  color: #ffffff; font-weight: 600; letter-spacing: .02em;
  font-size: clamp(15px, 2.6vmin, 24px); line-height: 1.5;
  text-shadow: 0 0 6px rgba(255, 255, 255, .9), 0 0 18px rgba(140, 190, 255, .55);
  opacity: 1; transition: opacity .8s ease; pointer-events: none; }
#cinematic-subtitle.fade { opacity: 0; }
#cinematic-subtitle.empty { display: none; }  /* S117：播歌行清走即收位 */
#subtitle-line { display: inline-block; }
#subtitle-line.flow { padding-left: 100%; animation: lyricFlow 10s linear infinite; }
@keyframes lyricFlow { from { transform: translateX(0); } to { transform: translateX(-100%); } }
/* S142：對話字幕＝雙行換行（即刻全文可讀——走馬燈跑唔贏 partial 覆寫，UHD 大屏
   一樣完整顯示）；走馬燈只留俾歌名行。wrap＝對話模式膠囊轉圓角卡。 */
#cinematic-subtitle.wrap { border-radius: 24px; }
#subtitle-line.multiline { display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }

/* S109 HUD 浮動掣 → S120 Gemini 視覺：粉紫→藍漸變膠囊＋高光邊框＋純白發光字
 * （gemini .ctrl-btn.active 同款——全站互動掣同一語言） */
#hud-action { position: absolute; left: 50%; bottom: 27%; transform: translateX(-50%);
  z-index: 31; display: flex; justify-content: center; }
#hud-action:empty { display: none; }
#hud-action button { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(135deg, rgba(255, 50, 205, .38), rgba(75, 95, 255, .45));
  border: 1px solid rgba(255, 145, 240, .70);
  box-shadow: 0 0 20px rgba(225, 65, 255, .30), inset 0 1px 0 rgba(255, 255, 255, .15);
  color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, .60);
  font-size: 15px; font-weight: 600; letter-spacing: .05em;
  border-radius: 999px; padding: 11px 26px;
  cursor: pointer; animation: hud-fadein .5s ease-out; }
@keyframes hud-fadein { from { opacity: 0; } to { opacity: 1; } }

/* S125：鍵盤 HUD 輸入膠囊——同 hud-action 掣同一視覺語言（粉紫→藍漸變＋高光＋blur 20）；
 * 擺字幕膠囊下方（bottom 9%）；Enter 送出即 hidden 收埋 */
#hud-kb-form { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%);
  z-index: 32; display: flex; width: min(86vw, 680px);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(135deg, rgba(255, 50, 205, .38), rgba(75, 95, 255, .45));
  border: 1px solid rgba(255, 145, 240, .70);
  box-shadow: 0 0 20px rgba(225, 65, 255, .30), inset 0 1px 0 rgba(255, 255, 255, .15);
  border-radius: 999px; padding: 4px 22px;
  animation: hud-fadein .25s ease-out; }
#hud-kb-form[hidden] { display: none; }
#hud-kb-form input { flex: 1; background: transparent; border: none; outline: none;
  color: #ffffff; text-shadow: 0 0 8px rgba(255, 255, 255, .60);
  font-size: 16px; font-weight: 600; letter-spacing: .02em; line-height: 2.4;
  min-width: 0; }
/* S127：placeholder 粉色（同膠囊邊框）非粗體；✕ 掣收埋輸入膠囊（唔想打字有逃生門） */
#hud-kb-form input::placeholder { color: rgba(255, 145, 240, .80);
  font-weight: 400; opacity: 1; }
#hud-kb-close { background: transparent; border: none; cursor: pointer;
  color: rgba(255, 145, 240, .85); font-size: 15px; line-height: 1;
  padding: 0 0 0 14px; flex: none; }

/* S109c：Core 形態 brandbar——奶油紙配色喺深空底對比差（使用者實報「同貓
 * 版差好遠」其中一環：狀態文字灰棕讀唔清）——淺色化覆寫，貓形態零改動 */
.core-form .brandbar .cat-title,
.core-form .brandbar .cat-mood { color: #eaf2ff; }
.core-form .brandbar .status-text { color: #9fc4f5; }
.core-form .brandbar .icon-btn { color: #cfe3ff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(160,200,255,.25); }
.core-form .now-playing { color: #9fdcff; }
/* S113：Core 形態 brandbar＝大膠囊導航欄（Gemini 參考圖）——fixed 置中毛玻璃膠囊
 * （999px 圓角＋blur(20px)＋rgba(12,14,34,.48)＋極細高光邊框）包晒左邊 J-CORE 標誌
 * ＋右邊連線狀態/☰；width:min(92vw,980px) 自適應——車機/手機直屏唔溢出 */
.core-form .brandbar {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  width: min(92vw, 980px); margin: 0; z-index: 20;
  padding: 10px 20px; gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(130, 165, 255, 0.15);
  background: rgba(12, 14, 34, 0.48);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08);
}
/* 窄屏（手機直屏/車機分屏）：padding/gap 縮、字距收——唔擠壓唔換行 */
@media (max-width: 480px) {
  .core-form .brandbar { padding: 8px 12px; gap: 6px; }
  .core-form .brandbar .cat-title { font-size: 12px; }  /* S134：13.2px 基準——窄屏微縮 */
  .core-form .brandbar .status-text { max-width: 30%; font-size: .7rem; }
}
.core-form #menu-pop { top: 84px; }  /* 膠囊下方——唔疊住 */

/* S114：Core pro 導航欄（Gemini 參考）——emoji 絕跡（🐱/😊 收埋）；JCORE 漸變字＋
 * CORE OS tag＋emblem 慢轉＋綠色連線 pill＋圓形 menu 掣。貓形態零波及（.core-only 預設收埋）。 */
.core-only { display: none; }
.core-form .core-only { display: flex; }
/* S122：menu 貓專用掣（🎨🔊💭❓🔍🚗⇄）——Core pro 形態收埋（掣 ID/wiring 唔變，貓形態零波及） */
.core-form #menu-pop .cat-only { display: none; }
.core-form .brandbar .cat-badge, .core-form .brandbar .cat-mood { display: none; }
.core-form .jcore-emblem { width: 30px; height: 30px; flex: 0 0 auto; align-items: center;
  justify-content: center; filter: drop-shadow(0 0 8px rgba(0, 242, 255, .55)); }
.core-form .jcore-emblem svg { width: 100%; height: 100%; animation: slowSpin 14s linear infinite; }
@keyframes slowSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* S131→S133：極微 lockup 精修——JCORE 發光收緊（邊緣更銳利）；CORE OS 由暗灰水印
 * →青藍→淺灰 5.2px（S133 定案） */
.brand-lockup { display: contents; }
.core-form .brand-lockup { display: flex; flex-direction: column;
  justify-content: center; min-width: 0; margin-right: 20px; position: relative; }
.core-form .brandbar .cat-title { line-height: 1; }  /* S134c：JCORE 與 Logo 垂直居中（絕對中線對齊） */
.core-form .brandbar .cat-title {
  font-size: 13.2px; font-weight: 800; letter-spacing: .22em;
  background: linear-gradient(100deg, #ffffff 0%, #9beeff 48%, #d69eff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(120, 210, 255, .55)); }
/* S134c：CORE OS 絕對定位吊喺 JCORE 正下方——唔影響 JCORE 與 Logo 嘅垂直居中 */
.core-form .brand-lockup .core-sub { position: absolute; top: 100%; right: 0;
  margin-top: 1px; font-size: 5.2px; font-weight: 700; letter-spacing: .14em;
  line-height: 1; color: #c3cdd9; opacity: .9;
  text-shadow: 0 0 3px rgba(190, 200, 215, .5); }
/* 連線容器——貓形態 display:contents 零波及；S128 Core 形態 pill 已拆（透明容器：
 * dot/status-text 收埋＝狀態移交 emblem 中心點；只淨 now-playing＋天氣組件） */
.conn-badge { display: contents; }
/* S115：右側對齊——conn-badge 推到膠囊最右（menu 掣跟實後面），唔浮喺中間 */
.core-form .conn-badge { margin-left: auto; }
.core-form .conn-badge { display: flex; align-items: center; gap: 10px;
  background: none; border: none; padding: 0; color: #6effc2; }
.core-form .conn-badge .dot { width: 7px; height: 7px; flex: 0 0 auto; background: #00f59b;
  box-shadow: 0 0 8px #00f59b, 0 0 16px #00f59b; animation: pulseDot 2.2s infinite ease-in-out; }
.core-form .conn-badge .dot.off { background: #ff5577; box-shadow: none; animation: none; }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .6; } }
.core-form .conn-badge .status-text { color: #6effc2; margin-left: 0; font-size: 12.5px;
  max-width: none; text-align: left; }
.core-form .conn-badge .now-playing { color: #9fdcff; font-size: 12.5px; }

/* ---- S128：Navbar 重設計（Core 形態）——①emblem 中心圓點＝連線狀態燈（紅閃↔幻彩紫）
 * ②居中動態時鐘（絕對置中——左右內容長度唔影響）③天氣組件（menu 掣左邊） ---- */
.core-form .conn-badge .dot, .core-form .conn-badge .status-text { display: none; }
.core-form .jcore-dot { transition: fill .3s ease; }
.core-form .jcore-dot.disc { fill: #ff4d6d; animation: pulse-red 1.1s ease-in-out infinite; }
@keyframes pulse-red {
  0%, 100% { fill: #ff4d6d; opacity: 1; }
  50% { fill: rgba(255, 77, 109, .25); opacity: .35; } }
.core-form .nav-clock { display: block; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); line-height: 1; flex: none;
  font-size: 15px; font-weight: 700; letter-spacing: .18em;
  font-variant-numeric: tabular-nums; color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, .9), 0 0 18px rgba(140, 190, 255, .55);
  pointer-events: none; }
.core-form .nav-weather { display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; color: #bfeaff;
  text-shadow: 0 0 8px rgba(80, 200, 255, .55); }
.core-form .nav-weather svg { color: #7de8ff; filter: drop-shadow(0 0 5px rgba(80, 200, 255, .85)); }
.core-form .brandbar .icon-btn { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  color: #d8e4ff; transition: all .2s ease; }
.core-form .brandbar .icon-btn:hover { background: rgba(130, 95, 255, .25);
  border-color: rgba(180, 145, 255, .55); }

/* S109d：Spotify embed 浮動迷你播放器（HUD 掣上方）→ S120 Gemini 視覺統一
 * （深紫藍毛玻璃＋高光邊框；空時唔佔位） */
#hud-player { position: absolute; left: 50%; bottom: 33%; transform: translateX(-50%);
  z-index: 31; width: min(70vw, 320px); border-radius: 14px; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: rgba(12, 14, 34, 0.48);
  border: 1px solid rgba(130, 165, 255, 0.22);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .10);
  animation: hud-fadein .5s ease-out; }
#hud-player:empty { display: none; }
#hud-player iframe { display: block; border: 0; border-radius: 12px; }

/* ---- S138：Spotify 授權引導 overlay（SDK auth 失敗直接跳授權——使用者定案）----
 * 動畫：overlay 蓋全螢幕（同深空底色漸變——星球/波視覺上 fade out）；
 * body.spotify-authing＝掣（brandbar/HUD/字幕）fade out＋鎖 pointer——收返自動 enable。 */
.spotify-auth-overlay { position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0a0724 0%, #020209 100%);
  opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.spotify-auth-overlay.show { opacity: 1; pointer-events: auto; }
#spotify-auth-overlay[hidden] { display: none; }
.sa-card { display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: min(86vw, 480px); padding: 32px 28px; text-align: center;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(130, 165, 255, .22);
  border-radius: 18px; box-shadow: 0 18px 60px rgba(0, 0, 0, .55); }
.sa-icon { font-size: 34px; line-height: 1;
  filter: drop-shadow(0 0 10px rgba(80, 200, 255, .8)); }
.sa-card h3 { margin: 0; font-size: 19px; font-weight: 600; color: #eaf2ff; letter-spacing: .04em;
  text-shadow: 0 0 12px rgba(140, 190, 255, .5); }
.sa-card ol { margin: 0; padding-left: 20px; text-align: left; display: flex;
  flex-direction: column; gap: 10px; }
.sa-card li { font-size: 13.5px; line-height: 1.55; color: #b9c8e0; }
.sa-login { padding: 12px 34px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: .04em; color: #06101f;
  background: linear-gradient(135deg, #7de8ff, #4a9dff);
  box-shadow: 0 0 18px rgba(80, 200, 255, .55); transition: transform .15s ease; }
.sa-login:hover { transform: translateY(-1px); }
.sa-later { border: 0; background: none; cursor: pointer; font-size: 12.5px;
  color: #7f8ea6; text-decoration: underline dotted; padding: 4px 8px; }
/* 掣 fade out 鎖死（授權期間）；收返＝enable（過渡返嚟）——Core 形態生效面全蓋；
 * 貓形態掣喺 .app 容器內同樣鎖（overlay 全覆蓋物理上已擋 click，呢度係視覺 fade） */
body.spotify-authing .brandbar, body.spotify-authing #cinematic-subtitle,
body.spotify-authing #hud-player, body.spotify-authing #hud-kb-form,
body.spotify-authing .chat { opacity: 0; pointer-events: none;
  transition: opacity .5s ease; }

/* ---- S142：天氣預報全息卡（metadata.weather → 星球/絲帶淡出＋卡片 fade in；
   報告員 TTS 講完/新輸入/撳卡 → 淡走星球返場——S138 overlay 同款 body class 模式）---- */
body.weather-mode #orb-canvas { opacity: 0; transition: opacity .6s ease; pointer-events: none; }
#weather-panel { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  z-index: 31; width: min(92vw, 540px); padding: 24px 28px; border-radius: 22px;
  cursor: pointer; overflow: hidden;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(150deg, rgba(10, 16, 46, .74), rgba(26, 16, 60, .66));
  border: 1px solid rgba(120, 200, 255, .35);
  box-shadow: 0 0 46px rgba(60, 170, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: wx-in .6s ease-out; }
#weather-panel[hidden] { display: none; }
@keyframes wx-in { from { opacity: 0; transform: translate(-50%, -44%) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
/* 全息掃描網格底（科幻感——Core 設計語言：深空＋青 neon） */
#weather-panel::before { content: ""; position: absolute; inset: 0; border-radius: 22px;
  background: repeating-linear-gradient(0deg, rgba(120, 200, 255, .05) 0 1px, transparent 1px 26px),
              repeating-linear-gradient(90deg, rgba(120, 200, 255, .04) 0 1px, transparent 1px 26px);
  pointer-events: none; }
.wx-head { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  position: relative; }
.wx-place { font-size: 15px; letter-spacing: .12em; color: #9fd8ff;
  text-shadow: 0 0 8px rgba(80, 180, 255, .5); }
.wx-now { display: flex; align-items: center; gap: 10px; }
.wxi { font-size: 20px; filter: drop-shadow(0 0 6px rgba(255, 220, 120, .55)); }
.wxi-big { font-size: 38px; }
.wx-temp { font-size: 42px; font-weight: 700; color: #ffffff;
  text-shadow: 0 0 14px rgba(140, 190, 255, .6); }
.wx-hours { display: flex; justify-content: space-between; margin: 16px 0 12px;
  padding: 10px 14px; border-radius: 14px; position: relative;
  background: rgba(20, 30, 70, .35); border: 1px solid rgba(120, 200, 255, .15); }
.wx-hour { display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; color: #c9dcf5; }
.wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; }
.wx-day { display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 8px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(30, 42, 90, .5), rgba(40, 26, 84, .4));
  border: 1px solid rgba(120, 200, 255, .18); }
.wx-day-name { font-size: 13px; color: #9fd8ff; letter-spacing: .08em; }
.wx-hi { font-size: 19px; font-weight: 700; color: #ffd9a8; }
.wx-lo { font-size: 13px; color: #9fb8d8; }
.wx-rain { font-size: 11px; color: #8fd0ff; }
/* ---- S147：附近搜尋全息卡（core-only）——metadata.nearby → body.nav-mode：
   S142 weather 同款 body class 模式（星球淡出＋卡 fade in；✕/新輸入/撳卡收——
   S148 裁示唔再自動收）。
   重用 wx-in keyframes。item 撳＝開導航（openNavApp 裝置揀路）。---- */
body.nav-mode #orb-canvas { opacity: 0; transition: opacity .6s ease; pointer-events: none; }
#nav-panel { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  z-index: 31; width: min(92vw, 540px); max-height: 72dvh; overflow-y: auto;
  padding: 20px 24px; border-radius: 22px; cursor: pointer;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(150deg, rgba(10, 16, 46, .74), rgba(26, 16, 60, .66));
  border: 1px solid rgba(120, 200, 255, .35);
  box-shadow: 0 0 46px rgba(60, 170, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: wx-in .6s ease-out; }
#nav-panel[hidden] { display: none; }
#nav-panel::before { content: ""; position: absolute; inset: 0; border-radius: 22px;
  background: repeating-linear-gradient(0deg, rgba(120, 200, 255, .05) 0 1px, transparent 1px 26px),
              repeating-linear-gradient(90deg, rgba(120, 200, 255, .04) 0 1px, transparent 1px 26px);
  pointer-events: none; }
.nb-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; position: relative; margin-bottom: 12px; }
.nb-title { font-size: 16px; font-weight: 700; letter-spacing: .14em; color: #9fd8ff;
  text-shadow: 0 0 8px rgba(80, 180, 255, .5); }
.nb-hint { font-size: 11px; letter-spacing: .08em; color: #7ea9d8; }
.nb-list { display: flex; flex-direction: column; gap: 8px; position: relative; }
.nb-item { display: flex; flex-direction: column; gap: 2px; text-decoration: none;
  padding: 10px 14px; min-height: 44px; justify-content: center; border-radius: 14px;
  background: linear-gradient(160deg, rgba(30, 42, 90, .5), rgba(40, 26, 84, .4));
  border: 1px solid rgba(120, 200, 255, .18); }
.nb-item:active { transform: scale(0.98); }
.nb-main { font-size: 14.5px; font-weight: 600; color: #eaf6ff;
  text-shadow: 0 0 6px rgba(120, 190, 255, .4); }
.nb-sub { font-size: 11.5px; color: #9fb8d8; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
/* ---- S148：面板 ✕ 掣（weather/nearby 共用）——右上角浮動；44px 級盲操目標---- */
.panel-close { position: absolute; top: 10px; right: 12px; z-index: 1;
  width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer;
  font-size: 15px; line-height: 1; color: #bfe3ff;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .18); }
.panel-close:active { transform: scale(0.92); }

/* ---- S158 手機發燙護欄：backdrop-filter 毛玻璃係 GPU 合成殺手——疊喺動畫 canvas
   上等於合成器每幀重新 blur 背景（手機發燙/耗電主因之一）。觸控裝置（手機/車機）
   改實底半透明——視覺近似、可讀性保住，GPU 負擔大減；桌面照舊毛玻璃零改動。---- */
@media (hover: none) and (pointer: coarse) {
  #cinematic-subtitle, #hud-action button, #hud-kb-form,
  .core-form .brandbar, #hud-player, #weather-panel, #nav-panel {
    backdrop-filter: none; -webkit-backdrop-filter: none; }
  #cinematic-subtitle { background: linear-gradient(135deg, rgba(16, 20, 52, .85), rgba(28, 18, 64, .85)); }
  .core-form .brandbar { background: rgba(12, 14, 34, .88); }
  #hud-player { background: rgba(12, 14, 34, .88); }
  #hud-action button, #hud-kb-form {
    background: linear-gradient(135deg, rgba(255, 50, 205, .68), rgba(75, 95, 255, .72)); }
}

/* ---- S161 P1→S174：DJ 候選歌 footer pill 列（Core 形態）——搬畫面最底
     （bottom 2%，鍵盤膠囊 9% 之下＝footer 位）。之前 bottom 13%＋flex-wrap：
     3 顆 pill 手機拆 2-3 行向上生＝蓋住 20% 位字幕膠囊（使用者實報）。而家
     單行橫滑永不向上生；首尾 margin auto＝有位時中央對齊、唔夠位時可滑。
     :empty 收位唔佔版。---- */
#music-picks { position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%);
  z-index: 31; display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 8px;
  width: min(96vw, 760px); overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
#music-picks::-webkit-scrollbar { display: none; }
#music-picks:empty { display: none; }
#music-picks button:first-child { margin-left: auto; }
#music-picks button:last-child { margin-right: auto; }
#music-picks button { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(135deg, rgba(255, 50, 205, .30), rgba(75, 95, 255, .38));
  border: 1px solid rgba(255, 145, 240, .45);
  color: #ffffff; text-shadow: 0 0 6px rgba(255, 255, 255, .45);
  font-size: 13px; font-weight: 600; letter-spacing: .03em;
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  flex: 0 0 auto; max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  animation: hud-fadein .5s ease-out; }
#music-picks button:active { transform: scale(0.97); }

/* ---- S161 ⑥：nav-panel 路線段（開始導航大掣＋揀版卡列）——重用 nb-* 卡面 ---- */
.np-hero { display: block; width: 100%; margin: 4px 0 12px; padding: 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-size: 16px; font-weight: 700; letter-spacing: .06em; color: #06101f;
  background: linear-gradient(135deg, #7de8ff, #4a9dff);
  box-shadow: 0 0 22px rgba(80, 200, 255, .45); position: relative; }
.np-hero:active { transform: scale(0.98); }
.np-ask-q { font-size: 14.5px; font-weight: 600; color: #eaf2ff;
  letter-spacing: .04em; margin: 6px 0 10px; position: relative;
  text-shadow: 0 0 8px rgba(140, 190, 255, .5); }
#nav-panel .nav-ask-btns { margin-top: 2px; margin-bottom: 4px; position: relative; }

/* ---- S161 ⑨→S174b：星戰 crawl——Core 所有回覆透視滾動（orb 下方；片尾字幕式）。
 * Neon cyberpunk（使用者裁示）：近白青芯＋分層青霓虹 glow——sharp 可讀唔糊。
 * top 57% 避開 orb 底（使用者實報同 orb 有少少疊）；pre-line 保留段落分行。
 * 純 CSS 3D composited layer；頂部 mask＝文字消失於遠方；reduced-motion 降級。---- */
#crawl { position: absolute; left: 50%; top: 57%; bottom: 10%; width: 72vw;
  transform: translateX(-50%); overflow: hidden; z-index: 29; pointer-events: auto;
  -webkit-mask-image: linear-gradient(to top, #000 72%, transparent);
  mask-image: linear-gradient(to top, #000 72%, transparent); cursor: pointer; }
#crawl[hidden] { display: none; }
#crawl .text { transform-origin: 50% 100%; text-align: center;
  color: #e6feff; font-weight: 600; line-height: 2.2; white-space: pre-line;
  font-size: clamp(15px, 2.4vmin, 22px); letter-spacing: .06em;
  text-shadow: 0 0 1px rgba(255, 255, 255, 1), 0 0 6px rgba(0, 240, 255, .9),
    0 0 18px rgba(0, 210, 255, .6), 0 0 36px rgba(0, 170, 255, .35);
  animation: crawl-up 30s linear forwards; }
@keyframes crawl-up {
  from { transform: perspective(380px) rotateX(24deg) translateY(100%); }
  to   { transform: perspective(380px) rotateX(24deg) translateY(-100%); } }
@media (prefers-reduced-motion: reduce) {
  #crawl { top: 40%; overflow-y: auto; }
  #crawl .text { animation: none; transform: none; }
}

/* ---- S190 出海 landing（US/EU SEO：raw HTML 可爬；已 onboard 由 inline script 收起）---- */
.landing { max-width: 720px; margin: 0 auto; padding: 32px 20px 48px; }
.landing h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 12px; }
.landing .tagline { font-size: 1.05rem; opacity: .85; margin: 0 0 24px; }
.landing-feats { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.landing-feats li { background: rgba(245,178,26,.10); border: 1px solid rgba(245,178,26,.35); border-radius: 14px; padding: 12px 14px; }
.landing-feats b { display: block; margin-bottom: 4px; }
.landing-feats span { font-size: .95rem; opacity: .8; }
.landing-cta { font-weight: 600; margin: 0 0 24px; }
.landing-footer { font-size: .9rem; opacity: .7; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.landing-footer a { color: inherit; }
