/* ========== 全局与 CSS 变量 ========== */
:root {
    --glow-color: rgba(255, 165, 0, 0.05);
    --glow-size: 40%;
    --turn-count: 0;
    /* Safe Area 变量 */
    --sab: env(safe-area-inset-bottom, 0px);
    --sat: env(safe-area-inset-top, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    /* 根治 100vh 毒瘤：用固定高度由 JS 设置，CSS 兜底用 dvh */
    height: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    background: linear-gradient(135deg, #1a1035 0%, #160d2e 30%, #1c1040 60%, #130e2a 100%);
    overflow: hidden;
}

body {
    height: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    overflow: hidden;
    background: transparent;
    color: #E0E0E0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "OPPOSans", "HarmonyOS Sans SC", "MiSans", "Helvetica Neue", "Noto Sans SC", sans-serif;
    display: flex;
    flex-direction: column;
    /* 关键：禁止 body 被键盘推动 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

/* ========== 主应用容器 ========== */
#app {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* 关键：允许 flex 子项收缩 */
    overflow: hidden;
    position: relative;
    /* JS 会动态设置 height，这里做兜底 */
    height: 100%;
}
/* 加载页主体容器（居中和堆叠） */
#logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 1001;
    /* 新增垂直堆叠布局 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* 标题和标语之间的间距 */
}

/* 核心标题 (光愈) - 动态流体放大及绝对居中校准 */
#logo-text {
    font-size: clamp(70px, 22vw, 160px) !important; 
    white-space: nowrap !important; 
    font-weight: 900;
    color: #FFF;
    
    /* 这是导致偏左的罪魁祸首 */
    letter-spacing: clamp(5px, 2vw, 5px); 
    
    /* 核心修复：用等量的左侧补偿，把文字向右顶回绝对中心 */
    padding-left: clamp(10px, 2vw, 15px);
    
    line-height: 1.1;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 
                 0 0 60px rgba(200, 160, 255, 0.4), 
                 0 0 100px rgba(200, 160, 255, 0.2);
    animation: titleBreathe 4s infinite ease-in-out; 
}
@keyframes titleBreathe {
    0%, 100% { opacity: 0.8; filter: blur(3px); transform: scale(0.98); }
    50%      { opacity: 1; filter: blur(0px); transform: scale(1.02); }
}
/* 核心标语 - 强制单行 + 动态极光渐变 */
.subtitle {
    font-family: "PingFang SC", "OPPOSans", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", sans-serif !important;
    font-size: clamp(16px, 4.5vw, 28px) !important; 
    font-weight: 300;
    letter-spacing: clamp(4px, 1.5vw, 8px);
    white-space: nowrap !important; 
    
    background: linear-gradient(90deg, #FFB7B2, #E2A9F3, #9CB4F4, #B2F0E6, #FFB7B2);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    
    /* 核心：新增初始隐藏，防止闪烁 */
    opacity: 0; 

    /* 核心修复：新增 fadeInSubtitle 动画 (0.5s单次)，并给 subtitleBreathe 增加 0.5s 的延迟 */
    animation: fadeInSubtitle 1.5s ease-out forwards, 
               gradientFlow 4s linear infinite, 
               subtitleBreathe 5s infinite ease-in-out 1.5s; /* 增加 0.5s 延迟，等待淡入完成 */
}

@keyframes gradientFlow {
    to { background-position: 200% center; }
}
/* 背景图层：opacity 由 JS 随对话轮次渐进控制 */
#bg-layer {
    position: fixed;
    inset: 0;
    z-index: -3;
    background: url('images/bg2.jpg') center / cover no-repeat;
    opacity: 0.2;
    transition: opacity 1.5s ease-in-out;
    pointer-events: none;
}

/* 动态环境光图层 */
#ambient-light {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(circle at center, var(--glow-color) 0%, transparent var(--glow-size));
    transition: all 1.5s ease-in-out;
    pointer-events: none;
}

/* 破晓层：opacity 由 JS 直接控制 —— 多层渐变 + 滤色混合，模拟真实破晓 */
#dawn-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        /* 第一层：底部白金曝光核心 —— 太阳越过地平线，铺满下半屏 */
        radial-gradient(ellipse 200% 90% at 50% 100%,
            rgba(255, 252, 240, 1) 0%,
            rgba(255, 235, 190, 0.9) 20%,
            rgba(255, 200, 130, 0.7) 40%,
            rgba(255, 170, 80, 0.4) 60%,
            transparent 85%
        ),
        /* 第二层：暖橙大气散射 —— 从底部蔓延到屏幕 3/4 处 */
        radial-gradient(ellipse 250% 120% at 50% 110%,
            rgba(255, 140, 50, 0.9) 0%,
            rgba(255, 100, 30, 0.7) 25%,
            rgba(245, 70, 60, 0.5) 45%,
            rgba(220, 50, 100, 0.25) 65%,
            transparent 85%
        ),
        /* 第三层：玫瑰紫高空折射 —— 铺满整个屏幕上部，只留顶端一丝夜色 */
        radial-gradient(ellipse 300% 160% at 50% 120%,
            rgba(230, 70, 150, 0.55) 0%,
            rgba(180, 50, 200, 0.4) 30%,
            rgba(120, 40, 180, 0.25) 55%,
            rgba(70, 25, 140, 0.1) 75%,
            transparent 92%
        ),
        /* 第四层：全屏暖色大气底色 —— 确保上方也被微光浸透 */
        linear-gradient(to top,
            rgba(255, 200, 120, 0.3) 0%,
            rgba(200, 100, 160, 0.15) 40%,
            rgba(100, 50, 140, 0.08) 70%,
            transparent 90%
        );
    mix-blend-mode: screen; /* 滤色混合：让光效叠加而非覆盖，越亮越通透 */
    opacity: 0;
    transition: opacity 4s cubic-bezier(0.16, 1, 0.3, 1); /* 4秒缓慢渐亮，先慢后快再柔 */
    pointer-events: none;
}

/* ========== 加载仪式 ========== */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.breathing-light {
    color: rgba(255, 255, 255, 0.95);
    font-size: 42px;
    letter-spacing: 10px;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.7), 0 0 60px rgba(200, 160, 255, 0.4);
    animation: breathe 3s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; filter: blur(3px); transform: scale(0.98); }
    50% { opacity: 1; filter: blur(0px); transform: scale(1.02); }
}

.explode {
    transform: scale(20);
    opacity: 0;
    pointer-events: none;
}

/* ========== 聊天区与输入区 ========== */
#content {
    flex: 1;
    min-height: 0; /* 关键：让 flex 子项可收缩 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-top: calc(20px + var(--sat));
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth; /* 核心平滑魔法 */
}

#message-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-bottom: 20px;
    /* 确保聊天记录不会被强光幕布吞没 */
    position: relative;
    z-index: 160; /* 必须高于 .report-backdrop 的 150 */
}

.message {
    margin: 5px 0;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.6;
    font-size: 14px;
    backdrop-filter: blur(5px);
    /* 文字描边：破晓亮起时保证可读性 */
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ai-message {
    background: rgba(10, 8, 26, 0.55);
    border-left: 2px solid rgba(255, 255, 255, 0.3);
    align-self: flex-start;
    margin-right: auto;
}

/* ========== 用户的对话气泡：透明淡黄色暖光 ========== */
.user-message {
    background: rgba(255, 245, 180, 0.15);
    border: 1px solid rgba(255, 245, 180, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
    text-align: left;
}

#input-container {
    padding: 10px 20px calc(10px + var(--sab)) 20px;
    background: linear-gradient(to top, rgba(10, 8, 26, 1) 50%, rgba(10, 8, 26, 0));
    flex-shrink: 0;
    /* 关键：不让输入区被推走 */
    position: relative;
    z-index: 100;
}

.input-wrapper {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    align-items: center;
    gap: 8px;
    position: relative; /* 作为精灵的定位锚点 */
}

#input-box {
    flex: 1;
    box-sizing: border-box;
    height: auto;
    min-height: 48px;
    padding: 12px 20px;
    line-height: 1.5;
    font-size: 16px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

#input-box:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 165, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.1);
}

/* 终极灵动发送按钮：粒子星火图标 */
#send-button {
    background: none; /* 彻底移除背景 */
    border: none;
    padding: 0;
    margin-left: 2px;
    width: 44px; /* 增大点击区域 */
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    outline: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent; /* 移除 iOS 点击高亮蓝框 */
}

/* SVG 图标本身的基础样式 */
#send-button svg {
    width: 80px;
    height: 80px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 4px rgba(200, 160, 255, 0.4)); /* 增加微弱发光 */
}

/* SVG 内部粒子的色彩与动画 */
.sparkle-core {
    /* 使用我们经典的极光渐变色 */
    fill: linear-gradient(135deg, #FFB7B2 0%, #E2A9F3 50%, #9CB4F4 100%); 
    /* 兜底颜色 */
    fill: #FFF; 
    animation: sparkleBreathe 3s infinite ease-in-out;
}

.sparkle-dot-1, .sparkle-dot-2 {
    fill: rgba(200, 160, 255, 0.7);
    animation: sparkleDots 4s infinite ease-in-out;
}
.sparkle-dot-2 { animation-delay: 1s; }

.sparkle-trail {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-dasharray: 10;
    stroke-dashoffset: 10;
    transition: stroke-dashoffset 0.3s ease;
}

/* --- 交互状态 --- */

/* 悬停/聚焦：光芒增强，粒子扩散 */
#send-button:hover svg, #send-button:focus svg {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(200, 160, 255, 0.8));
}
#send-button:hover .sparkle-trail, #send-button:focus .sparkle-trail {
    stroke-dashoffset: 0; /* 轨迹显现 */
    stroke: rgba(255, 255, 255, 0.6);
}

/* 点击：模拟“咻”地发射反馈 */
#send-button:active {
    transform: scale(0.9);
}

/* --- 专属动画 Keyframes --- */
@keyframes sparkleBreathe {
    0%, 100% { opacity: 0.8; transform: scale(0.95); fill: #E2A9F3; }
    50%      { opacity: 1; transform: scale(1.05); fill: #FFF; }
}

@keyframes sparkleDots {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 0.9; transform: translateY(-2px); }
}

/* ========== 光愈精灵 ========== */
#healer-spirit {
    position: absolute; /* 相对于 .input-wrapper (form) 定位 */
    left: 0;
    bottom: calc(100% + 5px); /* 悬浮在输入框正上方，间距稳定 */
    width: 64px;
    height: 64px;
    z-index: 50;
    pointer-events: none;
    animation: spiritBob 4s ease-in-out infinite;
}

#spirit-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    animation: spiritGlow 3s ease-in-out infinite;
}

/* 漂浮动画 */
@keyframes spiritBob {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

/* 光晕呼吸动画 */
@keyframes spiritGlow {
    0%, 100% {
        filter:
            drop-shadow(0 0 6px rgba(255, 215, 0, 0.6))
            drop-shadow(0 0 14px rgba(255, 215, 0, 0.3))
            drop-shadow(0 0 6px rgba(209, 196, 233, 0.4));
    }
    50% {
        filter:
            drop-shadow(0 0 14px rgba(255, 215, 0, 1))
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.6))
            drop-shadow(0 0 20px rgba(209, 196, 233, 0.8));
    }
}

/* 思考态：停止漂浮，光晕锁定最大值 */
#healer-spirit.thinking {
    animation: none;
    transform: translateY(-8px);
}

#healer-spirit.thinking #spirit-img {
    animation: none;
    filter:
        drop-shadow(0 0 14px rgba(255, 215, 0, 1))
        drop-shadow(0 0 30px rgba(255, 215, 0, 0.6))
        drop-shadow(0 0 20px rgba(209, 196, 233, 0.8));
}

/* ========== 快捷回复 ========== */
.quick-replies-container {
    display: flex;
    gap: 10px;
    margin-left: 120px;
    width: calc(100% - 84px);
    padding: 0 10px 10px 0;
    overflow-x: auto;
	white-space: nowrap; /* 强制在一行显示 */
    scrollbar-width: none;
    scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch; /* 🌟 苹果设备丝滑滚动必备 */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 100%);
}
.quick-replies-container::-webkit-scrollbar {
    display: none;
}
.quick-reply-btn {
    white-space: nowrap;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 20px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(6px);
    animation: quickReplyAppear 0.4s ease forwards;
}
.quick-reply-btn:active {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

@keyframes quickReplyAppear {
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 动作神态描写 ========== */
.action-text {
    color: #FFD700 !important;
    font-style: italic !important;
    opacity: 0.9 !important;
}

/* ========== 热词：柔和紫色背景呼吸效果 ========== */
.keyword-breathe {
    display: inline;
    padding: 0;
    margin: 0;
    /* 字体颜色保持与周围文字一致，不突兀 */
    color: inherit;
    font-weight: 500;
    text-shadow: none;
    text-shadow: none !important;
    box-shadow: none !important;
    background: transparent !important;
    animation: purpleBreathe 2.5s ease-in-out infinite alternate;
}

@keyframes purpleTextBreathe {
    0% {
        text-shadow: 0 0 4px rgba(147, 112, 219, 0.4), 0 0 8px rgba(147, 112, 219, 0.2);
    }
    100% {
        /* 光晕扩散，层次丰富 */
        text-shadow: 0 0 10px rgba(147, 112, 219, 0.9), 
                     0 0 20px rgba(147, 112, 219, 0.6), 
                     0 0 30px rgba(200, 160, 255, 0.4);
        color: #FFFFFF; /* 呼吸到最亮时，字芯变成极其耀眼的纯白 */
    }
}

/* ========== 内嵌纵向快捷回复 ========== */
.inline-replies-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-top: 3px;
    margin-bottom: 10px;
    margin-left: 10px;
}

.inline-reply-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(200, 160, 255, 0.4);
    color: #D1C4E9;
    padding: 5px 10px;
    border-radius: 8px 8px 8px 2px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0;
    transform: translateY(6px);
    animation: inlineReplyAppear 1s ease forwards;
    animation-delay: 1s; /* 延迟 1s 后开始，1s 内渐现 */
}

.inline-reply-btn:active {
    background: rgba(200, 160, 255, 0.2);
}

@keyframes inlineReplyAppear {
    to { opacity: 1; transform: translateY(0); }
}
/* 为标语新增细微的呼吸动画 */
@keyframes subtitleBreathe {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}
/* 新增：副标题 0.5s 渐渐出现动画 */
@keyframes fadeInSubtitle {
    0%   { opacity: 0; }
    100% { opacity: 0.6; } /* 渐现到我们设定的 breathe 动画最低点 */
}

/* ========== 商业化：破晓极光毛玻璃幕布 (修复闪烁与高斯模糊) ========== */
.report-backdrop {
    position: fixed; /* 🌟 修改：必须用 fixed 覆盖全屏，不管怎么滑 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 核心：从头到尾固定使用这个温柔的琥珀色渐变背景，绝不切换，防止跳闪 */
    background: radial-gradient(circle at center, rgba(255, 250, 240, 0.95) 0%, rgba(255, 225, 190, 0.75) 100%);

    /* 👇 核心：开启高斯模糊，把背后的聊天气泡"虚化"掉 */
    // backdrop-filter: blur(5px);
    // -webkit-backdrop-filter: blur(5px);

    /* 默认低于聊天气泡 (160)，只做背景光 */
    z-index: 150;

    /* 使用 2.5 秒的 ease-out，让光线和模糊感极其缓慢、柔和地扩散 */
    animation: burstOfLight 6s ease-out forwards;
}

/* 🌟 核心新增：当报告弹出时，强力覆盖模式，盖住一切气泡 */
.report-backdrop.cover-all {
    z-index: 190 !important;
}

/* 纯靠光学滤镜制造极度丝滑的光线变化，彻底杜绝闪烁 */
@keyframes burstOfLight {
    0% {
        opacity: 0;
        filter: brightness(3) contrast(0.5); /* 初始状态：极亮泛白，模拟刺眼晨光 */
    }
    40% {
        opacity: 1;
        filter: brightness(1.5) contrast(0.9); /* 光线充满屏幕，开始温柔地收敛 */
    }
    100% {
        opacity: 1;
        filter: brightness(1) contrast(1); /* 最终沉淀为舒服、不刺眼的暖光 */
    }
}

/* ========== 商业化收银台 UI ========== */
.action-btn-wrapper {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 250 !important;
    
}
/* ========== 商业化：按钮垂直居中拦截模式 ========== */
.action-btn-wrapper.centered-mode {
    /* 移除底部定位限制 */
    bottom: auto;
    /* 相对于全屏高度定位 */
    position: fixed;
    top: 50%;
    left: 0;
    width: 100%;
    /* 配合 translate 物理垂直居中 */
    transform: translateY(-50%);
    /* 保证高于聊天气泡 */
    z-index: 210;
    padding: 0 10%;
}

.glow-btn { background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 30px; padding: 15px 35px; color: #fff; font-size: 1.1rem; letter-spacing: 2px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 20px rgba(255, 215, 0, 0.15), inset 0 0 15px rgba(255, 255, 255, 0.05); animation: pulseGlow 2s infinite alternate; transition: all 0.3s ease; cursor: pointer; }
@keyframes pulseGlow { 0% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.05); } 100% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1); transform: scale(1.02); } }

/* ========== 商业化：淡紫光晕磨砂按钮 ========== */
.claim-btn-special {
    width: 100%;
    max-width: 450px;
    /* 极淡的紫色背景，通透感 */
    background: linear-gradient(135deg, rgba(235, 225, 255, 0.8), rgba(215, 200, 255, 0.6));
    /* 稍深的紫色描边勾勒轮廓 */
    border: 1px solid rgba(170, 130, 255, 0.7);
    border-radius: 25px;
    padding: 16px 0;
    /* 文字改为深紫色，保证在浅色背景上的清晰度与高级感 */
    color: #4a3b72;
    font-size: 1.15rem;
    font-weight: bold;
    letter-spacing: 2px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    /* 淡紫色发光光晕 */
    box-shadow: 0 8px 32px rgba(180, 150, 255, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.6);
    animation: pulseLightPurple 2.5s infinite alternate, fadeInModal 1s ease forwards;
}

@keyframes pulseLightPurple {
    0% { box-shadow: 0 5px 20px rgba(180, 150, 255, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.4); }
    100% { box-shadow: 0 10px 40px rgba(190, 160, 255, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.8); transform: translateY(-2px); }
}

/* ========== 商业化：晨曦极光收银台卡片 ========== */
.glass-modal {
    position: absolute;
    /* 为了给顶部的精灵留出空间，距离顶部多留一点 */
    bottom: 5vh;
    left: 5%;
    width: 90%;
    max-height: none;
    /* 👇 核心：解除截断封印，让精灵突破边界 */
    overflow: visible;

    /* 👇 核心修改：使用背景图，并确保完美覆盖卡片 */
    background-image: url('images/card_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    /* 阴影改为带有暖色调的高级弥散阴影 */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 228, 196, 0.3);
    z-index: 250 !important;
    animation: slideUpModal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    /* 👇 核心：因为背景变亮了，全局文字必须变成深色才看得清 */
    color: #5D4037; /* 温暖的深棕褐色 */
}

/* 强制覆盖卡片内所有标题的颜色 */
.glass-modal h3, .glass-modal h4 {
    color: #663333 !important; /* 深紫褐色标题 */
    text-shadow: none !important; /* 去除之前暗黑模式的发光字效果 */
}

/* 强制覆盖卡片内段落文字颜色 */
.glass-modal p {
    color: #6d5d55 !important;
}

/* 定制高级感的透明细滚动条，转移到 .modal-scroll-area 上 */
.modal-scroll-area::-webkit-scrollbar { width: 4px; }
.modal-scroll-area::-webkit-scrollbar-track { background: transparent; }
.modal-scroll-area::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }

/* 新增：真正的滚动区域 */
.modal-scroll-area {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 60px 20px 30px;
    text-align: center;
	scrollbar-width: none;
}
@keyframes slideUpModal { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }

/* ========== 精灵悬浮头像 (破形设计) ========== */
.sprite-avatar-wrapper {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    z-index: 210;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 260 !important;
}

.sprite-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    border: none;
    box-shadow: none;
    opacity: 0.8;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4)) drop-shadow(0 0 25px rgba(225, 190, 231, 0.3));
    animation: floatSprite 3s ease-in-out infinite;
}

@keyframes floatSprite {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); } /* 增加一点呼吸浮动的幅度 */
}

/* ========== 商业化：星轨之门炫酷按钮 (支付与海报通用) ========== */
/* 1. 共享深空背景与外发光容器 */
#pay-unlock-btn,
#generate-poster-btn {
    position: relative;
    z-index: 250 !important;
    background: linear-gradient(135deg, #1a0b2e 0%, #4a148c 50%, #120822 100%) !important;
    background-size: 200% 200% !important;
    animation: cosmicBg 4s ease infinite;

    border: 1px solid rgba(225, 190, 231, 0.4) !important;
    box-shadow: 0 5px 20px rgba(147, 112, 219, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.1) !important;
    border-radius: 50px !important;

    width: 85%;
    padding: 16px 0 !important;
    margin: 20px auto 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

/* 按钮背景的深空流转动画 */
@keyframes cosmicBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. 共享文字白金跑马灯流光 */
#pay-unlock-btn .price,
#pay-unlock-btn .action,
#generate-poster-btn .btn-text,
#generate-poster-btn .icon {
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 215, 0, 1) 20%,   /* 耀眼金 */
        rgba(255, 255, 255, 1) 50%,   /* 纯白高光中心 */
        rgba(255, 215, 0, 1) 80%,   /* 耀眼金 */
        rgba(255, 255, 255, 0.6) 100%
    );
    background-size: 200% auto;

    color: transparent !important;
    -webkit-background-clip: text;
    background-clip: text;

    animation: btnTextShine 2s linear infinite;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 3. 各自的内部元素微调 */
#pay-unlock-btn .price { font-size: 1.3rem; margin-right: 15px; }
#pay-unlock-btn .action { font-size: 1.15rem; }
#pay-unlock-btn .divider {
    width: 1px; height: 18px;
    background: rgba(255, 215, 0, 0.3) !important;
    margin: 0 15px 0 0;
}

#generate-poster-btn .btn-text { font-size: 1.15rem; }
#generate-poster-btn .icon { font-size: 1.2rem; margin-right: 8px; }

@keyframes btnTextShine {
    to { background-position: -200% center; }
}

.modal-inner { padding: 30px 20px; text-align: center; }
.header-icon { font-size: 2.5rem; margin-bottom: 10px; animation: floatIcon 3s ease-in-out infinite; }
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.modal-header h3 { font-size: 1.6rem; color: #FFD700; margin: 0 0 5px 0; font-weight: 900; letter-spacing: 2px; text-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
.modal-header .subtitle { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); margin: 0; }

/* ========== 内部白底磨砂面板 (图文卡片风格) ========== */
.report-panels-container {
    background: rgba(255, 255, 255, 0.45); /* 核心：半透明白底 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 20px 15px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 0 10px rgba(255, 255, 255, 0.6);
	scrollbar-width: none;
    text-align: left;
}

.panel-section { position: relative; }
.panel-title { font-size: 1rem; color: #5D4037 !important; margin-bottom: 8px; font-weight: bold; }

/* --- 免费预览区 --- */
.report-preview { margin: 0; padding: 0; }
#report-content { font-size: 0.9rem; color: #6d5d55 !important; line-height: 1.8; margin: 0; min-height: 40px; }

/* --- 分割线 --- */
.panel-divider { height: 1px; background: rgba(109, 93, 85, 0.15); margin: 15px 0; }

/* --- 锁定区 --- */
.locked-area { margin: 0; padding: 0; border: none; position: relative; }
.locked-blur-content { position: relative; }

/* 核心魔法：使用 filter: blur 把文字变模糊 */
.locked-blur-content p {
    font-size: 0.9rem;
    color: #6d5d55 !important;
    line-height: 1.6;
    margin: 0;
    filter: blur(5px);
    opacity: 0.7;
    user-select: none; /* 防止用户去复制模糊的文字 */
}

/* 居中悬浮的磨砂小圆锁 */
.lock-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.lock-icon-wrapper .lock-icon { font-size: 1.2rem; margin: 0; display: block; }

.pay-btn { background: linear-gradient(90deg, #CE93D8, #FFCC80); border: none; border-radius: 50px; width: 85%; padding: 16px 0; margin: 20px auto 10px; display: flex; align-items: center; justify-content: center; color: #1a1a2e; font-weight: bold; font-size: 1.15rem; box-shadow: 0 5px 20px rgba(255, 204, 128, 0.4); cursor: pointer; }
.pay-btn .price { font-size: 1.3rem; margin-right: 15px; }
.pay-btn .divider { width: 1px; height: 18px; background: rgba(0,0,0,0.2); margin-right: 15px; }
.guarantee { font-size: 0.75rem; color: rgba(255, 255, 255, 0.4); margin: 10px; }

/* ========== 商业化：海报生成区 UI ========== */
.poster-actions { margin-top: 30px; display: flex; flex-direction: column; align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 25px; }
.poster-btn { width: 85%; padding: 16px 0; margin-bottom: 10px; box-shadow: 0 5px 20px rgba(147, 112, 219, 0.3); }

.poster-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 5, 25, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); z-index: 500; display: flex; justify-content: center; align-items: center; animation: fadeInModal 0.5s ease; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.poster-display { position: relative; width: 80%; text-align: center; }
.poster-img { width: 100%; height: auto; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 175, 55, 0.15); }
.poster-display .close-btn { position: absolute; top: -45px; right: -15px; background: none; border: none; color: rgba(255, 255, 255, 0.6); font-size: 2.5rem; font-weight: 200; cursor: pointer; }
.save-instruction { color: rgba(255, 255, 255, 0.5); font-size: 0.8rem; margin-top: 5px; letter-spacing: 1px; }

/* ========== 光愈专属：正在倾听流光文字 (彻底去脏提亮版) ========== */
.listening-glow-text {
    font-size: 0.85rem;
    font-weight: 500;

    /* 🌟 核心杀手锏：强行干掉父级气泡传下来的黑色文字阴影！ */
    text-shadow: none !important;

    /* 🌟 核心：移除 filter: drop-shadow，防止部分手机浏览器渲染出黑框 */
    filter: none !important;

    /* 👇 提高基础亮度，从 0.5 调到 0.8，让没亮起的时候也是干净的白色 */
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.8) 40%,
        rgba(255, 235, 150, 1) 47%,    /* 香槟金更饱满 */
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 235, 150, 1) 53%,
        rgba(255, 255, 255, 0.8) 60%,
        rgba(255, 255, 255, 0.8) 100%
    );
    background-size: 200% auto;

    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;

    -webkit-text-stroke: 0;
    text-stroke: 0;

    animation: shineGlowText 2s linear infinite;
    letter-spacing: 1px;
    display: inline-block;
}

/* 保留动画逻辑 (不需要动) */
@keyframes shineGlowText {
    to {
        background-position: -200% center;
    }
}

/* ========== 全局组件：高级星空 Toast 提示 ========== */
.starry-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 11, 46, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(225, 190, 231, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 215, 0, 0.1);
    border-radius: 25px;
    padding: 14px 28px;
    color: #F8E8FF;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: toastFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    white-space: nowrap;
    letter-spacing: 1px;
}

.starry-toast.fade-out {
    animation: toastFadeOut 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translate(-50%, -30%); filter: blur(4px); }
    to { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
    to { opacity: 0; transform: translate(-50%, -70%); filter: blur(4px); }
}

/* ========== 潜意识测验：SVG 艺术卡片 ========== */
.svg-message-card {
    background: rgba(25, 15, 45, 0.4) !important; /* 深邃通透的星空底 */
    border: 1px solid rgba(225, 190, 231, 0.3) !important;
    border-radius: 20px !important;
    padding: 20px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 15px 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
    animation: floatSvgCard 4s ease-in-out infinite alternate, quickReplyAppear 0.8s ease forwards;
}

/* 让 SVG 图形本身带有灵魂发光效果 */
.svg-message-card svg {
    width: 100%;
    max-width: 180px; /* 控制大小 */
    height: auto;
    filter: drop-shadow(0 0 15px rgba(226, 169, 243, 0.5));
    transition: transform 0.5s ease;
}

.svg-message-card:hover svg {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
}

@keyframes floatSvgCard {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-6px); }
}

/* ========== 商业化：最终引导白底卡片 ========== */
.final-greeting-card {
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    color: #333333;
    padding: 24px 20px;
    width: 88%;
    max-width: 420px;
    line-height: 1.8;
    font-size: 15px;

    /* 👇 核心大招：脱离父级铁箱子，改为 fixed 全屏居中悬浮 */
    position: fixed;
    top: 5vh; /* 悬浮在屏幕中偏上的位置 */
    left: 50%;
    transform: translateX(-50%);

    z-index: 220 !important; /* 彻底打破层叠限制，高于模糊幕布(190)和报告卡片(200) */
/* 🌟 1. 动画时长从 0.8s 拉长到 2.5s */
    animation: cardFloatUp 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    /* 🌟 2. 新增延迟：等背景光先亮 1.5秒，卡片再开始出场 */
    animation-delay: 1.5s; 
    /* 🌟 3. 新增初始透明度：配合延迟，保证卡片在出场前完全隐身 */
    opacity: 0; 
    
    transition: top 0.6s ease-in-out, padding 0.6s ease-in-out; 
}   

/* 🌟 核心新增：当领取报告后，卡片上浮到顶部 */
.final-greeting-card.repositioned {
    top: 50px;
    transform: translate(-50%, 0);
    padding: 14px 20px;
    overflow: hidden; /* 跑马灯必须 */
    background: linear-gradient(135deg, #FFFFFF, #FFF8F0);
}

/* 跑马灯文字容器 */
.final-greeting-card.repositioned .marquee-text {
    display: inline-block;
}

@keyframes marqueeScroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
/* 隐藏上浮后的动作文本 */
.final-greeting-card.repositioned .action-text { display: none; }

/* 同步修改动画，适配 transform: translateX 的居中属性 */
@keyframes cardFloatUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 适配白底的金色动作文本（稍微加深为暗金色，保证在白底上的对比度） */
.final-greeting-card .action-text,
.final-greeting-card span[style*="color:#FFD700"] {
    color: #D4A017 !important;
    font-weight: 600;
    text-shadow: none !important;
}
.final-greeting-card .text-bold-center {
  display: block;
  font-weight: 900;        /* 变粗 */
  text-align: center;      /* 居中 */
  font-size: 17px;
  color: #222;
  margin-top: 12px;
  letter-spacing: 1px;
}
/* ========== 全屏深度报告页 ========== */
#full-report-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* 极美的深空极光渐变背景 + 自适应背景图（50%透明度通过渐变叠加实现） */
    background:
        radial-gradient(ellipse at top center, rgba(43, 22, 77, 0.7) 0%, rgba(13, 7, 24, 0.7) 100%),
        url('images/report_bg.png') center / cover no-repeat;
    z-index: 300; /* 必须是当前最高，盖住所有卡片和幕布 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 50px 20px 80px;
    animation: fadeInReport 0.8s ease-out forwards;
}

@keyframes fadeInReport {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.full-report-content {
    max-width: 500px; margin: 0 auto; position: relative;
}

#close-full-report-btn {
    position: absolute; top: -30px; right: 0;
    background: none; border: none;
    color: rgba(255, 255, 255, 0.4); font-size: 36px; font-weight: 200;
    cursor: pointer; z-index: 310; transition: color 0.3s;
}
#close-full-report-btn:active { color: #fff; }

.full-report-header {
    text-align: center; margin-bottom: 10px;
}
.full-report-header .icon-top { font-size: 2.5rem; margin-bottom:5px; animation: floatIcon 3s ease-in-out infinite; }
.full-report-title {
    color: #FFD700; font-size: 1.8rem; letter-spacing: 2px;
    margin-bottom: 5px; text-shadow: 0 0 20px rgba(255, 215, 0, 0.3); font-weight: 400;
}
.full-report-date { color: rgba(255, 255, 255, 0.4); font-size: 0.9rem; letter-spacing: 1px; }

.full-report-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(225, 190, 231, 0.15);
    border-radius: 20px;
    padding: 25px 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
}

.full-report-section .section-title {
    color: #E2A9F3; font-size: 1.15rem; margin-bottom: 15px; font-weight: 500;
    display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(225, 190, 231, 0.2); padding-bottom: 12px;
}
.full-report-section .section-text {
    color: rgba(255, 255, 255, 0.85); font-size: 1rem; line-height: 1.9; letter-spacing: 0.5px; text-align: justify;
}

.full-poster-actions { margin-top: 40px; text-align: center; }

/* 全屏报告页：炫酷跑马灯海报按钮 */
#full-generate-poster-btn {
    width: 90%;
    padding: 18px 0 !important;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1035, #2b164d);
    border: 2px solid transparent;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    z-index: 1;
}

/* 跑马灯光边框 */
#full-generate-poster-btn::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 52px;
    background: conic-gradient(
        from var(--marquee-angle, 0deg),
        #FFD700, #E2A9F3, #AFEEEE, #FFB6C1, #FFD700
    );
    z-index: -2;
    animation: marqueeRotate 3s linear infinite;
}

/* 内部填充背景，露出边框跑马灯 */
#full-generate-poster-btn::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    border-radius: 48px;
    background: linear-gradient(135deg, #1a1035, #2b164d);
    z-index: -1;
}

@keyframes marqueeRotate {
    to { --marquee-angle: 360deg; }
}

/* 注册自定义属性以支持 conic-gradient 动画 */
@property --marquee-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* 按钮悬浮光晕 */
#full-generate-poster-btn:active {
    transform: scale(0.97);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4), 0 0 60px rgba(226, 169, 243, 0.2);
}
/* 小精灵容器 */
.elf-portal-area {
    text-align: center;
    margin: 5px 0;
}

/* 小精灵浮动与呼吸特效 */
.floating-elf {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
    animation: elfFloat 4s ease-in-out infinite, elfGlow 4s ease-in-out infinite;
}

@keyframes elfFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes elfGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8)); }
}

/* 白色文字+金色跑马灯特效链接 */
.marquee-link {
    color: white;
    font-size: 0.9rem;
    margin-top: 10px;
    cursor: pointer;
    display: inline-block;
    padding: 5px 15px;
    position: relative;
    letter-spacing: 2px;
    font-weight: bold;
    /* 金色跑马灯边框效果 */
    border: 1px solid transparent;
    background-image: linear-gradient(#1a1a2e, #1a1a2e), linear-gradient(90deg, #ffd700, #fff, #ffd700);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: 200% 100%;
    animation: marqueeMove 3s linear infinite;
    border-radius: 20px;
}

@keyframes marqueeMove {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* 微型详情模态框 */
.mini-modal {
    display: none;
    position: fixed;
    z-index: 10001; /* 高于全屏报告 */
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.mini-modal-content {
    background: rgba(40, 30, 60, 0.95);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #ffd700;
    width: 80%;
    max-width: 400px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.close-mini-modal {
    position: absolute;
    right: 15px; top: 10px;
    color: #ffd700;
    font-size: 28px;
    cursor: pointer;
}

#mbti-detail-text {
    max-height: 300px;
    overflow-y: auto;
    color: #eee;
    line-height: 1.6;
    font-size: 0.95rem;
}