/* ═══ B平台加载动画适配（自动注入）═══ */
.flex.items-center.justify-center.size-6 { opacity: 1 !important; }
.flex.items-center.justify-center.size-6 > .flex.gap-2 { display: none !important; }
.is-assistant.w-fit { width: 100% !important; }
.is-assistant > .border.border-muted:has(.flex.items-center.justify-center.size-6) {
  width: 100% !important; background: transparent !important;
  border: none !important; padding: 0 !important;
}
.is-assistant .space-y-3:has(.flex.items-center.justify-center.size-6) {
  display: flex; justify-content: center; width: 100%;
}

/* ═══ B平台表格修正（自动注入）═══ */
.rili-markdown-renderer table { display:table!important; table-layout:auto!important; width:100%!important; border-collapse:collapse!important; }
.rili-markdown-renderer table caption { display:table-caption!important; caption-side:top!important; text-align:center!important; padding:8px!important; }
.rili-markdown-renderer thead { display:table-header-group!important; }
.rili-markdown-renderer tbody { display:table-row-group!important; }
.rili-markdown-renderer tr { display:table-row!important; }
.rili-markdown-renderer th, .rili-markdown-renderer td { display:table-cell!important; }

/* ═══ B平台按钮组保护（自动注入 — 防止按钮消失）═══
   原理：B平台消息操作按钮结构为：
   .flex.items-center.gap-1.ml-auto (hover显隐包装)
     └── .bg-muted.rounded.flex.p-0.5 (按钮组容器)
           └── button.rounded-full.size-7 (单个按钮)
   以下规则使用高specificity + !important确保按钮
   不被任何转换后/透传的CSS规则意外隐藏
   ═══════════════════════════════════════════════ */
/* 按钮组容器保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5,
.is-user .bg-muted.rounded.flex.p-0\.5,
.is-assistant .bg-muted.rounded.flex.p-0\.5 {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  pointer-events: auto !important;
  clip: auto !important;
  clip-path: none !important;
}
/* 单个按钮保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5 > button,
.is-user .bg-muted.rounded.flex.p-0\.5 > button,
.is-assistant .bg-muted.rounded.flex.p-0\.5 > button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  clip: auto !important;
  clip-path: none !important;
}
/* hover显隐包装层保护 — 仅保留B平台原生的opacity过渡 */
.flex.items-center.gap-1.ml-auto.md\:opacity-0.group-hover\:opacity-100 {
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
/* 操作行保护 */
.flex.w-full.items-center.justify-between.gap-2.px-2 {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* ======================================================
   《幻晶勇者队》- 聊天框特摄美化方案 v1.1
   (修正：移除所有影响阅读的发光，保留视觉识别但绝对清晰)
   ====================================================== */

/* --- 1. 统一聊天框基础——高对比深色金属背景，无外发光 --- */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
    background: linear-gradient(135deg, #0B0E14 0%, #151B23 100%) !important;
    border: 2px solid #3B3F4A !important;  /* 静态金属灰边框，不发光 */
    border-radius: 12px !important;
    color: #D1D5DB !important;
    isolation: isolate !important;
    /* 移除所有 box-shadow 以免产生亮度干扰 */
    box-shadow: none !important;
}

/* 移除之前的发光脉冲边框伪元素（完全删除） */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted::before {
    content: none !important;
}

/* --- 2. 文本——绝对清晰的浅色字体，无任何 text-shadow --- */
.rili-markdown-renderer {
    color: #E5E7EB !important;  /* 亮灰色 */
    font-family: 'Noto Sans SC', 'Segoe UI', 'Helvetica Neue', sans-serif !important;
    background: transparent !important;
    text-shadow: none !important;  /* 彻底移除发光 */
    z-index: 1 !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
}

/* 标题：依然使用黄色强调，但无发光 */
.rili-markdown-renderer h1,
.rili-markdown-renderer h2,
.rili-markdown-renderer h3 {
    color: #FACC15 !important; /* 战队黄 */
    font-family: 'Contrail One', 'Arial Black', sans-serif !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    border-bottom: 2px solid #EC4899 !important; /* 紫红能量线 */
    padding-bottom: 4px !important;
    text-shadow: none !important;
}

/* 加粗文本：红战士色，纯色无发光 */
.rili-markdown-renderer strong {
    color: #FF6B6B !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

/* --- 3. 隐藏原顶部装饰带 --- */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* --- 4. 底部操作按钮：纯色标识，无光晕，高对比可见 --- */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #B8C6D6 !important; /* 默认银灰 */
    text-shadow: none !important; /* 移除所有光晕 */
    transition: none !important; /* 简化动画 */
}

/* 红战士按钮 */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #FF5A5F !important;
}

/* 蓝战士按钮 */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #3B82F6 !important;
}

/* 黄战士按钮 */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #FACC15 !important;
}

/* 绿战士按钮 */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #34D399 !important;
}

/* 紫战士按钮 */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted .bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #A855F7 !important;
}

/* 模型名称（模拟数据流） */
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
    color: #A78BFA !important;
    font-family: 'Courier New', monospace !important;
    letter-spacing: 2px !important;
    opacity: 0.9 !important;
    text-shadow: none !important;
}

/* Token 消耗文本（橙红色，无发光） */
/* [Token消耗hover逻辑转换未启用]
.text-orange-500 {
    color: #F97316 !important;
    font-weight: bold !important;
    background: transparent !important;  /* 移除之前加的深色背景块 */
    padding: 0 !important;
    border-radius: 0 !important;
    text-shadow: none !important;
}
*/

/* --- 5. 自定义加载动画：纯色脉动，无发光干扰 --- */
.flex.items-center.justify-center.size-6 > .flex.gap-2 {
    display: none !important;
}

.flex.items-center.justify-center.size-6 {
    position: relative !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.flex.items-center.justify-center.size-6::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: #4A90D9;  /* 单一冷色，无发光 */
    border-radius: 50%;
    animation: gearPulse 1.2s ease-in-out infinite;
    /* 移除 box-shadow */
    box-shadow: none !important;
}

@keyframes gearPulse {
    0%   { transform: scale(0.8); opacity: 0.5; }
    50%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* --- 6. 输入框单独微调（驾驶舱通讯界面）--- */
.is-user > .border.border-muted {
    background: linear-gradient(160deg, #0E1217 0%, #1A222C 100%) !important;
    border: 1.5px solid #3B82F6 !important; /* 仅保留蓝战士配色边框，无发光 */
}

/* --- 7. 移动端适配 & 低动效模式 --- */
@media (max-width: 480px) {
    .is-user > .border.border-muted,
.is-assistant > .border.border-muted {
        border-radius: 10px !important;
    }
    .rili-markdown-renderer {
        font-size: 14px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flex.items-center.justify-center.size-6::after {
        animation: none !important;
    }
}