/*
 * smartqa.css - EarthLab 智能问答模块样式
 * ============================================================================
 * 功能特性：
 *   1. 浮动问答按钮（SVG图标 + 平台协调色）
 *   2. 毛玻璃效果问答面板
 *   3. 内嵌消息宽度自适应（修复横向滚动条）
 *   4. 数据集多级导航卡片（纵向列式布局）
 *   5. iframe 控制按钮样式（刷新/全屏/新窗口）
 *   6. 完整暗色模式支持
 *   7. 响应式移动端适配
 * ============================================================================
 */

/* ========== 基础样式重置 ========== */
.smart-qa-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========== 智能问答主容器 ========== */
.smart-qa-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.3px;
}

/* ========== 【优化】问答按钮（浮动图标）- SVG图标 + 平台协调色 ========== */
.qa-toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A2A6C 0%, #2A4A8A 100%);
    border: 3px solid white;
    box-shadow: 0 6px 20px rgba(26, 42, 108, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 10px;
    position: relative;
}

/* 隐藏原有图片（降级方案） */
.qa-toggle-btn img {
    display: none;
}

/* SVG对话图标 */
.qa-toggle-btn::before {
    content: '';
    width: 28px;
    height: 28px;
    background-image: url('../suit/assets/Home/icon-chat.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
}

.qa-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(26, 42, 108, 0.5);
}

/* ========== 连接状态指示器 ========== */
.qa-toggle-btn.connecting::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background-color: #ff9800;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 5px rgba(255, 152, 0, 0.5);
}

.qa-toggle-btn.connected::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background-color: #4caf50;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.qa-toggle-btn.disconnected::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background-color: #f44336;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(244, 67, 54, 0.5);
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.7; box-shadow: 0 0 5px rgba(255, 152, 0, 0.5); }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 10px rgba(255, 152, 0, 0.8); }
    100% { transform: scale(0.8); opacity: 0.7; box-shadow: 0 0 5px rgba(255, 152, 0, 0.5); }
}

/* ========== 问答面板 ========== */
.qa-panel {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 520px;
    height: 70vh;
    max-height: 750px;
    min-height: 550px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 48px -12px rgba(0, 20, 50, 0.35);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.qa-panel.active {
    display: flex;
    animation: slideInFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInFade {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== 最大化状态 ========== */
.qa-panel.maximized {
    position: fixed;
    right: 30px;
    bottom: 20px !important;
    top: 20px !important;
    left: auto;
    width: 560px;
    box-shadow: 0 28px 56px -12px rgba(0, 30, 60, 0.45);
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 212, 200, 0.3);
}

.qa-panel.maximized .qa-messages {
    flex: 1;
    overflow-y: auto;
}

.qa-panel.maximized .embed-responsive-container {
    height: 550px;
    max-height: 65vh;
}

/* ========== 面板头部 ========== */
.qa-header {
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A, #3A6A9A);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 212, 200, 0.3);
    position: relative;
    overflow: hidden;
}

.qa-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

/* ========== 面板头部标题 - 极简科技风 with 机器人AI图标 ========== */
.qa-header-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
    padding-left: 12px;

    /* 柔和科技渐变 */
    background: linear-gradient(135deg, #FFFFFF 0%, #E0F8FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* 单层发光 - 更干净 */
    text-shadow: 0 0 15px rgba(0, 212, 200, 0.5);

    transition: all 0.3s ease;
}

/* 悬停增强 */
/*.qa-header-title:hover {*/
/*    text-shadow: 0 0 25px rgba(0, 212, 200, 0.8);*/
/*    letter-spacing: 3px;*/
/*}*/

/* 机器人AI图标 - 本地SVG文件 */
.qa-header-title::before {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    background-image: url('../suit/assets/Home/icon-robot.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 8px #00D4C8);
    animation: ai-pulse 2s ease-in-out infinite;
}

/* 底部光条 */
.qa-header-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 32px;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg,
    transparent,
    #00D4C8,
    #FFFFFF,
    #00D4C8,
    transparent
    );
    opacity: 0.5;
    box-shadow: 0 0 8px #00D4C8;
}

/* AI图标脉动动画 */
@keyframes ai-pulse {
    0% { opacity: 0.8; filter: drop-shadow(0 0 5px #00D4C8); }
    50% { opacity: 1; filter: drop-shadow(0 0 15px #00D4C8) drop-shadow(0 0 25px #0088AA); }
    100% { opacity: 0.8; filter: drop-shadow(0 0 5px #00D4C8); }
}

/* ========== 头部操作按钮容器 ========== */
.qa-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 通用头部按钮样式 ========== */
.qa-clear-btn,
.qa-maximize-btn,
.qa-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(4px);
    font-size: 20px;
    padding: 0;
}

.qa-clear-btn:hover,
.qa-maximize-btn:hover,
.qa-close-btn:hover {
    background: rgba(0, 212, 200, 0.25);
    border-color: rgba(0, 212, 200, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 212, 200, 0.3);
}

.qa-clear-btn:active,
.qa-maximize-btn:active,
.qa-close-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.qa-clear-btn svg,
.qa-maximize-btn svg {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

/* ========== 消息区域 ========== */
.qa-messages {
    flex: 1;
    padding: 24px 24px;
    overflow-y: auto;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(8px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 自定义滚动条 */
.qa-messages::-webkit-scrollbar {
    width: 5px;
}

.qa-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

.qa-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #1A2A6C, #3A6A9A);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.qa-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #2A4A8A, #4A8AB0);
}

/* ========== 消息气泡 - 修复横向滚动条 ========== */
.message {
    margin-bottom: 8px;
    max-width: 95%;
    animation: messagePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes messagePop {
    0% { opacity: 0; transform: translateY(12px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    margin-left: auto;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 20px 20px 20px 6px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: all 0.2s;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.bot-message .message-bubble {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.04);
    color: #1A2A6C;
    border-radius: 20px 20px 20px 6px;
    box-shadow: 0 6px 14px rgba(26, 42, 108, 0.08);
}

.user-message .message-bubble {
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A);
    color: white;
    border-radius: 20px 20px 6px 20px;
    box-shadow: 0 6px 16px rgba(26, 42, 108, 0.25);
}

.message-time {
    font-size: 10px;
    color: #8E9A9E;
    margin-top: 6px;
    text-align: right;
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* ========== 【优化1】内嵌消息宽度显著增加（修复横向滚动条） ========== */
.embed-message {
    max-width: 100% !important;
    width: 100%;
}

.embed-message .message-bubble {
    width: 100%;
    max-width: 100%;
    padding: 28px;
    background: white;
    border: 1px solid rgba(0, 212, 200, 0.2);
    box-sizing: border-box;
    border-radius: 24px;
    box-shadow: 0 12px 28px -8px rgba(26, 42, 108, 0.12);
    overflow-x: hidden;
}

/* ========== 页面嵌入容器样式 ========== */
.page-embed-container {
    display: none;
    flex-direction: column;
    border-top: 1px solid rgba(0, 212, 200, 0.2);
    flex-shrink: 0;
    max-height: 50%;
    background: white;
    width: 100%;
}

.embed-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #F8FAFC;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    width: 100%;
}

.embed-title {
    font-size: 14px;
    color: #1A2A6C;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.embed-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.embed-action-btn {
    padding: 6px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    font-size: 12px;
    color: #1A2A6C;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.embed-action-btn:hover {
    background: #1A2A6C;
    border-color: #1A2A6C;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 42, 108, 0.2);
}

/* ========== iframe包裹区域 ========== */
.page-embed-frame-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    min-height: 280px;
    background: #F8FAFC;
    width: 100%;
    box-sizing: border-box;
}

.page-embed-frame {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    background: white;
    display: block;
    min-height: 320px;
    max-width: 100%;
}

/* ========== 【修复】iframe控制按钮样式 ========== */
.embed-preview-controls {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    overflow-x: hidden;
}

.embed-control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.embed-control-btn {
    padding: 8px 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    background: white;
    color: #1A2A6C;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.25s ease;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    white-space: nowrap;
    line-height: 1;
    border: 1px solid #e0e0e0;
}

.embed-control-btn .btn-icon {
    font-size: 15px;
    line-height: 1;
}

.embed-control-btn:hover {
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A);
    border-color: #1A2A6C;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(26, 42, 108, 0.2);
}

.embed-control-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ========== 响应式iframe容器（修复横向滚动条） ========== */
.embed-responsive-container {
    position: relative;
    width: 100%;
    height: 480px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    background: #F8FAFC;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.embed-scroll-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

.embed-frame-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 100%;
    transform-origin: 0 0;
    overflow-x: hidden;
}

.embed-responsive-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    transform-origin: 0 0;
    pointer-events: auto;
    display: block;
    min-height: 450px;
    max-width: 100%;
}

/* ========== 发送按钮 ========== */
.qa-send-btn {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A);
    padding: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 16px rgba(26, 42, 108, 0.25);
}

.qa-send-btn img {
    display: none;
}

.qa-send-btn::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url('../suit/assets/Home/icon-send.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    transition: all 0.3s ease;
}

.qa-send-btn:hover::before {
    transform: scale(1.1) translateY(-2px);
}

.qa-send-btn:active::before {
    transform: scale(0.9) translateY(2px);
}

/* ========== 数据集引导 ========== */
.dataset-guidance {
    margin: 8px 0 16px;
    padding: 24px 20px;
    background: linear-gradient(145deg, #F0F7FF, #FFFFFF);
    border-radius: 24px;
    border-left: 6px solid #00D4C8;
    box-shadow: 0 10px 25px -8px rgba(0, 212, 200, 0.15);
    width: 100%;
}

.dataset-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
}

.dataset-option-item {
    background: white;
    padding: 20px 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.dataset-option-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #1A2A6C, #00D4C8);
    opacity: 0;
    transition: opacity 0.3s;
}

.dataset-option-item:hover {
    background: white;
    border-color: #00D4C8;
    transform: translateY(-6px);
    box-shadow: 0 16px 28px -8px rgba(0, 212, 200, 0.25);
}

.dataset-option-item:hover::before {
    opacity: 1;
}

.dataset-option-icon {
    font-size: 28px;
    margin-bottom: 10px;
    color: #1A2A6C;
    transition: all 0.3s;
}

.dataset-option-item:hover .dataset-option-icon {
    transform: scale(1.1);
    color: #00D4C8;
}

.dataset-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #1A2A6C;
    margin-bottom: 6px;
}

.dataset-option-desc {
    font-size: 11px;
    color: #6A7A8A;
    line-height: 1.4;
}

/* ========== 【优化3】二级分类引导 - 纵向列式布局 ========== */
.level2-guidance {
    margin: 16px 0;
    padding: 20px;
    background: linear-gradient(145deg, #FFF5E6, #FFFFFF);
    border-radius: 20px;
    border-left: 6px solid #FF9800;
    box-shadow: 0 8px 20px -8px rgba(255, 152, 0, 0.15);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.level2-prompt {
    font-size: 14px;
    color: #E65100;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.level2-prompt::before {
    content: '▶';
    color: #FF9800;
    margin-right: 8px;
    font-size: 14px;
}

.level2-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.level2-option-item {
    padding: 14px 20px;
    background: white;
    border: 1.5px solid #FFB74D;
    border-radius: 16px;
    font-size: 14px;
    color: #E65100;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.level2-option-item:hover {
    background: #FF9800;
    border-color: #FF9800;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.2);
}

.level2-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.level2-name {
    flex: 1;
    text-align: left;
}

/* ========== 【优化3】三级分类引导 - 纵向列式布局 ========== */
.level3-guidance {
    margin: 16px 0;
    padding: 20px;
    background: linear-gradient(145deg, #E8F5E9, #FFFFFF);
    border-radius: 20px;
    border-left: 6px solid #4CAF50;
    box-shadow: 0 8px 20px -8px rgba(76, 175, 80, 0.15);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.level3-prompt {
    font-size: 14px;
    color: #2E7D32;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.level3-prompt::before {
    content: '◆';
    color: #4CAF50;
    margin-right: 8px;
    font-size: 16px;
}

.level3-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.level3-option-item {
    padding: 14px 20px;
    background: white;
    border: 1.5px solid #81C784;
    border-radius: 16px;
    font-size: 14px;
    color: #2E7D32;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.level3-option-item:hover {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.2);
}

.level3-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.level3-name {
    flex: 1;
    text-align: left;
}

/* ========== 示例问题区域 ========== */
.example-questions {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 212, 200, 0.2);
    border-bottom: 1px solid rgba(0, 212, 200, 0.2);
    flex-shrink: 0;
    width: 100%;
}

.example-title {
    font-size: 11px;
    color: #5A6A7A;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.example-title::before {
    content: '⚡';
    color: #00D4C8;
    margin-right: 6px;
    font-size: 14px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.example-question {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    font-size: 13px;
    color: #1A2A6C;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.example-question:hover {
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A);
    border-color: #00D4C8;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -8px rgba(26, 42, 108, 0.4);
}

.example-question:hover::after {
    content: attr(data-question);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 40, 0.95);
    backdrop-filter: blur(8px);
    color: white;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 12px;
    white-space: normal;
    max-width: 280px;
    width: max-content;
    margin-bottom: 12px;
    z-index: 1000;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    text-align: center;
    line-height: 1.5;
    border: 1px solid rgba(0, 212, 200, 0.3);
}

.example-question:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(10, 20, 40, 0.95);
    margin-bottom: 6px;
    pointer-events: none;
}

/* ========== 输入区域 ========== */
.qa-input-area {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 212, 200, 0.2);
    flex-shrink: 0;
    width: 100%;
}

.qa-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.qa-input {
    flex: 1;
    padding: 14px 20px;
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 28px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    height: 50px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    font-family: inherit;
}

.qa-input:focus {
    border-color: #00D4C8;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 212, 200, 0.1);
}

.qa-input::placeholder {
    color: #A0B0C0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ========== 建议问题样式 ========== */
.suggestions {
    margin: 8px 0 16px;
    padding: 20px;
    background: linear-gradient(145deg, #F8FAFC, #FFFFFF);
    border-radius: 24px;
    border-left: 6px solid #8A2BE2;
    box-shadow: 0 8px 20px -8px rgba(138, 43, 226, 0.15);
    width: 100%;
}

.suggestions-title {
    font-size: 14px;
    color: #5A6A7A;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.suggestions-title::before {
    content: '💡';
    color: #8A2BE2;
    margin-right: 6px;
    font-size: 16px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

.suggestion-item {
    background: white;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 18px;
    cursor: pointer;
    font-size: 13px;
    color: #1A2A6C;
    transition: all 0.25s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.suggestion-item:hover {
    background: #8A2BE2;
    border-color: #8A2BE2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(138, 43, 226, 0.25);
}

/* ========== 状态消息样式 ========== */
.status-message {
    text-align: center;
    margin: 8px 0;
    width: 100%;
}

.status-message .message-bubble {
    background: rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    color: #5A6A7A;
    font-size: 12px;
    padding: 8px 18px;
    border-radius: 30px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.status-message.status-success .message-bubble {
    background: rgba(0, 212, 200, 0.12);
    color: #008080;
    border-color: rgba(0, 212, 200, 0.3);
}

.status-message.status-error .message-bubble {
    background: rgba(255, 82, 82, 0.08);
    color: #D32F2F;
    border-color: rgba(255, 82, 82, 0.2);
}

/* ========== 加载指示器 ========== */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background: white;
    border-radius: 24px 24px 24px 8px;
    border: 1px solid rgba(0, 212, 200, 0.2);
    width: fit-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: #1A2A6C;
    margin: 0 2px;
    animation: typingBounce 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); background: #1A2A6C; }
    40% { transform: translateY(-12px); background: #00D4C8; }
}

/* ========== 全屏预览样式 ========== */
.fullscreen-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 20, 40, 0.85);
    backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.fullscreen-preview-container {
    width: 92%;
    height: 92%;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 200, 0.3);
}

.fullscreen-preview-header {
    padding: 16px 24px;
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A);
    border-bottom: 1px solid rgba(0, 212, 200, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fullscreen-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.fullscreen-preview-actions {
    display: flex;
    gap: 10px;
}

.fullscreen-preview-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    transition: all 0.25s;
}

.fullscreen-preview-btn:hover {
    background: #FF5252;
    border-color: #FF5252;
    transform: scale(1.08);
}

.fullscreen-preview-frame {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
    display: block;
}

/* ========== 暗色模式 ========== */
@media (prefers-color-scheme: dark) {
    .qa-panel {
        background: rgba(18, 22, 36, 0.92);
        backdrop-filter: blur(20px);
        border-color: rgba(0, 212, 200, 0.2);
    }

    .qa-messages {
        background: rgba(10, 15, 28, 0.9);
    }

    .qa-toggle-btn {
        background: linear-gradient(135deg, #2A3A5A 0%, #3A4A6A 100%);
    }

    .qa-toggle-btn::before {
        background-image: url('../suit/assets/Home/icon-chat-dark.svg');
    }

    .bot-message .message-bubble {
        background: rgba(30, 40, 60, 0.9);
        border-color: rgba(0, 212, 200, 0.2);
        color: #E0F0FF;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    }

    .user-message .message-bubble {
        background: linear-gradient(145deg, #2A4A8A, #3A6A9A);
        color: white;
    }

    /* 暗色模式标题样式 */
    .qa-header-title {
        background: linear-gradient(135deg, #FFFFFF 0%, #A0E0FF 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0 0 20px rgba(0, 212, 200, 0.8);
    }

    .qa-header-title::before {
        background-image: url('../suit/assets/Home/icon-robot-dark.svg');
        filter: drop-shadow(0 0 12px #00D4C8) drop-shadow(0 0 20px #0088FF);
    }

    .qa-header-title::after {
        background: linear-gradient(90deg,
        transparent,
        #00D4C8,
        #FFFFFF,
        #00D4C8,
        transparent
        );
        box-shadow: 0 0 15px #00D4C8;
        opacity: 0.7;
    }

    .example-questions {
        background: rgba(20, 30, 50, 0.7);
        border-color: rgba(0, 212, 200, 0.2);
    }

    .example-question {
        background: rgba(30, 40, 60, 0.8);
        border-color: rgba(255, 255, 255, 0.05);
        color: #C0E0FF;
    }

    .example-question:hover {
        background: linear-gradient(145deg, #3A6A9A, #4A8AB0);
        color: white;
    }

    .qa-input-area {
        background: rgba(20, 30, 50, 0.7);
        border-color: rgba(0, 212, 200, 0.2);
    }

    .qa-input {
        background: rgba(30, 40, 60, 0.9);
        border-color: rgba(255, 255, 255, 0.05);
        color: #E0F0FF;
    }

    .qa-input:focus {
        border-color: #00D4C8;
        background: rgba(40, 50, 70, 0.95);
    }

    .qa-input::placeholder {
        color: #8A9AAD;
    }

    .qa-send-btn::before {
        background-image: url('../suit/assets/Home/icon-send.svg');
    }

    .dataset-guidance {
        background: linear-gradient(145deg, #1A2A3A, #2A3A4A);
        border-left-color: #00D4C8;
    }

    .dataset-option-item {
        background: rgba(30, 40, 60, 0.8);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .dataset-option-title {
        color: #C0E0FF;
    }

    .dataset-option-desc {
        color: #A0B0C0;
    }

    .level2-guidance {
        background: linear-gradient(145deg, #332211, #2A2A2A);
    }

    .level2-option-item {
        background: rgba(40, 40, 50, 0.9);
        border-color: rgba(255, 152, 0, 0.5);
        color: #FFB74D;
    }

    .level2-option-item:hover {
        background: #FF9800;
        color: white;
    }

    .level3-guidance {
        background: linear-gradient(145deg, #1A3322, #2A2A2A);
    }

    .level3-option-item {
        background: rgba(40, 40, 50, 0.9);
        border-color: rgba(76, 175, 80, 0.5);
        color: #81C784;
    }

    .level3-option-item:hover {
        background: #4CAF50;
        color: white;
    }

    .embed-control-btn {
        background: rgba(40, 50, 70, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
        color: #C0E0FF;
    }

    .embed-control-btn:hover {
        background: linear-gradient(145deg, #2A4A8A, #3A6A9A);
        border-color: #00D4C8;
        color: white;
    }

    .embed-responsive-container {
        background: #1A1E2A;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .page-embed-container {
        background: rgba(20, 30, 50, 0.8);
    }

    .embed-controls {
        background: rgba(30, 40, 60, 0.9);
        border-color: rgba(255, 255, 255, 0.05);
    }

    .embed-title {
        color: #C0E0FF;
    }

    .typing-indicator {
        background: rgba(30, 40, 60, 0.9);
        border-color: rgba(0, 212, 200, 0.3);
    }

    .typing-indicator span {
        background: #00D4C8;
    }

    @keyframes typingBounceDark {
        0%, 80%, 100% { transform: translateY(0); background: #00D4C8; }
        40% { transform: translateY(-12px); background: #FFFFFF; }
    }
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .smart-qa-container {
        bottom: 20px;
        right: 20px;
    }

    .qa-toggle-btn {
        width: 60px;
        height: 60px;
        padding: 8px;
    }

    .qa-panel {
        width: calc(100vw - 40px);
        max-width: 520px;
        right: 0;
        bottom: 80px;
        height: 65vh;
        max-height: 650px;
        min-height: 500px;
    }

    .qa-panel.maximized {
        right: 20px;
        bottom: 20px !important;
        top: 20px !important;
        width: calc(100vw - 40px);
        max-width: 560px;
    }

    .qa-header {
        padding: 12px 20px;
    }

    /* 移动端标题适配 */
    .qa-header-title {
        font-size: 18px;
        padding-left: 8px;
    }

    .qa-header-title::before {
        width: 20px;
        height: 20px;
        margin-right: 8px;
    }

    .qa-header-title::after {
        left: 28px;
        width: 55%;
    }

    .qa-messages {
        padding: 20px;
    }

    .message-bubble {
        padding: 12px 16px;
        font-size: 13px;
    }

    .embed-message .message-bubble {
        padding: 20px;
    }

    .example-grid {
        grid-template-columns: 1fr;
    }

    .dataset-options-grid {
        grid-template-columns: 1fr;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .page-embed-frame-wrapper {
        padding: 12px 16px;
    }

    .embed-responsive-container {
        height: 360px;
    }

    .embed-responsive-frame {
        min-height: 340px;
    }

    .qa-panel.maximized .embed-responsive-container {
        height: 480px;
        max-height: 55vh;
    }

    .embed-preview-controls {
        gap: 8px;
        margin-bottom: 12px;
    }

    .embed-control-btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    .level2-option-item,
    .level3-option-item {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .qa-panel {
        width: calc(100vw - 30px);
        max-width: 480px;
    }

    .qa-panel.maximized {
        width: calc(100vw - 30px);
        max-width: 520px;
    }

    .embed-responsive-container {
        height: 300px;
    }

    .embed-responsive-frame {
        min-height: 280px;
    }

    .page-embed-frame-wrapper {
        padding: 10px 12px;
    }

    .qa-panel.maximized .embed-responsive-container {
        height: 400px;
    }

    .embed-control-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .embed-control-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
    }
}

/* ========== 兼容性处理 ========== */
@supports not (backdrop-filter: blur(20px)) {
    .qa-panel {
        background: rgba(255, 255, 255, 0.98);
    }
    .qa-messages {
        background: #F8FAFC;
    }
    .example-questions {
        background: white;
    }
    .qa-input-area {
        background: white;
    }
}

@supports not (mix-blend-mode: multiply) {
    .qa-toggle-btn img {
        mix-blend-mode: normal;
        filter: brightness(1.2) contrast(1.3);
    }
}

/* ========== Markdown 渲染样式 ========== */

/* Markdown 基础样式 - 应用于AI消息气泡 */
.bot-message .message-bubble.markdown-body {
    font-size: 14px;
    line-height: 1.6;
    color: #1A2A6C;
}

/* 标题样式 */
.bot-message .message-bubble.markdown-body h1,
.bot-message .message-bubble.markdown-body h2,
.bot-message .message-bubble.markdown-body h3,
.bot-message .message-bubble.markdown-body h4,
.bot-message .message-bubble.markdown-body h5,
.bot-message .message-bubble.markdown-body h6 {
    margin: 16px 0 8px;
    font-weight: 600;
    color: #1A2A6C;
    line-height: 1.3;
}

.bot-message .message-bubble.markdown-body h1 {
    font-size: 22px;
    border-bottom: 1px solid rgba(0,212,200,0.2);
    padding-bottom: 6px;
}
.bot-message .message-bubble.markdown-body h2 { font-size: 20px; }
.bot-message .message-bubble.markdown-body h3 { font-size: 18px; }
.bot-message .message-bubble.markdown-body h4 { font-size: 16px; }
.bot-message .message-bubble.markdown-body h5 { font-size: 15px; }
.bot-message .message-bubble.markdown-body h6 { font-size: 14px; color: #4A6A8A; }

/* 段落样式 */
.bot-message .message-bubble.markdown-body p {
    margin: 10px 0;
    color: #2A3A4A;
}

.bot-message .message-bubble.markdown-body p:first-child {
    margin-top: 0;
}

.bot-message .message-bubble.markdown-body p:last-child {
    margin-bottom: 0;
}

/* 列表样式 */
.bot-message .message-bubble.markdown-body ul,
.bot-message .message-bubble.markdown-body ol {
    margin: 8px 0 12px;
    padding-left: 24px;
}

.bot-message .message-bubble.markdown-body li {
    margin: 5px 0;
    line-height: 1.6;
    position: relative;
}

.bot-message .message-bubble.markdown-body ul > li {
    list-style-type: disc;
}

.bot-message .message-bubble.markdown-body ul > li > ul {
    margin-left: 20px;
}

.bot-message .message-bubble.markdown-body ul > li > ul > li {
    list-style-type: circle;
}

.bot-message .message-bubble.markdown-body ol > li {
    list-style-type: decimal;
}

/* 代码样式 */
.bot-message .message-bubble.markdown-body code {
    background: #F0F2F5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    color: #E83E8C;
    border: 1px solid rgba(0,0,0,0.05);
}

.bot-message .message-bubble.markdown-body pre {
    background: #F6F8FA;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid rgba(0,212,200,0.15);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.bot-message .message-bubble.markdown-body pre code {
    background: none;
    padding: 0;
    border: none;
    color: #2A3A4A;
    font-size: 13px;
    line-height: 1.5;
    display: block;
}

/* 引用样式 */
.bot-message .message-bubble.markdown-body blockquote {
    border-left: 4px solid #00D4C8;
    padding: 8px 16px;
    margin: 12px 0;
    background: rgba(0,212,200,0.04);
    border-radius: 0 12px 12px 0;
    color: #4A6A8A;
    font-style: italic;
}

.bot-message .message-bubble.markdown-body blockquote p {
    margin: 5px 0;
}

/* 链接样式 */
.bot-message .message-bubble.markdown-body a {
    color: #1A2A6C;
    text-decoration: none;
    border-bottom: 1px dashed #00D4C8;
    transition: all 0.2s;
}

.bot-message .message-bubble.markdown-body a:hover {
    color: #00D4C8;
    border-bottom-style: solid;
}

/* 表格样式 */
.bot-message .message-bubble.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    font-size: 13px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.bot-message .message-bubble.markdown-body th,
.bot-message .message-bubble.markdown-body td {
    border: 1px solid rgba(0,0,0,0.06);
    padding: 10px 12px;
    text-align: left;
}

.bot-message .message-bubble.markdown-body th {
    background: linear-gradient(145deg, #1A2A6C, #2A4A8A);
    color: white;
    font-weight: 600;
}

.bot-message .message-bubble.markdown-body td {
    background: white;
}

.bot-message .message-bubble.markdown-body tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.bot-message .message-bubble.markdown-body tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* 水平线 */
.bot-message .message-bubble.markdown-body hr {
    border: none;
    border-top: 1px solid rgba(0,212,200,0.3);
    margin: 20px 0;
}

/* 强调样式 */
.bot-message .message-bubble.markdown-body strong {
    color: #1A2A6C;
    font-weight: 600;
}

.bot-message .message-bubble.markdown-body em {
    font-style: italic;
    color: #2A6A8A;
}

/* 内联代码块在暗色模式下的样式 */
@media (prefers-color-scheme: dark) {
    .bot-message .message-bubble.markdown-body {
        color: #E0F0FF;
    }

    .bot-message .message-bubble.markdown-body h1,
    .bot-message .message-bubble.markdown-body h2,
    .bot-message .message-bubble.markdown-body h3,
    .bot-message .message-bubble.markdown-body h4,
    .bot-message .message-bubble.markdown-body h5,
    .bot-message .message-bubble.markdown-body h6 {
        color: #B0E0FF;
    }

    .bot-message .message-bubble.markdown-body p {
        color: #D0E0F0;
    }

    .bot-message .message-bubble.markdown-body code {
        background: #2A3A4A;
        color: #FFB86C;
        border-color: rgba(255,255,255,0.1);
    }

    .bot-message .message-bubble.markdown-body pre {
        background: #1E2A3A;
        border-color: rgba(0,212,200,0.2);
    }

    .bot-message .message-bubble.markdown-body pre code {
        color: #E0F0FF;
    }

    .bot-message .message-bubble.markdown-body blockquote {
        background: rgba(0,212,200,0.08);
        color: #B0D0E0;
    }

    .bot-message .message-bubble.markdown-body th {
        background: linear-gradient(145deg, #2A4A8A, #3A6A9A);
    }

    .bot-message .message-bubble.markdown-body td {
        background: #2A3A4A;
        color: #E0F0FF;
    }

    .bot-message .message-bubble.markdown-body strong {
        color: #00D4C8;
    }

    .bot-message .message-bubble.markdown-body a {
        color: #B0E0FF;
    }

    .bot-message .message-bubble.markdown-body a:hover {
        color: #00D4C8;
    }
}