Spaces:
Runtime error
Runtime error
| @tailwind base; | |
| @tailwind components; | |
| @tailwind utilities; | |
| /* Base styles */ | |
| :root { | |
| --primary-color: #3e6ae1; | |
| --primary-hover: #2952c8; | |
| --text-color: #1a1a1a; | |
| --light-text: #4d4d4d; | |
| --lightest-text: #737373; | |
| --border-color: #e5e7eb; | |
| --background-color: #ffffff; | |
| --sidebar-width: 280px; | |
| --header-height: 60px; | |
| --reasoning-background: #f9fafb; | |
| --user-message-bg: #f9f8f6; | |
| --user-message-color: var(--text-color); | |
| --assistant-message-bg: #f9f9f9; | |
| --assistant-message-color: #1a1a1a; | |
| --hover-color: #f5f5f5; | |
| --active-color: #e6f2ff; | |
| /* Responsive sidebar width */ | |
| --mobile-sidebar-width: 100%; | |
| --tablet-sidebar-width: 250px; | |
| } | |
| * { | |
| box-sizing: border-box; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; | |
| color: var(--text-color); | |
| line-height: 1.5; | |
| background-color: var(--background-color); | |
| } | |
| @layer components { | |
| /* App container */ | |
| .app-container { | |
| @apply flex flex-col h-screen w-full overflow-hidden; | |
| } | |
| /* Header styles */ | |
| .app-header { | |
| @apply flex justify-between items-center px-5 h-header border-b border-border bg-background; | |
| } | |
| .left-section { | |
| @apply flex items-center; | |
| } | |
| .right-section { | |
| @apply flex items-center gap-2.5; | |
| } | |
| .app-title { | |
| @apply text-xl font-semibold text-text; | |
| } | |
| } | |
| @layer components { | |
| /* Profile dropdown */ | |
| .profile-dropdown-container { | |
| @apply relative; | |
| } | |
| .profile-dropdown-button { | |
| @apply py-1.5 px-3 bg-background border border-border rounded text-sm text-text cursor-pointer flex items-center gap-1.5; | |
| } | |
| .profile-dropdown-menu { | |
| @apply absolute top-full right-0 w-[200px] bg-background border border-border rounded shadow-md z-10 mt-1.5; | |
| } | |
| .profile-option { | |
| @apply p-3 cursor-pointer transition-colors duration-200 text-sm; | |
| } | |
| .profile-option:hover { | |
| @apply bg-hover; | |
| } | |
| .profile-option.active { | |
| @apply bg-active font-medium; | |
| } | |
| } | |
| @layer components { | |
| .settings-button { | |
| @apply py-1.5 px-3 bg-background border border-border rounded text-sm text-text cursor-pointer; | |
| } | |
| .settings-button:hover { | |
| @apply bg-hover; | |
| } | |
| /* Main content area */ | |
| .app-content { | |
| @apply flex flex-1 overflow-hidden; | |
| } | |
| } | |
| @layer components { | |
| /* Sidebar */ | |
| .sidebar { | |
| @apply w-sidebar border-r border-border flex flex-col transition-[width] duration-300 ease-in-out bg-background; | |
| } | |
| .sidebar.collapsed { | |
| @apply w-[50px] overflow-hidden; | |
| } | |
| .sidebar.collapsed .chat-list, | |
| .sidebar.collapsed .sidebar-header h2 { | |
| @apply hidden; | |
| } | |
| .sidebar-header { | |
| @apply flex justify-between items-center py-3 px-4 border-b border-border; | |
| } | |
| .sidebar.collapsed .sidebar-header { | |
| @apply py-3 px-[5px] justify-center; | |
| } | |
| .sidebar-header h2 { | |
| @apply text-sm font-semibold text-light-text m-0; | |
| } | |
| .toggle-sidebar-button { | |
| @apply bg-transparent border-0 text-base text-lightest-text cursor-pointer flex items-center justify-center z-10 w-6 h-6; | |
| } | |
| .toggle-sidebar-button:hover { | |
| @apply text-text; | |
| } | |
| } | |
| @layer components { | |
| /* Chat list */ | |
| .chat-list { | |
| @apply flex-1 overflow-y-auto p-2.5; | |
| } | |
| .new-chat { | |
| @apply w-full py-2 px-3 bg-primary text-white border-none rounded cursor-pointer text-sm mb-4 transition-colors duration-200 flex items-center justify-center; | |
| } | |
| .new-chat:hover { | |
| @apply bg-primary-hover; | |
| } | |
| .chat-item { | |
| @apply flex justify-between items-center py-2 px-2.5 rounded cursor-pointer mb-0.5 transition-colors duration-200 text-sm text-light-text; | |
| } | |
| .chat-item:hover { | |
| @apply bg-hover; | |
| } | |
| .chat-item.active { | |
| @apply bg-active text-primary; | |
| } | |
| .delete-btn { | |
| @apply opacity-0 bg-transparent border-none text-lightest-text cursor-pointer text-xs transition-all duration-200 py-0.5 px-[5px]; | |
| } | |
| .chat-item:hover .delete-btn { | |
| @apply opacity-100; | |
| } | |
| .delete-btn:hover { | |
| @apply text-red-600; | |
| } | |
| .empty-state { | |
| @apply text-lightest-text text-center p-5 text-sm; | |
| } | |
| } | |
| @layer components { | |
| /* Main chat area */ | |
| .main-content { | |
| @apply flex-1 flex flex-col overflow-hidden bg-background; | |
| } | |
| /* Welcome screen */ | |
| .welcome-screen { | |
| @apply flex flex-col items-center justify-center h-full p-5 text-center; | |
| } | |
| .welcome-screen h2 { | |
| @apply text-2xl font-semibold mb-2.5 text-text; | |
| } | |
| .welcome-screen p { | |
| @apply text-light-text mb-5 text-sm; | |
| } | |
| .new-chat-button { | |
| @apply py-2.5 px-5 bg-primary text-white border-none rounded cursor-pointer text-sm transition-colors duration-200; | |
| } | |
| .new-chat-button:hover { | |
| @apply bg-primary-hover; | |
| } | |
| } | |
| @layer components { | |
| /* Chat window */ | |
| .chat-window { | |
| @apply flex flex-col h-full overflow-hidden; | |
| } | |
| .chat-messages { | |
| @apply flex-1 overflow-y-auto p-5 flex flex-col gap-6; | |
| } | |
| } | |
| @layer components { | |
| /* Message styles */ | |
| .message { | |
| @apply flex flex-col max-w-[800px] mx-auto w-full; | |
| } | |
| .message.user { | |
| @apply items-end; | |
| } | |
| .message.assistant { | |
| @apply items-start; | |
| } | |
| .reasoning-container { | |
| @apply w-full border border-border rounded-lg overflow-hidden mb-2.5 bg-reasoning-bg; | |
| } | |
| .reasoning-header { | |
| @apply flex justify-between items-center py-2 px-3 cursor-pointer text-[0.8125rem] text-light-text bg-[#f5f5f5] border-b border-border; | |
| } | |
| .toggle-icon { | |
| @apply text-[0.625rem]; | |
| } | |
| .reasoning-content { | |
| @apply p-3 text-[0.8125rem] whitespace-pre-wrap overflow-x-auto text-light-text max-h-[300px] overflow-y-auto; | |
| } | |
| .message-content { | |
| @apply py-3 px-4 rounded-md text-[0.9375rem] leading-normal break-words max-w-[90%] relative; | |
| } | |
| .message.user .message-content { | |
| @apply bg-user-message-bg text-user-message-color rounded-[6px_6px_0_6px]; | |
| } | |
| .message.assistant .message-content { | |
| @apply bg-assistant-message-bg text-assistant-message-color rounded-[6px_6px_6px_0]; | |
| } | |
| } | |
| @layer components { | |
| .copy-button { | |
| @apply absolute right-2 bottom-2 bg-white/80 border border-border rounded py-1 px-2 text-xs cursor-pointer opacity-0 transition-opacity duration-200; | |
| } | |
| .message-content:hover .copy-button { | |
| @apply opacity-100; | |
| } | |
| .copy-button.copied { | |
| @apply bg-emerald-500 text-white border-emerald-600; | |
| } | |
| .message.user .copy-button { | |
| @apply bg-white/90 text-light-text; | |
| } | |
| .message.user .copy-button:hover { | |
| @apply bg-white text-text; | |
| } | |
| .message.assistant .copy-button { | |
| @apply bg-[rgba(249,249,249,0.9)] text-text; | |
| } | |
| .message.assistant .copy-button:hover { | |
| @apply bg-background; | |
| } | |
| /* Add styles for markdown content */ | |
| .message-content p { | |
| @apply mb-4; | |
| } | |
| .message-content p:last-child { | |
| @apply mb-0; | |
| } | |
| .message-content pre { | |
| @apply bg-black/5 p-3 rounded overflow-x-auto my-4; | |
| } | |
| .message-content code { | |
| @apply bg-black/5 py-0.5 px-1 rounded font-mono; | |
| } | |
| .message-content pre code { | |
| @apply bg-transparent p-0; | |
| } | |
| .message-content ul, | |
| .message-content ol { | |
| @apply my-4 pl-8; | |
| } | |
| .message-content li { | |
| @apply my-2; | |
| } | |
| .message-content blockquote { | |
| @apply border-l-4 border-border my-4 pl-4 text-light-text; | |
| } | |
| .message-content img { | |
| @apply max-w-full h-auto my-4 rounded; | |
| } | |
| .message-content table { | |
| @apply border-collapse w-full my-4; | |
| } | |
| .message-content th, | |
| .message-content td { | |
| @apply border border-border p-2 text-left; | |
| } | |
| .message-content th { | |
| @apply bg-hover; | |
| } | |
| .message-time { | |
| @apply text-xs text-lightest-text mt-1; | |
| } | |
| } | |
| @layer components { | |
| /* Input area */ | |
| .chat-input { | |
| @apply flex p-4 border-t border-border gap-2.5 bg-background; | |
| } | |
| .message-input { | |
| @apply flex-1 py-3 px-4 border border-border rounded-md text-[0.9375rem] resize-none min-h-[24px] max-h-[200px] text-text outline-none transition-colors duration-200; | |
| } | |
| .message-input:focus { | |
| @apply border-primary; | |
| } | |
| .send-button { | |
| @apply px-5 bg-primary text-white border-none rounded-md cursor-pointer text-[0.9375rem] transition-colors duration-200 flex items-center justify-center; | |
| } | |
| .send-button:hover:not(:disabled) { | |
| @apply bg-primary-hover; | |
| } | |
| .send-button:disabled { | |
| @apply bg-slate-400 cursor-not-allowed opacity-70; | |
| } | |
| /* Loading cursor */ | |
| .loading-cursor { | |
| @apply inline-block w-0.5 h-[1.2em] bg-current ml-0.5 animate-blink align-text-bottom; | |
| } | |
| @keyframes blink { | |
| 0%, 100% { opacity: 1; } | |
| 50% { opacity: 0; } | |
| } | |
| } | |
| @layer components { | |
| /* Settings modal */ | |
| .settings-overlay { | |
| @apply fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]; | |
| } | |
| .settings-modal { | |
| @apply bg-background rounded-lg w-[600px] max-w-[90%] max-h-[90vh] overflow-y-auto relative p-6 shadow-md; | |
| } | |
| .settings-panel h2 { | |
| @apply text-xl font-semibold mb-5 text-text; | |
| } | |
| .close-settings-button { | |
| @apply absolute top-4 right-4 bg-transparent border-none text-xl cursor-pointer text-lightest-text w-6 h-6 flex items-center justify-center rounded; | |
| } | |
| .close-settings-button:hover { | |
| @apply bg-hover text-text; | |
| } | |
| /* Profile management in settings */ | |
| .profiles-section { | |
| @apply mb-6 border-b border-border pb-5; | |
| } | |
| .profiles-header { | |
| @apply flex justify-between items-center mb-3; | |
| } | |
| .profiles-header h3 { | |
| @apply text-base font-semibold text-text; | |
| } | |
| .add-profile-button { | |
| @apply py-1 px-2 bg-transparent border border-border rounded text-sm text-text cursor-pointer transition-all duration-200; | |
| } | |
| .add-profile-button:hover { | |
| @apply bg-hover; | |
| } | |
| .profiles-list { | |
| @apply flex flex-wrap gap-2 mb-4; | |
| } | |
| .profile-item { | |
| @apply py-2 px-3 bg-background border border-border rounded text-sm cursor-pointer transition-all duration-200 flex items-center gap-2; | |
| } | |
| .profile-item:hover { | |
| @apply bg-hover; | |
| } | |
| .profile-item.active { | |
| @apply bg-active border-primary; | |
| } | |
| .delete-profile-button { | |
| @apply bg-transparent border-none text-lightest-text cursor-pointer text-base transition-colors duration-200 flex items-center justify-center w-5 h-5; | |
| } | |
| .delete-profile-button:hover { | |
| @apply text-red-600; | |
| } | |
| .current-profile-section h3 { | |
| @apply text-base font-semibold text-text mb-4; | |
| } | |
| .setting-item { | |
| @apply mb-4; | |
| } | |
| .setting-item label { | |
| @apply block mb-1.5 text-sm text-light-text; | |
| } | |
| .setting-item input { | |
| @apply w-full py-2 px-3 border border-border rounded text-sm transition-colors duration-200; | |
| } | |
| .setting-item input:focus { | |
| @apply outline-none border-primary; | |
| } | |
| .setting-hint { | |
| @apply mt-1; | |
| } | |
| .hint-toggle { | |
| @apply bg-transparent border-none text-primary cursor-pointer text-xs p-0 text-left; | |
| } | |
| .hint-content { | |
| @apply hidden mt-2 text-xs text-light-text bg-hover p-2 rounded; | |
| } | |
| .hint-content.expanded { | |
| @apply block; | |
| } | |
| .hint-content p { | |
| @apply mb-1.5; | |
| } | |
| .hint-content ul { | |
| @apply ml-5; | |
| } | |
| .hint-content li { | |
| @apply mb-1; | |
| } | |
| .settings-actions { | |
| @apply flex justify-end gap-2.5 mt-6; | |
| } | |
| .save-button { | |
| @apply py-2 px-4 bg-primary text-white border-none rounded cursor-pointer text-sm transition-colors duration-200; | |
| } | |
| .save-button:hover { | |
| @apply bg-primary-hover; | |
| } | |
| .cancel-button { | |
| @apply py-2 px-4 bg-transparent border border-border rounded cursor-pointer text-sm transition-all duration-200; | |
| } | |
| .cancel-button:hover { | |
| @apply bg-hover; | |
| } | |
| } | |
| @layer components { | |
| /* Error and notification styles */ | |
| .error-message { | |
| @apply fixed bottom-5 left-1/2 -translate-x-1/2 bg-red-100 text-red-600 py-2.5 px-5 rounded text-sm shadow-md z-[1000]; | |
| } | |
| .loading { | |
| @apply fixed bottom-5 left-1/2 -translate-x-1/2 bg-blue-50 text-blue-700 py-2.5 px-5 rounded text-sm shadow-md z-[1000]; | |
| } | |
| } | |
| @layer utilities { | |
| /* Custom scrollbar */ | |
| ::-webkit-scrollbar { | |
| @apply w-1.5 h-1.5; | |
| } | |
| ::-webkit-scrollbar-track { | |
| @apply bg-transparent; | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| @apply bg-gray-300 rounded-sm; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| @apply bg-gray-400; | |
| } | |
| } | |
| /* Responsive styles */ | |
| @media (max-width: 768px) { | |
| .app-header { | |
| padding: 0 1rem; | |
| } | |
| .app-title { | |
| font-size: 1rem; | |
| } | |
| .sidebar { | |
| position: fixed; | |
| z-index: 50; | |
| height: 100%; | |
| width: 100%; | |
| left: -100%; | |
| transition: all 0.3s ease-in-out; | |
| } | |
| .sidebar.mobile-open { | |
| left: 0; | |
| } | |
| /* 确保在移动设备上收起的侧边栏仍然可见 */ | |
| .sidebar.collapsed { | |
| width: 50px; | |
| left: 0; | |
| } | |
| .message-content { | |
| max-width: 100%; | |
| } | |
| .settings-modal { | |
| width: 95%; | |
| max-height: 80vh; | |
| } | |
| .profiles-list { | |
| flex-direction: column; | |
| gap: 0.5rem; | |
| } | |
| .chat-input { | |
| padding: 0.75rem; | |
| } | |
| .message-input { | |
| font-size: 0.875rem; | |
| } | |
| .send-button { | |
| padding: 0 1rem; | |
| } | |
| } | |
| /* Small mobile devices */ | |
| @media (max-width: 480px) { | |
| .app-header { | |
| height: 50px; | |
| } | |
| .right-section { | |
| gap: 0.5rem; | |
| } | |
| .profile-dropdown-button, | |
| .settings-button { | |
| padding: 0.25rem 0.5rem; | |
| font-size: 0.75rem; | |
| } | |
| .chat-messages { | |
| padding: 0.75rem; | |
| } | |
| .message-content { | |
| padding: 0.75rem; | |
| font-size: 0.875rem; | |
| } | |
| .welcome-screen h2 { | |
| font-size: 1.25rem; | |
| } | |
| } | |