/* ============================================================
   六位 AI 娘專屬瀏覽器主題美學 & 專屬場景背景（完美襯托去背立繪）
   ============================================================ */

/* 1. Claude 娘 — 暖羊皮紙貴族書房風 */
body[data-theme="claude"] {
  --chrome-frame: #e9e2d6;
  --chrome-bar: #fcfaf6;
  --chrome-border: #e2d9c8;
  --surface-bg: #F6F1E7;
  --surface-card: #FFFDFA;
  --chat-bg: #FAF6EE;
  --bubble-ai-bg: #FFFFFF;
  --bubble-user-bg: #3b2f2a;
  --bubble-user-text: #fdfaf5;
  --accent: #D97757;
  --accent-soft: rgba(217, 119, 87, 0.13);
  --text-main: #2a211c;
  --text-muted: #78695e;
}
body[data-theme="claude"] .msg-row.ai .msg-bubble { font-family: var(--font-serif); }
body[data-theme="claude"] .scene-bg-layer {
  background:
    radial-gradient(circle at 22% 24%, rgba(251, 191, 36, 0.34), transparent 52%),
    radial-gradient(circle at 80% 78%, rgba(217, 119, 87, 0.25), transparent 55%),
    linear-gradient(165deg, #2d2018 0%, #4c3324 55%, #7c4d35 100%);
}

/* 2. DeepSeek 娘 — 深海鯨魚極客書房風 */
body[data-theme="deepseek"] {
  --chrome-frame: #dfe7f7;
  --chrome-bar: #ffffff;
  --chrome-border: #d5e0f5;
  --surface-bg: #F2F6FF;
  --surface-card: #FFFFFF;
  --chat-bg: #F7FAFF;
  --bubble-ai-bg: #FFFFFF;
  --bubble-user-bg: #1e3a8a;
  --bubble-user-text: #ffffff;
  --accent: #4D6BFE;
  --accent-soft: rgba(77, 107, 254, 0.12);
  --text-main: #172554;
  --text-muted: #5b6d94;
}
body[data-theme="deepseek"] .scene-bg-layer {
  background:
    radial-gradient(circle at 75% 22%, rgba(96, 165, 250, 0.42), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(77, 107, 254, 0.32), transparent 55%),
    linear-gradient(165deg, #0f1f4b 0%, #1d3b8a 52%, #2b59c3 100%);
}

/* 3. Gemini 娘 — 紫藍星辰極光多模態風 */
body[data-theme="gemini"] {
  --chrome-frame: #e5e1f8;
  --chrome-bar: #ffffff;
  --chrome-border: #ded8f7;
  --surface-bg: #F5F3FF;
  --surface-card: #FFFFFF;
  --chat-bg: #FAF8FF;
  --bubble-ai-bg: #FFFFFF;
  --bubble-user-bg: #4c1d95;
  --bubble-user-text: #ffffff;
  --accent: #7C5CFF;
  --accent-soft: rgba(124, 92, 255, 0.13);
  --text-main: #1e1b4b;
  --text-muted: #6b6399;
}
body[data-theme="gemini"] .scene-bg-layer {
  background:
    radial-gradient(circle at 25% 20%, rgba(244, 114, 182, 0.36), transparent 48%),
    radial-gradient(circle at 78% 30%, rgba(56, 189, 248, 0.36), transparent 52%),
    linear-gradient(160deg, #1b1240 0%, #37207a 55%, #5b3cc4 100%);
}

/* 4. GPT 娘 — 聖潔雲端黃金露台風 */
body[data-theme="gpt"] {
  --chrome-frame: #e2e8e6;
  --chrome-bar: #ffffff;
  --chrome-border: #d8e2df;
  --surface-bg: #F5F7F6;
  --surface-card: #FFFFFF;
  --chat-bg: #FAFAFA;
  --bubble-ai-bg: #FFFFFF;
  --bubble-user-bg: #0f172a;
  --bubble-user-text: #ffffff;
  --accent: #10A37F;
  --accent-soft: rgba(16, 163, 127, 0.12);
  --text-main: #0f172a;
  --text-muted: #64748b;
}
body[data-theme="gpt"] .scene-bg-layer {
  background:
    radial-gradient(circle at 50% 18%, rgba(254, 243, 199, 0.72), transparent 56%),
    radial-gradient(circle at 82% 82%, rgba(16, 163, 127, 0.24), transparent 55%),
    linear-gradient(170deg, #93c5fd 0%, #dbeafe 46%, #fef3c7 100%);
}

/* 5. Grok 娘 — 哥德暗黑反叛霓虹天台風 */
body[data-theme="grok"] {
  --chrome-frame: #111218;
  --chrome-bar: #191b24;
  --chrome-border: #2c2f3f;
  --surface-bg: #12131a;
  --surface-card: #1b1d28;
  --chat-bg: #151720;
  --bubble-ai-bg: #222534;
  --bubble-user-bg: #E5A93C;
  --bubble-user-text: #111218;
  --accent: #E5A93C;
  --accent-soft: rgba(229, 169, 60, 0.16);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
}
body[data-theme="grok"] .browser-tab { background: rgba(255, 255, 255, 0.08); color: #9ca3af; }
body[data-theme="grok"] .browser-tab.active { background: #191b24; color: #fbbf24; }
body[data-theme="grok"] .omnibox { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); }
body[data-theme="grok"] .icon-tool-btn { background: rgba(255, 255, 255, 0.1); color: #e5e7eb; }
body[data-theme="grok"] .hud-chip { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); color: #f3f4f6; }
body[data-theme="grok"] .scene-bg-layer {
  background:
    radial-gradient(circle at 50% 18%, rgba(229, 169, 60, 0.36), transparent 48%),
    radial-gradient(circle at 20% 85%, rgba(220, 38, 38, 0.35), transparent 55%),
    linear-gradient(170deg, #0b0c14 0%, #1c1528 58%, #31121e 100%);
}
body[data-theme="grok"] .choice-btn { background: #1f2230; border-color: #34384d; color: #f3f4f6; }
body[data-theme="grok"] .choice-btn:hover:not(:disabled) { border-color: #E5A93C; background: rgba(229, 169, 60, 0.16); }
body[data-theme="grok"] .btn-stage-prompt { background: rgba(255, 255, 255, 0.09); color: #f3f4f6; border-color: rgba(255, 255, 255, 0.15); }

/* 6. 千問（Qwen）娘 — 江南西湖煙火水墨風 */
body[data-theme="qwen"] {
  --chrome-frame: #e2e4f3;
  --chrome-bar: #fcfcff;
  --chrome-border: #d5d9ef;
  --surface-bg: #F4F5FC;
  --surface-card: #FFFFFF;
  --chat-bg: #F9FAFE;
  --bubble-ai-bg: #FFFFFF;
  --bubble-user-bg: #312e81;
  --bubble-user-text: #ffffff;
  --accent: #5B4BE8;
  --accent-soft: rgba(91, 75, 232, 0.12);
  --text-main: #1e1b4b;
  --text-muted: #64698a;
}
body[data-theme="qwen"] .scene-bg-layer {
  background:
    radial-gradient(circle at 78% 22%, rgba(251, 146, 60, 0.36), transparent 45%),
    radial-gradient(circle at 24% 30%, rgba(165, 180, 252, 0.38), transparent 52%),
    linear-gradient(168deg, #1e1b4b 0%, #3730a3 52%, #6366f1 100%);
}

/* ==================== 立繪動態表情與異常狀態濾鏡 ==================== */
.portrait-frame.mood-happy .stage-portrait {
  animation: happyBounce 0.55s ease-out 1, idleBreath 3.5s ease-in-out 0.55s infinite;
  filter: saturate(1.12) brightness(1.04) drop-shadow(0 14px 24px rgba(244, 114, 182, 0.38));
}
@keyframes happyBounce {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

.portrait-frame.mood-shy .stage-portrait {
  filter: saturate(1.16) drop-shadow(0 0 22px rgba(251, 113, 133, 0.58));
}

.portrait-frame.mood-angry .stage-portrait {
  animation: angryShake 0.36s ease-in-out 2;
  filter: contrast(1.12) drop-shadow(0 0 22px rgba(239, 68, 68, 0.65));
}
@keyframes angryShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px) rotate(-1deg); }
  75% { transform: translateX(8px) rotate(1deg); }
}

.portrait-frame.mood-nerfed .stage-portrait {
  filter: grayscale(0.32) contrast(0.95) drop-shadow(0 10px 16px rgba(15, 23, 42, 0.25));
}

.portrait-frame.mood-busy .stage-portrait {
  filter: blur(1.5px) grayscale(0.6);
  animation: none;
}

.portrait-frame.mood-guardrail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; height: 3px;
  background: #ef4444; box-shadow: 0 0 14px #ef4444;
  z-index: 6; animation: scanLine 1.2s linear infinite;
}
@keyframes scanLine { 0% { top: 0%; } 100% { top: 100%; } }

body.incognito-active .browser-top-bar { background: #1f2430 !important; }
body.incognito-active .browser-address-bar { background: #282e3d !important; border-color: #3a4154 !important; color: #e2e8f0; }
