@import "tailwindcss"; :root { --background: #ffffff; --foreground: #171717; --sidebar-bg: #f5f5f5; --chat-bg: #ffffff; --message-input-bg: #f9f9f9; --message-user-bg: #667eea; --message-bot-bg: #f5f5f5; --border-color: #e0e0e0; --primary-color: #667eea; --primary-color-dark: #5a67d8; } @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); --font-sans: var(--font-geist-sans); --font-mono: var(--font-geist-mono); } @media (prefers-color-scheme: dark) { :root { --background: #0a0a0a; --foreground: #ededed; --sidebar-bg: #1a1a1a; --chat-bg: #0a0a0a; --message-input-bg: #1e1e1e; --message-user-bg: #4338ca; --message-bot-bg: #1e1e1e; --border-color: #333333; --primary-color: #6366f1; --primary-color-dark: #4f46e5; } } * { margin: 0; padding: 0; box-sizing: border-box; } body { background: var(--background); color: var(--foreground); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.6; } /* 聊天界面容器 */ .chat-interface { display: flex; flex-direction: column; height: 100vh; max-width: 1200px; margin: 0 auto; background-color: var(--chat-bg); box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); } /* 顶部导航 */ .chat-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%); color: white; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .header-left h1 { font-size: 1.5rem; margin-bottom: 0.25rem; } .header-left p { font-size: 0.9rem; opacity: 0.9; } .header-right .config-btn { background-color: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3); color: white; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; transition: all 0.3s ease; } .header-right .config-btn:hover { background-color: rgba(255, 255, 255, 0.3); border: 1px solid rgba(255, 255, 255, 0.5); } /* 侧边栏 - 保留原有侧边栏样式但降低优先级 */ .sidebar { background-color: var(--sidebar-bg); border-right: 1px solid var(--border-color); height: 100vh; display: flex; flex-direction: column; } .chat-container { background-color: var(--chat-bg); height: 100vh; display: flex; flex-direction: column; } .chat-messages { flex: 1; overflow-y: auto; padding: 20px; } .message-input-container { background-color: var(--message-input-bg); border-top: 1px solid var(--border-color); padding: 10px 20px; } .message-user { background-color: var(--message-user-bg); border-radius: 18px 18px 0 18px; align-self: flex-end; max-width: 70%; } .message-bot { background-color: var(--message-bot-bg); border-radius: 18px 18px 18px 0; align-self: flex-start; max-width: 70%; } .user-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: var(--primary-color); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; } .scrollbar-thin::-webkit-scrollbar { width: 4px; } .scrollbar-thin::-webkit-scrollbar-track { background: transparent; } .scrollbar-thin::-webkit-scrollbar-thumb { background-color: rgba(156, 163, 175, 0.5); border-radius: 20px; } .scrollbar-thin::-webkit-scrollbar-thumb:hover { background-color: rgba(156, 163, 175, 0.8); } /* 聊天内容区 - 覆盖原有样式 */ .chat-interface .chat-container { flex: 1; overflow-y: auto; padding: 2rem; background-color: var(--chat-bg); scroll-behavior: smooth; height: auto; display: block; } /* 消息样式 */ .message { display: flex; margin-bottom: 1.5rem; animation: fadeIn 0.3s ease-in-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .user-message { justify-content: flex-end; align-self: flex-end; } .bot-message { justify-content: flex-start; align-self: flex-start; } .message-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin: 0 10px; flex-shrink: 0; } .user-message .message-avatar { background-color: var(--message-user-bg); color: white; } .bot-message .message-avatar { background-color: var(--primary-color); color: white; } .message-content { max-width: 70%; padding: 1rem; border-radius: 12px; position: relative; word-wrap: break-word; } .user-message .message-content { background-color: var(--message-user-bg); color: white; border-bottom-right-radius: 4px; } .bot-message .message-content { background-color: var(--message-bot-bg); color: var(--foreground); border: 1px solid var(--border-color); border-bottom-left-radius: 4px; } .message-content p { margin-bottom: 0.5rem; white-space: pre-wrap; line-height: 1.5; } .message-time { font-size: 0.75rem; opacity: 0.7; display: block; text-align: right; } .user-message .message-time { color: rgba(255, 255, 255, 0.8); } .bot-message .message-time { color: rgba(156, 163, 175, 0.8); } /* 输入区 */ .chat-input-area { display: flex; padding: 1.5rem 2rem; background-color: var(--chat-bg); border-top: 1px solid var(--border-color); gap: 1rem; } .chat-input-area textarea { flex: 1; min-height: 60px; max-height: 120px; padding: 0.75rem 1rem; border: 2px solid var(--border-color); border-radius: 8px; font-family: inherit; font-size: 1rem; resize: none; transition: border-color 0.3s ease; background-color: var(--message-input-bg); color: var(--foreground); } .chat-input-area textarea:focus { outline: none; border-color: var(--primary-color); } .chat-input-area textarea:disabled { background-color: #f5f5f5; cursor: not-allowed; opacity: 0.6; } .chat-input-area button { padding: 0.75rem 2rem; background-color: var(--primary-color); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.3s ease; white-space: nowrap; min-width: 80px; } .chat-input-area button:hover:not(:disabled) { background-color: var(--primary-color-dark); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(90, 103, 216, 0.2); } .chat-input-area button:active:not(:disabled) { transform: translateY(0); } .chat-input-area button:disabled { background-color: #ccc; cursor: not-allowed; } /* 配置表单覆盖层 */ .config-form-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn 0.3s ease; } /* 配置表单 */ .config-form { background-color: var(--chat-bg); border-radius: 12px; padding: 2rem; max-width: 400px; width: 90%; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); animation: slideIn 0.3s ease; } @keyframes slideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } .config-form h2 { margin-bottom: 1.5rem; color: var(--foreground); text-align: center; } .form-group { margin-bottom: 1.5rem; } .form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--foreground); } .form-group input { width: 100%; padding: 0.75rem 1rem; border: 2px solid var(--border-color); border-radius: 6px; font-size: 1rem; transition: border-color 0.3s ease; background-color: var(--message-input-bg); color: var(--foreground); } .form-group input:focus { outline: none; border-color: var(--primary-color); } .submit-btn { width: 100%; padding: 0.75rem; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background-color 0.3s ease; } .submit-btn:hover { background-color: var(--primary-color-dark); } /* 打字动画 */ .typing-indicator { display: flex; align-items: center; gap: 4px; } .typing-indicator span { width: 8px; height: 8px; background-color: #999; border-radius: 50%; animation: typing 1.4s infinite ease-in-out both; } .typing-indicator span:nth-child(1) { animation-delay: -0.32s; } .typing-indicator span:nth-child(2) { animation-delay: -0.16s; } @keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } } /* 响应式设计 */ @media (max-width: 768px) { .chat-interface { max-width: 100%; } .chat-header { padding: 1rem; } .header-left h1 { font-size: 1.25rem; } .chat-interface .chat-container { padding: 1rem; } .message-content { max-width: 85%; padding: 0.75rem; } .chat-input-area { padding: 1rem; } .config-form { margin: 1rem; } }