/** * ChatWorkspace 对话工作台样式 * * 参考原型图V2 */ /* === 整体布局 === */ .chat-workspace { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; background-color: #FFFFFF; font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; overflow: hidden; } /* === 移动端遮罩 === */ .mobile-overlay { position: fixed; inset: 0; z-index: 40; background-color: rgba(0, 0, 0, 0.2); backdrop-filter: blur(2px); } @media (min-width: 1024px) { .mobile-overlay { display: none; } } /* === 左侧边栏 === */ .workspace-sidebar { position: fixed; z-index: 50; width: 256px; height: 100%; background-color: #f8fafc; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.3s ease; } .workspace-sidebar.open { transform: translateX(0); } @media (min-width: 1024px) { .workspace-sidebar { position: relative; transform: translateX(0); } } /* 边栏头部 */ .sidebar-header { padding: 16px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; } .back-btn { display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: none; color: #64748b; font-size: 14px; font-weight: 600; cursor: pointer; transition: color 0.2s; } .back-btn:hover { color: #1e293b; } .close-sidebar-btn { padding: 4px; background: none; border: none; color: #94a3b8; cursor: pointer; } @media (min-width: 1024px) { .close-sidebar-btn { display: none; } } /* 新建对话按钮 */ .sidebar-new { padding: 16px; } .new-chat-btn { width: 100%; padding: 10px 16px; background-color: #FFFFFF; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; font-weight: 500; color: #334155; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .new-chat-btn:hover { border-color: #4F6EF2; color: #4F6EF2; } /* 历史记录 */ .sidebar-history { flex: 1; overflow-y: auto; padding: 0 8px 16px; } .history-group { margin-bottom: 16px; } .history-label { padding: 8px 8px; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; } .history-item { width: 100%; padding: 8px 12px; background: none; border: none; border-left: 2px solid transparent; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; font-size: 12px; color: #64748b; text-align: left; cursor: pointer; transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .history-item:hover { background-color: #f1f5f9; } .history-item.active { background-color: rgba(226, 232, 240, 0.5); color: #1e293b; font-weight: 500; border-left-color: #4F6EF2; } /* 历史记录标题 */ .history-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; } /* 历史记录操作按钮 */ .history-item-actions { display: none; align-items: center; gap: 4px; flex-shrink: 0; } .history-item:hover .history-item-actions { display: flex; } .history-action-btn { padding: 4px; background: none; border: none; color: #94a3b8; cursor: pointer; border-radius: 4px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; } .history-action-btn:hover { background-color: #e2e8f0; color: #475569; } .history-action-btn.delete:hover { background-color: #fee2e2; color: #ef4444; } /* 历史记录编辑模式 */ .history-item-edit { display: flex; align-items: center; gap: 6px; width: 100%; } .history-edit-input { flex: 1; padding: 4px 8px; border: 1px solid #4F6EF2; border-radius: 4px; font-size: 12px; outline: none; background: white; } .history-edit-save { padding: 4px; background: #4F6EF2; border: none; color: white; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; } .history-edit-save:hover { background: #3b5fe0; } /* 用户信息 */ .sidebar-user { padding: 16px; border-top: 1px solid #e2e8f0; background-color: rgba(241, 245, 249, 0.5); display: flex; align-items: center; gap: 8px; } .user-avatar { width: 28px; height: 28px; border-radius: 50%; background-color: #4F6EF2; color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; } .user-info { flex: 1; min-width: 0; } .user-name { font-size: 12px; font-weight: 500; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .user-plan { font-size: 10px; color: #94a3b8; } /* === 主对话区 === */ .workspace-main { flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden; } /* 头部 */ .workspace-header { height: 56px; padding: 0 16px; border-bottom: 1px solid #f1f5f9; background-color: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; } .header-left { display: flex; align-items: center; gap: 12px; } .menu-btn { padding: 8px; margin-left: -8px; background: none; border: none; color: #64748b; cursor: pointer; border-radius: 6px; transition: background-color 0.2s; } .menu-btn:hover { background-color: #f1f5f9; } @media (min-width: 1024px) { .menu-btn { display: none; } } .agent-icon-box { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .agent-info { display: flex; flex-direction: column; } .agent-name { font-size: 14px; font-weight: 700; color: #1e293b; margin: 0; line-height: 1.2; } .agent-status { display: flex; align-items: center; gap: 6px; } .status-dot { width: 6px; height: 6px; border-radius: 50%; background-color: #22c55e; } .status-text { font-size: 10px; color: #64748b; } .header-right { display: flex; align-items: center; gap: 8px; } .header-action { padding: 8px; background: none; border: none; color: #94a3b8; cursor: pointer; border-radius: 6px; transition: all 0.2s; } .header-action:hover { color: #4F6EF2; background-color: #f1f5f9; } /* 对话区域容器 */ .workspace-chat-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; } /* 消息区域 */ .workspace-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; } /* 欢迎卡片容器(左上角,类似消息气泡) */ .welcome-card-container { display: flex; gap: 12px; max-width: 100%; animation: fadeIn 0.3s ease-out; } /* 欢迎卡片 */ .welcome-card { background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; border-top-left-radius: 4px; padding: 12px 16px; display: flex; align-items: center; max-width: 85%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); } .welcome-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .welcome-text { font-size: 14px; line-height: 1.5; color: #334155; margin: 0; } /* === 消息项 === */ .message-item { display: flex; gap: 12px; animation: fadeIn 0.3s ease-out; } .message-item.user { flex-direction: row-reverse; } /* 消息头像 */ .message-avatar { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .message-avatar.user-avatar { background-color: #e2e8f0; color: #64748b; font-size: 12px; font-weight: 600; } /* 消息内容包装 */ .message-content-wrapper { flex: 1; display: flex; flex-direction: column; gap: 12px; max-width: 85%; } .message-item.user .message-content-wrapper { align-items: flex-end; } /* 消息气泡 */ .message-bubble { padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; } .message-bubble.user { background: linear-gradient(135deg, #4F6EF2 0%, #3d5afe 100%); color: white; border-radius: 12px; border-top-right-radius: 4px; box-shadow: 0 2px 8px rgba(79, 110, 242, 0.25); } .message-bubble.assistant { background-color: #f8fafc; border: 1px solid #e2e8f0; border-top-left-radius: 4px; color: #334155; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); } /* 打字光标 */ .typing-cursor { display: inline-block; animation: blink 0.8s step-end infinite; color: #4F6EF2; margin-left: 2px; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } /* 加载中提示 */ .loading-container { display: flex; align-items: center; justify-content: center; padding: 40px; } .loading-spinner { font-size: 14px; color: #94a3b8; } /* 输入区域(靠下) */ .workspace-input-area { padding: 16px 24px 24px; background-color: #FFFFFF; border-top: 1px solid #f1f5f9; } /* 工具栏(新版:按钮+附件同一行) */ .input-toolbar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent; padding-bottom: 4px; } .input-toolbar-row::-webkit-scrollbar { height: 4px; } .input-toolbar-row::-webkit-scrollbar-track { background: transparent; } .input-toolbar-row::-webkit-scrollbar-thumb { background-color: #e2e8f0; border-radius: 2px; } .toolbar-buttons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; } /* 工具栏中的附件列表 */ .toolbar-attachments { display: flex; align-items: center; gap: 8px; flex-shrink: 0; } /* 紧凑型附件卡片 */ .toolbar-attachment-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; color: #475569; white-space: nowrap; transition: all 0.2s; } .toolbar-attachment-chip:hover { background: #f1f5f9; border-color: #cbd5e1; } .toolbar-attachment-chip.uploading { opacity: 0.7; } .toolbar-attachment-chip .chip-icon { font-size: 14px; } .toolbar-attachment-chip .chip-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; } .toolbar-attachment-chip .chip-loading { font-size: 12px; } .toolbar-attachment-chip .chip-remove { display: flex; align-items: center; justify-content: center; padding: 2px; background: none; border: none; color: #94a3b8; cursor: pointer; border-radius: 4px; transition: all 0.2s; } .toolbar-attachment-chip .chip-remove:hover { background: #e2e8f0; color: #ef4444; } /* 旧版工具栏(保留兼容) */ .input-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; } .deep-thinking-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 16px; background-color: #FFFFFF; font-size: 13px; color: #64748b; cursor: pointer; transition: all 0.2s; } .deep-thinking-btn.active { background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); border-color: transparent; color: white; box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); } .deep-thinking-btn:hover:not(.active) { border-color: #a78bfa; color: #8b5cf6; } .attachment-btn { padding: 6px; background: none; border: none; color: #94a3b8; cursor: pointer; border-radius: 6px; transition: all 0.2s; } .attachment-btn:hover { background-color: #f1f5f9; color: #64748b; } .attachment-btn:disabled { opacity: 0.5; cursor: not-allowed; } .attachment-btn.has-attachments { color: #4F6EF2; position: relative; } .attachment-count { position: absolute; top: -2px; right: -2px; background-color: #4F6EF2; color: white; font-size: 10px; min-width: 14px; height: 14px; border-radius: 7px; display: flex; align-items: center; justify-content: center; padding: 0 3px; } /* 附件预览区域 */ .attachments-preview { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px; max-width: 1024px; margin: 0 auto; } .attachment-chip { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background-color: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; color: #475569; } .attachment-chip.uploading { opacity: 0.6; } .attachment-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .uploading-spinner { animation: spin 1s linear infinite; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } .remove-attachment { padding: 2px; background: none; border: none; color: #94a3b8; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; } .remove-attachment:hover { background-color: #fee2e2; color: #ef4444; } /* 输入框 */ .input-box { position: relative; background-color: #f8fafc; border: 2px solid #e2e8f0; border-radius: 16px; transition: all 0.3s; max-width: 1024px; margin: 0 auto; } .input-box:focus-within { border-color: #4F6EF2; box-shadow: 0 0 0 4px rgba(79, 110, 242, 0.1); background-color: #FFFFFF; } .chat-textarea { width: 100%; padding: 14px 56px 14px 16px; background: transparent; border: none; outline: none; font-size: 14px; color: #334155; resize: none; max-height: 128px; font-family: inherit; line-height: 1.5; } .chat-textarea::placeholder { color: #94a3b8; } .chat-textarea:disabled { cursor: not-allowed; opacity: 0.6; } .send-btn { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; background-color: #1e293b; color: white; border: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .send-btn:hover { background-color: #334155; } .send-btn:disabled { opacity: 0.5; cursor: not-allowed; } /* 输入提示 */ .input-hint { text-align: center; margin-top: 8px; font-size: 10px; color: #94a3b8; } /* === 滚动条 === */ .sidebar-history::-webkit-scrollbar, .workspace-messages::-webkit-scrollbar { width: 6px; } .sidebar-history::-webkit-scrollbar-track, .workspace-messages::-webkit-scrollbar-track { background: transparent; } .sidebar-history::-webkit-scrollbar-thumb, .workspace-messages::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 3px; } .sidebar-history::-webkit-scrollbar-thumb:hover, .workspace-messages::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; } /* === 消息中的附件显示 === */ .message-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); } /* FileCard 在消息中的显示样式 */ .message-file-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; max-width: 320px; } .message-item.user .message-file-cards { margin-left: auto; } /* 自定义 FileCard 样式以适配对话场景 */ .message-file-cards :global(.ant-file-card) { background: rgba(255, 255, 255, 0.95); border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); } /* 附件预览区域的 FileCard.List 样式 */ .attachments-preview :global(.ant-file-card-list) { gap: 8px; } .attachments-preview :global(.ant-file-card) { background: rgba(255, 255, 255, 0.95); border-radius: 8px; } /* ============================================ */ /* MarkdownContent 组件样式 */ /* ============================================ */ .message-bubble .markdown-content { white-space: normal; } .message-bubble .markdown-content p { margin: 0 0 8px 0; } .message-bubble .markdown-content p:last-child { margin-bottom: 0; } .message-bubble .markdown-content .md-divider { border: none; border-top: 1px solid #E5E7EB; margin: 12px 0; } .message-bubble .markdown-content h1, .message-bubble .markdown-content h2, .message-bubble .markdown-content h3 { margin: 16px 0 8px 0; font-weight: 700; line-height: 1.4; } .message-bubble .markdown-content h1:first-child, .message-bubble .markdown-content h2:first-child, .message-bubble .markdown-content h3:first-child { margin-top: 0; } .message-bubble .markdown-content h1 { font-size: 1.3em; }.message-bubble .markdown-content h2 { font-size: 1.2em; }.message-bubble .markdown-content h3 { font-size: 1.1em; }.message-bubble .markdown-content ul, .message-bubble .markdown-content ol { margin: 8px 0 12px 0; padding-left: 24px; } .message-bubble .markdown-content ul { list-style-type: disc; }.message-bubble .markdown-content ol { list-style-type: decimal; }.message-bubble .markdown-content li { margin: 6px 0; line-height: 1.6; display: list-item; }.message-bubble .markdown-content li::marker { color: #4F6EF2; } .message-bubble .markdown-content strong { font-weight: 700; color: #1F2937; } .message-bubble .markdown-content em { font-style: italic; color: #4B5563; }.message-bubble .markdown-content code { background: rgba(79, 110, 242, 0.1); color: #4F6EF2; padding: 2px 6px; border-radius: 4px; font-family: 'Monaco', 'Consolas', 'Courier New', monospace; font-size: 0.9em; }