* { margin: 0; padding: 0; box-sizing: border-box; } :root { --bg-primary: #1a1a1a; --bg-secondary: #252525; --bg-tertiary: #2f2f2f; --text-primary: #e8e8e8; --text-secondary: #a0a0a0; --accent: #6366f1; --accent-hover: #4f46e5; --user-msg: #4f46e5; --assistant-msg: #2f2f2f; --border: #3a3a3a; --shadow: rgba(0, 0, 0, 0.5); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; line-height: 1.6; font-weight: 400; font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } body { background: var(--bg-primary); color: var(--text-primary); overflow: hidden; height: 100vh; } .app-container { display: flex; flex-direction: column; height: 100vh; background: linear-gradient(135deg, #1a1a1a 0%, #2a1a2a 100%); position: relative; } .app-container::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 300px; background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.1) 0%, transparent 70%); pointer-events: none; } /* Header */ .app-header { background: rgba(37, 37, 37, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(58, 58, 58, 0.5); padding: 12px 16px; user-select: none; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .header-content { display: flex; justify-content: space-between; align-items: center; } .character-display { display: flex; align-items: center; gap: 8px; } .avatar-circle { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-tertiary); border: 1px solid var(--border); background-size: cover; background-position: center; } .avatar-circle-large { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-tertiary); border: 2px solid var(--border); background-size: cover; background-position: center; } .avatar-upload { display: flex; align-items: center; gap: 12px; } .avatar-preview { flex-shrink: 0; } #character-header-name { font-weight: 500; color: var(--text-primary); } .character-controls { display: flex; align-items: center; gap: 8px; } .character-select { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary); padding: 6px 10px; font-family: inherit; font-size: 13px; transition: border-color 0.2s ease; } .character-select:hover { border-color: var(--accent); } .select-wrapper { position: relative; display: inline-block; } .select-wrapper::after { content: "▼"; position: absolute; top: 50%; right: 10px; transform: translateY(-50%); font-size: 12px; color: var(--text-secondary); pointer-events: none; } .character-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background: transparent; padding-right: 30px; } .btn-danger { background-color: #ef4444; color: white; } .btn-danger:hover { background-color: #dc2626; } .header-controls { display: flex; gap: 8px; } .icon-btn { width: 28px; height: 28px; border: none; background: transparent; color: var(--text-secondary); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; } .icon-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); } .icon-btn.close:hover { background: #ef4444; color: white; } /* Chat Container */ .chat-container { flex: 1; overflow: hidden; background: var(--bg-primary); } .messages-list { height: 100%; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; } .messages-list::-webkit-scrollbar { width: 8px; } .messages-list::-webkit-scrollbar-track { background: var(--bg-primary); } .messages-list::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; } .messages-list::-webkit-scrollbar-thumb:hover { background: var(--border); } .message { display: flex; animation: slideIn 0.3s ease; position: relative; } @keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .message.user { justify-content: flex-end; } .message.assistant { justify-content: flex-start; gap: 10px; } .message-content { max-width: 80%; padding: 12px 16px; border-radius: 12px; line-height: 1.6; } .message.user .message-content { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; border-bottom-right-radius: 4px; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3); } .message.assistant .message-content { background: rgba(47, 47, 47, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--text-primary); border-bottom-left-radius: 4px; border: 1px solid rgba(58, 58, 58, 0.5); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); } .message-content p { margin: 0; word-wrap: break-word; } .message-content p + p { margin-top: 12px; } /* Message action buttons */ .message-actions { position: absolute; top: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s ease; } .message.user .message-actions { right: 8px; } .message.assistant .message-actions { right: 8px; } .message:hover .message-actions { opacity: 1; } .message-action-btn { width: 24px; height: 24px; border: none; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 6px; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; padding: 0; } .message-action-btn:hover { background: rgba(0, 0, 0, 0.7); color: var(--text-primary); transform: scale(1.1); } .message-action-btn:active { transform: scale(0.9); } .message-action-btn svg { width: 14px; height: 14px; } /* Swipe navigation */ .swipe-controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 8px; background: rgba(0, 0, 0, 0.3); border-radius: 12px; width: fit-content; opacity: 0; transition: opacity 0.2s ease; } .message.assistant:hover .swipe-controls { opacity: 1; } .swipe-controls.always-visible { opacity: 1; } .swipe-btn { width: 20px; height: 20px; border: none; background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; padding: 0; } .swipe-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); color: var(--text-primary); } .swipe-btn:disabled { opacity: 0.3; cursor: not-allowed; } .swipe-btn svg { width: 12px; height: 12px; } .swipe-counter { font-size: 11px; color: var(--text-secondary); min-width: 32px; text-align: center; user-select: none; } /* Edit mode for messages */ .message-edit-form { width: 100%; display: flex; flex-direction: column; gap: 8px; } .message-edit-textarea { width: 100%; background: var(--bg-tertiary); border: 1px solid var(--accent); border-radius: 8px; padding: 12px; color: var(--text-primary); font-size: 14px; font-family: inherit; resize: vertical; min-height: 60px; } .message-edit-textarea:focus { outline: none; border-color: var(--accent-hover); } .message-edit-actions { display: flex; gap: 8px; justify-content: flex-end; } .message-edit-btn { padding: 6px 12px; border: none; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; font-family: inherit; } .message-edit-btn.save { background: var(--accent); color: white; } .message-edit-btn.save:hover { background: var(--accent-hover); } .message-edit-btn.cancel { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); } .message-edit-btn.cancel:hover { background: var(--border); } .message-content code { background: rgba(0, 0, 0, 0.3); padding: 2px 6px; border-radius: 4px; font-family: 'Monaco', 'Courier New', monospace; font-size: 0.9em; } .message-content pre { background: rgba(0, 0, 0, 0.3); padding: 12px; border-radius: 6px; overflow-x: auto; margin: 8px 0; } .message-content pre code { background: none; padding: 0; } /* Copy button for code blocks */ .copy-btn { position: absolute; top: 8px; right: 8px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px; padding: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); opacity: 0; transition: all 0.2s ease; } .message-content pre:hover .copy-btn { opacity: 1; } .copy-btn:hover { background: var(--border); color: var(--text-primary); } .copy-btn.copied { color: #22c55e; border-color: #22c55e; } /* Enhanced markdown styles */ .message-content h1, .message-content h2, .message-content h3 { margin-top: 16px; margin-bottom: 8px; font-weight: 600; } .message-content h1 { font-size: 1.5em; } .message-content h2 { font-size: 1.3em; } .message-content h3 { font-size: 1.1em; } .message-content ul, .message-content ol { margin: 8px 0; padding-left: 24px; } .message-content li { margin: 4px 0; } .message-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; } .message-content a:hover { border-bottom-color: var(--accent); } .message-content blockquote { border-left: 3px solid var(--accent); padding-left: 12px; margin: 8px 0; color: var(--text-secondary); font-style: italic; } .message-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; } .message-content table { border-collapse: collapse; width: 100%; margin: 12px 0; } .message-content th, .message-content td { border: 1px solid var(--border); padding: 8px; text-align: left; } .message-content th { background: var(--bg-tertiary); font-weight: 600; } /* Typing indicator */ .typing-indicator { display: flex; gap: 4px; padding: 12px 16px; } .typing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-secondary); animation: typing 1.4s infinite; } .typing-dot:nth-child(2) { animation-delay: 0.2s; } .typing-dot:nth-child(3) { animation-delay: 0.4s; } @keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-8px); } } /* Input Container */ .input-container { background: rgba(37, 37, 37, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid rgba(58, 58, 58, 0.5); padding: 16px; box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1); } .chat-form { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 8px; } #message-input { flex: 1; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; color: var(--text-primary); font-size: 14px; font-family: inherit; resize: none; max-height: 120px; transition: border-color 0.2s ease; } #message-input:focus { outline: none; border-color: var(--accent); } #message-input::placeholder { color: var(--text-secondary); } .send-btn { width: 44px; height: 44px; background: var(--accent); border: none; border-radius: 12px; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; } .send-btn:hover { background: var(--accent-hover); transform: scale(1.05); } .send-btn:active { transform: scale(0.95); } .send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; } .status-bar { display: flex; justify-content: space-between; align-items: center; } .status-text { font-size: 12px; color: var(--text-secondary); } .status-text.streaming { color: var(--accent); animation: pulse 2s ease-in-out infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } /* Light mode support */ @media (prefers-color-scheme: light) { :root { --bg-primary: #ffffff; --bg-secondary: #f5f5f5; --bg-tertiary: #e8e8e8; --text-primary: #1a1a1a; --text-secondary: #666666; --accent: #6366f1; --accent-hover: #4f46e5; --user-msg: #6366f1; --assistant-msg: #f5f5f5; --border: #e0e0e0; --shadow: rgba(0, 0, 0, 0.1); } .message.assistant .message-content { border: 1px solid var(--border); } } /* Settings Panel */ .settings-panel { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-primary); z-index: 1000; overflow-y: auto; padding: 60px 20px 20px; } .settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .settings-header h2 { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0; } .settings-tabs { display: flex; gap: 8px; margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; } .tab-btn { flex: 1; padding: 10px 16px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; font-family: inherit; } .tab-btn:hover { background: var(--border); color: var(--text-primary); } .tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); } .tab-content { display: none; } .tab-content.active { display: block; } .settings-form { max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; } .form-group { display: flex; flex-direction: column; gap: 8px; } .form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; } .form-group input, .form-group select, .form-group textarea { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px; padding: 12px; color: var(--text-primary); font-size: 14px; font-family: inherit; transition: border-color 0.2s ease; } .form-group textarea { resize: vertical; min-height: 80px; } .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); } .form-group select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background: var(--bg-tertiary) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.75rem center/1.5em 1.5em; } .btn-danger { background-color: #ef4444; color: white; } .btn-danger:hover { background-color: #dc2626; } .btn-primary, .btn-secondary { padding: 12px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; font-family: inherit; } .btn-primary { background: var(--accent); color: white; } .btn-primary:hover:not(:disabled) { background: var(--accent-hover); } .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; } .btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); } .btn-secondary:hover { background: var(--border); } .validation-message { padding: 12px; border-radius: 8px; font-size: 13px; display: none; } .validation-message.success { display: block; background: rgba(34, 197, 94, 0.1); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.2); } .validation-message.error { display: block; background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); } /* Avatar Modal */ .avatar-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; } .avatar-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; } .avatar-modal-content { position: relative; z-index: 1; max-width: 90vw; max-height: 90vh; pointer-events: none; } .avatar-modal-content img { max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); object-fit: contain; } /* Make avatars clickable */ .avatar-circle, .avatar-circle-large { cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; } .avatar-circle:hover, .avatar-circle-large:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); } .avatar-circle:active, .avatar-circle-large:active { transform: scale(0.95); } /* Responsive */ @media (max-width: 600px) { .messages-list { padding: 12px; } .message-content { max-width: 90%; } .input-container { padding: 12px; } .settings-panel { padding: 60px 16px 16px; } }