diff --git a/frontend/src/components/chat/MessageList.css b/frontend/src/components/chat/MessageList.css index 7474d349..7511174b 100644 --- a/frontend/src/components/chat/MessageList.css +++ b/frontend/src/components/chat/MessageList.css @@ -1,15 +1,21 @@ .message-list { flex: 1; overflow-y: auto; - padding: 24px; - background: #f5f5f5; + overflow-x: hidden; + padding: 20px 16px 20px 20px; /* 右侧留空给滚动条 */ + background: linear-gradient(180deg, #f5f7fa 0%, #fafbfc 100%); + min-height: 0; /* 重要:让flex容器可以正确计算滚动 */ + max-height: 100%; /* 限制最大高度 */ + position: relative; + scroll-behavior: smooth; /* 平滑滚动 */ } .message-item { display: flex; gap: 12px; - margin-bottom: 24px; + margin-bottom: 20px; animation: fadeIn 0.3s ease-in; + max-width: 100%; } @keyframes fadeIn { @@ -40,14 +46,31 @@ .message-body { background: white; - border-radius: 8px; - padding: 12px 16px; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + border-radius: 12px; + padding: 14px 18px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + max-width: 85%; + word-wrap: break-word; + transition: box-shadow 0.2s ease; +} + +.message-body:hover { + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); } .message-user .message-body { - background: #e6f7ff; - border: 1px solid #91d5ff; + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + border: none; + color: white; +} + +.message-user .user-message-text { + color: white; +} + +.message-assistant .message-body { + background: white; + border: 1px solid #e8e8e8; } .user-message-text { @@ -168,22 +191,22 @@ border-top: 1px solid #f0f0f0; } -/* 滚动条样式 */ +/* 滚动条样式 - 优化 */ .message-list::-webkit-scrollbar { - width: 8px; + width: 6px; } .message-list::-webkit-scrollbar-track { - background: #f1f1f1; - border-radius: 4px; + background: transparent; } .message-list::-webkit-scrollbar-thumb { - background: #888; - border-radius: 4px; + background: rgba(0, 0, 0, 0.2); + border-radius: 3px; + transition: background 0.2s; } .message-list::-webkit-scrollbar-thumb:hover { - background: #555; + background: rgba(0, 0, 0, 0.35); } diff --git a/frontend/src/layouts/MainLayout.tsx b/frontend/src/layouts/MainLayout.tsx index 4dc75845..1e103167 100644 --- a/frontend/src/layouts/MainLayout.tsx +++ b/frontend/src/layouts/MainLayout.tsx @@ -116,7 +116,7 @@ const MainLayout = () => { collapsible collapsed={collapsed} theme="light" - width={280} + width={240} style={{ overflow: 'auto' }} > {/* Logo区域 */} @@ -184,11 +184,12 @@ const MainLayout = () => { {/* 内容区 */} diff --git a/frontend/src/pages/AgentChatPage.tsx b/frontend/src/pages/AgentChatPage.tsx index 2fa24cd9..808d03ff 100644 --- a/frontend/src/pages/AgentChatPage.tsx +++ b/frontend/src/pages/AgentChatPage.tsx @@ -190,66 +190,73 @@ const AgentChatPage = () => { return (
- {/* 标题栏 */} - - - - {agent.icon} -
- - {agent.name} - - - {agent.description} - - - 分类:{agent.category} | 项目:{currentProject?.name} - + {/* 顶部工具栏 - 紧凑设计 */} +
+ + {agent.icon} +
+
+ {agent.name}
- - - {/* 模型选择器 */} - +
+ {agent.category} · {currentProject?.name} +
+
- - {/* 聊天区域 */} - +
+ + {/* 聊天区域 - 去掉Card,直接使用div */} +
- {/* 消息列表 */} - {messages.length === 0 && !sending ? ( -
-
- -
开始对话,我将为您提供专业的研究建议
-
- 您可以直接输入问题,或使用@知识库功能引用文献 + {/* 消息列表区域 */} +
+ {messages.length === 0 && !sending ? ( +
+
+ +
开始对话,我将为您提供专业的研究建议
+
+ 您可以直接输入问题,或使用@知识库功能引用文献 +
-
- ) : ( - - )} + ) : ( + + )} +
{/* 消息输入 */} { knowledgeBases={knowledgeBases} placeholder={`向${agent.name}提问...(Shift+Enter换行,Enter发送)`} /> - +
) } diff --git a/frontend/src/pages/HistoryPage.tsx b/frontend/src/pages/HistoryPage.tsx index 979a2ae5..654c8ce0 100644 --- a/frontend/src/pages/HistoryPage.tsx +++ b/frontend/src/pages/HistoryPage.tsx @@ -3,7 +3,7 @@ import { HistoryOutlined, SyncOutlined } from '@ant-design/icons' const HistoryPage = () => { return ( -
+
{ } return ( -
+
{/* 欢迎区域 */}
diff --git a/frontend/src/pages/KnowledgePage.tsx b/frontend/src/pages/KnowledgePage.tsx index 563b8a62..203a4fb7 100644 --- a/frontend/src/pages/KnowledgePage.tsx +++ b/frontend/src/pages/KnowledgePage.tsx @@ -153,7 +153,7 @@ const KnowledgePage = () => { ] return ( -
+
{/* 提示信息 */}