/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a28;
  --bg-hover: #22223a;
  --bg-active: #2a2a45;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #555570;
  --accent: #6c5ce7;
  --accent-hover: #7d6ff0;
  --accent-dim: rgba(108, 92, 231, 0.15);
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --success: #2ecc71;
  --border: #2a2a3a;
  --border-light: #333350;
  --shadow: rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-width: 300px;
  --header-height: 56px;
  --tab-height: 60px;
  --input-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  touch-action: manipulation;
}

/* Universal hidden */
[hidden] { display: none !important; }

input, textarea, button, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--accent); text-decoration: none; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== Page Layout ===== */
.page { display: flex; flex-direction: column; height: 100%; }
.page[hidden] { display: none; }

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.app[hidden] { display: none; }

.pages-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===== Login Page ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

.login-logo { margin-bottom: 24px; }

.login-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-form { width: 100%; }

.input-group {
  position: relative;
  margin-bottom: 12px;
}

.input-group input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus { border-color: var(--accent); }

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px;
  color: var(--text-muted);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
}

.login-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
}

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  min-height: 48px;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 44px;
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-small {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 36px;
  white-space: nowrap;
}

.btn-small:hover { background: var(--accent-hover); }

.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  flex-shrink: 0;
}

.icon-btn:hover { background: var(--bg-hover); }

/* ===== Chat Header ===== */
.chat-header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  flex-shrink: 0;
}

.chat-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Skill Bar ===== */
.skill-bar {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.skill-bar::-webkit-scrollbar { display: none; }

.skill-chips {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.skill-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
}

.skill-chip:hover { border-color: var(--accent); }

.skill-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Messages ===== */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
}

.message {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: fadeInUp 0.3s ease;
}

.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

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

.message.user .message-avatar { background: var(--accent); }
.message.assistant .message-avatar { background: var(--bg-tertiary); border: 1px solid var(--border); }

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  font-size: 15px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.message.user .message-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Markdown in messages */
.message-bubble p { margin: 0.4em 0; }
.message-bubble p:first-child { margin-top: 0; }
.message-bubble p:last-child { margin-bottom: 0; }

.message-bubble strong { font-weight: 700; }
.message-bubble em { font-style: italic; }

.message-bubble ul, .message-bubble ol {
  margin: 0.4em 0;
  padding-left: 1.5em;
}

.message-bubble li { margin: 0.2em 0; }

.message-bubble code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Fira Code', 'Consolas', monospace;
}

.message.user .message-bubble code {
  background: rgba(255, 255, 255, 0.2);
}

.message-bubble pre {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 0.5em 0;
  overflow-x: auto;
  position: relative;
}

.message.user .message-bubble pre {
  background: rgba(0, 0, 0, 0.2);
}

.message-bubble pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.code-header + pre { border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 0; }

.copy-btn {
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.copy-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.1); }

.message-bubble blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 0.5em 0;
  color: var(--text-secondary);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0.32s; }

/* ===== Input Area ===== */
.input-area {
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 4px 4px 16px;
  transition: border-color 0.2s;
}

.input-wrapper:focus-within { border-color: var(--accent); }

#chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 24px;
  padding: 10px 0;
}

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

.send-btn, .stop-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.send-btn {
  background: var(--accent);
  color: white;
}

.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.stop-btn {
  background: var(--danger);
  color: white;
}

.stop-btn:hover { background: var(--danger-hover); }

/* ===== Sidebar ===== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.sidebar-overlay[hidden] { display: none; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: var(--sidebar-width);
  background: var(--bg-secondary);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.sidebar-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sidebar-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px;
  padding: 12px 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 44px;
}

.sidebar-new-chat:hover { background: rgba(108, 92, 231, 0.25); }

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  gap: 12px;
  position: relative;
  min-height: 64px;
}

.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--bg-active); }

.chat-item-content {
  flex: 1;
  min-width: 0;
}

.chat-item-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.chat-item-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.chat-item-delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-item:hover .chat-item-delete { opacity: 1; }
.chat-item-delete:hover { background: rgba(231, 76, 60, 0.15); color: var(--danger); }

.chat-list-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ===== Tab Bar ===== */
.tab-bar {
  display: flex;
  height: var(--tab-height);
  padding-bottom: var(--safe-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  transition: color 0.2s;
  min-height: 44px;
  position: relative;
}

.tab.active { color: var(--accent); }

.tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}

.tab-icon { font-size: 20px; line-height: 1; }
.tab-label { font-size: 11px; font-weight: 500; }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: var(--header-height);
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
}

/* ===== Items List (Skills/Rules) ===== */
.items-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: all 0.2s;
}

.item-card:hover { border-color: var(--border-light); }

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

.item-card-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.item-card-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.item-card-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.item-card-toggle input:checked + .toggle-slider { background: var(--accent); }
.item-card-toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.item-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.item-card-prompt {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  max-height: 60px;
  overflow: hidden;
  line-height: 1.4;
}

.item-card-priority {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.item-card-actions {
  display: flex;
  gap: 8px;
}

.item-card-actions button {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
  transition: all 0.2s;
  min-height: 32px;
}

.item-edit-btn {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.item-edit-btn:hover { background: var(--bg-active); }

.item-delete-btn {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
}

.item-delete-btn:hover { background: rgba(231, 76, 60, 0.2); }

.items-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

/* ===== Settings ===== */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.settings-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.settings-row:last-child { border-bottom: none; }

.settings-label { color: var(--text-secondary); font-size: 14px; }
.settings-value { font-size: 14px; font-weight: 500; }

.settings-btn {
  width: 100%;
  padding: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
  min-height: 48px;
}

.settings-btn:last-child { margin-bottom: 0; }
.settings-btn:hover { background: var(--bg-active); }

.settings-btn-danger { color: var(--danger); }
.settings-btn-danger:hover { background: rgba(231, 76, 60, 0.1); border-color: var(--danger); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  animation: scaleIn 0.2s ease;
}

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

.modal-header h2 { font-size: 18px; font-weight: 700; }

.modal-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal form { padding: 20px; }

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group textarea { resize: vertical; line-height: 1.5; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions .btn-primary {
  width: auto;
  padding: 10px 24px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(var(--tab-height) + 20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  z-index: 300;
  animation: fadeInUp 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow);
  white-space: nowrap;
  max-width: 90%;
}

.toast[hidden] { display: none; }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== Responsive ===== */
@media (min-width: 601px) {
  .app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ===== Reasoning Block (MiMo thinking) ===== */
.reasoning-block {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.reasoning-block summary {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.reasoning-block summary:hover {
  background: var(--bg-hover);
}

.reasoning-block[open] summary {
  border-bottom: 1px solid var(--border);
}

.reasoning-content {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
}

.reasoning-content p {
  margin: 0 0 6px;
}

.content-area p {
  margin: 0 0 8px;
}

.content-area p:last-child {
  margin-bottom: 0;
}
