/* ═══ 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;
}

/* =============================================
   聊天框全局样式 —— 隐婚总裁主题
   配色：冷金 #c0a060 / 酒红 #d35400 / 深灰 #34495e / 深蓝灰 #2c3e50
   字体：Noto Sans SC (正文) / Playfair Display (标题) / Dancing Script (手写)
   ============================================= */

/* --- 移除顶部颜色装饰条 --- */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* --- 聊天气泡主体 --- */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
    background: linear-gradient(135deg, #fef9f4 0%, #fff5f0 100%) !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(212, 83, 0, 0.1) !important;
    padding: 15px !important;
    transition: all 0.3s ease-in-out !important;
}

/* --- Markdown 正文 --- */
.rili-markdown-renderer {
    font-family: 'Noto Sans SC', sans-serif !important;
    color: #34495e !important;
    line-height: 1.6 !important;
    font-size: 0.98em !important;
}

/* --- 一级标题 --- */
.rili-markdown-renderer h1 {
    font-family: 'Playfair Display', serif !important;
    color: #2c3e50 !important;
    font-size: 1.5em !important;
    border-bottom: 2px solid #c0a060 !important;
    padding-bottom: 6px !important;
    margin-bottom: 14px !important;
}

/* --- 二级标题 --- */
.rili-markdown-renderer h2 {
    font-family: 'Playfair Display', serif !important;
    color: #2c3e50 !important;
    font-size: 1.25em !important;
    margin-top: 16px !important;
    margin-bottom: 10px !important;
}

/* --- 三级标题 --- */
.rili-markdown-renderer h3 {
    font-family: 'Dancing Script', cursive !important;
    color: #d35400 !important;
    font-size: 1.3em !important;
    margin-top: 14px !important;
    margin-bottom: 8px !important;
}

/* --- 加粗 --- */
.rili-markdown-renderer strong {
    color: #2c3e50 !important;
    font-weight: 700 !important;
}

/* --- 行内代码 --- */
.rili-markdown-renderer code {
    background: rgba(192, 160, 96, 0.1) !important;
    color: #d35400 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 0.92em !important;
    font-family: 'Noto Sans SC', monospace !important;
}

/* --- 链接 --- */
.rili-markdown-renderer a {
    color: #c0a060 !important;
    text-decoration: none !important;
    border-bottom: 1px dashed #c0a060 !important;
    transition: all 0.2s ease !important;
}
.rili-markdown-renderer a:hover {
    color: #d35400 !important;
    border-bottom-color: #d35400 !important;
}

/* --- 引用块 --- */
.rili-markdown-renderer blockquote {
    border-left: 3px solid #c0a060 !important;
    background: rgba(192, 160, 96, 0.05) !important;
    padding: 8px 14px !important;
    margin: 10px 0 !important;
    border-radius: 0 6px 6px 0 !important;
    color: #5a6c7d !important;
    font-style: italic !important;
}

/* --- 水平分割线 --- */
.rili-markdown-renderer hr {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(to right, transparent, #c0a060, transparent) !important;
    margin: 16px 0 !important;
}

/* --- 无序列表 --- */
.rili-markdown-renderer ul {
    padding-left: 20px !important;
    margin: 8px 0 !important;
}
.rili-markdown-renderer ul li::marker {
    color: #c0a060 !important;
}

/* =============================================
   details / summary —— 折叠面板（状态栏等）
   ============================================= */

/* 面板容器 */
.rili-markdown-renderer details {
    background: linear-gradient(135deg, #fef9f4 0%, #fff5f0 100%) !important;
    border: 1px solid rgba(212, 83, 0, 0.15) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    margin: 12px 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
}
.rili-markdown-renderer details[open] {
    border-color: rgba(212, 83, 0, 0.3) !important;
    box-shadow: 0 4px 18px rgba(212, 83, 0, 0.08) !important;
}

/* 面板标题行 */
.rili-markdown-renderer details summary {
    font-family: 'Dancing Script', cursive !important;
    font-size: 1.2em !important;
    color: #d35400 !important;
    cursor: pointer !important;
    padding: 4px 0 !important;
    outline: none !important;
    user-select: none !important;
    transition: color 0.2s ease !important;
    list-style: none !important;            /* 隐藏默认三角（WebKit） */
}
.rili-markdown-renderer details summary::-webkit-details-marker {
    display: none !important;              /* 隐藏默认三角（WebKit） */
}
.rili-markdown-renderer details summary::marker {
    display: none !important;              /* 隐藏默认三角（标准） */
}

/* 自定义展开/折叠指示器 */
.rili-markdown-renderer details summary::before {
    content: '▸' !important;
    display: inline-block !important;
    margin-right: 8px !important;
    font-size: 0.9em !important;
    color: #c0a060 !important;
    transition: transform 0.25s ease !important;
}
.rili-markdown-renderer details[open] > summary::before {
    transform: rotate(90deg) !important;
    color: #d35400 !important;
}

/* 悬停效果 */
.rili-markdown-renderer details summary:hover {
    color: #c0a060 !important;
}

/* 面板内容区 */
.rili-markdown-renderer details > *:not(summary) {
    margin-top: 10px !important;
}

/* --- 底部操作按钮 --- */
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #c0a060 !important;
    font-family: 'Noto Sans SC', sans-serif !important;
    font-weight: bold !important;
    background: none !important;
    border: 1px solid #c0a060 !important;
    border-radius: 8px !important;
    padding: 4px 12px !important;
    min-width: unset !important;
    transition: all 0.3s ease !important;
}
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    background: #c0a060 !important;
    color: #fdfefe !important;
    box-shadow: 0 2px 10px rgba(192, 160, 96, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* --- 模型名称 --- */
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
    color: #34495e !important;
    font-family: 'Noto Sans SC', sans-serif !important;
    font-size: 0.85em !important;
    opacity: 0.8 !important;
}

/* --- Token 消耗 --- */
/* [Token消耗hover逻辑转换未启用]
.text-orange-500 {
    color: #d35400 !important;
    font-family: 'Noto Sans SC', sans-serif !important;
    font-weight: bold !important;
    font-size: 0.85em !important;
}
*/