/* --- 暗夜·沉浸式交互引擎 V3 (Pro Max) --- */

ai {
    display: block;
    background: #050505;
    color: #cecece; /* 稍微提升亮度提高易读性 */
    /* 使用系统原生字体栈，确保最高清晰度 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #1a0a0a;
    line-height: 1.85;
    font-size: 16px;
    max-width: 95%;
    margin: 15px auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
    -webkit-font-smoothing: antialiased; /* 强制字体锐化 */
    -moz-osx-font-smoothing: grayscale;
}

/* 环境抬头 */
ai hd {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #833;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(128,0,0,0.15);
    margin-bottom: 25px;
    font-weight: 600;
}

/* --- 核心优化：呼吸灯光对话框 --- */
@keyframes borderPulse {
    0%, 100% { border-color: rgba(136, 0, 0, 0.6); box-shadow: 0 0 8px rgba(136, 0, 0, 0.2); }
    50% { border-color: rgba(255, 0, 0, 0.9); box-shadow: 0 0 18px rgba(255, 0, 0, 0.4); }
}

@keyframes borderPulseWhite {
    0%, 100% { border-color: rgba(60, 60, 60, 0.6); box-shadow: 0 0 8px rgba(255, 255, 255, 0.05); }
    50% { border-color: rgba(100, 100, 100, 0.9); box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }
}

ai q { 
    display: block; 
    margin: 20px 0; 
    padding: 14px 20px; 
    border-radius: 12px; 
    position: relative;
    transition: 0.3s;
}

/* NPC 对话：红色呼吸灯 */
ai q.ln { 
    border: 1px solid #800; 
    background: linear-gradient(95deg, rgba(40,0,0,0.3), rgba(0,0,0,0.2)); 
    color: #f5f5f5; 
    animation: borderPulse 4s infinite ease-in-out;
}

/* 玩家对话：银灰呼吸灯 */
ai q.pl { 
    border: 1px solid #444; 
    background: linear-gradient(265deg, rgba(30,30,30,0.3), rgba(0,0,0,0.2)); 
    text-align: right; 
    color: #eee; 
    animation: borderPulseWhite 5s infinite ease-in-out;
}

ai i { display: block; color: #777; font-style: italic; font-size: 15px; margin: 15px 35px; border-left: 2px solid #222; padding-left: 15px; letter-spacing: 0.5px; }
ai x { display: block; color: #600; text-align: center; font-size: 13px; font-weight: bold; margin: 30px 0; letter-spacing: 8px; opacity: 0.8; }

/* --- 手机浮窗 V2：灵动岛 & 玻璃质感 --- */
ai details.ph-v2 {
    margin: 40px auto;
    width: 300px;
    background: #000;
    border-radius: 48px;
    border: 5px solid #1a1a1a;
    box-shadow: 0 30px 70px rgba(0,0,0,1), inset 0 0 20px rgba(255,255,255,0.02);
    overflow: hidden;
    transition: 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

ai details.ph-v2 summary { list-style: none; padding: 20px 0; cursor: pointer; display: flex; justify-content: center; outline: none; }
ai details.ph-v2 summary::-webkit-details-marker { display: none; }

ai .island {
    width: 110px; height: 30px; background: #000; border-radius: 20px; border: 1px solid #1a1a1a;
    box-shadow: inset 0 0 5px rgba(255,255,255,0.1);
    transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
ai details.ph-v2[open] .island { width: 160px; height: 6px; background: #222; transform: translateY(5px); }

ai .screen {
    height: 440px;
    background: linear-gradient(180deg, #1f0a0a 0%, #080808 100%);
    position: relative;
    padding: 15px 20px;
    animation: screenWake 1.2s ease;
}
/* 增加屏幕顶部的玻璃反光 */
ai .screen::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

@keyframes screenWake { from { filter: brightness(0); } to { filter: brightness(1); } }

ai .status-bar { display: flex; justify-content: space-between; font-size: 12px; color: #fff; margin-bottom: 18px; font-weight: 600; }
ai .lock-date { text-align: center; font-size: 13px; color: #ff4d4d; margin-bottom: 30px; font-weight: bold; letter-spacing: 1px; }

ai .app-card {
    background: rgba(40, 40, 40, 0.45);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-radius: 20px; padding: 14px; border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px; transform: translateY(30px); opacity: 0;
    animation: cardRise 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: calc(var(--i) * 0.18s + 0.4s);
}
@keyframes cardRise { to { transform: translateY(0); opacity: 1; } }

ai .app-info { font-size: 11px; color: #aaa; margin-bottom: 6px; font-weight: 500; }
ai .app-cont { font-size: 14px; color: #fff; line-height: 1.5; font-weight: 400; }

/* --- 角色档案：禁忌色温优化 --- */
ai details.st { margin-top: 30px; border-top: 1px solid #150505; }
ai details.st summary { color: #555; font-size: 13px; padding: 15px; cursor: pointer; text-align: center; letter-spacing: 2px; }
ai .c-p { background: #0a0a0a; padding: 20px; border-radius: 12px; border: 1px solid #1a0505; }
ai .c-p f { color: #e00; font-size: 20px; font-weight: 800; text-shadow: 0 0 15px rgba(255,0,0,0.3); }
ai .c-p d { display: block; font-size: 13px; color: #888; margin-top: 8px; }
ai .c-p d.k {
    color: #ffa0a0; background: rgba(120,0,0,0.1); padding: 10px; border-radius: 6px; border-left: 3px solid #b00;
    animation: hotPulse 3.5s infinite ease-in-out;
}

/* --- 行动选项：流光溢彩 --- */
ai .ac { display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 40px; }
ai .a-i {
    background: #0d0d0d;
    border: 1px solid #222;
    padding: 16px 25px;
    border-radius: 10px;
    color: #bbb;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    overflow: hidden;
}
ai .a-i:hover {
    color: #fff;
    border-color: #900;
    background: linear-gradient(90deg, #1a0505, #0d0d0d);
    transform: translateX(8px);
    box-shadow: -10px 0 20px rgba(255,0,0,0.1);
}

/* 滚动条 */
ai ::-webkit-scrollbar { width: 4px; }
ai ::-webkit-scrollbar-track { background: #050505; }
ai ::-webkit-scrollbar-thumb { background: #300; border-radius: 10px; }

/* --- 暗夜·流光霓虹 (Neon Noir Pro) 深度美化方案 --- */

/* 1. 强制抹除平台默认干扰元素 */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* 2. 核心聊天框：流光质感重塑 */
.bg-gray-100\/90.relative.inline-block {
    background: rgba(10, 10, 10, 0.85) !important; /* 深度暗色基调 */
    backdrop-filter: blur(15px) saturate(180%) !important; /* 磨砂玻璃质感 */
    -webkit-backdrop-filter: blur(15px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    padding: 12px 18px !important;
    margin: 10px 0 !important;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.5), /* 内部深度 */
        0 10px 30px rgba(0, 0, 0, 0.4) !important; /* 外部沉稳阴影 */
    isolation: isolate !important; /* 创建层叠上下文，保护文字 */
    overflow: hidden !important;
}

/* 3. 动态流光边框 (::before 实现) */
.bg-gray-100\/90.relative.inline-block::before {
    content: "" !important;
    position: absolute !important;
    inset: -2px !important; /* 稍微超出边界形成流光 */
    background: conic-gradient(
        from 0deg, 
        transparent 0%, 
        transparent 70%, 
        #ff0000 85%, 
        #ff4d4d 95%, 
        transparent 100%
    ) !important;
    animation: borderRotate 4s linear infinite !important;
    z-index: -1 !important;
    opacity: 0.6 !important;
}

/* 内部遮罩，确保流光只出现在边缘 */
.bg-gray-100\/90.relative.inline-block::after {
    content: "" !important;
    position: absolute !important;
    inset: 1px !important;
    background: #0a0a0a !important;
    border-radius: 19px !important;
    z-index: -1 !important;
}

@keyframes borderRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 4. 文本可读性：极致清晰 */
.markdown-body {
    color: #F5F5F5 !important; /* 纯净高亮文本 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
    z-index: 1 !important;
    position: relative !important;
    -webkit-font-smoothing: antialiased !important;
    text-shadow: none !important; /* 严禁阴影，确保锐利 */
}

/* 强调文字 */
.markdown-body strong {
    color: #ff3333 !important;
    font-weight: 800 !important;
}

/* 5. 加载动画：SMIL SVG 方案 (强制可见) */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    display: none !important; /* 隐藏默认 */
}

.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="30" fill="none" stroke="%23ff0000" stroke-width="8"><animate attributeName="r" from="10" to="40" dur="1.5s" begin="0s" repeatCount="indefinite" /><animate attributeName="opacity" from="1" to="0" dur="1.5s" begin="0s" repeatCount="indefinite" /></circle><circle cx="50" cy="50" r="15" fill="%23ff0000"><animate attributeName="opacity" values="1;0.3;1" dur="1s" repeatCount="indefinite" /></circle></svg>') no-repeat center !important;
    background-size: contain !important;
    min-width: 30px !important;
    min-height: 30px !important;
}

/* 6. 底部功能按钮美化 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
    color: #EAEAEA !important; /* 确保深色背景可见 */
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    margin: 0 4px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
}

.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    background: rgba(255, 0, 0, 0.2) !important;
    color: #ff4d4d !important;
}

/* 模型名称与Token */
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
    color: #888 !important;
    font-size: 11px !important;
    padding: 0 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* 7. 响应式与交互增强 */
@media (max-width: 480px) {
    .bg-gray-100\/90.relative.inline-block {
        padding: 10px 14px !important;
        max-width: 96% !important;
    }
}

.bg-gray-100\/90.relative.inline-block:hover {
    transform: translateY(-2px) !important;
    transition: transform 0.3s ease !important;
}