/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f7f7f8;
    color: #1f2937;
    height: 100vh;
    overflow: hidden; /* 保持全局不滚动 */
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
}

/* 确保所有元素都不会导致水平滚动 */
* {
    box-sizing: border-box;
    max-width: 100%;
}

/* 防止内容区域超出视口 */
html {
    overflow-x: hidden;
    width: 100%;
}

/* 主容器 */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 侧边栏样式 - 科技感红色主题 */
.sidebar {
    width: 360px;
    background-color: #b44f4f;
    border-right: 1px solid #f87171;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 科技感装饰效果 */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    transform: translate(40%, -40%);
}

.sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    transform: translate(-30%, 30%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 100%);
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255,255,255,0.2), inset 0 0 10px rgba(255,255,255,0.1);
    overflow: hidden;
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: #ffffff;
}

/* 引导标题 */
.new-chat-section {
    padding: 16px;
}

.conversations-section {
    padding: 16px;
    /* 保持与会话按钮对齐 */
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin: 0 auto 8px auto;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    width: 50%;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* 确保左边框对齐 */
    margin-left: 0;
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.2) 100%);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.new-chat-btn svg {
    color: #ffffff;
}

/* 分类列表 */
.categories-section {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 分类按钮包装器 */
.category-wrapper {
    position: relative;
    width: 100%;
    z-index: 9999;
}

/* 弹出框样式 - 使用fixed定位使其在整个文档范围内显示 */
.tooltip {
    position: fixed;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease;
}

.tooltip-content {
    background-color: rgba(180, 79, 79, 0.9); /* 透明红色背景 */
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 800px;
    height: 600px;
    overflow: hidden; /* 移除所有滚动条 */
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10000;
    position: relative;
    word-wrap: break-word; /* 确保长文本换行 */
    white-space: normal; /* 允许正常换行 */
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .tooltip-content {
        width: calc(100vw - 400px);
        height: 600px;
    }
}

@media (max-width: 900px) {
    .tooltip-content {
        width: calc(100vw - 350px);
        height: 500px;
    }
}

/* 鼠标悬停时显示弹出框 */
.category-wrapper:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* 鼠标悬停在弹出框上时保持显示 */
.tooltip:hover {
    visibility: visible;
    opacity: 1;
}

/* 弹出框内文字样式 */
.tooltip-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.tooltip-content h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
}

.tooltip-content p {
    margin-bottom: 10px;
}

.tooltip-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.tooltip-content li {
    margin-bottom: 5px;
}

.category-item {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 14px;
    text-align: left;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 确保左边框对齐 */
    margin-left: 0;
}

.arrow-icon {
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-item:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.conversation-item {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 19px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
    border: 1px solid transparent; /* 默认透明边框 */
    /* 确保左边框对齐并调整宽度 */
    margin-left: 0;
}

.conversation-item:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.2) 100%);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.conversation-item.active {
    background-color: transparent; /* 默认纯透明背景，只显示文字 */
    border-color: transparent; /* 默认不显示边框 */
    box-shadow: none; /* 移除阴影效果 */
}

/* 确保选中状态的会话项在鼠标悬停时也显示与新建对话按钮一致的样式 */
.conversation-item.active:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.2) 100%);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.conversation-title {
    flex: 1;
    font-size: 14px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item.active .conversation-title {
    color: #ffffff;
    font-weight: 500;
}

.conversation-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.conversation-action {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
}

.conversation-action:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    min-height: 0; /* 关键：允许子元素正确设置 flex:1 的滚动 */
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    min-height: 0; /* 关键：使 messages-container 能够计算高度 */
}

.messages-container {
    flex: 1;
    overflow-y: auto; /* 启用滚动 */
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0; /* 防止被父容器撑开导致无法滚动 */
}

/* 确保侧边栏会话列表也可滚动 */
.conversations-section {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* 增强滚动条可见性（保留之前的样式调整） */
.messages-container,
.conversations-section {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

.messages-container::-webkit-scrollbar,
.conversations-section::-webkit-scrollbar {
    width: 10px;
}

.messages-container::-webkit-scrollbar-track,
.conversations-section::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb,
.conversations-section::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.conversations-section::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 16px;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

/* 消息气泡 */
.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background-color: #3b82f6;
    color: white;
}

.message.assistant .message-avatar {
    background-color: #f3f4f6;
    color: #374151;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 44px);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background-color: #b44f4f;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background-color: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

/* 消息功能按钮栏 */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.message.user .message-actions {
    justify-content: flex-start;
}

/* 消息功能按钮 */
.message-action-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    white-space: nowrap;
}

.message-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

.message.user .message-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 点赞/差评按钮状态 */
.message-action-btn.like-btn.liked {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

.message-action-btn.dislike-btn.disliked {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .message-actions {
        gap: 4px;
    }
    
    .message-action-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

.message.assistant .message-time {
    text-align: left;
}

/* 消息中的图片 */
.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

/* 加载状态 */
.message.loading .message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 输入区域 */
.input-section {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 文件预览 */
.file-preview {
    margin-bottom: 12px;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.file-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

/* 输入行 */
.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #f63b3b;
     /*border-color: #3b82f6;*/
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#messageInput {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 96px 12px 16px;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    font-family: inherit;
}

#messageInput::placeholder {
    color: #9ca3af;
}

/* 长按说话按钮 */
.long-press-voice-btn {
    width: 100%;
    height: 44px;
    background-color: #b44f4f;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.long-press-voice-btn:hover {
    background-color: #c56060;
    transform: translateY(-1px);
}

.long-press-voice-btn:active {
    background-color: #a34545;
    transform: translateY(0);
}

.long-press-voice-btn.recording {
    background-color: #b44f4f;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 输入工具栏 */
.input-toolbar {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 发送按钮 */
.send-btn {
    width: 44px;
    height: 44px;
    background-color: #3b82f6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    background-color: #2563eb;
}

.send-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* Tooltip样式 */
.tooltip-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: white;
    font-weight: 500;
    text-align: center; /* 标题居中显示 */
}

.tooltip-content {
    max-height: 500px; /* 设置最大高度 */
    overflow-y: auto; /* 超出部分显示垂直滚动条 */
}

/* 自定义滚动条样式 */
.tooltip-content::-webkit-scrollbar {
    width: 6px;
}

.tooltip-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* 底部信息 */
.footer {
    text-align: center;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.footer-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #374151;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px;
}

/* 语音录制器 */
.voice-recorder {
    text-align: center;
}

.voice-visualizer {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.voice-circle::before {
    content: '🎤';
    font-size: 32px;
    color: white;
}

.voice-circle.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.voice-status {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

.voice-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.voice-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.voice-btn.start {
    background-color: #10b981;
    color: white;
}

.voice-btn.start:hover {
    background-color: #059669;
}

.voice-btn.stop {
    background-color: #ef4444;
    color: white;
}

.voice-btn.stop:hover {
    background-color: #dc2626;
}

.voice-btn.cancel {
    background-color: #6b7280;
    color: white;
}

.voice-btn.cancel:hover {
    background-color: #4b5563;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .chat-container {
        max-width: none;
        margin: 0;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .input-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .send-btn {
        width: 100%;
        height: 44px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* 滚动条样式 */
.messages-container,
.conversations-section {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

.messages-container::-webkit-scrollbar,
.conversations-section::-webkit-scrollbar {
    width: 10px;
}

.messages-container::-webkit-scrollbar-track,
.conversations-section::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb,
.conversations-section::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.conversations-section::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* 动画效果 */
.message {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversation-item {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 选中文本样式 */
::selection {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* 焦点样式 */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
/* 隐藏聊天消息区域滚动条但保留滚动功能 */
.messages-container {
  -ms-overflow-style: none; /* IE/旧版 Edge 隐藏滚动条 */
  scrollbar-width: none;    /* Firefox 隐藏滚动条 */
  scrollbar-gutter: auto;   /* 不保留滚动条占位，避免空白边距 */
}
.messages-container::-webkit-scrollbar {
  width: 0;  /* WebKit 隐藏滚动条 */
  height: 0;
}
.conversations-section::-webkit-scrollbar {
  width: 10px;
}
.conversations-section::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 6px;
}
.conversations-section::-webkit-scrollbar-thumb {
  background-color: #9ca3af;
  border-radius: 6px;
}
.conversations-section::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280;
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 16px;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

/* 消息气泡 */
.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background-color: #f63b3b;
    /*background-color: #3b82f6;*/
    color: white;
}

.message.assistant .message-avatar {
    background-color: #f3f4f6;
    color: #374151;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 44px);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background-color: #f63b3b;
    /* background-color: #3b82f6;*/
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background-color: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message.assistant .message-time {
    text-align: left;
}

/* 消息中的图片 */
.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

/* 加载状态 */
.message.loading .message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 输入区域 */
.input-section {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 文件预览 */
.file-preview {
    margin-bottom: 12px;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.file-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

/* 输入行 */
.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#messageInput {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px 12px 16px;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    font-family: inherit;
}

#messageInput::placeholder {
    color: #9ca3af;
}

/* 输入工具栏 */
.input-toolbar {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 发送按钮 */
.send-btn {
    width: 44px;
    height: 44px;
    background-color: #f63b3b;
    /*    background-color: #3b82f6; */
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    background-color: #2563eb;
}

.send-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* 底部信息 */
.footer {
    text-align: center;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.footer-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #374151;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px;
}

/* 语音录制器 */
.voice-recorder {
    text-align: center;
}

.voice-visualizer {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.voice-circle::before {
    content: '🎤';
    font-size: 32px;
    color: white;
}

.voice-circle.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.voice-status {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

.voice-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.voice-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.voice-btn.start {
    background-color: #10b981;
    color: white;
}

.voice-btn.start:hover {
    background-color: #059669;
}

.voice-btn.stop {
    background-color: #ef4444;
    color: white;
}

.voice-btn.stop:hover {
    background-color: #dc2626;
}

.voice-btn.cancel {
    background-color: #6b7280;
    color: white;
}

.voice-btn.cancel:hover {
    background-color: #4b5563;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .chat-container {
        max-width: none;
        margin: 0;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .input-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .send-btn {
        width: 100%;
        height: 44px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* 滚动条样式 */
.messages-container,
.conversations-section {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

.messages-container::-webkit-scrollbar,
.conversations-section::-webkit-scrollbar {
    width: 10px;
}

.messages-container::-webkit-scrollbar-track,
.conversations-section::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb,
.conversations-section::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.conversations-section::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* 动画效果 */
.message {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversation-item {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 选中文本样式 */
::selection {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* 焦点样式 */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
/* 隐藏聊天消息区域滚动条但保留滚动功能 */
.messages-container {
  -ms-overflow-style: none; /* IE/旧版 Edge 隐藏滚动条 */
  scrollbar-width: none;    /* Firefox 隐藏滚动条 */
  scrollbar-gutter: auto;   /* 不保留滚动条占位，避免空白边距 */
}
.messages-container::-webkit-scrollbar {
  width: 0;  /* WebKit 隐藏滚动条 */
  height: 0;
}
.conversations-section::-webkit-scrollbar {
  width: 10px;
}
.conversations-section::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 6px;
}
.conversations-section::-webkit-scrollbar-thumb {
  background-color: #9ca3af;
  border-radius: 6px;
}
.conversations-section::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280;
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 16px;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

/* 消息气泡 */
.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background-color: #b44f4f;
   /*   background-color: #b44f4f; */
    color: white;
}

.message.assistant .message-avatar {
    background-color: #f3f4f6;
    color: #374151;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 44px);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background-color: #f63b3b;
    /*  background-color: #3b82f6; */
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    position: relative;
}

.message-play-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    border: none;
    background: rgba(255,255,255,0.75);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 6px;
    color: #111827;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    opacity: 0.6; /* 默认半透明可见 */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.message.assistant .message-bubble:hover .message-play-btn {
    opacity: 1;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .message-play-btn {
        opacity: 0.9; /* 移动端提高可见度 */
    }
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 0.6em 0 0.4em;
    line-height: 1.25;
}

.message-bubble a {
    color: #2563eb;
    text-decoration: underline;
}

.message-bubble code {
    background: rgba(31, 41, 55, 0.08);
    padding: 0.15em 0.35em;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95em;
}

.message-bubble pre {
    background: rgba(31, 41, 55, 0.08);
    padding: 12px;
    border-radius: 8px;
    overflow: auto;
}

.message-bubble pre code {
    background: transparent;
    padding: 0;
}

.message-bubble ul,
.message-bubble ol {
    padding-left: 1.2em;
    margin: 0.5em 0;
}

.message-bubble li {
    margin: 0.3em 0;
}
.message.user .message-bubble {
    background-color: #f63b3b;
   /*     background-color: #3b82f6; */
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background-color: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message.assistant .message-time {
    text-align: left;
}

/* 消息中的图片 */
.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

/* 加载状态 */
.message.loading .message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 输入区域 */
.input-section {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 文件预览 */
.file-preview {
    margin-bottom: 12px;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.file-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

/* 输入行 */
.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #f63b3b;
     /*   border-color: #3b82f6; */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#messageInput {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px 12px 16px;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    font-family: inherit;
}

#messageInput::placeholder {
    color: #9ca3af;
}

/* 输入工具栏 */
.input-toolbar {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 发送按钮 */
.send-btn {
    width: 44px;
    height: 44px;
    background-color: #3b82f6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    background-color: #2563eb;
}

.send-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* 底部信息 */
.footer {
    text-align: center;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.footer-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #374151;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px;
}

/* 语音录制器 */
.voice-recorder {
    text-align: center;
}

.voice-visualizer {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.voice-circle::before {
    content: '🎤';
    font-size: 32px;
    color: white;
}

.voice-circle.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.voice-status {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
}

.voice-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.voice-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.voice-btn.start {
    background-color: #10b981;
    color: white;
}

.voice-btn.start:hover {
    background-color: #059669;
}

.voice-btn.stop {
    background-color: #ef4444;
    color: white;
}

.voice-btn.stop:hover {
    background-color: #dc2626;
}

.voice-btn.cancel {
    background-color: #6b7280;
    color: white;
}

.voice-btn.cancel:hover {
    background-color: #4b5563;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .chat-container {
        max-width: none;
        margin: 0;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .input-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .send-btn {
        width: 100%;
        height: 44px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* 滚动条样式 */
.messages-container,
.conversations-section {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

.messages-container::-webkit-scrollbar,
.conversations-section::-webkit-scrollbar {
    width: 10px;
}

.messages-container::-webkit-scrollbar-track,
.conversations-section::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb,
.conversations-section::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 6px;
}

.messages-container::-webkit-scrollbar-thumb:hover,
.conversations-section::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* 动画效果 */
.message {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversation-item {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 选中文本样式 */
::selection {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* 焦点样式 */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
.message-bubble p {
    margin: 0.5em 0;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 0.6em 0 0.4em;
    line-height: 1.25;
}

.message-bubble a {
    color: #2563eb;
    text-decoration: underline;
}

.message-bubble code {
    background: rgba(31, 41, 55, 0.08);
    padding: 0.15em 0.35em;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95em;
}

.message-bubble pre {
    background: rgba(31, 41, 55, 0.08);
    padding: 12px;
    border-radius: 8px;
    overflow: auto;
}

.message-bubble pre code {
    background: transparent;
    padding: 0;
}

.message-bubble ul,
.message-bubble ol {
    padding-left: 1.2em;
    margin: 0.5em 0;
}

.message-bubble li {
    margin: 0.3em 0;
}
.message.user .message-bubble {
    background-color: #b44f4f;
    /*    background-color: #3b82f6; */
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background-color: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.message.assistant .message-time {
    text-align: left;
}

/* 消息中的图片 */
.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

/* 加载状态 */
.message.loading .message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 输入区域 */
.input-section {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 文件预览 */
.file-preview {
    margin-bottom: 12px;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.file-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background-color: #f3f4f6;
    color: #ef4444;
}

/* 输入行 */
.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#messageInput {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px 12px 16px;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    font-family: inherit;
}

#messageInput::placeholder {
    color: #9ca3af;
}

/* 输入工具栏 */
.input-toolbar {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 发送按钮 */
.send-btn {
    width: 44px;
    height: 44px;
    background-color: #3b82f6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    background-color: #2563eb;
}

.send-btn:disabled {
    background-color: #d1d5db;
    cursor: not-allowed;
}

/* 底部信息 */
.footer {
    text-align: center;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.footer-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}
