/* =========================================
   星际航行风格：全局气泡容器与全息扫描线背景
========================================= */
.group.is-user > div:first-child, 
.group.is-assistant > div:first-child {
    background: linear-gradient(135deg, rgba(8, 12, 21, 0.95) 0%, rgba(3, 5, 10, 0.98) 100%) !important;
    border: 1px solid rgba(0, 240, 255, 0.15) !important;
    border-radius: 4px !important;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.05), inset 0 0 30px rgba(0, 240, 255, 0.03) !important;
    backdrop-filter: blur(12px) !important;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* 全息数据扫描线动画遮罩 (置于底层，绝不遮挡文字) */
.group.is-user > div:first-child::before, 
.group.is-assistant > div:first-child::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 240, 255, 0.02) 3px, rgba(0, 240, 255, 0.02) 4px);
    z-index: -1;
    pointer-events: none;
}

/* =========================================
   阵营区分：舰长指令(User) vs 舰载主机(AI)
========================================= */
/* 用户端 (舰长通讯 - 琥珀色能量条) */
.group.is-user > div:first-child {
    border-left: 4px solid #ffb000 !important;
    border-right: 1px solid rgba(255, 176, 0, 0.15) !important;
}

/* AI端 (主控系统 - 赛博蓝能量条) */
.group.is-assistant > div:first-child {
    border-right: 4px solid #00f0ff !important;
    border-left: 1px solid rgba(0, 240, 255, 0.15) !important;
}

/* =========================================
   绝对可读性：正文排版与荧光渲染
========================================= */
.rili-markdown-renderer {
    position: relative;
    z-index: 1;
}

.rili-markdown-renderer, 
.rili-markdown-renderer p,
.rili-markdown-renderer span {
    color: #e0f8ff !important; /* 极高对比度的冰蓝色，确保暗黑深空背景下的阅读性 */
    font-family: "SF Pro Display", -apple-system, sans-serif !important;
    line-height: 1.6 !important;
    text-shadow: none !important; /* 正文禁止发光以免字体模糊 */
}

/* 强调内容高亮 */
.rili-markdown-renderer strong {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.6) !important;
    font-weight: 700 !important;
}

/* =========================================
   系统分区：思维链、记忆区、NPC面板分离设计
========================================= */
/* 1. 思维链 (折叠面板) - 加密数据终端风格 */
.rili-markdown-renderer details {
    background: rgba(0, 240, 255, 0.03) !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    border-left: 3px solid #00f0ff !important;
    border-radius: 2px !important;
    padding: 10px !important;
    margin: 12px 0 !important;
}

.rili-markdown-renderer summary {
    color: #00f0ff !important;
    font-family: 'Courier New', Consolas, monospace !important;
    font-size: 0.85em !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer;
}

.rili-markdown-renderer details > *:not(summary) {
    color: #8ab4f8 !important; /* 运算过程采用偏暗的辅助蓝色 */
    font-family: 'Courier New', Consolas, monospace !important;
    border-top: 1px dashed rgba(0, 240, 255, 0.2) !important;
    margin-top: 10px !important;
    padding-top: 10px !important;
    font-size: 0.9em !important;
}

/* 2. 记忆区/系统提示 (引用块) - 琥珀色警告面板 */
.rili-markdown-renderer blockquote {
    background: rgba(255, 176, 0, 0.05) !important;
    border: 1px solid rgba(255, 176, 0, 0.1) !important;
    border-left: 4px solid #ffb000 !important;
    padding: 12px 16px !important;
    margin: 12px 0 !important;
    color: #ffdca8 !important;
    border-radius: 0 4px 4px 0 !important;
    box-shadow: inset 15px 0 25px -15px rgba(255, 176, 0, 0.15) !important;
}

/* 3. 人物/NPC面板分割线 (激光射线) */
.rili-markdown-renderer hr {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, #00f0ff 50%, transparent 100%) !important;
    margin: 24px 0 !important;
    box-shadow: 0 0 8px #00f0ff !important;
}

/* 4. 面板标题 (H1/H2/H3) - 飞船控制台标题 */
.rili-markdown-renderer h1, 
.rili-markdown-renderer h2, 
.rili-markdown-renderer h3 {
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3) !important;
    padding-bottom: 6px !important;
    margin-top: 20px !important;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5) !important;
    display: inline-block !important;
    padding-right: 20px !important;
}

/* =========================================
   HUD底部信息与操作台控件
========================================= */
/* Token 消耗数据 - 全息读数 */
.text-xs.font-mono.text-muted-foreground {
    color: rgba(0, 240, 255, 0.65) !important;
    text-shadow: 0 0 4px rgba(0, 240, 255, 0.3) !important;
}

/* 底部操作按钮台 (复制/编辑/刷新) */
.bg-muted.rounded.flex {
    background: rgba(0, 20, 35, 0.6) !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    backdrop-filter: blur(4px) !important;
    border-radius: 2px !important;
}

.bg-muted.rounded.flex button svg.lucide {
    stroke: #00f0ff !important;
    opacity: 0.7 !important;
    transition: all 0.2s ease !important;
}

.bg-muted.rounded.flex button:hover svg.lucide {
    stroke: #ffffff !important;
    opacity: 1 !important;
    filter: drop-shadow(0 0 5px #00f0ff) !important;
}

/* =========================================
   系统连接加载动画：无视屏蔽的内联SVG SMIL动效
========================================= */
/* 隐藏原生打点 */
.flex.gap-2.w-full.h-full.items-center.justify-center > span { 
    display: none !important; 
}

/* 注入科幻终端载入动画 */
.flex.gap-2.w-full.h-full.items-center.justify-center {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='20'%3E%3Ctext x='0' y='15' fill='%2300f0ff' font-family='monospace' font-size='13' font-weight='bold' letter-spacing='2'%3E%3Canimate attributeName='opacity' values='0.3;1;0.3' dur='1.2s' repeatCount='indefinite'/%3E%3E%3E SYSTEM_UPLINK_ESTABLISHING...%3C/text%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center left !important;
    opacity: 0.8 !important;
}