/* 取消摘要样式 */
.cancellation-summary {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.cancellation-summary .summary-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.cancellation-summary .summary-header .icon {
    font-size: 1.5em;
    margin-right: 8px;
}

.cancellation-summary .summary-header h4 {
    margin: 0;
    color: #856404;
}

.cancellation-summary .summary-progress {
    margin-bottom: 12px;
    font-weight: 500;
}

.cancellation-summary .completed-steps {
    margin-bottom: 12px;
}

.cancellation-summary .completed-steps ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.cancellation-summary .completed-steps li {
    margin: 4px 0;
    font-size: 0.9em;
}

.cancellation-summary .partial-results {
    margin-bottom: 16px;
}

.cancellation-summary .results-preview {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

.cancellation-summary .results-preview details {
    margin-bottom: 8px;
}

.cancellation-summary .results-preview summary {
    cursor: pointer;
    font-weight: 500;
}

.cancellation-summary .results-preview pre {
    background: white;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0 0 0;
    font-size: 0.8em;
    white-space: pre-wrap;
    word-break: break-all;
}

.cancellation-summary .cancellation-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.cancellation-summary .btn-view-details {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.cancellation-summary .btn-close {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .cancellation-summary {
        padding: 12px;
    }
    
    .cancellation-summary .cancellation-actions {
        flex-direction: column;
    }
    
    .cancellation-summary .results-preview {
        max-height: 150px;
    }
}
/* 确保Agent容器默认完全隐藏且不影响布局 */
#agent-thinking-container {
    display: none !important;
    position: fixed !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 只有在显示时才应用样式 */
#agent-thinking-container[style*="display: block"] {
    display: block !important;
    /* 其他样式由JS动态注入的CSS控制 */
}

/* Agent消息样式 */
.message.agent-thinking,
.message.agent-step,
.message.agent-final-answer,
.message.agent-error {
    border-left: 4px solid #6366f1;
    background: #f8fafc;
}

.message.agent-thinking .agent-thinking-header,
.message.agent-step .agent-step-header,
.message.agent-final-answer .agent-final-header,
.message.agent-error .agent-error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.agent-badge, .step-type, .final-badge, .error-badge {
    background: #6366f1;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.iteration-badge, .tool-badge, .iterations-info, .iteration-info {
    background: #94a3b8;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75em;
}

.parameters-details {
    margin-top: 8px;
}

.parameters-details summary {
    cursor: pointer;
    font-weight: bold;
    color: #475569;
}

.parameters-details pre {
    background: #f1f5f9;
    padding: 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-size: 0.9em;
    overflow-x: auto;
}

.observation-result.success {
    color: #059669;
}

.observation-result.error {
    color: #dc2626;
}

.output-text {
    margin-top: 4px;
    white-space: pre-wrap;
}

.message.system.agent-start,
.message.system.agent-complete {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.agent-start-header,
.agent-complete-header {
    font-weight: bold;
    color: #1e40af;
    margin-bottom: 8px;
}

.agent-title, .complete-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.9em;
}

/* Agent执行摘要样式 */
.agent-execution-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    font-size: 0.9em;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #0369a1;
}

.summary-details {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: #475569;
    font-size: 0.85em;
}

.summary-note {
    color: #64748b;
    font-size: 0.8em;
    font-style: italic;
}

/* ============================================================
 * DataBus研究过程导出功能 - CSS样式
 * ============================================================ */

/* 导出通知动画 */
@keyframes databusNotificationSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes databusNotificationSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 导出按钮样式 */
.summary-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: flex-start;
}

.export-databus-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.export-databus-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.export-databus-btn:active {
    transform: translateY(0);
}

.export-databus-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.export-databus-btn .export-icon {
    font-size: 16px;
}

/* Agent摘要卡片增强样式 */
.agent-execution-summary {
    border-left: 4px solid #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.agent-execution-summary .content {
    padding: 16px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.summary-icon {
    font-size: 20px;
}

.summary-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.summary-details span {
    display: inline-flex;
    align-items: center;
}

.summary-note {
    color: #888;
    font-size: 13px;
    font-style: italic;
}

/* DataBus导出通知样式 */
.databus-export-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 350px;
    animation: databusNotificationSlideIn 0.3s ease;
}

.databus-export-notification .notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.databus-export-notification .notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-files-setting {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.upload-files-setting .setting-row {
    margin-top: 8px;
}

/* 模型选择对话框：限制最大高度，内容过多时显示滚动条 */
.model-selection-dialog {
    max-height: 90vh;          /* 最大高度为视口高度的 90% */
    overflow-y: auto;          /* 垂直方向超出时显示滚动条 */
    padding: 24px;             /* 保持原有内边距，可根据需要调整 */
}

/* ============================================================
 * 研究模型选择区样式（与导出按钮紫蓝渐变同源，保持设计协调）
 * ============================================================ */

/* 分组小标题：报告模型 / 研究模型 */
.dialog-subtitle {
    margin: 20px 0 10px;
    padding-left: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.model-options + .dialog-subtitle,
.dialog-header + .dialog-subtitle {
    margin-top: 8px;
}

.research-model-options {
    margin-bottom: 8px;
}

.research-model-options .model-option {
    background: #fafbfc;
}

.research-model-options .model-option:hover {
    background: #f5f5ff;
    border-color: #d6d3f7;
}

/* 研究模型选中态：紫蓝边框 + 淡紫渐变背景 */
.research-model-options .model-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg,
        rgba(102, 126, 234, 0.10),
        rgba(118, 75, 162, 0.08));
    box-shadow: 0 0 0 1px #667eea,
                0 2px 6px rgba(102, 126, 234, 0.15);
}

.research-model-options .model-option.selected .model-badge {
    background: #667eea;
    color: #ffffff;
}

.research-model-options .model-option.selected .model-name {
    color: #4c1d95;
}

/* 研究模型徽章（未选中时） */
.model-badge.research {
    background: #ede9fe;
    color: #5b21b6;
}

.model-badge.research-default {
    background: #eef2ff;
    color: #4f46e5;
}

/* 防止上方通用规则误伤报告模型选中态 */
.model-options:not(.research-model-options) .model-option.selected .model-badge.premium {
    background: #ffd700;
    color: #8b6b00;
}

.model-options:not(.research-model-options) .model-option.selected .model-badge.standard {
    background: #e3f2fd;
    color: #1976d2;
}

/* 移动端微调 */
@media (max-width: 767px) {
    .dialog-subtitle {
        margin: 16px 0 8px;
        font-size: 0.9rem;
    }
    .research-model-options .model-option {
        padding: 12px;
    }
    .model-selection-dialog {
        padding: 18px;
        max-height: 92vh;
    }
}