/* DS随心转 AI聊天页面样式 */

/* 全局重置和基础样式 */
* {
    box-sizing: border-box;
}

.chat-home-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    overflow: hidden;
}

.chat-home-main {
    height: 100vh;
    position: relative;
}

/* 用户头像 - 固定在左下角 */
.chat-user-profile {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 200;
}

.chat-user-avatar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border-radius: 50px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.chat-user-avatar:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #333;
}

.chat-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

.chat-user-avatar .user-name {
    font-size: 14px;
    font-weight: 500;
    margin-right: 4px;
}

.chat-user-avatar .vip-badge {
    width: 20px;
    height: 20px;
    margin: 0 4px;
}

.chat-user-avatar .layui-icon {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.chat-user-dropdown.show + .chat-user-avatar .layui-icon {
    transform: rotate(180deg);
}

/* 用户下拉菜单 */
.chat-user-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    min-width: 120px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.chat-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-user-dropdown .dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.chat-user-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.chat-user-dropdown .dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 4px 0;
}

.chat-user-dropdown .dropdown-logout-btn {
    color: #dc3545;
}

.chat-user-dropdown .dropdown-logout-btn:hover {
    background-color: #fff5f5;
}

/* 主容器 */
.chat-container {
    display: flex;
    height: 100vh;
    background-color: #f8f9fa;
}

/* 左侧边栏 */
.chat-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 100;
}

/* 顶部导航区域 */
.chat-nav {
    padding: 60px 10px 30px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.chat-logo {
    margin-bottom: 20px;
}

.chat-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.chat-logo .logo-img {
    width: 32px;
    height: 32px;
    margin-right: 12px;
}

.chat-logo .logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.chat-navigation {
    width: 60%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-navigation .nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 26px;
    text-decoration: none;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.chat-navigation .nav-item .iconfont {
    font-size: 16px;
}

.chat-navigation .nav-item:hover {
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

.chat-navigation .nav-item.active {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 格式转换按钮样式 */
.chat-navigation .nav-item-convert {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chat-navigation .nav-item-convert:hover {
    background: linear-gradient(135deg, #5a6dd8 0%, #6a408f 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-new-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
}

/* 会话管理区域 */
.chat-session-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 80px; /* 为用户头像留出空间 */
}

/* 新建对话按钮 */
.new-chat-btn {
    margin: 20px;
    padding: 12px 16px;
    background: #fff;
    color: black;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    border: solid 1px #eee;
}

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

.new-chat-btn:active {
    transform: translateY(0);
}

.new-chat-btn .layui-icon {
    font-size: 16px;
}

/* 会话列表容器 */
.session-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.session-title {
    padding: 0 20px 12px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.session-title .layui-icon {
    font-size: 16px;
}

/* 会话列表 */
.session-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.session-list::-webkit-scrollbar {
    width: 4px;
}

.session-list::-webkit-scrollbar-track {
    background: transparent;
}

.session-list::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.session-list::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* 会话项 */
.session-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.session-item:hover {
    background: #f0f0f0;
    border-color: #e0e0e0;
}

.session-item.active {
    background: #e3f2fd;
    border-color: #1976d2;
}

.session-content {
    flex: 1;
    min-width: 0;
}

.session-title-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* 内联编辑输入框样式 */
.session-title-input {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    width: 100%;
    border: 1px solid #1976d2;
    border-radius: 4px;
    padding: 2px 6px;
    margin-bottom: 4px;
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.session-title-input:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.3);
}

.session-time {
    font-size: 12px;
    color: #999;
}

.session-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.session-item:hover .session-actions {
    opacity: 1;
}

.session-actions .layui-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.session-edit {
    color: #6c757d;
}

.session-edit:hover {
    background-color: #e2e6ea;
    color: #495057;
}

.session-delete {
    color: #dc3545;
}

.session-delete:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* 空状态 */
.empty-sessions {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-sessions .layui-icon {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
    display: block;
}

.empty-sessions p {
    margin: 4px 0;
    font-size: 14px;
}

.empty-sessions p:first-of-type {
    font-weight: 500;
    color: #495057;
}

/* 右侧主内容区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
}

.chat-main::-webkit-scrollbar {
    width: 8px;
}

.chat-main::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.chat-main::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.chat-main::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.chat-main {
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 #f8f9fa;
}

/* 欢迎区域 */
.chat-welcome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: white;
}

.welcome-content {
    text-align: center;
    color: #333;
    width: 80%;
    padding: 0 20px;
}

.welcome-content h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 30px 0;
    color: #2c3e50;
}

.welcome-content img {
    width: 36px;
    margin-right: 10px;
}

/* 消息显示区域 */
.chat-messages {
    flex: none;
    padding: 20px 0 160px 0;
    background: transparent;
    margin: 0 auto;
    width: 90%;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* 消息样式 */
.message {
    display: flex;
    margin-bottom: 24px;
    align-items: flex-start;
    max-width: 100%; /* 确保消息不会溢出 */
}

.message.user-message {
    justify-content: flex-end;
}

.message.ai-message {
    justify-content: flex-start;
}

.user-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%; /* 预留一些空间，避免贴边 */
    width: 100%;
}

.message-bubble {
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    max-width: 100%; /* 确保内容不会溢出父容器 */
    overflow-wrap: break-word; /* 强制长单词换行 */
    word-break: break-word; /* 兼容性处理 */
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
    padding: 12px 16px;
}

.ai-message .message-bubble {
    color: #333;
    padding: 12px 0 0;
    width: 100%; /* 确保占满父容器宽度 */
    box-sizing: border-box; /* 包含padding在宽度计算中 */
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    opacity: 0.7;
}

.user-message .message-time {
    text-align: right;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* 输入区域通用样式 */
.chat-input-container {
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 6px;
}

/* 输入框包装器通用样式 */
.input-wrapper {
    background: white;
    border-radius: 12px;
    transition: box-shadow 0.2s ease;
}

/* 输入操作区域通用样式 */
.input-actions {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 0;
    gap: 12px;
}

/* 输入选项区域通用样式 */
.input-options {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 确保深度思考按钮和发送按钮的布局 */
.input-options .deep-thinking-btn {
    margin-right: auto;
}

.input-options .upload-btn,
.input-options .send-btn {
    margin-left: 8px;
}

/* === 位置相关的特定样式 === */

/* 初始状态：输入框在欢迎内容中 */
.chat-welcome .chat-input-container {
    position: relative;
    width: 100%;
    transform: none;
}

/* 遮罩层：防止消息穿透输入框 */
.chat-input-backdrop {
    position: relative;
    background: white;
    z-index: 10;
    margin-top: auto;
    padding-top: 20px;
}

/* 对话状态：输入框在底部 */
.chat-input-container.bottom-fixed {
    position: fixed;
    bottom: 10px;
    width: 70%;
    background: white;
    z-index: 100;
    border-radius: 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    /* 初始位置，将通过JavaScript动态调整 */
    left: 15%;
}

/* 底部固定输入框的包装器覆盖样式 */
.chat-input-container.bottom-fixed .input-wrapper {
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.chat-input-container.bottom-fixed .input-wrapper:focus-within {
    box-shadow: none;
}

/* 底部固定输入框的操作区域覆盖样式 */
.chat-input-container.bottom-fixed .input-actions {
    padding: 10px 16px;
}

/* 底部固定输入框的选项区域覆盖样式 */
.chat-input-container.bottom-fixed .input-options {
    padding: 0 10px;
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    background: transparent;
    min-height: 60px;
    overflow-y: auto;
}

.message-input::placeholder {
    color: #999;
}

.send-btn {
    width: 30px;
    height: 33px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn .iconfont {
    font-size: 20px;
}

/* 文件上传按钮样式 */
.upload-btn {
    width: 30px;
    height: 33px;
    border: none;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 8px;
}

.upload-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(208, 212, 209, 0.4);
}

.upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.upload-btn .layui-icon {
    font-size: 18px;
}

/* 已上传文件显示区域样式 */
.uploaded-files {
    position: relative;
    z-index: 10;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.uploaded-file {
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #28a745;
    animation: fadeIn 0.3s ease;
    cursor: pointer;
    position: relative;
}

.uploaded-file .remove-file {
    margin: 0;
    padding: 0;
    position: absolute;
    top: -6px;
    right: -6px;
    display: none;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.uploaded-file:hover .remove-file {
    display: flex;
}

.uploaded-file svg {
    width: 26px;
    height: 26px;
}

.uploaded-file .file-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 消息中的文件显示样式 */
.message-files {
    padding: 8px;
    border-radius: 8px;
}

.message-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 6px;
    padding: 8px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 8px;
    font-size: 14px;
    color: #28a745;
    transition: all 0.2s ease;
}

.message-file .file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.message-file svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

/* 流式响应时的发送按钮 */
.send-btn.streaming {
    position: relative;
}
.send-btn.streaming:hover {
    transform: scale(1.05);
}

/* 停止按钮的图标显示为白色矩形 */
.send-btn.streaming .iconfont {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 2px;
    margin: 0;
}

/* 隐藏原图标内容 */
.send-btn.streaming .iconfont::before {
    content: '';
    display: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.input-tips {
    color: #999;
}

/* 自定义确认弹窗按钮样式 - 让右侧确定按钮高亮 */
.layui-layer-btn .layui-layer-btn0 {
    background-color: #f0f0f0 !important;
    color: #666 !important;
    border-color: #d0d0d0 !important;
}

.layui-layer-btn .layui-layer-btn0:hover {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}

.layui-layer-btn .layui-layer-btn1 {
    background-color: #1976d2 !important;
    color: white !important;
    border-color: #1976d2 !important;
}

.layui-layer-btn .layui-layer-btn1:hover {
    background-color: #1565c0 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        position: relative;
    }

    .chat-user-profile {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 10px 20px;
    }

    .chat-session-area {
        padding-bottom: 20px;
    }

    .chat-main {
        flex: 1;
    }

    .chat-input-backdrop {
        left: 0;
        position: fixed; /* 移动端仍然使用fixed定位 */
        bottom: 0;
        background: white;
    }

    .chat-input-container.bottom-fixed {
        width: 90%;
        left: 5%;
    }

    .welcome-content h1 {
        font-size: 24px;
    }

    .welcome-content p {
        font-size: 14px;
    }

    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chat-nav {
        padding: 15px;
    }
    
    .new-chat-btn {
        margin: 15px;
        padding: 10px 14px;
    }
    
    .session-list {
        padding: 0 15px 15px;
    }
    
    .chat-messages {
        margin: 15px;
        margin-bottom: 0;
        padding: 15px;
    }
    
    .input-actions {
        padding: 12px;
    }
    
    .chat-input-container.bottom-fixed .input-actions {
        padding: 12px 15px;
    }
    
    .message-avatar img {
        width: 32px;
        height: 32px;
    }
    
    .message-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .chat-home-body {
        background-color: #1a1a1a;
    }
    
    .chat-sidebar {
        background: #2d2d2d;
        border-right-color: #404040;
    }
    
    .chat-nav {
        border-bottom-color: #404040;
    }
    
    .chat-logo .logo-text {
        color: #fff;
    }
    
    .chat-navigation .nav-item {
        color: #b0b0b0;
    }
    
    .chat-navigation .nav-item:hover {
        background-color: #404040;
        color: #fff;
    }
    
    .session-item {
        background: #404040;
    }
    
    .session-item:hover {
        background: #4a4a4a;
    }
    
    .session-title-text {
        color: #fff;
    }
    
    .session-time {
        color: #888;
    }
    
    .chat-messages {
        background: #2d2d2d;
    }
    
    .ai-message .message-bubble {
        background: #404040;
        color: #fff;
        border-color: #555;
    }
    
    .input-wrapper {
        background: #2d2d2d;
    }
    
    .message-input {
        color: #fff;
    }
    
    .message-input::placeholder {
        color: #888;
    }
    
    .chat-user-avatar {
        background: #2d2d2d;
        color: #fff;
    }
    
    .chat-user-dropdown {
        background: #2d2d2d;
    }
    
    .chat-user-dropdown .dropdown-item {
        color: #fff;
    }
    
    .chat-user-dropdown .dropdown-item:hover {
        background-color: #404040;
    }
    
    .session-title-input {
        background: #404040;
        border-color: #1976d2;
        color: #fff;
    }
    
    .session-title-input:focus {
        background: #4a4a4a;
    }
    
    .chat-input-backdrop {
        background: #2d2d2d;
    }
}

/* Markdown 内容样式 */
.message-content,
.message-bubble  {
    line-height: 1.8;
    word-wrap: break-word;
    font-size: 15px;
    color: #333;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6,
.message-bubble  h1,
.message-bubble  h2,
.message-bubble  h3,
.message-bubble  h4,
.message-bubble  h5,
.message-bubble  h6 {
    margin: 24px 0 16px 0;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
}

.message-content h1,
.message-bubble  h1 { 
    font-size: 1.8em; 
    border-bottom: 2px solid #e1e4e8;
    padding-bottom: 8px;
}

.message-content h2,
.message-bubble  h2 { 
    font-size: 1.5em; 
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 6px;
}

.message-content h3,
.message-bubble  h3 { font-size: 1.3em; }

.message-content h4,
.message-bubble  h4 { font-size: 1.1em; }

.message-content h5,
.message-bubble  h5 { font-size: 1em; }

.message-content h6,
.message-bubble  h6 { font-size: 0.9em; color: #6a737d; }

.message-content p,
.message-bubble  p {
    margin: 16px 0;
    line-height: 1.8;
}

.message-content ul,
.message-content ol,
.message-bubble  ul,
.message-bubble  ol {
    margin: 16px 0;
    padding-left: 24px;
    line-height: 1.8;
}

.message-content li,
.message-bubble  li {
    margin: 8px 0;
}

/* 第一层列表样式 */
.message-content > ul > li,
.message-bubble > ul > li {
    list-style-type: disc;
}

.message-content > ol > li,
.message-bubble > ol > li {
    list-style-type: decimal;
}

/* 第二层列表样式 */
.message-content > ul > li > ul > li,
.message-bubble > ul > li > ul > li,
.message-content > ol > li > ul > li,
.message-bubble > ol > li > ul > li {
    list-style-type: circle;
}

.message-content > ul > li > ol > li,
.message-bubble > ul > li > ol > li,
.message-content > ol > li > ol > li,
.message-bubble > ol > li > ol > li {
    list-style-type: lower-alpha;
}

.message-content pre,
.message-bubble  pre {
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    overflow: visible; /* 移除滚动条，允许内容自然换行 */
    margin: 20px 0;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%; /* 确保不会溢出 */
    white-space: pre-wrap; /* 允许代码换行 */
    word-break: break-all; /* 强制长代码行换行 */
}

.message-content code,
.message-bubble  code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
    padding: 2px 6px;
    margin: 0;
    background-color: #f1f3f4;
    border: 1px solid #e8eaed;
    border-radius: 4px;
    color: #d73a49;
}

.message-content pre code,
.message-bubble  pre code {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border: 0;
    color: inherit;
    word-break: break-all; /* 强制长代码行换行 */
    white-space: pre-wrap; /* 保持代码格式并允许换行 */
    overflow-wrap: break-word; /* 确保长单词也能换行 */
}

.message-content blockquote,
.message-bubble  blockquote {
    border-left: 4px solid #1976d2;
    padding: 16px 20px;
    margin: 20px 0;
    background-color: #f8f9ff;
    color: #495057;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

.message-content table,
.message-bubble  table {
    border-collapse: collapse;
    margin: 20px 0;
    width: 100%;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%; /* 确保表格不会溢出 */
    table-layout: auto; /* 允许表格自动调整列宽 */
}

/* 为表格添加滚动容器 */
.message-content,
.message-bubble {
    overflow-x: auto; /* 为整个内容区域添加水平滚动 */
}

/* 确保所有文本内容都能正确换行 */
.message-content *,
.message-bubble * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 特殊处理长URL */
.message-content a,
.message-bubble a {
    word-break: break-all;
    overflow-wrap: break-word;
}

.message-content th,
.message-content td,
.message-bubble  th,
.message-bubble  td {
    border: 1px solid #e1e4e8;
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

.message-content th,
.message-bubble  th {
    background-color: #f6f8fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e4e8;
}

.message-content td,
.message-bubble  td {
    background-color: #fff;
}

.message-content tr:nth-child(even) td,
.message-bubble  tr:nth-child(even) td {
    background-color: #f9f9f9;
}

.message-content tr:hover td,
.message-bubble  tr:hover td {
    background-color: #f0f8ff;
}

.message-content hr,
.message-bubble  hr {
    border: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #e1e4e8, transparent);
    margin: 24px 0;
}

/* 数学公式样式 */
.message-content .math-block,
.message-bubble  .math-block {
    margin: 0;
    text-align: center;
    overflow-x: auto;
    padding: 0;
}

.message-content .math-inline,
.message-bubble  .math-inline {
    display: inline;
    padding: 2px 4px;
}

.message-content .math-error,
.message-bubble  .math-error {
    color: #d73a49;
    font-family: monospace;
    background-color: #ffeaea;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ffcdd2;
}

/* 流式渲染临时内容样式 */
.streaming-temp {
    opacity: 0.7;
    font-style: italic;
    color: #666;
}

/* 代码高亮主题适配 */
.message-content .hljs,
.message-bubble  .hljs {
    background: #f8f9fa !important;
    line-height: 1.6;
}

/* 改进强调文本样式 */
.message-content strong,
.message-bubble  strong {
    font-weight: 700;
    color: #2c3e50;
}

.message-content em,
.message-bubble  em {
    font-style: italic;
    color: #495057;
}

/* 改进链接样式 */
.message-content a,
.message-bubble  a {
    color: #1976d2;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

.message-content a:hover,
.message-bubble  a:hover {
    border-bottom: 1px solid #1976d2;
}

/* 暗色主题下的Markdown样式 */
@media (prefers-color-scheme: dark) {
    .message-content,
    .message-bubble  {
        color: #e2e8f0;
    }
    
    .message-content h1,
    .message-content h2,
    .message-content h3,
    .message-content h4,
    .message-content h5,
    .message-content h6,
    .message-bubble  h1,
    .message-bubble  h2,
    .message-bubble  h3,
    .message-bubble  h4,
    .message-bubble  h5,
    .message-bubble  h6 {
        color: #f7fafc;
        border-color: #4a5568;
    }
    
    .message-content pre {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .message-content code {
        background-color: #374151;
        border-color: #4a5568;
        color: #fbbf24;
    }
    
    .message-content blockquote {
        border-left-color: #3b82f6;
        background-color: #1e293b;
        color: #cbd5e1;
    }
    
    .message-content table {
        border-color: #4a5568;
    }
    
    .message-content th,
    .message-content td {
        border-color: #4a5568;
    }
    
    .message-content th {
        background-color: #374151;
        color: #f7fafc;
    }
    
    .message-content td {
        background-color: #1f2937;
    }
    
    .message-content tr:nth-child(even) td {
        background-color: #2d3748;
    }
    
    .message-content tr:hover td {
        background-color: #3730a3;
    }
    
    .message-content hr {
        background: linear-gradient(to right, transparent, #4a5568, transparent);
    }
    
    .message-content .math-block {
        background-color: #374151;
        border-color: #4a5568;
    }
    
    .message-content .math-inline {
        background-color: #374151;
    }
    
    .message-content strong {
        color: #f7fafc;
    }
    
    .message-content em {
        color: #cbd5e1;
    }
    
    .message-content a {
        color: #60a5fa;
    }
    
    .message-content a:hover {
        border-bottom-color: #60a5fa;
    }
    
    .message-content .hljs {
        background: #2d3748 !important;
    }
    
    .streaming-temp {
        color: #9ca3af;
    }

    /* 暗色主题下的加载动画 */
    .message-bubble.loading {
        background: linear-gradient(135deg, #2d3748 0%, #1f2937 100%);
        border-color: #4a5568;
    }

    .typing-indicator span {
        background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
        box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
    }

    .typing-indicator span:nth-child(1),
    .typing-indicator span:nth-child(2),
    .typing-indicator span:nth-child(3) {
        box-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
    }
}

/* 深度思考按钮样式 */
.deep-thinking-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.deep-thinking-btn:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.deep-thinking-btn.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.deep-thinking-btn .layui-icon {
    font-size: 16px;
}

/* 推理内容显示样式 */
.message-reasoning {
    width: 100%;
    margin-bottom: 12px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background-color: #f8f9ff;
    overflow: hidden;
}

.reasoning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #e3f2fd;
    border-bottom: 1px solid #e1e4e8;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.reasoning-header:hover {
    background-color: #bbdefb;
}

.reasoning-header-left {
    display: flex;
    align-items: center;
}

.reasoning-header i {
    margin-right: 8px;
    color: #1976d2;
    font-size: 16px;
}

.reasoning-header span {
    flex: 1;
    font-weight: 500;
    color: #1976d2;
    font-size: 14px;
}

.reasoning-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.reasoning-toggle:hover {
    background-color: rgba(25, 118, 210, 0.1);
}

.reasoning-toggle i {
    color: #1976d2;
    font-size: 14px;
    margin: 0;
}

.reasoning-content {
    padding: 16px;
    display: none;
    background-color: #fafafa;
    border-top: 1px solid #e1e4e8;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* 推理内容Markdown样式 */
.reasoning-content h1,
.reasoning-content h2,
.reasoning-content h3,
.reasoning-content h4,
.reasoning-content h5,
.reasoning-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    color: #2c3e50;
}

.reasoning-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.reasoning-content code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
    padding: 2px 4px;
    margin: 0;
    background-color: #f1f3f4;
    border: 1px solid #e8eaed;
    border-radius: 3px;
    color: #d73a49;
}

.reasoning-content pre {
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    overflow: auto;
    margin: 16px 0;
    font-size: 13px;
}

.reasoning-content pre code {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border: 0;
    color: inherit;
}

/* 暗色主题下的推理内容样式 */
@media (prefers-color-scheme: dark) {
    .deep-thinking-option {
        color: #cbd5e1;
    }
    
    .deep-thinking-option:hover {
        color: #60a5fa;
    }
    
    .deep-thinking-desc {
        color: #9ca3af;
    }
    
    .message-reasoning {
        border-color: #4a5568;
        background-color: #1e293b;
    }
    
    .reasoning-header {
        background-color: #2d3748;
        border-bottom-color: #4a5568;
        color: #60a5fa;
    }
    
    .reasoning-header:hover {
        background-color: #374151;
    }
    
    .reasoning-header i,
    .reasoning-header span {
        color: #60a5fa;
    }
    
    .reasoning-toggle:hover {
        background-color: rgba(96, 165, 250, 0.1);
    }
    
    .reasoning-toggle i {
        color: #60a5fa;
    }
    
    .reasoning-content {
        background-color: #1f2937;
        border-top-color: #4a5568;
        color: #e2e8f0;
    }
    
    .reasoning-content h1,
    .reasoning-content h2,
    .reasoning-content h3,
    .reasoning-content h4,
    .reasoning-content h5,
    .reasoning-content h6 {
        color: #f7fafc;
    }
    
    .reasoning-content code {
        background-color: #374151;
        border-color: #4a5568;
        color: #fbbf24;
    }
    
    .reasoning-content pre {
        background-color: #2d3748;
        border-color: #4a5568;
    }
}

/* 数学公式占位符样式 */
.math-placeholder {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9em;
    cursor: help;
}

.math-placeholder:hover {
    background-color: #fff1b3;
    border-color: #f39c12;
}

/* 暗色主题下的数学占位符 */
@media (prefers-color-scheme: dark) {
    .math-placeholder {
        background-color: #856404;
        color: #fff3cd;
        border-color: #ffeaa7;
    }

    .math-placeholder:hover {
        background-color: #f39c12;
        color: #2c3e50;
    }
}

/* ========== 登录模态窗口样式 ========== */
.login-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    display: none;
}

.login-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px);
    z-index: 1 !important;
}

.login-modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 420px;
    background: white !important;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2 !important;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.login-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.login-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.login-modal-close .layui-icon {
    font-size: 20px;
}

.login-modal-body {
    padding: 24px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.login-form .form-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.login-form .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-form .form-input::placeholder {
    color: #9ca3af;
}

.verify-code-group {
    display: flex;
    gap: 12px;
}

.verify-code-group .form-input {
    flex: 1;
}

.send-code-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.send-code-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-code-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-code-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.login-submit-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.login-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.login-tips {
    margin-top: 16px;
    text-align: center;
}

.login-tips p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.login-tips a {
    color: #3b82f6;
    text-decoration: none;
}

.login-tips a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-modal-content {
        width: 95%;
        margin: 0 10px;
    }

    .login-modal-header {
        padding: 20px 16px 12px;
    }

    .login-modal-body {
        padding: 20px 16px;
    }

    .login-modal-header h3 {
        font-size: 18px;
    }

    .verify-code-group {
        gap: 8px;
    }

    .send-code-btn {
        padding: 0 16px;
        font-size: 13px;
    }
}

/* 三栏布局样式 */
.chat-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* 左侧边栏 - 基础样式 */
.chat-sidebar {
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 展开状态的侧边栏 */
.chat-sidebar.expanded {
    width: 15vw;
    min-width: 260px;
    max-width: 320px;
}

/* 收起状态的侧边栏 */
.chat-sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

/* 侧边栏收起/展开按钮 */
.sidebar-toggle-btn {
    position: absolute;
    top: 15px;
    right: -15px;
    width: 30px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 收起状态侧边栏的切换按钮位置 */
.chat-sidebar.collapsed .sidebar-toggle-btn {
    right: auto;
    left: 10px;
}

.sidebar-toggle-btn i {
    font-size: 14px;
    color: #666;
    transition: transform 0.3s ease;
}

/* 中间聊天区域 */
.chat-main {
    flex: 1;
    min-width: 300px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

/* 右侧编辑器面板 */
.editor-panel {
    width: 30vw;
    min-width: 380px;
    max-width: 700px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease;
}

.editor-panel.collapsed {
    width: 0;
    min-width: 0;
    opacity: 0;
}

/* 右侧编辑器展开按钮 */
.editor-expand-btn {
    position: fixed;
    right: 0;
    top: 4%;
    transform: translateY(-50%);
    width: 30px;
    height: 40px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px 0 0 8px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.editor-expand-btn:hover {
    background: #f8f9fa;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    width: 35px;
}

.editor-expand-btn i {
    font-size: 14px;
    color: #666;
    transition: transform 0.3s ease;
}

/* 编辑器控制区域 */
.editor-controls {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 30px;
    border-bottom: 1px solid #e8e8e8;
    background: #fafbfc;
}

.editor-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.editor-buttons {
    display: flex;
    gap: 8px;
}

.editor-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e8e8e8;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-btn:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

.editor-btn i {
    font-size: 14px;
    color: #666;
}

/* 编辑器收起按钮 - 位于编辑器左上角外侧 */
#editorCollapseBtn {
    position: absolute;
    top: 15px;
    left: -18px;
    width: 30px;
    height: 35px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

#editorCollapseBtn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#editorCollapseBtn i {
    font-size: 14px;
    color: #666;
    transition: transform 0.3s ease;
}

 /* 编辑器内容区域 */
.editor-content {
    flex: 1;
    padding: 4px 20px;
    overflow-y: auto;
}

#react-editor-root {
    height: 100%;
    min-height: 300px;
}

/* 编辑器全屏模态窗口 */
#editorFullscreenModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99998 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
}

.editor-fullscreen-content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 80vw !important;
    height: 95vh !important;
    background: white !important;
    border-radius: 8px;
    z-index: 99999 !important;
    margin: 2.5vh auto;
    display: flex;
    flex-direction: column;
}

.editor-fullscreen-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #e8e8e8;
    background: #fafbfc;
    border-radius: 8px 8px 0 0;
}

.editor-fullscreen-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.editor-fullscreen-close {
    width: 36px;
    height: 36px;
    border: 1px solid #e8e8e8;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-fullscreen-close:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

.editor-fullscreen-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

#react-editor-root-fullscreen {
    height: 100%;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .chat-sidebar.expanded {
        width: 16vw;
        min-width: 250px;
        max-width: 300px;
    }
    .editor-panel {
        width: 29vw;
        min-width: 350px;
        max-width: 420px;
    }
    .chat-main {
        min-width: 320px;
    }
}

@media (max-width: 1024px) {
    .chat-sidebar.expanded {
        width: 18vw;
        min-width: 240px;
        max-width: 280px;
    }
    .chat-sidebar.collapsed {
        width: 50px;
        min-width: 50px;
    }
    .editor-panel {
        width: 28vw;
        min-width: 320px;
        max-width: 380px;
    }
    .chat-main {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100vw;
        min-width: 100vw;
        height: auto;
        position: relative;
    }

    .chat-sidebar.mobile-hidden {
        display: none;
    }

    .chat-main {
        min-width: 100vw;
        height: 60vh;
    }

    .editor-panel {
        width: 100vw;
        min-width: 100vw;
        height: 40vh;
        border-left: none;
        border-top: 1px solid #e8e8e8;
    }

    .sidebar-toggle-btn {
        display: none;
    }
}

/* 收起状态侧边栏样式 */
.chat-sidebar.collapsed .chat-logo {
    justify-content: center;
    padding: 15px 0;
}

.chat-sidebar.collapsed .chat-logo .logo-img {
    margin: 0;
    width: 40px;
    height: 40px;
}

/* 收起状态导航区域 */
.collapsed-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
}

.collapsed-new-chat-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #eee;
    background: #fff;
    color: black;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.collapsed-new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.collapsed-nav-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.2s ease;
}

.collapsed-nav-item:hover {
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

.collapsed-nav-item.nav-item-convert {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.collapsed-nav-item.nav-item-convert:hover {
    background: linear-gradient(135deg, #5a6dd8 0%, #6a408f 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.collapsed-nav-item .iconfont {
    font-size: 18px;
    margin: 0;
}

/* 收起状态用户头像 */
.collapsed-user-profile {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.collapsed-user-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    text-decoration: none;
    transition: all 0.2s ease;
}

.collapsed-user-avatar:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.collapsed-user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #f0f0f0;
}

.collapsed-vip-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 50%;
    border: 2px solid white;
}

/* 收起状态的下拉菜单 */
.collapsed-user-dropdown {
    position: absolute;
    bottom: 50%;
    left: 100%;
    transform: translateY(50%);
    margin-left: 8px;
    min-width: 120px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(50%) translateX(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
    z-index: 1000;
}

.collapsed-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(50%) translateX(0);
}

.collapsed-user-dropdown .dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.collapsed-user-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.collapsed-user-dropdown .dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 4px 0;
}

.collapsed-user-dropdown .dropdown-logout-btn {
    color: #dc3545;
}

.collapsed-user-dropdown .dropdown-logout-btn:hover {
    background-color: #fff5f5;
}

/* 登录模态窗口关键样式 */
#loginModal, #wechatGroupModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

#loginModal .login-modal-content, #wechatGroupModal .login-modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 420px;
    background: white !important;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100000 !important;
}

/* 微信群二维码模态窗口特殊样式 */
#wechatGroupModal .login-modal-content.wechat-group-modal {
    max-width: 380px;
}

#wechatGroupModal .login-modal-body {
    background: #fafbfc;
}

/* 二维码容器悬停效果 */
#wechatGroupModal img {
    transition: transform 0.3s ease;
}

#wechatGroupModal img:hover {
    transform: scale(1.02);
}

/* 登录表单行布局 */
.login-form .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.login-form .form-group label {
    flex-shrink: 0;
    width: 80px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: right;
}

.login-form .form-group .form-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

.login-form .form-group .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-form .verify-code-group {
    display: flex;
    gap: 12px;
    flex: 1;
}

.login-form .verify-code-group .form-input {
    flex: 1;
}

.login-form .send-code-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.login-form .send-code-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-form .send-code-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 消息工具栏样式 */
.message-tools {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 最后一条AI消息的工具栏始终显示 */
.message.ai-message.last-ai-message .message-tools {
    opacity: 1;
    visibility: visible;
}

/* 鼠标悬停时显示工具栏 */
.message.ai-message:hover .message-tools {
    opacity: 1;
    visibility: visible;
}

.message-tools .tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    color: white;
    min-width: auto;
}

.message-tools .tool-btn svg {
    width: 20px;
    height: 20px;
}

.message-tools .tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-tools .tool-btn .iconfont {
    font-size: 14px;
}

/* 复制按钮 */
.message-tools .copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 精修按钮 */
.message-tools .refine-btn {
    background: linear-gradient(135deg, #00bfa5 0%, #00897b 100%);
}

/* 重新生成按钮 */
.message-tools .regenerate-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Word导出按钮 */
.message-tools .export-word {
    background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
}

/* PDF导出按钮 */
.message-tools .export-pdf {
    background: linear-gradient(135deg, #ea4335 0%, #d33b2c 100%);
}

/* Excel导出按钮 */
.message-tools .export-excel {
    background: linear-gradient(135deg, #34a853 0%, #28a745 100%);
}

/* 图片导出按钮 */
.message-tools .export-image {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

/* 加载状态 */
.message-tools .tool-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* 编辑器内容恢复模态窗口样式 */
#restoreEditorModal .restore-editor-modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 460px;
    background: white !important;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100000 !important;
    animation: modalSlideIn 0.3s ease-out;
}

.restore-editor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.restore-editor-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
}

.restore-editor-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.restore-editor-modal-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.restore-editor-modal-close .layui-icon {
    font-size: 20px;
}

.restore-editor-modal-body {
    padding: 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0 0 16px 16px;
}

.restore-editor-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    transition: transform 0.3s ease;
}

.restore-editor-icon:hover {
    transform: scale(1.05);
}

.restore-editor-message {
    font-size: 16px;
    color: #374151;
    margin-bottom: 32px;
    font-weight: 500;
    line-height: 1.6;
}

.restore-editor-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.restore-editor-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 140px;
    gap: 8px;
}

.restore-editor-btn .layui-icon {
    font-size: 16px;
}

.restore-editor-btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.restore-editor-btn-secondary:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.restore-editor-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.restore-editor-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.restore-editor-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .message-tools {
        flex-wrap: wrap;
        gap: 6px;
    }

    .message-tools .tool-btn {
        font-size: 11px;
        padding: 5px 8px;
        min-width: 70px;
    }

    .reasoning-header {
        padding: 10px 12px !important;
    }

    /* 恢复编辑器弹窗移动端适配 */
    #restoreEditorModal .restore-editor-modal-content {
        width: 95%;
        max-width: 380px;
    }

    .restore-editor-modal-header {
        padding: 20px 16px 16px;
    }

    .restore-editor-modal-header h3 {
        font-size: 18px;
    }

    .restore-editor-modal-body {
        padding: 24px 16px;
    }

    .restore-editor-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }

    .restore-editor-icon .layui-icon {
        font-size: 36px !important;
    }

    .restore-editor-message {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .restore-editor-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .restore-editor-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 14px;
    }
}