/* 由 index.html 內嵌 <style> 搬出（弱掃修正 2026-10：CSP 不再允許內嵌樣式），內容不變 */
    /* ═══════════════════════════════════════ */
    /* 🎨極簡設計              */
    /* ═══════════════════════════════════════ */
    
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    /* 防止 iOS/Chrome 鍵盤彈出時縮放錯位 */
    html {
      height: 100%;
    }

    body {
      font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
      /* 背景圖由 venue-loader._applyTheme() 動態設定，不在 CSS 寫死 */
      background-color: #1a1a2e;
      background-size: cover;
      background-position: center 0;
      background-repeat: no-repeat;
      overflow: hidden;
      height: 100vh;
      height: 100dvh; /* iOS 15.4+ 修正：動態視窗高度，不含網址列 */
    }

    .main-container {
      width: 100%;
      height: 100vh;
      height: 100dvh; /* iOS 修正 */
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
    }

    /* ─────────────────────────────────── */
    /* 載入畫面                             */
    /* ─────────────────────────────────── */
    .loading-overlay {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100vh; height: 100dvh;
      background: linear-gradient(135deg, #0d0e1a 0%, #1a1040 50%, #0d0e1a 100%);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      transition: opacity 0.6s ease;
    }
    .loading-overlay.hidden {
      opacity: 0;
      pointer-events: none;
      display: none !important;
    }
    .loading-char-name {
      font-size: 28px; font-weight: 700;
      background: linear-gradient(135deg, #FF2D95, #B24BF3);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent;
      background-clip: text;
      margin-bottom: 6px; letter-spacing: 2px;
    }
    .loading-subtitle {
      font-size: 13px; color: rgba(255,255,255,0.45);
      margin-bottom: 48px; letter-spacing: 1px;
    }
    .loading-bar-wrap {
      width: 260px; height: 4px;
      background: rgba(255,255,255,0.1);
      border-radius: 4px; overflow: hidden; margin-bottom: 14px;
    }
    .loading-bar-fill {
      height: 100%; width: 0%;
      background: linear-gradient(90deg, #FF2D95, #B24BF3, #667eea);
      border-radius: 4px; transition: width 0.3s ease;
      box-shadow: 0 0 8px rgba(255,45,149,0.6);
    }
    .loading-pct {
      font-size: 13px; font-family: monospace;
      color: rgba(255,255,255,0.5); letter-spacing: 1px;
    }
    .loading-pct span { color: #FF2D95; font-weight: 700; }

    /* ─────────────────────────────────── */
    /* 歡迎畫面                             */
    /* ─────────────────────────────────── */
    /* 🍪 Cookie 授權 Modal */
    .cookie-modal {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.92);
      backdrop-filter: blur(12px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10001;
      padding: 24px;
    }
    .cookie-card {
      background: linear-gradient(135deg, rgba(30,15,60,0.95), rgba(20,10,40,0.95));
      border: 1px solid rgba(255,45,149,0.3);
      border-radius: 20px;
      padding: 28px 24px;
      max-width: 360px;
      width: 100%;
      text-align: center;
    }
    .cookie-icon {
      margin-bottom: 16px;
      display: flex; align-items: center; justify-content: center;
    }
    .cookie-btn-accept {
      display: flex; align-items: center; justify-content: center;
    }
    .cookie-title {
      font-size: 18px; font-weight: 700; color: white; margin-bottom: 10px;
    }
    .cookie-desc {
      font-size: 13px; color: rgba(255,255,255,0.6);
      line-height: 1.7; margin-bottom: 20px;
    }
    .cookie-desc strong { color: rgba(255,255,255,0.85); }
    .cookie-btn-accept {
      width: 100%; padding: 14px;
      background: linear-gradient(135deg, #FF2D95, #B24BF3);
      color: white; border: none; border-radius: 14px;
      font-size: 15px; font-weight: 700; cursor: pointer;
      margin-bottom: 10px; letter-spacing: 0.5px;
      font-family: 'Noto Sans TC', sans-serif;
    }
    .cookie-error {
      display: none;
      background: rgba(255,60,60,0.15);
      border: 1px solid rgba(255,60,60,0.3);
      border-radius: 10px; padding: 12px;
      font-size: 12px; color: #ff8080;
      line-height: 1.6; margin-bottom: 12px; text-align: left;
    }
    .cookie-error.show { display: block; }

    .welcome-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(10px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      animation: fadeIn 0.5s;
    }
    .welcome-modal.visible {
      display: flex;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes fadeOut {
      from { opacity: 1; }
      to { opacity: 0; }
    }

    .welcome-content {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      border-radius: 24px;
      padding: 40px 50px;
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.2);
      max-width: 500px;
      animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes scaleIn {
      from {
        opacity: 0;
        transform: scale(0.8);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .welcome-icon {
      font-size: 72px;
      margin-bottom: 20px;
      animation: wave 1.5s ease-in-out infinite;
    }

    @keyframes wave {
      0%, 100% { transform: rotate(0deg); }
      25% { transform: rotate(-10deg); }
      75% { transform: rotate(10deg); }
    }

    .welcome-title {
      color: white;
      font-size: 28px;
      font-weight: 700;
      margin-bottom: 15px;
    }

    .welcome-subtitle {
      color: rgba(255, 255, 255, 0.8);
      font-size: 16px;
      line-height: 1.8;
      margin-bottom: 30px;
      white-space: pre-line; /* 🆕 讓文字裡的換行直接顯示，不用另外組 <br> 標籤 */
    }

    .welcome-button {
      background: linear-gradient(135deg, #FF2D95, #B24BF3);
      color: white;
      border: none;
      padding: 14px 40px;
      border-radius: 25px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s;
    }

    .welcome-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(255, 45, 149, 0.4);
    }

    .welcome-button:active {
      transform: translateY(0);
    }

    /* ─────────────────────────────────── */
    /* 情緒標籤 (右上角,小巧)               */
    /* ─────────────────────────────────── */
    .emotion-tag {
      position: fixed;
      top: 20px;
      right: 20px;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(15px);
      padding: 8px 14px;
      border-radius: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
      color: white;
      font-size: 13px;
      font-weight: 500;
      border: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      z-index: 20;
      transition: all 0.5s ease;
    }

    .emotion-tag:hover {
      transform: scale(1.05);
    }

    #emotionIcon {
      font-size: 20px;
      animation: emotionPulse 2s ease-in-out infinite;
    }

    @keyframes emotionPulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.15); }
    }

    /* ─────────────────────────────────── */
    /* VTuber 展示區 (居中,更大)            */
    /* ─────────────────────────────────── */
    .vtuber-display {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
      padding: 20px;
    }

    .canvas-container {
      width: 100%;
      max-width: 900px;
      height: 100%;
      max-height: 900px;
      position: relative;
    }

    /* 🆕 GPS 提示燈泡與提示面板（從野柳版本搬過來的通用版）─────────── */
    #gpsHintBulb {
      position: absolute;
      right: 14px;
      top: 28%;
      transform: translateY(-50%);
      width: 46px; height: 56px;
      border-radius: 23px;
      background: rgba(20,10,40,0.75);
      border: 1.5px solid rgba(245,166,35,0.6);
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      cursor: pointer;
      z-index: 1000;
      box-shadow: 0 0 0 0 rgba(245,166,35,0.5), 0 4px 12px rgba(0,0,0,0.4);
      animation: gps-bulb-pulse 1.8s ease-in-out infinite;
      -webkit-tap-highlight-color: transparent;
      backdrop-filter: blur(8px);
      pointer-events: auto;
      transition: transform 0.15s;
    }
    #gpsHintBulb:active {
      transform: translateY(-50%) scale(0.93);
    }
    @keyframes gps-bulb-pulse {
      0%   { box-shadow: 0 0 0 0 rgba(245,166,35,0.5), 0 4px 12px rgba(0,0,0,0.4); border-color: rgba(245,166,35,0.6); }
      50%  { box-shadow: 0 0 0 8px rgba(245,166,35,0), 0 4px 16px rgba(245,166,35,0.3); border-color: rgba(245,166,35,1); }
      100% { box-shadow: 0 0 0 0 rgba(245,166,35,0.5), 0 4px 12px rgba(0,0,0,0.4); border-color: rgba(245,166,35,0.6); }
    }

    #gpsHintPanel {
      position: fixed;
      bottom: 100px;
      left: 50%;
      transform: translateX(-50%);
      width: calc(100% - 32px);
      max-width: 380px;
      background: rgba(20,10,40,0.96);
      border: 1px solid rgba(255,140,0,0.4);
      border-radius: 16px;
      padding: 14px 16px;
      z-index: 2000;
      display: none;
      backdrop-filter: blur(12px);
      box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,140,0,0.15);
    }
    #gpsHintPanel::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(245,166,35,0.5), transparent);
      border-radius: 16px 16px 0 0;
    }
    .gps-hint-header {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 10px;
    }
    .gps-hint-icon {
      width: 26px; height: 26px; border-radius: 50%;
      background: rgba(245,166,35,0.15);
      border: 1px solid rgba(245,166,35,0.4);
      display: flex; align-items: center; justify-content: center;
      font-size: 13px;
      animation: glow-hint 2s ease-in-out infinite;
    }
    @keyframes glow-hint {
      0%,100% { box-shadow: 0 0 4px rgba(245,166,35,0.3); }
      50%      { box-shadow: 0 0 12px rgba(245,166,35,0.6); }
    }
    .gps-hint-label {
      font-size: 11px; color: rgba(245,166,35,0.85);
      font-weight: 600; letter-spacing: 0.06em;
    }
    .gps-hint-spot {
      font-size: 10px; color: rgba(255,255,255,0.4);
      margin-bottom: 8px;
    }
    .gps-hint-text {
      font-size: 13px; color: rgba(255,255,255,0.88);
      line-height: 1.6;
    }
    .gps-hint-close {
      position: absolute; top: 10px; right: 10px;
      width: 22px; height: 22px; border-radius: 50%;
      background: rgba(255,255,255,0.08);
      border: none; color: rgba(255,255,255,0.4);
      font-size: 12px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
    }

    #vtuberCanvas {
      width: 100%;
      height: 100%;
    }

    /* ─────────────────────────────────── */
    /* 對話氣泡 (簡潔浮動)                 */
    /* ─────────────────────────────────── */
    .dialogue-container {
      position: fixed;
      bottom: 140px;
      left: 50%;
      transform: translateX(-50%);
      max-width: 600px;
      width: 90%;
      pointer-events: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      z-index: 50;
    }

    .dialogue-bubble {
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(13px);
      color: white;
      padding: 16px 22px;
      border-radius: 18px;
      max-width: 100%;
      font-size: 15px;
      line-height: 1.6;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
      border: 1px solid rgba(255, 255, 255, 0.15);
      pointer-events: auto;
      animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
      white-space: pre-line;
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .character-name {
      font-size: 12px;
      font-weight: 700;
      color: #FF2D95;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .dialogue-bubble.user .character-name {
      color: #00F0FF;
    }

    /* ─────────────────────────────────── */
    /* 底部互動欄 (簡潔圖示化)             */
    /* ─────────────────────────────────── */
    .bottom-bar {
      position: fixed;
      bottom: 0;
      bottom: env(safe-area-inset-bottom, 0);
      left: 0;
      right: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(20px);
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      padding: 16px 20px;
      padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
      display: flex;
      flex-direction: column;
      gap: 12px;
      z-index: 100;
      transition: transform 0.2s ease;
    }

    /* 輸入框區域 */
    .input-wrapper {
      display: flex;
      gap: 10px;
      align-items: center;
      max-width: 800px;
      margin: 0 auto;
      width: 100%;
    }

    .chat-input {
      flex: 1;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: white;
      padding: 12px 18px;
      border-radius: 25px;
      font-size: 15px;
      outline: none;
      transition: all 0.3s;
    }

    .chat-input:focus {
      background: rgba(255, 255, 255, 0.15);
      border-color: rgba(255, 45, 149, 0.6);
      box-shadow: 0 0 0 3px rgba(255, 45, 149, 0.15);
    }

    .chat-input::placeholder {
      color: rgba(255, 255, 255, 0.5);
    }

    /* 圖示按鈕 (統一風格) */
    .icon-btn {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.25);
      background: rgba(255, 255, 255, 0.1);
      color: white;
      font-size: 20px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s;
      position: relative;
      flex-shrink: 0;
    }

    .icon-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.1);
      border-color: rgba(255, 45, 149, 0.5);
    }

    .icon-btn:active {
      transform: scale(0.95);
    }

    /* 發送按鈕 (強調色) */
    .icon-btn svg, .icon-btn i {
      display: block; pointer-events: none;
      color: currentColor; stroke: currentColor;
    }
    .send-btn {
      background: linear-gradient(135deg, #FF2D95, #B24BF3);
      border: none;
    }

    .send-btn:hover {
      box-shadow: 0 4px 15px rgba(255, 45, 149, 0.4);
    }

    /* 徽章 */
    .badge {
      position: absolute;
      top: -4px;
      right: -4px;
      background: #ef4444;
      color: white;
      font-size: 10px;
      font-weight: bold;
      padding: 2px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
      display: none;
    }

    .badge.show {
      display: block;
    }

    /* 功能按鈕列 */
    .action-buttons {
      display: flex;
      gap: 12px;
      justify-content: center;
      align-items: center;
    }

    /* 🆕 底部導覽列圖示文字說明——原本純圖示，新玩家不一定看得懂每顆
       按鈕的意思，這裡用一個外層容器把圖示按鈕跟下方小字包在一起， */
    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
    }
    .nav-item-label {
      font-size: 10px;
      color: rgba(255, 255, 255, 0.6);
      line-height: 1;
      white-space: nowrap;
    }

    /* ─────────────────────────────────── */
    /* 推薦問題浮動面板 (隱藏式)           */
    /* ─────────────────────────────────── */
    .suggestions-panel {
      position: fixed;
      bottom: 150px;
      left: 50%;
      transform: translateX(-50%) scale(1);
      max-width: 600px;
      width: 90%;
      background: rgba(15, 15, 35, 0.95);
      backdrop-filter: blur(30px);
      border-radius: 20px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 20px;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
      z-index: 90;
      transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      opacity: 1;
      pointer-events: auto;
    }

    .suggestions-panel.hidden {
      opacity: 0;
      pointer-events: none;
      transform: translateX(-50%) translateY(30px) scale(0.95);
    }

    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .panel-header h3 {
      color: white;
      font-size: 16px;
      font-weight: 600;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .close-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: none;
      background: rgba(255, 255, 255, 0.1);
      color: white;
      font-size: 16px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s;
    }

    .close-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: rotate(90deg);
    }

    /* ── Onboarding 說明蓋板 ── */
    .onboarding-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.88);
      backdrop-filter: blur(12px);
      z-index: 12000;
      display: flex; align-items: center; justify-content: center;
      padding: 20px;
      animation: obFadeIn 0.3s ease;
    }
    @keyframes obFadeIn {
      from { opacity:0; } to { opacity:1; }
    }
    .onboarding-overlay.hiding {
      animation: obFadeOut 0.2s ease forwards;
    }
    @keyframes obFadeOut {
      from { opacity:1; } to { opacity:0; }
    }
    .onboarding-card {
      background: linear-gradient(135deg,rgba(30,15,60,0.98),rgba(20,10,40,0.98));
      border: 1px solid rgba(255,45,149,0.3);
      border-radius: 20px;
      padding: 24px 20px;
      max-width: 360px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      position: relative;
    }
    .onboarding-close {
      position: absolute; top: 14px; right: 14px;
      width: 28px; height: 28px;
      border-radius: 50%;
      background: rgba(255,255,255,0.1);
      border: none; color: white; font-size: 14px;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: background 0.2s;
    }
    .onboarding-close:hover { background: rgba(255,45,149,0.3); }
    .onboarding-title {
      text-align: center; margin-bottom: 20px;
    }
    .onboarding-title .sub {
      font-size: 12px; color: rgba(255,255,255,0.4);
      letter-spacing: 1px; margin-bottom: 4px;
    }
    .onboarding-title .main {
      font-size: 18px; font-weight: 700; color: white;
    }
    /* 說明圖片模式 */
    .onboarding-image {
      width: 100%; border-radius: 12px;
      border: 1px solid rgba(255,45,149,0.2);
      margin-bottom: 16px; display: block;
    }
    /* 步驟模式 */
    .onboarding-steps {
      display: flex; flex-direction: column; gap: 10px;
      margin-bottom: 20px;
    }
    .onboarding-step {
      display: flex; gap: 12px; align-items: flex-start;
      border-radius: 12px; padding: 11px 12px;
    }
    .onboarding-step.pink   { background:rgba(255,45,149,0.08);  border:1px solid rgba(255,45,149,0.2);  }
    .onboarding-step.purple { background:rgba(178,75,243,0.08);  border:1px solid rgba(178,75,243,0.2);  }
    .onboarding-step.cyan   { background:rgba(0,240,255,0.06);   border:1px solid rgba(0,240,255,0.15); }
    .onboarding-step.gold   { background:rgba(255,215,0,0.06);   border:1px solid rgba(255,215,0,0.15); }
    .onboarding-step-num {
      width: 30px; height: 30px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; font-size: 15px; font-weight: 700;
    }
    .pink   .onboarding-step-num { background:rgba(255,45,149,0.2);  color:#FF2D95; }
    .purple .onboarding-step-num { background:rgba(178,75,243,0.2);  color:#B24BF3; }
    .cyan   .onboarding-step-num { background:rgba(0,240,255,0.1);   color:#00F0FF; }
    .gold   .onboarding-step-num { background:rgba(255,215,0,0.1);   color:#FFD700; }
    .onboarding-step-title {
      font-size: 13px; font-weight: 600; color: white; margin-bottom: 2px;
    }
    .onboarding-step-desc {
      font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.5;
    }
    .onboarding-btn {
      width: 100%; padding: 13px;
      background: linear-gradient(135deg,#FF2D95,#B24BF3);
      color: white; border: none; border-radius: 14px;
      font-size: 14px; font-weight: 700; cursor: pointer;
      letter-spacing: 0.5px; font-family: inherit;
      transition: opacity 0.2s;
    }
    .onboarding-btn:hover { opacity: 0.9; }

    /* 滑動版專用 */
    .ob-swipe-card {
      padding: 20px 20px 20px;
      max-width: 380px;
    }
    .ob-track {
      overflow: hidden;
      border-radius: 12px;
      margin-bottom: 16px;
    }
    .ob-slides {
      display: flex;
      transition: transform 0.35s cubic-bezier(.4,0,.2,1);
    }
    .ob-page {
      min-width: 100%;
    }
    .ob-slide {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 14px;
    }
    .ob-img {
      width: 100%;
      max-height: 260px;
      object-fit: contain;
      border-radius: 12px;
      border: 1px solid rgba(255,45,149,0.2);
    }
    .ob-placeholder {
      width: 100%;
      height: 220px;
      background: rgba(255,255,255,0.04);
      border: 1px dashed rgba(255,45,149,0.25);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .ob-placeholder-icon { font-size: 52px; }
    .ob-text { text-align: center; padding: 0 4px; }
    .ob-slide-title {
      font-size: 16px; font-weight: 700; color: white;
      margin-bottom: 6px;
    }
    .ob-slide-desc {
      font-size: 13px; color: rgba(255,255,255,1);
      line-height: 1.6;
    }
    .ob-nav {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
    }
    .ob-dots {
      display: flex;
      gap: 6px;
      align-items: center;
    }
    .ob-dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: rgba(255,255,255,0.2);
      cursor: pointer;
      transition: all 0.2s;
    }
    .ob-dot.active {
      width: 20px;
      border-radius: 4px;
      background: #FF2D95;
    }
    .ob-arrow-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      gap: 12px;
      margin-bottom: 4px;
    }
    .ob-arrow {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.15);
      color: white; font-size: 22px; line-height: 1;
      cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.2s, opacity 0.2s;
    }
    .ob-arrow:hover { background: rgba(255,45,149,0.2); }
    .ob-tag {
      display: inline-block;
      background: rgba(255,45,149,0.15);
      border: 1px solid rgba(255,45,149,0.3);
      border-radius: 20px;
      padding: 3px 10px;
      font-size: 11px;
      color: #FF2D95;
      font-weight: 600;
      letter-spacing: 0.5px;
      margin-bottom: 6px;
    }
    .ob-next-btn {
      width: 100%;
    }

    /* 推薦問題網格 */
    .suggestions-grid {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 280px;
      overflow-y: auto;
    }

    /* 自定義滾動條 */
    .suggestions-grid::-webkit-scrollbar {
      width: 6px;
    }

    .suggestions-grid::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
    }

    .suggestions-grid::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 10px;
    }

    .suggestions-grid::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.3);
    }

    .suggestion-card {
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 12px;
      padding: 10px 14px;
      color: white;
      font-size: 13px;
      text-align: left;
      cursor: pointer;
      transition: all 0.25s;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .suggestion-card:hover {
      background: rgba(255,45,149,0.12);
      border-color: rgba(255,45,149,0.35);
      transform: translateY(-1px);
    }

    .suggestion-card:active {
      transform: translateY(0) scale(0.98);
    }

    .suggestion-icon {
      width: 30px;
      height: 30px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    /* icon 顏色類別 */
    .suggestion-icon.pink   { background: rgba(255,45,149,0.15); color: #FF2D95; }
    .suggestion-icon.purple { background: rgba(178,75,243,0.15);  color: #B24BF3; }
    .suggestion-icon.cyan   { background: rgba(0,240,255,0.1);    color: #00F0FF; }

    .suggestion-text {
      line-height: 1.4;
      flex: 1;
      font-size: 13px;
      color: rgba(255,255,255,0.85);
    }

    /* ─────────────────────────────────── */
    /* 歷史面板                             */
    /* ─────────────────────────────────── */
    .history-panel {
      position: fixed;
      top: 80px;
      right: 20px;
      width: 350px;
      max-width: 90vw;
      max-height: 70vh;
      background: rgba(15, 15, 35, 0.95);
      backdrop-filter: blur(30px);
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
      display: none;
      flex-direction: column;
      z-index: 95;
      animation: slideInRight 0.3s;
    }

    @keyframes slideInRight {
      from {
        opacity: 0;
        transform: translateX(30px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    .history-panel.show {
      display: flex;
    }

    .history-header {
      padding: 16px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.15);
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: move;
    }

    .history-title {
      color: white;
      font-size: 16px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .history-close-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: none;
      background: rgba(255, 255, 255, 0.1);
      color: white;
      font-size: 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s;
    }

    .history-close-btn:hover {
      background: rgba(255, 255, 255, 0.2);
    }

    .history-content {
      flex: 1;
      overflow-y: auto;
      padding: 16px;
    }

    .history-item {
      margin-bottom: 16px;
      animation: fadeInUp 0.3s;
    }

    .history-user {
      background: rgba(0, 240, 255, 0.15);
      border: 1px solid rgba(0, 240, 255, 0.3);
      border-radius: 12px;
      padding: 10px 14px;
      color: white;
      font-size: 13px;
      line-height: 1.6;
      margin-bottom: 8px;
    }

    .history-ai {
      background: rgba(255, 45, 149, 0.15);
      border: 1px solid rgba(255, 45, 149, 0.3);
      border-radius: 12px;
      padding: 10px 14px;
      color: white;
      font-size: 13px;
      line-height: 1.6;
    }

    .history-label {
      font-size: 11px;
      font-weight: 600;
      opacity: 0.7;
      margin-bottom: 4px;
    }

    .history-empty {
      text-align: center;
      padding: 40px 20px;
      color: rgba(255, 255, 255, 0.5);
      font-size: 14px;
    }

    /* ── 冒險紀錄 Tab ── */
    .history-tabs {
      display: flex;
      gap: 6px;
      padding: 10px 14px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      flex-shrink: 0;
    }
    .htab {
      flex: 1; padding: 7px 10px;
      border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.05);
      color: rgba(255,255,255,0.5);
      font-size: 12px; font-weight: 600;
      cursor: pointer; transition: all 0.2s;
      font-family: inherit;
    }
    .htab.active {
      background: rgba(255,45,149,0.15);
      border-color: rgba(255,45,149,0.4);
      color: #FF2D95;
    }

    /* ── 關卡進度卡片 ── */
    .quest-card {
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 12px;
      padding: 12px 14px;
      margin-bottom: 8px;
      transition: border-color 0.2s;
    }
    .quest-card.completed { border-color: rgba(74,222,128,0.2); }
    .quest-card.inProgress { border-color: rgba(96,165,250,0.3); }
    .quest-header {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 6px;
    }
    .quest-status { display:flex; align-items:center; flex-shrink: 0; }
    .quest-title { font-size: 13px; font-weight: 600; color: white; flex: 1; }
    .quest-time { font-size: 10px; color: rgba(255,255,255,0.4); }
    .quest-gallery {
      display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
    }
    .quest-thumb {
      width: 52px; height: 52px;
      border-radius: 8px; object-fit: cover;
      border: 1px solid rgba(255,45,149,0.2);
      cursor: pointer; transition: transform 0.2s;
    }
    .quest-thumb:hover { transform: scale(1.08); }
    .quest-thumb-placeholder {
      width: 52px; height: 52px;
      border-radius: 8px;
      background: rgba(255,255,255,0.05);
      border: 1px dashed rgba(255,45,149,0.2);
      display: flex; align-items: center; justify-content: center;
      font-size: 20px; cursor: pointer;
    }
    .quest-retrigger {
      width: 100%; padding: 7px;
      border-radius: 8px;
      background: rgba(255,45,149,0.1);
      border: 1px solid rgba(255,45,149,0.25);
      color: rgba(255,255,255,0.8);
      font-size: 11px; font-weight: 600;
      cursor: pointer; transition: all 0.2s;
      font-family: inherit;
      display: flex; align-items: center; justify-content: center; gap: 5px;
    }
    .quest-retrigger:hover {
      background: rgba(255,45,149,0.2);
      border-color: rgba(255,45,149,0.5);
      color: white;
    }

      @keyframes arPulse {
        0%, 100% {
          opacity: 1;
          transform: translateX(-50%) scale(1);
        }
        50% {
          opacity: 0.8;
          transform: translateX(-50%) scale(1.05);
        }
      }





      @keyframes arPulse {
        0%, 100% {
          opacity: 1;
          transform: translateX(-50%) scale(1);
        }
        50% {
          opacity: 0.8;
          transform: translateX(-50%) scale(1.05);
        }
      }



    /* ─────────────────────────────────── */
    /* 響應式設計 - 手機版                 */
    /* ─────────────────────────────────── */
    @media (max-width: 768px) {
      .emotion-tag {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 12px;
      }

      #emotionIcon {
        font-size: 18px;
      }

      .vtuber-display {
        padding: 20px;
      }

      .canvas-container {
        position: fixed;
        width: 100%;
        height: 100svh; /* svh = small viewport，不含鍵盤 */
        height: 100vh;  /* 降級 */
        max-width: none;
        max-height: none;
        top: 0;
        left: 0;
      }

      .dialogue-container {
        bottom: 160px;
        max-width: 92%;
      }

      .dialogue-bubble {
        font-size: 14px;
        padding: 14px 18px;
      }

      .bottom-bar {
        padding: 12px 15px;
        gap: 10px;
      }

      .chat-input {
        font-size: 14px;
        padding: 10px 16px;
      }

      .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
      }

      .action-buttons {
        gap: 8px;
      }

      .suggestions-panel {
        bottom: 140px;
        width: 94%;
        padding: 16px;
      }

      .suggestions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .suggestion-card {
        font-size: 13px;
        padding: 12px 14px;
      }

      .history-panel {
        right: 10px;
        left: 10px;
        width: auto;
        top: 70px;
      }

      .welcome-content {
        padding: 30px 35px;
        max-width: 90%;
      }

      .welcome-icon {
        font-size: 60px;
      }

      .welcome-title {
        font-size: 24px;
      }

      .welcome-subtitle {
        font-size: 14px;
      }
    }

    /* AR 掃描層 - 平板 */
      .ar-close-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
      }
      
      .ar-hint {
        bottom: 20px;
        font-size: 14px;
        padding: 12px 20px;
      }
    

    @media (max-width: 480px) {
      .canvas-container {
        width: 100%;
        height: 100svh; /* svh = small viewport，不含鍵盤 */
        height: 100vh;  /* 降級 */
        max-width: none;
        max-height: none;
        top: 0;
        left: 0;
      }

      .dialogue-container {
        bottom: 150px;
      }

      .suggestions-panel {
        bottom: 130px;
      }

      .action-buttons .icon-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
      }

      .welcome-content {
        padding: 25px 30px;
      }

      .welcome-icon {
        font-size: 50px;
      }

      .welcome-title {
        font-size: 22px;
      }

      /* AR 掃描層 - 手機 */
      .ar-controls {
        top: 10px;
        right: 10px;
      }
      
      .ar-close-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
      }
      
      .ar-hint {
        bottom: 15px;
        left: 10px;
        right: 10px;
        transform: none;
        font-size: 13px;
        padding: 10px 15px;
      }
      
     /* 🆕 AR pulse 動畫調整 */
      @keyframes arPulse {
        0%, 100% {
          opacity: 1;
          transform: scale(1);  /* 手機版不用 translateX */
        }
        50% {
          opacity: 0.8;
          transform: scale(1.05);
        }
      }
    }

    /* ─────────────────────────────────── */
    /* iOS Safari 專屬修正                  */
    /* @supports (-webkit-touch-callout)   */
    /* 只有 iOS Safari 會套用              */
    /* ─────────────────────────────────── */
    @supports (-webkit-touch-callout: none) {
      /* 鍵盤彈出時 bottom-bar 透過 JS visualViewport 控制，
         這裡只設定靜態 safe-area 間距 */
      .bottom-bar {
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
        /* transition 讓 translateY 移動平滑 */
        transition: transform 0.15s ease-out;
        will-change: transform;
      }

      /* iOS 上輸入框 font-size 至少 16px 防止自動縮放 */
      .chat-input {
        font-size: 16px;
      }
    }
      
