/* ========================================== Chat Switchboard – Styles (v0.5.0) ========================================== */ :root { --bg: #0f0f13; --bg-secondary: #1a1a24; --bg-tertiary: #252533; --border: #2a2a3a; --text: #e4e4ef; --text-secondary: #8888a0; --accent: #6c9fff; --accent-hover: #8ab4ff; --danger: #e74c3c; --success: #2ecc71; --warning: #f39c12; --radius: 8px; --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --mono: 'SF Mono', 'Fira Code', Consolas, monospace; } * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: var(--font); background: var(--bg); color: var(--text); height: 100vh; overflow: hidden; } a { color: var(--accent); } /* ── Layout ──────────────────────────────── */ #appContainer { display: flex; flex-direction: column; height: 100vh; } .header { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; height: 48px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex-shrink: 0; } .header-title { font-size: 1rem; font-weight: 600; } .header-actions { display: flex; align-items: center; gap: 0.5rem; } .main { display: flex; flex: 1; overflow: hidden; } /* ── Sidebar ─────────────────────────────── */ .sidebar { width: 260px; background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 0.75rem; gap: 0.5rem; flex-shrink: 0; overflow-y: auto; } .new-chat-btn { width: 100%; } .chat-history { flex: 1; overflow-y: auto; } .chat-item { display: flex; align-items: center; padding: 0.5rem 0.75rem; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; gap: 0.5rem; transition: background 0.15s; } .chat-item:hover { background: var(--bg-tertiary); } .chat-item.active { background: var(--bg-tertiary); border-left: 2px solid var(--accent); } .chat-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .chat-item-delete { opacity: 0; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.75rem; padding: 2px 4px; transition: opacity 0.15s; } .chat-item:hover .chat-item-delete { opacity: 1; } /* ── Chat Area ───────────────────────────── */ .chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; } .chat-messages { flex: 1; overflow-y: auto; padding: 1rem; } .message { margin-bottom: 1rem; } .message-inner { display: flex; gap: 0.75rem; max-width: 800px; margin: 0 auto; } .message-avatar { font-size: 1.25rem; flex-shrink: 0; } .message-body { flex: 1; min-width: 0; } .message-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; } .message-role { font-weight: 600; font-size: 0.85rem; } .message-time { font-size: 0.7rem; color: var(--text-secondary); } .message-copy { background: none; border: none; cursor: pointer; font-size: 0.75rem; opacity: 0; transition: opacity 0.15s; margin-left: auto; } .message:hover .message-copy { opacity: 0.7; } .message-text { font-size: 0.9rem; line-height: 1.6; word-wrap: break-word; } /* ── Markdown Rendered Content ────────────── */ .message-text p { margin: 0.4em 0; } .message-text p:first-child { margin-top: 0; } .message-text p:last-child { margin-bottom: 0; } .message-text pre { background: var(--bg-tertiary); padding: 0.75rem; border-radius: var(--radius); overflow-x: auto; margin: 0.5rem 0; position: relative; font-size: 0.8rem; } .message-text code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-tertiary); padding: 0.15em 0.35em; border-radius: 3px; } .message-text pre code { font-size: inherit; background: none; padding: 0; } .copy-code-btn { position: absolute; top: 4px; right: 4px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 4px; padding: 2px 8px; font-size: 0.7rem; cursor: pointer; opacity: 0; transition: opacity 0.15s; } .message-text pre:hover .copy-code-btn { opacity: 1; } .copy-code-btn:hover { background: var(--border); color: var(--text); } .message-text ul, .message-text ol { margin: 0.4em 0; padding-left: 1.5em; } .message-text li { margin: 0.2em 0; } .message-text li > p { margin: 0.2em 0; } .message-text blockquote { border-left: 3px solid var(--accent); padding: 0.25em 0.75em; margin: 0.4em 0; color: var(--text-secondary); background: var(--bg-tertiary); border-radius: 0 4px 4px 0; } .message-text a { color: var(--accent); text-decoration: none; } .message-text a:hover { text-decoration: underline; } .message-text hr { border: none; border-top: 1px solid var(--border); margin: 0.75em 0; } .message-text table { border-collapse: collapse; width: 100%; margin: 0.5em 0; font-size: 0.95em; } .message-text th, .message-text td { border: 1px solid var(--border); padding: 0.35em 0.6em; text-align: left; } .message-text th { background: var(--bg-tertiary); font-weight: 600; } .message-text img { max-width: 100%; border-radius: 4px; } .message-text h1, .message-text h2, .message-text h3, .message-text h4, .message-text h5, .message-text h6 { margin: 0.75em 0 0.35em; font-weight: 600; } .message-text h1 { font-size: 1.3em; } .message-text h2 { font-size: 1.15em; } .message-text h3 { font-size: 1.05em; } /* ── Thinking Blocks ─────────────────────── */ .thinking-block { border: 1px solid rgba(108, 159, 255, 0.15); border-radius: var(--radius); margin: 0.5rem 0; background: rgba(108, 159, 255, 0.04); } .thinking-block summary { padding: 0.4rem 0.75rem; cursor: pointer; font-size: 0.8rem; color: var(--text-secondary); user-select: none; } .thinking-block summary:hover { color: var(--text); } .thinking-block[open] summary { border-bottom: 1px solid rgba(108, 159, 255, 0.1); } .thinking-content { padding: 0.5rem 0.75rem; font-size: 0.8rem; color: var(--text-secondary); max-height: 300px; overflow-y: auto; line-height: 1.5; background: rgba(108, 159, 255, 0.02); } .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary); } .empty-icon { font-size: 3rem; margin-bottom: 1rem; } .empty-hint { color: var(--text-secondary); font-size: 0.8rem; text-align: center; padding: 1rem; } .error-hint { color: var(--danger); font-size: 0.8rem; padding: 0.5rem; } .loading { color: var(--text-secondary); font-size: 0.8rem; padding: 0.5rem; } /* ── Input Area ──────────────────────────── */ .input-area { border-top: 1px solid var(--border); padding: 0.5rem 1rem 0.75rem; background: var(--bg-secondary); flex-shrink: 0; } .input-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; } .model-selector { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; } .model-selector label { color: var(--text-secondary); } .model-selector select { background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text); padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; max-width: 300px; } .input-row { display: flex; gap: 0.5rem; align-items: flex-end; } .input-row textarea { flex: 1; resize: none; background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-family: var(--font); font-size: 0.9rem; max-height: 200px; line-height: 1.5; } .input-row textarea:focus { outline: none; border-color: var(--accent); } .input-actions { display: flex; gap: 0.25rem; align-items: center; } /* ── Buttons ─────────────────────────────── */ button { font-family: var(--font); cursor: pointer; } .btn-primary { background: var(--accent); color: #fff; border: none; padding: 0.5rem 1rem; border-radius: var(--radius); font-weight: 600; font-size: 0.85rem; transition: background 0.15s; } .btn-primary:hover { background: var(--accent-hover); } .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; } .btn-full { width: 100%; } .btn-small { font-size: 0.8rem; padding: 0.35rem 0.75rem; } .btn-danger { background: var(--danger); color: #fff; border: none; border-radius: 4px; } .btn-icon { background: none; border: none; color: var(--text-secondary); font-size: 1rem; padding: 0.25rem; transition: color 0.15s; } .btn-icon:hover { color: var(--text); } .btn-send { background: var(--accent); color: #fff; border: none; padding: 0.5rem 1rem; border-radius: var(--radius); font-weight: 600; font-size: 0.85rem; } .btn-send:disabled { opacity: 0.5; } .btn-stop { display: none; background: var(--warning); color: #000; border: none; padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.85rem; } .btn-stop.visible { display: block; } .btn-regen { background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius); padding: 0.35rem; } /* ── Connection Status ───────────────────── */ .connection-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; padding: 0.25rem 0.5rem; border-radius: var(--radius); transition: background 0.15s; } .connection-status:hover { background: var(--bg-tertiary); } .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); } .connection-status.online .status-dot { background: var(--success); } /* ── Typing Indicator ────────────────────── */ .typing-indicator { display: flex; gap: 4px; padding: 0.5rem 0; } .typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-secondary); animation: typing 1.2s infinite; } .typing-indicator span:nth-child(2) { animation-delay: 0.2s; } .typing-indicator span:nth-child(3) { animation-delay: 0.4s; } @keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } } /* ── Dropdown ────────────────────────────── */ .dropdown { position: relative; } .dropdown-menu { display: none; position: absolute; top: 100%; right: 0; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.25rem; z-index: 100; min-width: 140px; } .dropdown-menu.show { display: block; } .dropdown-menu button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 0.4rem 0.75rem; font-size: 0.8rem; border-radius: 4px; } .dropdown-menu button:hover { background: var(--bg-tertiary); } /* ── Auth Splash ─────────────────────────── */ .splash { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--bg); } .splash-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 380px; max-width: 90vw; } .splash-brand { text-align: center; margin-bottom: 1.5rem; } .splash-logo { font-size: 3rem; margin-bottom: 0.5rem; } .splash-brand h1 { font-size: 1.25rem; } .splash-brand p { color: var(--text-secondary); font-size: 0.85rem; } .splash-error { color: var(--danger); font-size: 0.8rem; text-align: center; margin-top: 0.5rem; } .auth-tabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 1px solid var(--border); } .auth-tab { flex: 1; background: none; border: none; color: var(--text-secondary); padding: 0.5rem; cursor: pointer; border-bottom: 2px solid transparent; font-size: 0.9rem; } .auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); } .auth-error { color: var(--danger); font-size: 0.8rem; min-height: 1.2em; margin: 0.5rem 0; } .auth-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; } /* ── Forms ────────────────────────────────── */ .form-group { margin-bottom: 0.75rem; } .form-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.25rem; } .form-group input, .form-group select, .form-group textarea { width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-family: var(--font); font-size: 0.85rem; } .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); } .form-row { display: flex; gap: 0.75rem; } .form-row .form-group { flex: 1; } .checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; cursor: pointer; margin: 0.5rem 0; } /* ── Modal ────────────────────────────────── */ .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 1000; } .modal-overlay.active { display: flex; } .modal { background: var(--bg-secondary); border-radius: 12px; width: 90%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column; animation: modalIn 0.2s ease; } .modal-wide { max-width: 750px; } @keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } } .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); } .modal-header h2 { font-size: 1rem; } .modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.25rem; cursor: pointer; } .modal-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; } .modal-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; } .settings-section { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); } .settings-section:last-child { border-bottom: none; } .settings-section h3 { font-size: 0.9rem; margin-bottom: 0.75rem; color: var(--accent); } /* ── Providers ───────────────────────────── */ .provider-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); } .provider-info { flex: 1; } .provider-name { font-weight: 600; font-size: 0.85rem; } .provider-meta { font-size: 0.75rem; color: var(--text-secondary); margin-left: 0.5rem; } .provider-actions { display: flex; align-items: center; gap: 0.5rem; } .badge-global { font-size: 0.7rem; color: var(--text-secondary); background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; } /* ── Admin ────────────────────────────────── */ .admin-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 1rem; background: var(--bg-tertiary); } .admin-tab { padding: 0.5rem 0.75rem; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.8rem; border-bottom: 2px solid transparent; } .admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); } .admin-user-row { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; } .admin-user-email { font-size: 0.75rem; color: var(--text-secondary); } .admin-model-row { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; } .badge-admin { background: var(--accent); color: #fff; font-size: 0.65rem; padding: 1px 6px; border-radius: 4px; } .badge-user { background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.65rem; padding: 1px 6px; border-radius: 4px; } .badge-inactive { background: var(--danger); color: #fff; font-size: 0.65rem; padding: 1px 6px; border-radius: 4px; } /* ── Toast ────────────────────────────────── */ .toast-container { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 0.5rem; } .toast { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 1rem; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; animation: toastIn 0.3s ease; } .toast.error { border-color: var(--danger); } .toast.warning { border-color: var(--warning); } .toast.success { border-color: var(--success); } .toast button { background: none; border: none; color: var(--text-secondary); cursor: pointer; } @keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } /* ── Debug Modal ─────────────────────────── */ .debug-modal { max-width: 900px; height: 80vh; overflow: hidden; } .debug-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 1rem; background: var(--bg-tertiary); } .debug-tab { padding: 0.5rem 0.75rem; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.8rem; border-bottom: 2px solid transparent; } .debug-tab.active { color: var(--accent); border-bottom-color: var(--accent); } .debug-modal-body { flex: 1; overflow: hidden; padding: 0 !important; } .debug-tab-content { height: 100%; display: flex; flex-direction: column; } .debug-toolbar { display: flex; gap: 1rem; padding: 0.4rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.75rem; } .debug-check { display: flex; align-items: center; gap: 0.3rem; color: var(--text-secondary); cursor: pointer; } .debug-content { flex: 1; overflow-y: auto; padding: 0.5rem; font-family: var(--mono); font-size: 0.72rem; line-height: 1.5; } .debug-entry { padding: 1px 0.5rem; border-bottom: 1px solid rgba(128,128,128,0.08); white-space: pre-wrap; word-break: break-all; } .debug-time { color: var(--text-secondary); opacity: 0.6; font-size: 0.68rem; } .debug-msg { color: var(--text); } .debug-empty { color: var(--text-secondary); text-align: center; padding: 2rem; } .debug-net-entry { border-bottom: 1px solid var(--border); } .debug-net-entry summary { padding: 0.4rem 0.5rem; cursor: pointer; font-size: 0.75rem; } .debug-net-method { font-weight: bold; color: var(--accent); } .debug-net-url { color: var(--text); word-break: break-all; } .debug-net-detail { padding: 0.5rem 1rem; font-size: 0.72rem; } .debug-pre { white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow: auto; padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: 4px; margin: 0.3rem 0; } .debug-footer { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-top: 1px solid var(--border); } /* ── Responsive ──────────────────────────── */ @media (max-width: 768px) { .sidebar { width: 220px; } .header-title { font-size: 0.9rem; } } @media (max-width: 640px) { .sidebar { display: none; } }