:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-hover: #252540;
  --text-primary: #e8e8f0;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #e94560;
  --accent-hover: #ff6b8a;
  --border: #2a2a40;
  --success: #10b981;
  --user-bg: #1e3a5f;
  --assistant-bg: #1a1a2e;
  --code-bg: #0d0d15;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}
.app { display: flex; height: 100vh; }
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 24px;
}
.logo { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 8px; }
.sidebar-header h1 { font-size: 20px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  display: inline-block;
  transition: all 0.3s;
}
.status.online { background: rgba(16,185,129,0.15); color: var(--success); }
.status.offline { background: rgba(233,69,96,0.15); color: var(--accent); }
.model-section h3, .info-section h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 12px;
}
.model-select {
  width: 100%; padding: 10px 12px; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-primary); font-size: 14px; cursor: pointer; margin-bottom: 10px;
}
.model-select:focus { outline: none; border-color: var(--accent); }
.btn-secondary {
  width: 100%; padding: 8px; background: var(--bg-hover);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.info-section { margin-top: auto; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 11px; color: var(--accent); }
.chat-area { flex: 1; display: flex; flex-direction: column; background: var(--bg-primary); }
.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.chat-title { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 32px; height: 32px; border-radius: 8px; }
.chat-header h2 { font-size: 18px; font-weight: 600; }
.btn-primary { padding: 8px 16px; background: var(--accent); border: none; border-radius: 8px; color: white; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background: var(--accent-hover); }
.messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.welcome { text-align: center; padding: 40px 20px; max-width: 600px; margin: 0 auto; }
.welcome-logo { width: 80px; height: 80px; border-radius: 20px; margin-bottom: 20px; }
.welcome h2 { font-size: 28px; margin-bottom: 12px; background: linear-gradient(135deg, var(--accent), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.welcome > p { color: var(--text-secondary); margin-bottom: 40px; }
.features { display: flex; flex-direction: column; gap: 16px; }
.feature { display: flex; align-items: flex-start; gap: 16px; padding: 16px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; text-align: left; }
.feature span { font-size: 24px; }
.feature strong { display: block; margin-bottom: 4px; color: var(--text-primary); }
.feature p { color: var(--text-secondary); font-size: 13px; }
.message { max-width: 80%; padding: 14px 18px; border-radius: 14px; font-size: 15px; line-height: 1.6; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.message.user { align-self: flex-end; background: var(--user-bg); border-bottom-right-radius: 4px; }
.message.assistant { align-self: flex-start; background: var(--assistant-bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message .role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-bottom: 6px; }
.message.user .role { color: #60a5fa; }
.message pre { background: var(--code-bg); padding: 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0; font-family: 'Menlo', 'Monaco', monospace; font-size: 13px; }
.message code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; font-family: 'Menlo', 'Monaco', monospace; font-size: 13px; }
.input-area { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.input-wrapper { display: flex; gap: 12px; align-items: flex-end; }
#messageInput { flex: 1; padding: 12px 16px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 12px; color: var(--text-primary); font-size: 15px; resize: none; max-height: 200px; min-height: 48px; line-height: 1.5; }
#messageInput:focus { outline: none; border-color: var(--accent); }
#messageInput::placeholder { color: var(--text-muted); }
.btn-send { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); border: none; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.btn-send:hover { background: var(--accent-hover); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }
.input-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.loading-dots { display: flex; gap: 4px; padding: 8px 0; }
.loading-dots span { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
.error-banner { background: rgba(233,69,96,0.15); border: 1px solid var(--accent); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; color: var(--accent); font-size: 14px; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
