﻿/* =============================================
   Deep Research Page Styles
   ============================================= */

/* 顶部工具栏 */
.header {
    background: #fff;
    /* border-bottom: 1px solid #e9ecef; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    top: 0;
    z-index: 1000;
}


.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 主容器布局 */
.research-container {
    display: flex;
    height: calc(100vh - 65px);
    background: #f8f9fa;
}

/* 左侧研究报告列表 */
.research-sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

/* 收起状态 */
.research-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
    opacity: 0;
    transform: translateX(-100%);
}

.research-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

/* 标题行样式 */
.sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sidebar-title-row h5 {
    margin: 0;
    color: #495057;
    font-weight: 600;
    flex: 1;
}

/* 收起/展开按钮样式 */
.sidebar-toggle-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
}

.sidebar-toggle-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: scale(1.05);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

.sidebar-toggle-btn i {
    transition: transform 0.2s ease-in-out;
}

/* 展开按钮（固定位置） */
.sidebar-expand-btn {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    animation: slideInLeft 0.3s ease-out;
}

.sidebar-expand-btn button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    border: none;
    transition: all 0.3s ease-in-out;
    animation: expandButtonPulse 3s ease-in-out infinite;
}

.sidebar-expand-btn button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    animation: none;
    /* 悬停时停止脉冲动画 */
}

.sidebar-expand-btn button:active {
    transform: scale(0.95);
}

/* 当侧边栏收起时，调整主内容区域 */
.research-container.sidebar-collapsed .research-content {
    margin-left: 0;
    width: calc(100% - 400px);
    /* 减去右侧聊天面板的宽度 */
}

@media (max-width: 1200px) {
    .research-container.sidebar-collapsed .research-content {
        width: calc(100% - 350px);
        /* 在中等屏幕上调整 */
    }
}

@media (max-width: 992px) {
    .research-container.sidebar-collapsed .research-content {
        width: 100%;
        /* 在小屏幕上占满宽度 */
    }
}

/* 动画效果 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }

    to {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px);
    }
}

/* 展开按钮脉冲动画 */
@keyframes expandButtonPulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 4px 16px rgba(0, 123, 255, 0.5);
        transform: scale(1.05);
    }
}

#selectedModel {
    font-weight: bold;
}

.search-box {
    position: relative;
}

.search-box input {
    border-radius: 0.5rem;
    padding-right: 2.5rem;
    border: 1px solid #ced4da;
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.research-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.research-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    position: relative;
}

.research-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.research-item.active {
    border-color: #007bff;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.research-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.research-item-header h6 {
    margin: 0;
    color: #212529;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}

.research-date {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.research-item-summary {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.research-item-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    margin-top: 5px;
}

.research-item:hover .research-item-actions {
    opacity: 1;
}

/* 中部内容区域 */
.research-content {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 65px);
    transition: width 0.3s ease-in-out, margin-left 0.3s ease-in-out;
}

.research-content-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.research-content-header h4 {
    margin: 0;
    color: #212529;
    font-weight: 600;
}

.content-actions {
    display: flex;
    gap: 0.5rem;
}

.research-content-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #fff;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* 右侧聊天面板 */
.research-chat-panel {
    width: 400px;
    background: #fff;
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.chat-panel-header .nav-tabs {
    border-bottom: none;
    margin: 0;
}

.chat-panel-header .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.chat-panel-header .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: none;
}

.chat-panel-content {
    flex: 1;
    overflow: hidden;
}

.chat-panel-content .tab-pane {
    height: 100%;
    display: flex;
    flex-direction: column;
    display: none;
    /* 默认隐藏所有面板 */
}

.chat-panel-content .tab-pane.active {
    display: flex;
    /* 只显示活动的面板 */
    animation: fadeIn 0.2s ease-in-out;
}

/* AI对话界面 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
}

.welcome-message {
    margin-bottom: 1rem;
}

.assistant-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.message-content {
    background: #fff;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    max-width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-content p {
    margin: 0 0 0.5rem 0;
    /* color: #212529; */
    line-height: 1.4;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.message-content li {
    color: #495057;
    margin-bottom: 0.25rem;
}

.user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.user-message .message-content {
    background: #007bff;
    color: #fff;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.chat-input-area {
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.chat-input-area textarea {
    border-radius: 0.5rem;
    resize: none;
    border: 1px solid #ced4da;
}

.chat-input-area textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.chat-tools {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    justify-content: flex-start;
}

/* AI活动面板 */
.activity-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.15s ease-in-out;
}

.activity-item:hover {
    background: #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.activity-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.activity-time {
    color: #adb5bd;
    font-size: 0.8rem;
}

.activity-status {
    margin-left: 0.75rem;
    display: flex;
    align-items: center;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .research-chat-panel {
        width: 350px;
    }
}

@media (max-width: 992px) {

    .research-container {
        flex-direction: column;
        height: auto;
    }

    .research-sidebar {
        width: 100%;
        max-height: 300px;
    }

    .research-sidebar.collapsed {
        max-height: 0;
        padding: 0;
        transform: translateY(-100%);
    }

    .research-chat-panel {
        width: 100%;
        max-height: 400px;
    }

    /* 移动端展开按钮位置调整 */
    .sidebar-expand-btn {
        left: 50%;
        top: 10px;
        transform: translateX(-50%);
    }

    .sidebar-expand-btn button {
        width: 50px;
        height: 30px;
        border-radius: 15px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.5rem 1rem;
    }

    .research-sidebar {
        max-height: 250px;
    }

    .research-sidebar.collapsed {
        max-height: 0;
        padding: 0;
    }

    .research-content-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .research-content-body {
        padding: 1rem;
    }

    .chat-panel-header .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* 小屏幕设备的侧边栏按钮调整 */
    .sidebar-toggle-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }

    .sidebar-expand-btn {
        left: 50%;
        top: 5px;
        transform: translateX(-50%);
    }

    .sidebar-expand-btn button {
        width: 45px;
        height: 28px;
        font-size: 0.9rem;
    }
}

/* 自定义滚动条 */
.research-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.activity-list::-webkit-scrollbar,
.research-content-body::-webkit-scrollbar {
    width: 6px;
}

.research-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.activity-list::-webkit-scrollbar-track,
.research-content-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.research-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb,
.research-content-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.research-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.activity-list::-webkit-scrollbar-thumb:hover,
.research-content-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.research-item,
.assistant-message,
.user-message,
.activity-item {
    animation: fadeIn 0.3s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 模型选择下拉框样式 */
.model-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.15s ease-in-out;
}

.model-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.model-item:last-child {
    border-bottom: none;
}

.model-info {
    display: flex;
    flex-direction: column;
}

.model-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.model-desc {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.3;
}

/* 研究内容样式增强 */
.research-meta {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.research-meta .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.research-content-body h2 {
    color: #212529;
    margin-bottom: 1rem;
    font-weight: 600;
}

.research-content-body h3 {
    color: #495057;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border-left: 4px solid #007bff;
    padding-left: 1rem;
}

.research-content-body h5 {
    color: #007bff;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.research-content-body ul,
.research-content-body ol {
    margin-bottom: 1.5rem;
}

.research-content-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.research-content-body .alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式优化 */
@media (max-width: 576px) {
    .header {
        padding: 0.5rem;
    }

    .research-container {
        flex-direction: column;
        height: auto;
    }

    .research-sidebar {
        width: 100%;
        height: 300px;
    }

    .research-content {
        width: 100%;
        height: calc(100vh - 360px);
    }

    .research-chat-panel {
        width: 100%;
        height: 300px;
    }

    .research-item-actions {
        position: static;
        margin-top: 0.5rem;
        justify-content: flex-start;
    }

    .research-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .research-date {
        margin-top: 0.25rem;
    }

    .research-content-header h4 {
        font-size: 1.1rem;
    }

    .content-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .content-actions .btn {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
    }
}

i.googleico {
    background-image: url(../images/google.svg);
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center center;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

i.yahooico {
    background-image: url(../images/yahoo.svg);
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center center;
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* 模型搜索样式 */
#searchIcon {
    cursor: pointer;
    margin: 5px;
    color: gray;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#searchIcon:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.searchModel {
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    width: calc(100% - 10px);
}

.searchModel.expand {
    animation: expandSearch 0.3s ease-out;
}

@keyframes expandSearch {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: calc(100% - 10px);
        opacity: 1;
    }
}

.searchModel:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 模型项样式增强 */
.model-item {
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 2px 0;
}

.model-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}



/* 工具提示样式 */
#customTooltip {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 200px;
    word-wrap: break-word;
}

/* 模型下拉菜单样式 */
#modelList {
    max-height: 505px;
    overflow-y: auto;
    overflow-x: hidden;
}

#modelList::-webkit-scrollbar {
    width: 6px;
}

#modelList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#modelList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#modelList::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.icon-360 {
    background-image: url('../../images/modelsvg/360.svg');
}

.icon-bing {
    background-image: url('../../images/modelsvg/bing.svg');
}

.icon-claude {
    background-image: url('../../images/modelsvg/claude.svg');
}

.icon-deepseek {
    background-image: url('../../images/modelsvg/deepseek.svg');
}

.icon-ernie {
    background-image: url('../../images/modelsvg/ernie.svg');
}

.icon-gemini {
    background-image: url('../../images/modelsvg/gemini.svg');
}

.icon-glm {
    background-image: url('../../images/modelsvg/glm.svg');
}

.icon-gpt {
    background-image: url('../../images/modelsvg/gpt.svg');
}

.icon-hunyuan {
    background-image: url('../../images/modelsvg/hunyuan.svg');
}

.icon-llama {
    background-image: url('../../images/modelsvg/llama.svg');
}

.icon-minimax {
    background-image: url('../../images/modelsvg/minimax.svg');
}

.icon-mistral {
    background-image: url('../../images/modelsvg/mistral.svg');
}

.icon-moonshot {
    background-image: url('../../images/modelsvg/moonshot.svg');
}

.icon-qwen {
    background-image: url('../../images/modelsvg/qwen.svg');
}

.icon-sparkdesk {
    background-image: url('../../images/modelsvg/sparkdesk.svg');
}

.icon-suno {
    background-image: url('../../images/modelsvg/suno.svg');
}

.icon-cohere {
    background-image: url('../../images/modelsvg/cohere.svg');
}

.icon-internlm {
    background-image: url('../../images/modelsvg/internlm.svg');
}

.icon-yi {
    background-image: url('../../images/modelsvg/yi.svg');
}

.icon-xai {
    background-image: url('../../images/modelsvg/xai.svg');
}

.icon-doubao {
    background-image: url('../../images/modelsvg/doubao.png');
}

.icon-amazon {
    background-image: url('../../images/modelsvg/amazon.svg');
}

.icon-test {
    background-image: url('../../images/modelsvg/test.svg');
}

/* =============================================
   研究报告编辑模式样式
   ============================================= */

/* 编辑容器 */
.research-edit-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    height: calc(100vh - 65px);
}

/* 编辑主体 - Markdown编辑器区 */
.research-edit-body {
    flex: 1;
    padding: 0;
    background: #fff;
    height: calc(100vh - 65px);
}

.vditor-container {
    height: 100%;
    border: none;
}

/* 覆盖 Vditor 默认样式 */
.research-edit-body .vditor {
    border: none !important;
    height: 100% !important;
}

.research-edit-body .vditor-content {
    height: calc(100% - 40px) !important;
}

.research-edit-body .vditor-toolbar {
    background: #f8f9fa !important;
}

.research-edit-body .vditor-ir,
.research-edit-body .vditor-wysiwyg,
.research-edit-body .vditor-sv {
    height: 100% !important;
}

.research-edit-body .vditor-preview {
    background: #fff !important;
}

/* 自动保存消息样式 */
.auto-save-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Vditor 编辑器定制样式 */
.research-edit-body .vditor-toolbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.research-edit-body .vditor-toolbar .vditor-toolbar__item {
    transition: background-color 0.15s ease-in-out;
}

.research-edit-body .vditor-toolbar .vditor-toolbar__item:hover {
    background-color: #e9ecef !important;
}

/* 编辑模式的响应式设计 */
@media (max-width: 768px) {

    /* 移动端编辑器工具栏优化 */
    .research-edit-body .vditor-toolbar {
        flex-wrap: wrap !important;
    }

    .research-edit-body .vditor-toolbar .vditor-toolbar__item {
        min-width: 32px !important;
        height: 32px !important;
    }

    /* 自动保存消息在移动端的位置调整 */
    .auto-save-message {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .research-edit-body .vditor {
        font-size: 14px !important;
    }

    .research-edit-body .vditor-toolbar .vditor-toolbar__item {
        min-width: 28px !important;
        height: 28px !important;
    }
}

/* 研究报告列表项进度条样式 */
.research-item-progress {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.research-progress-bar {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.research-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    transition: width 0.3s ease;
    position: relative;
}

.research-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.research-progress-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-align: center;
}

/* 研究项目状态样式 */
.research-item.processing {
    border-color: #ffc107;
    background: #fffbf0;
}

.research-item.processing:hover {
    border-color: #e0a800;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.research-item.completed {
    border-color: #28a745;
    background: #f8fff9;
}

.research-item.completed:hover {
    border-color: #1e7e34;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.research-item.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.research-item.error:hover {
    border-color: #c82333;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

/* 编辑器禁用状态样式 */
.research-edit-container.disabled {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.research-edit-container.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.research-edit-container.disabled::after {
    content: attr(data-disabled-message);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #6c757d;
    font-weight: 500;
    z-index: 11;
    white-space: nowrap;
}

/* 默认提示文字，当没有设置data-disabled-message时使用 */
.research-edit-container.disabled:not([data-disabled-message])::after {
    content: '请选择或创建一个研究项目开始编辑';
}

[class^="language-"] {
    background-color: transparent !important;
}

.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {
    opacity: 0.7 !important;
}

/* 无限滚动相关样式 */
.loading-placeholder,
.loading-more {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.loading-placeholder i,
.loading-more i {
    margin-right: 0.5rem;
    color: #007bff;
}

.empty-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-placeholder i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-placeholder p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.empty-placeholder p:first-of-type {
    font-weight: 600;
    color: #495057;
}

.error-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: #dc3545;
}

.error-placeholder i {
    font-size: 2.5rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-placeholder p {
    margin: 0.5rem 0 1.5rem 0;
    color: #6c757d;
}

/* 研究项目状态样式优化 */
.research-item.processing {
    border-left: 4px solid #ffc107;
}

.research-item.completed {
    border-left: 4px solid #28a745;
}

.research-item.processing .research-item-progress {
    display: block;
}

.research-item.completed .research-item-progress {
    display: none;
}

/* 滚动条样式优化 */
.research-list::-webkit-scrollbar {
    width: 6px;
}

.research-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.research-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.research-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画优化 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.research-item {
    animation: fadeIn 0.3s ease-in-out;
}

/* 搜索框聚焦状态 */
.search-box input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Badge样式优化 */
.research-item-tags .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.badge-success {
    background-color: #28a745;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-secondary {
    background-color: #6c757d;
}

/* 覆盖表格样式，允许内容换行 */
.vditor-reset table {
    border-collapse: collapse !important;
    empty-cells: show !important;
    margin-bottom: 16px !important;
    overflow: visible !important;
    /* 改为visible，不显示滚动条 */
    border-spacing: 0 !important;
    display: table !important;
    /* 改为table，保持表格布局 */
    word-break: break-word !important;
    /* 改为break-word，允许换行 */
    width: 100% !important;
    table-layout: auto !important;
    /* 允许列宽自适应内容 */
}

/* 确保td内容可以换行 */
.vditor-reset table td,
.vditor-reset table th {
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    /* 允许换行 */
    overflow-wrap: break-word !important;
    max-width: 0 !important;
    /* 配合table-layout使用 */
}

.vditor-tip__content {
    background-color: #03b9d9 !important;
    padding: 10px 20px !important;
    color: #fff !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    margin-bottom: 10px !important;
}

/* =============================================
   Deep Research Chat Styles
   ============================================= */

/* 消息时间显示 */
.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.user-message .message-time {
    text-align: right;
}

.assistant-message .message-time {
    text-align: left;
    margin-left: 3rem;
}

/* 加载状态消息 */
.loading-message .message-avatar i {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 消息操作按钮 */
.message-actions {
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.assistant-message:hover .message-actions {
    opacity: 1;
}

.message-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

/* 聊天发送按钮样式增强 */
#sendChatBtn {
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#sendChatBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 停止生成按钮样式 */
#sendChatBtn.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    animation: stopButtonPulse 2s ease-in-out infinite;
}

#sendChatBtn.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

#sendChatBtn.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

@keyframes stopButtonPulse {

    0%,
    100% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
    }

    50% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    }
}

/* 发送按钮图标动画 */
#sendChatBtn i {
    transition: transform 0.2s ease;
}

#sendChatBtn:hover i {
    transform: scale(1.1);
}

#sendChatBtn.btn-danger i {
    animation: stopIconRotate 1s ease-in-out infinite alternate;
}

@keyframes stopIconRotate {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* 代码块样式 */
.message-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
    overflow-x: auto;
    font-size: 0.875rem;
}

.message-content code {
    background: #f8f9fa;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.message-content pre code {
    background: transparent;
    padding: 0;
}

/* 数学公式样式 */
.message-content .MathJax {
    font-size: 1em !important;
}

/* 表格样式 */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.message-content table th,
.message-content table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    text-align: left;
}

.message-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 引用样式 */
.message-content blockquote {
    border-left: 4px solid #007bff;
    margin: 0.5rem 0;
    padding-left: 1rem;
    color: #6c757d;
    font-style: italic;
}

/* 链接样式 */
.message-content a {
    color: #007bff;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

/* 错误消息样式 */
.message-content .text-danger {
    color: #dc3545 !important;
}

/* 聊天输入区域增强 */
.chat-input-area .input-group-append .btn {
    border-left: none;
}

.chat-input-area .input-group-append .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-input-area textarea {
    font-size: 0.9rem;
}

/* 响应式聊天样式 */
@media (max-width: 768px) {
    .message-content {
        max-width: 90%;
    }

    .user-message .message-content {
        max-width: 85%;
    }

    .assistant-message .message-time {
        margin-left: 2.5rem;
    }

    .chat-input-area {
        padding: 0.75rem;
    }

    /* 移动端停止按钮样式调整 */
    #sendChatBtn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
    }

    .assistant-message .message-time {
        margin-left: 2rem;
    }

    .message-content {
        font-size: 0.875rem;
    }

    .chat-input-area textarea {
        font-size: 0.875rem;
    }

    /* 小屏幕停止按钮样式 */
    #sendChatBtn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    #sendChatBtn.btn-danger {
        animation: none;
        /* 在小屏幕上禁用动画以提高性能 */
    }
}

.deepchat-think-box {
    margin: 10px 0 15px 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.deepchat-think-summary {
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
    list-style: none;
    outline: none;
}

.deepchat-think-summary::-webkit-details-marker {
    display: none;
}

.deepchat-think-summary::marker {
    display: none;
}

.deepchat-think-summary:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.deepchat-think-summary .fa-brain {
    color: #17a2b8;
    flex-shrink: 0;
}

.deepchat-think-status {
    flex: 1;
    margin-left: 4px;
}

.deepchat-think-copy {
    font-size: 12px;
    padding: 2px 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.deepchat-think-content {
    padding: 12px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #e9ecef;
}

.deepchat-think-content p:last-child {
    margin-bottom: 0;
}

.deepchat-main-response {
    margin-top: 8px;
}

/* 当思考框展开时的动画效果 */
.deepchat-think-box[open] .deepchat-think-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

/* 自定义details的展开/收起图标 */
.deepchat-think-box[open] .deepchat-think-summary::before {
    content: "▼";
    margin-right: 8px;
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.deepchat-think-summary::before {
    content: "▶";
    margin-right: 8px;
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

/* 流式输出指示器样式 */
.deepchat-streaming-indicator {
    color: #007bff;
    font-weight: bold;
    margin-left: 4px;
    animation: deepchatBlink 1.5s infinite;
    font-size: 1.2em;
    line-height: 1;
    vertical-align: baseline;
}

@keyframes deepchatBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

/* =============================================
   引用按钮样式
   ============================================= */

.quote-button {
    position: fixed;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3), 0 0 0 0 rgba(0, 123, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
    user-select: none;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.quote-button.show {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: quoteButtonPulse 2s infinite;
}

.quote-button:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.5), 0 0 0 4px rgba(0, 123, 255, 0.2);
}

.quote-button:active {
    transform: scale(0.9) rotate(-2deg);
    transition: all 0.1s ease;
}

@keyframes quoteButtonPulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3), 0 0 0 0 rgba(0, 123, 255, 0.4);
    }

    50% {
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3), 0 0 0 8px rgba(0, 123, 255, 0.1);
    }
}

.quote-button i {
    pointer-events: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .quote-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .quote-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

html.dark .research-sidebar {
    border-color: #202123;
}

html.dark .research-sidebar-header {
    background-color: #292A2D;
    border-color: #292A2D;
}

html.dark .sidebar-title-row h5 {
    color: lightgray;
}

html.dark .research-list {
    background-color: #292A2D;
}

html.dark .research-item.completed {
    background-color: #333;
}

html.dark .research-item-header h6 {
    color: lightgray;
}

html.dark .research-edit-body .vditor-toolbar {
    background: #292A2D !important;
    border-color: #333;
}

html.dark .vditor-outline {
    background-color: #202123;
    color: lightgray !important;
}

html.dark .vditor-outline li>span {
    color: lightgray !important;
}

html.dark .vditor-reset {
    background: #292A2D !important;
    color: lightgray;
}

html.dark .vditor-reset table tbody tr:nth-child(2n) {
    background-color: #495057;
}

html.dark .chat-messages {
    background-color: #292A2D;
}

html.dark .chat-input-area {
    background-color: #292A2D;
}

html.dark .message-content {
    background: #495057;
    color: lightgray;
}

html.dark .activity-item:hover {
    background: #495057;
}

html.dark .activity-title {
    color: lightgray;
}