* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
hr {
    display: none;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    padding: 0;
    margin: 0;
}
h3 {
	font-size: 18px;
	padding: 10px 0 10px 0;
}
h4 {
    margin: 1em 0 0.5em;
    font-size: 18px;
}
.chat-container {
    flex: 1;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #fff;
    position: relative;
    overflow: hidden;
}

/* 左侧边栏样式 */
.sidebar {
    width: 60px;
    background-color: #001529;
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.sidebar.expanded {
    width: 300px;
}

.sidebar-header {
    padding: 0 10px;
    margin-bottom: 30px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    display: none;
}

.sidebar.expanded .sidebar-title {
    display: block;
}

.sidebar-menu {
    flex: 1;
    width: 100%;
    padding: 0 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}

.menu-item i {
    margin-right: 10px;
    font-size: 20px;
    min-width: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

.menu-item span {
    display: none;
}

.sidebar.expanded .menu-item span {
    display: inline;
}

.menu-item:hover {
    background-color: #1890ff;
    color: white;
}

.menu-item.active {
    background-color: #1890ff;
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar.expanded .sidebar-footer {
    display: flex;
}

.user-info {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    padding: 8px 15px;
    border-radius: 4px;
}

.user-info i {
    margin-right: 10px;
    font-size: 20px;
    min-width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-content.expanded {
    margin-left: 250px;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #1890ff;
    color: white;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: bold;
}

.navbar-links {
    display: flex;
    gap: 15px;
}

.navbar-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-header {
    padding: 15px;
    background: #1890ff;
    color: white;
    text-align: center;
    font-size: 18px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    flex: 1;
    text-align: center;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.voice-settings {
    display: flex;
    align-items: center;
}

.voice-select {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    max-width: 150px;
    transition: background-color 0.2s;
}

.voice-select:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.voice-select:focus {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.voice-select option {
    background-color: #1890ff;
    color: white;
}

/* 移动设备适配 */
@media (max-width: 480px) {
    .voice-select {
        max-width: 100px;
        font-size: 12px;
        padding: 4px;
    }
}

/* 用户菜单样式 */
.user-menu {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0 15px;
    height: 100%;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin-right: 8px;
}

/* 设置相关样式 */
.settings-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

.settings-toggle i {
    pointer-events: auto;
    cursor: pointer;
}

.settings-toggle:hover {
    color: #e6f7ff;
}

/* 删除不需要的样式 */
.user-dropdown,
.user-dropdown-item,
.user-dropdown-divider {
    display: none;
}

#clearConversation {
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #fff;
    color: #666;
    width: 30px;
    height: 30px;
    padding: 0;
    position: relative;
}

#clearConversation:hover {
    background: #f5f5f5;
    color: #333;
}

#clearConversation::after {
    content: "清空对话";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    white-space: nowrap;
    font-size: 14px;
    color: #666;
    opacity: 0;
    transition: opacity 0.3s;
}

#clearConversation:hover::after {
    opacity: 1;
}

.chat-settings {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    margin-top: 5px;
}

.chat-settings.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.settings-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.close-settings {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-settings:hover {
    color: #333;
}

.settings-content {
    padding: 16px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.setting-item input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 8px;
}

.setting-item input[type="number"]:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

#conversationRoundsContainer {
    margin-top: 8px;
    margin-bottom: 8px;
    transition: opacity 0.3s;
}

#conversationRoundsContainer.hidden {
    display: none;
}

/* 复制成功提示 */
.copy-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 16px;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

/* 标题样式 */
.header-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* 消息加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading.active {
    opacity: 1;
}

.loading-icon {
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 思考过程块样式 */
.thoughts {
    background-color: #f9f9f9;
    border-left: 3px solid #1890ff;
    margin-bottom: 10px;
}

.thoughts-header {
    font-weight: bold;
    color: #1890ff;
    margin-bottom: 8px;
}

/* 快速提问按钮区域 */
.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px auto;
    max-width: 800px;
    padding: 0 20px;
    justify-content: center;
}

/* 添加居中样式 */
.quick-prompts.centered {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 800px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    text-align: center;
}

.quick-prompts.centered:not(.hidden) {
    display: grid; /* 当没有hidden类时显示 */
}

.quick-prompts.centered::before {
    content: "您可能想了解...";
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #1890ff;
    font-size: 18px;
    font-weight: bold;
}

.quick-prompts.centered .prompt-btn {
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
    background-color: #fff;
    color: #333;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quick-prompts.centered .prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.2);
    background-color: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

.quick-prompts.hidden {
    display: none !important; /* 使用!important确保隐藏 */
}

.prompt-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 13px;
    margin: 3px;
}

.prompt-btn:hover {
    background-color: #0056b3;
}

/* 新对话按钮 */
.new-chat-btn {
    background-color: #1890ff;
    color: white;
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.new-chat-btn:hover {
    background-color: #40a9ff;
}

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

/* 错误消息样式 */
.error-message {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
    color: #ff4d4f;
}
/* 页脚样式 */
.footer {
    background-color: white;
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.footer a {
    color: #1890ff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 聊天消息样式 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 5px 5px 0 5px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.message.visible {
    opacity: 1;
    transform: translateY(0);
}

.message.user {
    align-self: flex-end;
    max-width: 80%;
}

.message.ai {
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.message.user .message-content {
    background-color: #1890ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.ai .message-content {
    background-color: #f5f5f5;
    color: #333;
    border-bottom-left-radius: 4px;
    width: 100%;
	font-size: 15px;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-bottom: 8px;
}

.message-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 8px;
}

.message-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

/* 表格样式 */
.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
    overflow-x: auto;
    display: block;
    font-size: 13px;
}

.message-content table th,
.message-content table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.message-content table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

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

.message-content table tr:hover {
    background-color: #f1f1f1;
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.copy-button, .regenerate-button, .speak-button {
    background: none;
    border: none;
    color: #707579;
    cursor: pointer;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.copy-button:hover, .regenerate-button:hover, .speak-button:hover {
    background-color: #f0f2f5;
    color: #1890ff;
}

.speak-button.speaking {
    color: #1890ff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 聊天输入区域 */
.chat-input-container {
    padding: 5px 10px 10px 10px;
}

.chat-input {
    max-width: 900px;
    margin: 0 auto;
}

.input-container {
    position: relative;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
    padding: 5px 0;
}

.input-container:focus-within {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

#messageInput {
    width: 100%;
    padding: 12px 16px 8px 16px;
    border: none;
    background-color: transparent;
    outline: none;
    font-size: 16px;
    resize: none;
    overflow-y: auto;
    min-height: 48px;
    max-height: 150px; /* 限制最大高度 */
    line-height: 1.5;
    transition: height 0.2s ease;
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 10px 5px 10px;
    gap: 8px;
}

#uploadButton {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
}

#uploadButton:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 0.1);
}

#voiceButton {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#voiceButton:hover {
    color: #1890ff;
    background-color: rgba(24, 144, 255, 0.1);
}

#sendButton {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background-color: #1890ff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendButton:hover {
    background-color: #40a9ff;
}

#sendButton:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
}

/* 思考过程样式 */
.message.thoughts {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    margin: 10px 0;
    padding: 10px;
}

.thoughts-header {
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
}

.thoughts-content {
    color: #212529;
    font-size: 0.9em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.thoughts-content pre {
    background-color: #e9ecef;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
}

.thoughts-content code {
    background-color: #e9ecef;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

/* 优化加载动画样式 */
.message .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 60px;
}

.message .loading.active {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.message .loading:not(.active) {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.message .loading-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.message .loading-text {
    margin-left: 10px;
    color: #6c757d;
    font-size: 0.9em;
}

/* 居中容器样式 */
.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* 新会话按钮容器样式 */
.new-chat-btn-container {
    padding: 10px 0;
    margin-bottom: 20px;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.new-chat-btn:hover {
    background-color: #0056b3;
}

.new-chat-btn i {
    margin-right: 8px;
}

/* 移动设备调整 */
@media (max-width: 768px) {
    .message.user {
        max-width: 90%;
    }
    
    .quick-prompts.centered {
        width: 90%;
        padding: 15px;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .quick-prompts.centered::before {
        font-size: 16px;
        top: -25px;
    }
    
    .quick-prompts.centered .prompt-btn {
        padding: 5px;
        font-size: 14px;
    }
    
    .input-container {
        padding: 5px 0;
    }
    
    .input-actions {
        padding: 0 8px 5px 8px;
        gap: 6px;
    }
    
    #messageInput {
        padding: 10px 12px 8px 12px;
        font-size: 15px;
    }
}

/* 语音按钮监听动画 - 新方案 */
#voiceButton.listening-animation {
  /* 动画会覆盖 background-color */
  animation: pulseRedBackgroundAndScale 1.2s infinite ease-in-out;
}

/* 移除旧的 box-shadow 动画 */
/*
@keyframes pulseButtonBorder {
  0% {
    box-shadow: 0 0 0 0px rgba(255, 0, 0, 0.8);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0px rgba(255, 0, 0, 0);
  }
}
*/

@keyframes pulseRedBackgroundAndScale {
  0% {
    background-color: #e60000; /* 深红色 */
    transform: scale(1);
  }
  50% {
    background-color: #ff4d4d; /* 鲜红色 */
    transform: scale(1.05); /* 轻微放大 */
  }
  100% {
    background-color: #e60000; /* 深红色 */
    transform: scale(1);
  }
}

/* 上传按钮样式 */
#uploadButton::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    z-index: 1000;
    width: max-content;
    max-width: 220px;
    margin-bottom: 5px;
}

#uploadButton::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.75) transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    margin-bottom: -5px;
}

#uploadButton:hover::after,
#uploadButton:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 文件预览容器 */
.file-preview-container {
    margin: 10px 15px;
    padding: 10px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background-color: #f9f9f9;
    overflow: hidden;
    transition: all 0.3s;
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

#removeFile {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
}

#removeFile:hover {
    color: #f5222d;
}

.file-preview {
    margin-bottom: 10px;
    text-align: center;
    max-height: 150px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.file-thumbnail {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.text-file {
    background-color: #e6f7ff;
    color: #1890ff;
}

.word-file {
    background-color: #e6f7ff;
    color: #1677ff;
}

.image-thumbnail {
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    object-fit: contain;
}

.file-text-preview {
    padding: 10px;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 12px;
    max-height: 100px;
    overflow-y: auto;
    color: #666;
}

.text-preview {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
}

/* 适配移动设备 */
@media (max-width: 768px) {
    .message.user {
        padding-right: 10px;
    }
}

/* 迷你文件预览样式 */
.mini-file-preview {
    display: flex;
    align-items: center;
    background-color: rgba(24, 144, 255, 0.08);
    border-radius: 4px;
    padding: 2px 4px;
    max-width: 120px;
    margin: 0 0 0 10px;
}

.mini-thumbnail {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #1890ff;
    margin-right: 4px;
    overflow: hidden;
}

.mini-thumbnail.text-file {
    color: #1890ff;
}

.mini-thumbnail.pdf-file {
    color: #fa541c;
}

.mini-thumbnail.word-file {
    color: #1677ff;
}

.mini-image {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 2px;
}

#miniRemoveFile {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    margin-left: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

#miniRemoveFile:hover {
    color: #f5222d;
}

/* 消息中的文件信息样式 */
.message-file-info {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 3px 0;
    font-size: 12px;
}

.message-mini-thumbnail {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 14px;
    border-radius: 2px;
    overflow: hidden;
}

.message-thumb-img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
}

.message-file-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.pdf-thumb {
    color: #fa541c;
}

.word-thumb {
    color: #1677ff;
}

.text-thumb {
    color: #1890ff;
}

.message-text {
    word-break: break-word;
}

/* OCR进度条样式 */
.ocr-progress-container {
    margin: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.ocr-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#ocrProgressTitle {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

#ocrProgressPercent {
    font-size: 14px;
    color: #1890ff;
    font-weight: bold;
}

.ocr-progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ocr-progress-bar {
    height: 100%;
    background-color: #1890ff;
    border-radius: 4px;
    width: 0;
    transition: width 0.3s;
}

.ocr-progress-status {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.auto-speak-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.auto-speak-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.auto-speak-toggle.active {
    background-color: rgba(255, 255, 255, 0.3);
}

.auto-speak-toggle.disabled {
    color: rgba(255, 255, 255, 0.5);
}

.auto-speak-toggle.disabled i:before {
    content: "\f6a9"; /* fa-volume-mute */
}