/* ===== CSS 变量 & 主题 ===== */
:root {
  --bg-base: #0d1117;
  --bg-surface: #161b22;
  --bg-panel: #1c2128;
  --bg-hover: #21262d;
  --bg-input: #0d1117;

  --border: #30363d;
  --border-light: #21262d;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;

  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --accent-dim: #1f3a5f;

  --green: #3fb950;
  --green-dim: #1a3d24;
  --red: #f85149;
  --red-dim: #3d1a1a;
  --yellow: #e3b341;
  --yellow-dim: #3d2e1a;
  --purple: #bc8cff;
  --purple-dim: #2d1f4e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --sidebar-width: 300px;
  --topbar-height: 56px;

  --transition: 0.18s ease;
}

/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== 顶部导航栏 ===== */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; color: var(--accent);
}
.logo i { font-size: 20px; }
.tagline {
  color: var(--text-secondary); font-size: 13px;
  border-left: 1px solid var(--border); padding-left: 16px;
}
.topbar-right { display: flex; gap: 10px; }

/* ===== 整体布局：topbar固定，下方左右分栏 ===== */
.app-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===== 左侧侧边栏：独立滚动 ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 0;
  height: 100%;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section {
  padding: 12px 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-section:last-child { border-bottom: none; }

.section-title {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px;
}

/* ===== 右侧主内容区 ===== */
.main-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 上半部分（输入+响应）左右并排 ── */
.content-top {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ── Prompt 编辑列（左） ── */
.prompt-col {
  width: 50%;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 响应列（右） ── */
.response-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 底部历史记录区 ── */
.history-row {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  height: 200px;
  min-height: 48px;
}

/* ===== 面板通用 Header ===== */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  flex-shrink: 0;
}
.panel-header h2 {
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}
.panel-header h2 i { color: var(--accent); }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== Prompt 面板 ===== */
.prompt-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 输入区：可滚动，撑满剩余空间 */
.prompt-inputs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prompt-inputs::-webkit-scrollbar { width: 4px; }
.prompt-inputs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.prompt-input-group { display: flex; flex-direction: column; gap: 7px; }
.prompt-label {
  display: flex; align-items: center; justify-content: space-between;
}

/* ── 发送按钮条：flex-shrink:0 保证永不被压缩 ── */
.prompt-footer {
  flex-shrink: 0;
  flex-grow: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 2px solid var(--accent);
  background: var(--bg-panel);
  gap: 10px;
  /* 防止任何情况下被裁掉 */
  position: relative;
  z-index: 10;
}
.prompt-meta {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  min-width: 0;
}
.meta-item {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.meta-item strong { color: var(--text-secondary); }

/* ===== 发送按钮 ===== */
.btn-send {
  flex-shrink: 0;
  background: linear-gradient(135deg, #388bfd, var(--accent));
  color: #fff;
  padding: 10px 22px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(88,166,255,0.35);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88,166,255,0.5);
}
.btn-send:active:not(:disabled) { transform: translateY(0); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-send.loading {
  background: var(--bg-hover); color: var(--text-muted);
  cursor: not-allowed; transform: none; box-shadow: none;
}
.btn-send i { transition: transform 0.3s; }
.btn-send:hover:not(:disabled) i { transform: translateX(3px) rotate(-20deg); }

/* ===== 响应面板 ===== */
.response-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.response-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.response-body::-webkit-scrollbar { width: 6px; }
.response-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== 空状态、加载、错误 ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 40px 20px; color: var(--text-muted);
  height: 100%;
}
.empty-state i { font-size: 36px; opacity: 0.25; }
.empty-state p { font-size: 13px; }
.empty-state .hint { font-size: 11px; opacity: 0.6; }

.response-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.response-meta span {
  font-size: 11px; padding: 2px 8px;
  border-radius: 10px; background: var(--bg-panel);
  color: var(--text-muted); border: 1px solid var(--border);
}

.error-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 24px 20px; color: var(--red);
}
.error-state > i { font-size: 28px; }
.error-state p { font-size: 13px; color: var(--text-secondary); text-align: left; width: 100%; max-width: 560px; line-height: 1.6; }

.loading-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 40px 20px; color: var(--text-muted);
}
.typing-indicator { display: flex; gap: 5px; }
.typing-indicator span {
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* Markdown 响应内容 */
.response-text {
  color: var(--text-primary); line-height: 1.8; font-size: 14px;
}
.response-text h1, .response-text h2, .response-text h3,
.response-text h4, .response-text h5, .response-text h6 {
  margin: 1.1em 0 0.5em; color: var(--text-primary); line-height: 1.3;
}
.response-text h1 { font-size: 1.4em; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.response-text h2 { font-size: 1.2em; }
.response-text p { margin: 0.7em 0; }
.response-text ul, .response-text ol { padding-left: 1.4em; margin: 0.7em 0; }
.response-text li { margin: 0.25em 0; }
.response-text code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-panel); padding: 2px 6px;
  border-radius: 4px; border: 1px solid var(--border); color: var(--accent);
}
.response-text pre {
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px; overflow-x: auto; margin: 0.8em 0;
}
.response-text pre code { background: none; border: none; padding: 0; color: var(--text-primary); font-size: 13px; }
.response-text blockquote {
  border-left: 3px solid var(--accent); padding-left: 12px;
  color: var(--text-secondary); margin: 0.8em 0;
}
.response-text table { border-collapse: collapse; width: 100%; margin: 0.8em 0; font-size: 13px; }
.response-text th, .response-text td { border: 1px solid var(--border); padding: 7px 10px; }
.response-text th { background: var(--bg-panel); font-weight: 600; }
.response-text a { color: var(--accent); text-decoration: none; }
.response-text a:hover { text-decoration: underline; }
.response-text strong { color: var(--text-primary); font-weight: 600; }
.response-text hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }

/* 光标 */
.cursor-blink::after {
  content: '▋'; color: var(--accent); animation: blink 1s infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ===== 历史面板 ===== */
.history-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.history-list {
  flex: 1; overflow-y: auto; padding: 8px;
}
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.history-count {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-input); padding: 2px 8px;
  border-radius: 10px; border: 1px solid var(--border);
}

.empty-history {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 20px; color: var(--text-muted);
}
.empty-history i { font-size: 22px; opacity: 0.3; }
.empty-history p { font-size: 12px; }

.history-item {
  display: flex; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent; margin-bottom: 3px;
}
.history-item:hover { background: var(--bg-hover); border-color: var(--border); }
.history-badge {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.history-badge.ok { background: var(--green-dim); color: var(--green); }
.history-badge.err { background: var(--red-dim); color: var(--red); }
.history-info { flex: 1; min-width: 0; }
.history-prompt {
  font-size: 12px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.history-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.history-meta span { display: flex; align-items: center; gap: 3px; }

/* ===== 表单元素 ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px;
}

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > i:first-child {
  position: absolute; left: 10px; color: var(--text-muted);
  font-size: 12px; pointer-events: none; z-index: 1;
}
.input-with-icon input {
  width: 100%; padding: 8px 10px 8px 30px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 12px;
  transition: border-color var(--transition); outline: none;
}
.input-with-icon input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,0.12);
}
.input-with-icon input::placeholder { color: var(--text-muted); }

.toggle-pass {
  position: absolute; right: 8px; background: none; border: none;
  cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px;
  transition: color var(--transition);
}
.toggle-pass:hover { color: var(--text-secondary); }

/* Textarea */
textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.7;
  padding: 10px 12px; resize: vertical; outline: none;
  transition: border-color var(--transition); min-height: 72px;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,166,255,0.12); }
textarea::placeholder { color: var(--text-muted); }

/* Badge */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-system { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple); }
.badge-user   { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.char-count { font-size: 11px; color: var(--text-muted); }

/* ===== 滑块 ===== */
.slider {
  -webkit-appearance: none; width: 100%; height: 4px;
  border-radius: 2px; background: var(--border); outline: none;
  cursor: pointer; transition: background var(--transition);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg-surface); box-shadow: 0 0 4px rgba(88,166,255,0.4);
  transition: transform var(--transition);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.param-value {
  background: var(--accent-dim); color: var(--accent);
  padding: 1px 6px; border-radius: 10px;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono);
}

/* ===== Toggle ===== */
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-slider {
  width: 36px; height: 20px; background: var(--border);
  border-radius: 10px; position: relative; transition: background var(--transition); flex-shrink: 0;
}
.toggle-slider::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  background: white; border-radius: 50%; top: 3px; left: 3px;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(16px); }
.toggle-label { font-size: 12px; color: var(--text-secondary); }

/* ===== 预设按钮 ===== */
.presets { display: flex; flex-direction: column; gap: 6px; }
.preset-item {
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer; text-align: left; transition: all var(--transition);
}
.preset-item:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #0d1117; }
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88,166,255,0.3);
}
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== 配置状态 ===== */
.config-status {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 7px 10px; background: var(--green-dim);
  border: 1px solid var(--green); border-radius: var(--radius-sm);
  color: var(--green); font-size: 12px; animation: fadeIn 0.3s ease;
}

/* URL 预览 */
.url-preview {
  margin-top: 8px; padding: 8px 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.url-preview-label {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px; margin-bottom: 4px;
}
.url-preview code {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  word-break: break-all; display: block; line-height: 1.5;
}

/* ===== 文件上传 ===== */
.file-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all var(--transition); background: var(--bg-input);
}
.file-upload-area:hover, .file-upload-area.drag-over {
  border-color: var(--accent); background: var(--accent-dim);
}
.file-upload-area i.upload-icon { color: var(--text-secondary); font-size: 16px; flex-shrink: 0; }
.file-upload-area:hover i.upload-icon, .file-upload-area.drag-over i.upload-icon { color: var(--accent); }
.file-upload-text { flex: 1; }
.file-upload-text strong { display: block; font-size: 12px; color: var(--text-primary); margin-bottom: 2px; }
.file-upload-text span { font-size: 11px; color: var(--text-muted); }
.file-upload-area input[type="file"] { display: none; }

.file-info-bar {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--green-dim); border: 1px solid var(--green);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--green);
}
.file-info-bar i { font-size: 13px; }
.file-info-bar .file-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info-bar .file-size { color: var(--text-muted); flex-shrink: 0; }
.file-info-bar button {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px; border-radius: 3px; transition: color var(--transition); flex-shrink: 0;
}
.file-info-bar button:hover { color: var(--red); }

.file-insert-mode { display: flex; gap: 6px; margin-top: 4px; }
.insert-mode-btn {
  flex: 1; padding: 5px 8px; font-size: 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-panel);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition); text-align: center;
}
.insert-mode-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px); display: flex; align-items: center;
  justify-content: center; z-index: 1000; animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 90%; max-width: 700px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 4px; border-radius: 4px; transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-panel); flex-shrink: 0;
}
.modal-section { margin-bottom: 18px; }
.modal-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px;
}
.modal-text {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; line-height: 1.7; color: var(--text-primary);
  white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow-y: auto;
}
.modal-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-chip {
  padding: 4px 10px; border-radius: 20px; font-size: 12px;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text-secondary); display: flex; align-items: center; gap: 5px;
}
.stat-chip i { color: var(--accent); }

/* ===== Toast ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 2000;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  min-width: 200px; max-width: 340px; font-size: 13px;
  animation: slideInRight 0.25s ease;
}
.toast.success { border-color: var(--green); }
.toast.success i { color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.error i { color: var(--red); }
.toast.info i { color: var(--accent); }
.toast-out { animation: slideOutRight 0.25s ease forwards; }

/* ===== 工具类 ===== */
.hidden { display: none !important; }

/* ===== 动画 ===== */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight  { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(40px); opacity: 0; } }

/* ===== 响应式 ===== */
@media (max-width: 1000px) {
  .content-top { flex-direction: column; overflow-y: auto; }
  .prompt-col {
    width: 100%; border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 420px; flex-shrink: 0;
  }
  .response-col { min-height: 280px; flex-shrink: 0; }
  .history-row { height: auto; max-height: 180px; }
}
@media (max-width: 720px) {
  .app-layout { flex-direction: column; overflow-y: auto; }
  .sidebar {
    width: 100%; min-width: unset;
    height: auto; overflow-y: visible;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .main-content { overflow: visible; flex: none; }
  body { height: auto; overflow: auto; }
  .tagline { display: none; }
  .topbar { padding: 0 12px; }
}
