:root{color-scheme:light;--bg: #f4f6f9;--surface: #ffffff;--border: #e2e8f0;--text: #1e293b;--muted: #64748b;--primary: #2563eb;--primary-hover: #1d4ed8;--user-bg: #2563eb;--user-text: #ffffff;--online: #16a34a;--offline: #dc2626}*{box-sizing:border-box;margin:0;padding:0}body{font-family:Segoe UI,system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text);height:100dvh;overflow:hidden}.app{display:flex;flex-direction:column;height:100dvh;max-width:1024px;margin:0 auto;background:var(--surface);border-left:1px solid var(--border);border-right:1px solid var(--border)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap}.brand{display:flex;align-items:center;gap:12px}.brand-badge{width:38px;height:38px;border-radius:10px;background:var(--primary);color:#fff;font-weight:700;font-size:14px;display:flex;align-items:center;justify-content:center}.brand h1{font-size:16px;font-weight:600}.status-text{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:6px}.status-text:before{content:"";width:8px;height:8px;border-radius:50%;background:#94a3b8}.status-text.online:before{background:var(--online)}.status-text.offline:before{background:var(--offline)}.topbar-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.api-input{padding:7px 10px;border:1px solid var(--border);border-radius:8px;font-size:13px;width:210px;color:var(--text)}.btn{border:none;border-radius:8px;padding:8px 14px;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s,opacity .15s}.btn:disabled{opacity:.55;cursor:not-allowed}.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover:not(:disabled){background:var(--primary-hover)}.btn-secondary{background:#eff6ff;color:var(--primary);border:1px solid #bfdbfe}.btn-secondary:hover:not(:disabled){background:#dbeafe}.btn-ghost{background:transparent;color:var(--muted);border:1px solid var(--border)}.btn-ghost:hover:not(:disabled){background:#f8fafc;color:var(--text)}.chat-container{flex:1;overflow-y:auto;padding:20px;background:#f8fafc}.empty-state{max-width:580px;margin:60px auto 20px;text-align:center}.empty-state h2{font-size:20px;margin-bottom:8px}.empty-state p{font-size:14px;color:var(--muted);margin-bottom:20px}.suggestions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}.chip{background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:8px 14px;font-size:13px;color:var(--text);cursor:pointer;transition:border-color .15s,color .15s}.chip:hover{border-color:var(--primary);color:var(--primary)}.messages-list{display:flex;flex-direction:column;gap:16px}.msg-row{display:flex;flex-direction:column;max-width:85%}.msg-row.user{align-self:flex-end;align-items:flex-end}.msg-row.assistant{align-self:flex-start;align-items:flex-start}.bubble{padding:12px 16px;border-radius:14px;font-size:14px;line-height:1.55;word-break:break-word}.msg-row.user .bubble{background:var(--user-bg);color:var(--user-text);border-bottom-right-radius:4px;white-space:pre-wrap}.msg-row.assistant .bubble{background:var(--surface);border:1px solid var(--border);border-bottom-left-radius:4px;box-shadow:0 1px 2px #0f172a0a}.bubble p+p{margin-top:8px}.bubble h1,.bubble h2,.bubble h3,.bubble h4{margin-top:10px;margin-bottom:6px;font-size:15px}.bubble ul,.bubble ol{margin:6px 0 6px 20px}.bubble li{margin:3px 0}.bubble code{background:#f1f5f9;padding:1px 5px;border-radius:4px;font-size:12.5px}.bubble table{border-collapse:collapse;width:100%;margin:10px 0;font-size:13px}.bubble th,.bubble td{border:1px solid var(--border);padding:6px 10px;text-align:left}.bubble th{background:#f1f5f9;font-weight:600}.thinking-box{margin-bottom:10px;background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:6px 10px;font-size:12.5px;color:var(--muted)}.thinking-box summary{cursor:pointer;font-weight:600;-webkit-user-select:none;user-select:none}.thinking-content{margin-top:6px;white-space:pre-wrap}.msg-meta{font-size:11px;color:var(--muted);margin-top:4px;padding:0 4px}.loading-indicator{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:13.5px}.spinner{width:14px;height:14px;border:2px solid #cbd5e1;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.composer-bar{padding:12px 20px;background:var(--surface);border-top:1px solid var(--border)}.composer-form{display:flex;gap:10px;align-items:flex-end}.composer-form textarea{flex:1;resize:none;max-height:140px;padding:10px 14px;border:1px solid var(--border);border-radius:10px;font-family:inherit;font-size:14px;line-height:1.4;outline:none}.composer-form textarea:focus{border-color:var(--primary)}
