/* ===== 聊天框整体美化 - 优雅蓝调 ===== */
.bg-gray-100\/90.relative.inline-block {
    background: linear-gradient(135deg, #F5F9FF 0%, #EBF4FF 100%) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(79, 134, 198, 0.12) !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(147, 197, 253, 0.3) !important;
}

/* 主文本内容 - 深蓝灰色字体 */
.markdown-body {
    color: #1E293B !important;
    background: transparent !important;
    line-height: 1.8 !important;
}

/* 顶部装饰 - 蓝色光晕 */
.bg-gray-100\/90.relative.inline-block::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 80% !important;
    height: 3px !important;
    background: linear-gradient(90deg, transparent, rgba(79, 134, 198, 0.5), transparent) !important;
    border-radius: 2px !important;
}

/* ===== 外层状态栏样式（常驻颜色） ===== */
/* 外层标题栏 - 深邃蓝色渐变 */
.markdown-body details > summary {
    background: linear-gradient(135deg, #4F86C6 0%, #3B72B0 100%) !important;
    color: #FFFFFF !important;
    padding: 12px 16px !important;
    border-radius: 8px 8px 0 0 !important;
    border: 2px solid #93C5FD !important;
    border-bottom: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-bottom: 0 !important;
    box-shadow: 0 2px 6px rgba(79, 134, 198, 0.2) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

/* 外层标题栏悬停效果 */
.markdown-body details > summary:hover {
    background: linear-gradient(135deg, #3B72B0 0%, #2E5A8F 100%) !important;
    box-shadow: 0 3px 10px rgba(79, 134, 198, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* 外层内容区 - 浅蓝色（常驻） */
.markdown-body details > summary + * {
    background: linear-gradient(180deg, #DBEAFE 0%, #BFDBFE 100%) !important;
    padding: 16px !important;
    border: 2px solid #93C5FD !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    margin-top: 0 !important;
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.15) !important;
}

/* 确保折叠状态下边框完整 */
.markdown-body details:not([open]) > summary {
    border-radius: 8px !important;
    border: 2px solid #93C5FD !important;
}

/* ===== 外层内容区的段落样式优化 ===== */
/* 确保所有信息项在同一层级 */
.markdown-body details > summary + * > p {
    margin: 6px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* ===== 嵌套状态栏样式（嵌入式风格） ===== */
/* 嵌套标题栏 - 更小更紧凑 */
.markdown-body details details > summary {
    background: rgba(59, 114, 176, 0.15) !important;
    color: #1E40AF !important;
    padding: 8px 12px !important;
    border-radius: 6px 6px 0 0 !important;
    border: 1px solid rgba(147, 197, 253, 0.5) !important;
    border-bottom: none !important;
    font-weight: 500 !important;
    font-size: 0.9em !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 10px 0 0 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* 嵌套标题栏悬停效果 */
.markdown-body details details > summary:hover {
    background: rgba(59, 114, 176, 0.25) !important;
}

/* 嵌套内容区 - 嵌入式风格，修复溢出问题 */
.markdown-body details details > summary + * {
    background: rgba(255, 255, 255, 0.6) !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(147, 197, 253, 0.5) !important;
    border-top: none !important;
    border-radius: 0 0 6px 6px !important;
    margin: 0 0 8px 0 !important;
    box-shadow: inset 0 1px 3px rgba(79, 134, 198, 0.08) !important;
    overflow: hidden !important;
}

/* 嵌套内容区的段落 */
.markdown-body details details > summary + * > p {
    margin: 4px 0 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* 嵌套折叠状态 */
.markdown-body details details:not([open]) > summary {
    border-radius: 6px !important;
    border: 1px solid rgba(147, 197, 253, 0.5) !important;
    margin-bottom: 8px !important;
}

/* ===== 表格样式优化 ===== */
.markdown-body table {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #93C5FD !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 6px rgba(147, 197, 253, 0.15) !important;
    margin: 8px 0 !important;
    width: 100% !important;
    table-layout: auto !important;
}

.markdown-body th {
    background: linear-gradient(135deg, #4F86C6 0%, #3B72B0 100%) !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    padding: 10px !important;
    border: 1px solid #93C5FD !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

.markdown-body td {
    padding: 8px !important;
    border: 1px solid #BFDBFE !important;
    color: #1E293B !important;
    background: rgba(219, 234, 254, 0.3) !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* ===== 数值进度条样式 ===== */
.markdown-body p[style*="--val"] {
    position: relative !important;
    padding-left: 8px !important;
    overflow: visible !important;
}

.markdown-body p[style*="--val"]::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: calc(var(--val) * 1%) !important;
    height: 6px !important;
    background: linear-gradient(90deg, #4F86C6, #3B72B0) !important;
    border-radius: 3px !important;
    opacity: 0.7 !important;
    z-index: -1 !important;
    box-shadow: 0 1px 3px rgba(79, 134, 198, 0.3) !important;
}

/* ===== 分类标题样式 ===== */
.markdown-body p[t] {
    font-weight: 700 !important;
    color: #1E40AF !important;
    margin-top: 12px !important;
    margin-bottom: 8px !important;
    padding-bottom: 4px !important;
    border-bottom: 2px solid #93C5FD !important;
}

/* ===== 行动建议区域 ===== */
.markdown-body suggested_questions p {
    background: rgba(219, 234, 254, 0.5) !important;
    padding: 10px 14px !important;
    margin: 8px 0 !important;
    border-left: 4px solid #4F86C6 !important;
    border-radius: 4px !important;
    color: #1E293B !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 4px rgba(79, 134, 198, 0.1) !important;
}

.markdown-body suggested_questions p:hover {
    background: rgba(191, 219, 254, 0.7) !important;
    border-left-color: #3B72B0 !important;
    transform: translateX(4px) !important;
    box-shadow: 0 2px 6px rgba(79, 134, 198, 0.2) !important;
}

/* ===== 信息标签样式 ===== */
.markdown-body p d {
    display: inline-block !important;
    margin-right: 12px !important;
    padding: 4px 10px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border-radius: 4px !important;
    border: 1px solid rgba(147, 197, 253, 0.4) !important;
    font-size: 0.95em !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

/* ===== 响应式适配 ===== */
/* 手机端优化 */
@media (max-width: 768px) {
    .bg-gray-100\/90.relative.inline-block {
        padding: 16px !important;
        border-radius: 12px !important;
    }
    
    .markdown-body details > summary {
        padding: 10px 12px !important;
        font-size: 0.95em !important;
    }
    
    .markdown-body details > summary + * {
        padding: 12px !important;
    }
    
    .markdown-body details details > summary {
        padding: 6px 10px !important;
        font-size: 0.85em !important;
    }
    
    .markdown-body details details > summary + * {
        padding: 8px 10px !important;
    }
    
    .markdown-body p d {
        margin-right: 8px !important;
        padding: 3px 8px !important;
        font-size: 0.9em !important;
    }
    
    .markdown-body table {
        font-size: 0.85em !important;
    }
    
    .markdown-body th,
    .markdown-body td {
        padding: 6px !important;
    }
}

/* 超小屏幕（手机竖屏） */
@media (max-width: 480px) {
    .bg-gray-100\/90.relative.inline-block {
        padding: 12px !important;
    }
    
    .markdown-body details > summary {
        padding: 8px 10px !important;
        font-size: 0.9em !important;
    }
    
    .markdown-body details details > summary {
        padding: 6px 8px !important;
        font-size: 0.8em !important;
    }
    
    .markdown-body p d {
        display: block !important;
        margin: 4px 0 !important;
    }
    
    .markdown-body table {
        font-size: 0.8em !important;
        display: block !important;
        overflow-x: auto !important;
    }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .bg-gray-100\/90.relative.inline-block {
        padding: 24px !important;
        max-width: 95% !important;
    }
}

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

/* ===== 底部附加元素颜色适配 ===== */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
    color: #1E40AF !important;
}

.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    color: #3B72B0 !important;
}

.text-orange-500 {
    color: #4F86C6 !important;
}