/* ===== CSS 变量 ===== */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #232342;
  --bg-hover: #2a2a4a;
  --bg-input: #1e1e36;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b85;
  --accent: #7c5cfc;
  --accent-hover: #6a4de6;
  --accent-light: rgba(124, 92, 252, 0.15);
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-width: 380px;
  --header-height: 56px;
  --transition: 0.2s ease;
}

/* ===== 重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* ===== 布局 ===== */
#app {
  display: flex;
  height: 100vh;
}

/* ===== 侧边栏 ===== */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}

#sidebar.collapsed {
  transform: translateX(-100%);
  margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
}

#close-sidebar {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
#close-sidebar:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* ===== 配置区域 ===== */
.config-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.config-section:last-child {
  border-bottom: none;
}

.config-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.config-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.config-field {
  margin-bottom: 14px;
}

.config-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.config-field label input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
  accent-color: var(--accent);
}

.config-field label span {
  vertical-align: middle;
  font-size: 13px;
}

.config-field input[type="text"],
.config-field input[type="password"],
.config-field input[type="number"],
.config-field textarea,
.config-field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.config-field input:focus,
.config-field textarea:focus,
.config-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.config-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.config-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.config-field textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.config-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  vertical-align: middle;
}

.range-val {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.config-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 按钮 ===== */
.btn-primary, .btn-secondary, .btn-ghost {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  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(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== 侧边栏遮罩 ===== */
#sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}
#sidebar-overlay.active {
  display: block;
}

/* ===== 模型组合输入 ===== */
.model-combo {
  display: flex;
  gap: 8px;
  align-items: center;
}

.model-combo select {
  flex: 1;
}

.model-combo input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.model-combo input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.model-combo-field .config-hint {
  margin-top: 4px;
}

/* ===== 主区域 ===== */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ===== 顶部栏 ===== */
#header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left h1 {
  font-size: 16px;
  font-weight: 600;
}

#toggle-sidebar {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: var(--transition);
}
#toggle-sidebar:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  display: inline-block;
  transition: var(--transition);
}
.status-dot.configured {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* ===== 消息列表 ===== */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  scroll-behavior: smooth;
}

/* ===== 欢迎屏 ===== */
.welcome-screen {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 24px;
  text-align: center;
}

.welcome-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.welcome-screen h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-screen > p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.feature-card:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.feature-text {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.welcome-tip {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.welcome-tip strong {
  color: var(--accent);
}

/* ===== 消息气泡 ===== */
.message {
  max-width: 820px;
  margin: 0 auto 20px;
  padding: 0 24px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--bg-tertiary);
}

.message.assistant .message-avatar {
  background: var(--accent);
}

.message-role {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.message-content {
  margin-left: 36px;
}

/* 用户消息 */
.message.user .message-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 助手消息 */
.message.assistant .message-content {
  padding: 0;
}

/* 处理步骤 */
.processing-steps {
  margin-bottom: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.step-item.active {
  color: var(--text-primary);
  background: var(--accent-light);
}

.step-item.done {
  color: var(--success);
}

.step-item.error {
  color: var(--error);
}

.step-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 分析卡片 */
.analysis-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.analysis-header:hover {
  background: var(--bg-hover);
}

.analysis-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.analysis-toggle {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.analysis-card.collapsed .analysis-toggle {
  transform: rotate(-90deg);
}

.analysis-body {
  padding: 0 14px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.analysis-card.collapsed .analysis-body {
  display: none;
}

/* 增强提示词卡片 */
.prompt-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.prompt-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.prompt-copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.prompt-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prompt-body {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 参数标签 */
.param-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.param-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.param-tag .param-label {
  color: var(--text-muted);
}

.param-tag .param-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* 提醒/建议卡片 */
.notice-card {
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid;
}

.notice-card .notice-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.notice-card .notice-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.notice-card .notice-list li {
  margin-bottom: 2px;
}

.notice-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

.notice-warning .notice-header {
  color: #b45309;
}

.notice-suggestion {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.notice-suggestion .notice-header {
  color: #1d4ed8;
}

/* 图片结果 */
.image-result {
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.image-wrapper {
  position: relative;
  cursor: pointer;
  display: block;
}

.image-wrapper img {
  width: 100%;
  display: block;
  transition: var(--transition);
}

.image-wrapper:hover img {
  opacity: 0.92;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: var(--transition);
}

.image-wrapper:hover .image-overlay {
  opacity: 1;
}

.image-action-btn {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.image-action-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* 错误消息 */
.error-message {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--error);
  margin-bottom: 12px;
  line-height: 1.6;
}

.error-message strong {
  display: block;
  margin-bottom: 4px;
}

.error-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.retry-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.retry-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.retry-image-btn {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.retry-image-btn:hover {
  opacity: 0.9;
}

/* ===== 输入区 ===== */
#input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.input-wrapper {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 8px 8px 8px;
  transition: var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.attach-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* 附件预览区 */
.attachment-preview {
  max-width: 820px;
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}

.attachment-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-thumb .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.attachment-thumb .remove-btn:hover {
  background: var(--error);
}

.attachment-thumb.ref-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.attachment-thumb.ref-thumb::after {
  content: '引用';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: white;
  font-size: 9px;
  text-align: center;
  line-height: 14px;
}

/* 图片结果上的引用按钮 */
.image-ref-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.image-ref-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#user-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 160px;
  line-height: 1.5;
  padding: 6px 0;
}

#user-input::placeholder {
  color: var(--text-muted);
}

#send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

#send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.05);
}

#send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#send-btn.loading {
  background: var(--bg-tertiary);
  pointer-events: none;
}

#send-btn.loading svg {
  animation: spin 1s linear infinite;
}

.input-hint {
  max-width: 820px;
  margin: 6px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== 弹窗 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-content img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--error);
}

.modal-info {
  max-width: 600px;
  text-align: center;
}

.modal-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.6;
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: white;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: var(--success); color: #0f0f1a; }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); color: #0f0f1a; }
.toast.info { background: var(--accent); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    margin-left: 0;
  }

  #sidebar.show {
    transform: translateX(0);
  }

  .welcome-features {
    grid-template-columns: 1fr;
  }

  .header-left h1 {
    font-size: 14px;
  }

  .header-right .btn-ghost span {
    display: none;
  }

  #messages {
    padding: 12px 0;
  }

  .message {
    padding: 0 12px;
  }

  #input-area {
    padding: 8px 12px 12px;
  }
}
