diff --git a/web/static/css/style.css b/web/static/css/style.css index 96419805..db5ccb51 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -22,6 +22,11 @@ --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05); --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1); --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15); + /* 对话页专用 */ + --chat-bg: linear-gradient(180deg, #f0f4f8 0%, #e8eef4 50%, #f2f6fa 100%); + --chat-bubble-user: linear-gradient(135deg, #2563eb 0%, #0066ff 50%, #0052cc 100%); + --chat-bubble-assistant: #ffffff; + --chat-sidebar-bg: linear-gradient(180deg, #fcfdfe 0%, #f6f8fb 100%); } body { @@ -450,13 +455,23 @@ body { .conversation-sidebar { width: 280px; - background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%); + background: var(--chat-sidebar-bg); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; flex-shrink: 0; height: 100%; overflow: hidden; + box-shadow: 4px 0 24px rgba(0, 0, 0, 0.03); +} + +.conversation-sidebar .sidebar-content::-webkit-scrollbar { + width: 6px; +} + +.conversation-sidebar .sidebar-content::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.12); + border-radius: 3px; } header { @@ -753,25 +768,26 @@ header { .new-chat-btn { width: 100%; - padding: 10px 16px; - background: var(--accent-color); + padding: 11px 16px; + background: linear-gradient(135deg, var(--accent-color) 0%, #0052cc 100%); color: white; border: none; - border-radius: 8px; + border-radius: 10px; font-size: 0.9375rem; font-weight: 500; cursor: pointer; - transition: all 0.2s; + transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; justify-content: center; gap: 8px; + box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25); } .new-chat-btn:hover { - background: var(--accent-hover); - transform: translateY(-1px); - box-shadow: var(--shadow-sm); + background: linear-gradient(135deg, #0052cc 0%, var(--accent-color) 100%); + transform: translateY(-2px); + box-shadow: 0 4px 14px rgba(0, 102, 255, 0.35); } .new-chat-btn span { @@ -806,7 +822,7 @@ header { width: 100%; padding: 8px 32px 8px 12px; border: 1px solid var(--border-color); - border-radius: 6px; + border-radius: 10px; font-size: 0.875rem; background: var(--bg-primary); color: var(--text-primary); @@ -1002,9 +1018,19 @@ header { flex-direction: column; flex: 1; min-width: 0; - background: #f5f7fa; + background: var(--chat-bg); overflow: hidden; height: 100%; + position: relative; +} + +.chat-container::before { + content: ''; + position: absolute; + inset: 0; + background-image: radial-gradient(circle at 20% 30%, rgba(0, 102, 255, 0.03) 0%, transparent 50%), + radial-gradient(circle at 80% 70%, rgba(0, 102, 255, 0.02) 0%, transparent 40%); + pointer-events: none; } /* 会话顶部栏样式 */ @@ -1026,26 +1052,46 @@ header { flex: 1; overflow-y: auto; overflow-x: hidden; - padding: 24px; - background: #f5f7fa; + padding: 28px 24px 32px; + background: transparent; display: flex; flex-direction: column; min-height: 0; + position: relative; + z-index: 1; +} + +.chat-messages::-webkit-scrollbar { + width: 8px; +} + +.chat-messages::-webkit-scrollbar-track { + background: transparent; + border-radius: 4px; +} + +.chat-messages::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.12); + border-radius: 4px; +} + +.chat-messages::-webkit-scrollbar-thumb:hover { + background: rgba(0, 0, 0, 0.2); } .message { - margin-bottom: 24px; + margin-bottom: 26px; display: flex; align-items: flex-start; - gap: 12px; - animation: fadeIn 0.3s ease-in; + gap: 14px; + animation: messageFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1); width: 100%; } -@keyframes fadeIn { +@keyframes messageFadeIn { from { opacity: 0; - transform: translateY(10px); + transform: translateY(12px); } to { opacity: 1; @@ -1064,24 +1110,31 @@ header { } .message-avatar { - width: 32px; - height: 32px; - border-radius: 6px; + width: 36px; + height: 36px; + border-radius: 10px; display: flex; align-items: center; justify-content: center; - font-size: 0.75rem; + font-size: 0.8125rem; font-weight: 600; flex-shrink: 0; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.message:hover .message-avatar { + box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08); } .message.user .message-avatar { - background: var(--accent-color); + background: var(--chat-bubble-user); color: white; + border: none; } .message.assistant .message-avatar { - background: var(--bg-tertiary); + background: var(--chat-bubble-assistant); color: var(--text-secondary); border: 1px solid var(--border-color); } @@ -1119,17 +1172,22 @@ header { } .message-bubble { - padding: 12px 16px; - border-radius: 8px; + padding: 14px 18px; + border-radius: 14px; word-wrap: break-word; word-break: break-word; - line-height: 1.6; - box-shadow: var(--shadow-sm); + line-height: 1.62; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04); overflow-x: auto; overflow-y: visible; max-width: 100%; -webkit-overflow-scrolling: touch; position: relative; + transition: box-shadow 0.2s ease; +} + +.message-bubble:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05); } /* Markdown 样式 */ @@ -1450,18 +1508,24 @@ header { } .message.user .message-bubble { - background: var(--accent-color); + background: var(--chat-bubble-user); color: white; - border-bottom-right-radius: 8px; - border-top-right-radius: 2px; + border: none; + border-top-right-radius: 6px; + border-bottom-right-radius: 14px; + box-shadow: 0 2px 12px rgba(0, 102, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08); +} + +.message.user .message-bubble:hover { + box-shadow: 0 4px 18px rgba(0, 102, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1); } .message.assistant .message-bubble { - background: var(--bg-primary); + background: var(--chat-bubble-assistant); color: var(--text-primary); - border: 1px solid var(--border-color); - border-bottom-left-radius: 8px; - border-top-left-radius: 2px; + border: 1px solid rgba(0, 0, 0, 0.06); + border-top-left-radius: 6px; + border-bottom-left-radius: 14px; } .message.assistant .message-bubble pre { @@ -1472,70 +1536,80 @@ header { } .message.system .message-bubble { - background: var(--bg-tertiary); + background: rgba(255, 255, 255, 0.85); color: var(--text-secondary); border: 1px solid var(--border-color); - text-align: left; + text-align: center; font-size: 0.875rem; - padding: 10px 16px; + padding: 12px 20px; width: 100%; + border-radius: 12px; + backdrop-filter: blur(6px); } .message-time { font-size: 0.6875rem; color: var(--text-muted); - margin-top: 4px; + margin-top: 6px; padding: 0 2px; font-weight: 400; + letter-spacing: 0.02em; } /* MCP调用区域 */ .mcp-call-section { - margin-top: 12px; - padding-top: 12px; - border-top: 1px solid var(--border-color); + margin-top: 14px; + padding-top: 14px; + border-top: 1px solid rgba(0, 0, 0, 0.06); width: 100%; } .mcp-call-label { font-size: 0.75rem; color: var(--text-secondary); - margin-bottom: 8px; + margin-bottom: 10px; display: flex; align-items: center; - gap: 6px; - font-weight: 500; + gap: 8px; + font-weight: 600; + letter-spacing: 0.02em; } .mcp-call-label::before { content: ''; - width: 4px; - height: 4px; + width: 5px; + height: 5px; background: var(--accent-color); border-radius: 50%; display: inline-block; flex-shrink: 0; + box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2); } .mcp-call-buttons { display: flex; flex-wrap: wrap; - gap: 6px; + gap: 8px; } .process-detail-btn { - background: rgba(156, 39, 176, 0.1) !important; - border-color: rgba(156, 39, 176, 0.3) !important; - color: #9c27b0 !important; + background: rgba(156, 39, 176, 0.12) !important; + border-color: rgba(156, 39, 176, 0.35) !important; + color: #7b1fa2 !important; display: inline-flex; align-items: center; gap: 6px; + border-radius: 10px !important; + padding: 8px 14px !important; + font-weight: 500 !important; + transition: all 0.2s ease !important; } .process-detail-btn:hover { - background: rgba(156, 39, 176, 0.2) !important; + background: rgba(156, 39, 176, 0.22) !important; border-color: #9c27b0 !important; - color: #7b1fa2 !important; + color: #6a1b9a !important; + box-shadow: 0 2px 10px rgba(156, 39, 176, 0.25) !important; } .process-detail-btn span { @@ -1572,14 +1646,18 @@ header { .chat-input-container { display: flex; flex-direction: row; - gap: 8px; + gap: 10px; align-items: flex-end; - padding: 12px 16px; - background: var(--bg-primary); + padding: 16px 20px 20px; + background: rgba(255, 255, 255, 0.92); border-top: 1px solid rgba(0, 0, 0, 0.06); flex-shrink: 0; width: 100%; box-sizing: border-box; + backdrop-filter: blur(10px); + position: relative; + z-index: 2; + box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.04); } .chat-input-container > .chat-input-field { @@ -1601,26 +1679,26 @@ header { .chat-input-container textarea { flex: 1; min-width: 0; - padding: 10px 14px; - border: 1px solid rgba(0, 0, 0, 0.1); - border-radius: 12px; + padding: 12px 16px; + border: 1px solid rgba(0, 0, 0, 0.08); + border-radius: 14px; font-size: 0.9375rem; outline: none; - transition: all 0.2s; + transition: border-color 0.2s ease, box-shadow 0.2s ease; background: #ffffff; color: var(--text-primary); resize: none; - height: 40px; - min-height: 40px; - max-height: 120px; + height: 44px; + min-height: 44px; + max-height: 140px; font-family: inherit; - line-height: 1.4; + line-height: 1.45; overflow-y: auto; box-sizing: border-box; vertical-align: middle; - /* 隐藏滚动条但保留滚动功能 */ - scrollbar-width: thin; /* Firefox */ - scrollbar-color: transparent transparent; /* Firefox - 隐藏滚动条 */ + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); + scrollbar-width: thin; + scrollbar-color: transparent transparent; } /* WebKit 浏览器(Chrome, Safari, Edge)的滚动条样式 - 隐藏但保留功能 */ @@ -1648,7 +1726,7 @@ header { .chat-input-container textarea:focus { border-color: var(--accent-color); - box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.08); + box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12); background: #ffffff; } @@ -1661,22 +1739,22 @@ header { align-items: center; justify-content: center; gap: 6px; - padding: 10px 20px; - height: 40px; + padding: 10px 22px; + height: 44px; background: linear-gradient(135deg, var(--accent-color) 0%, #0052cc 100%); color: white; border: none; - border-radius: 12px; + border-radius: 14px; cursor: pointer; font-size: 0.9375rem; font-weight: 600; - transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); + transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap; flex-shrink: 0; box-sizing: border-box; position: relative; overflow: hidden; - box-shadow: 0 2px 8px rgba(0, 102, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 3px 12px rgba(0, 102, 255, 0.28), 0 1px 4px rgba(0, 0, 0, 0.08); } /* 按钮光效动画 */ @@ -1904,11 +1982,11 @@ header { display: inline-flex; align-items: center; gap: 6px; - padding: 6px 12px; - background: var(--bg-primary); + padding: 8px 14px; + background: rgba(0, 102, 255, 0.08); color: var(--accent-color); - border: 1px solid var(--border-color); - border-radius: 6px; + border: 1px solid rgba(0, 102, 255, 0.2); + border-radius: 10px; font-size: 0.8125rem; font-weight: 500; cursor: pointer; @@ -1920,7 +1998,7 @@ header { color: white; border-color: var(--accent-color); transform: translateY(-1px); - box-shadow: var(--shadow-sm); + box-shadow: 0 3px 10px rgba(0, 102, 255, 0.3); } .mcp-detail-btn:active { @@ -2516,7 +2594,7 @@ header { align-items: center; margin-bottom: 12px; padding-bottom: 12px; - border-bottom: 1px solid var(--border-color); + border-bottom: 1px solid rgba(0, 0, 0, 0.06); } .progress-actions { @@ -2553,19 +2631,21 @@ header { } .progress-toggle { - padding: 4px 12px; + padding: 6px 14px; background: var(--bg-tertiary); border: 1px solid var(--border-color); - border-radius: 4px; + border-radius: 8px; font-size: 0.8125rem; + font-weight: 500; color: var(--text-secondary); cursor: pointer; - transition: all 0.2s; + transition: all 0.2s ease; } .progress-toggle:hover { background: var(--bg-secondary); color: var(--text-primary); + border-color: rgba(0, 0, 0, 0.12); } .progress-timeline { @@ -2580,13 +2660,13 @@ header { } .timeline-item { - padding: 12px; - margin-bottom: 8px; - border-left: 3px solid var(--border-color); + padding: 12px 14px; + margin-bottom: 10px; + border-left: 4px solid var(--border-color); padding-left: 16px; background: var(--bg-secondary); - border-radius: 4px; - transition: all 0.2s; + border-radius: 8px; + transition: all 0.2s ease; } .timeline-item:hover { @@ -9317,15 +9397,16 @@ header { display: flex; align-items: center; gap: 6px; - padding: 10px 12px; - height: 40px; + padding: 10px 14px; + height: 44px; background: #ffffff; - border: 1px solid rgba(0, 0, 0, 0.1); - border-radius: 12px; + border: 1px solid rgba(0, 0, 0, 0.08); + border-radius: 14px; color: var(--text-primary); cursor: pointer; - transition: all 0.2s; + transition: all 0.2s ease; flex-shrink: 0; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); font-size: 0.9375rem; font-weight: 500; white-space: nowrap;