/* ============ 多多集结号 Web 版样式 ============ */
/* 深色主题风格，参考 DeepSeek/ChatGPT */

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

:root {
  /* 颜色变量 - 深色主题 */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #161b22;
  --bg-input: #21262d;
  --bg-hover: #30363d;
  
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  
  --accent-primary: #58a6ff;
  --accent-secondary: #388bfd;
  --accent-hover: #79c0ff;
  
  --user-bubble: #238636;
  --ai-bubble: #21262d;
  --ai-bubble-hover: #30363d;
  
  --border-color: #30363d;
  --border-light: #484f58;
  
  --success: #3fb950;
  --error: #f85149;
  --warning: #d29922;
  
  /* 间距 */
  --sidebar-width: 280px;
  --header-height: 60px;
  --input-area-height: 140px;
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  
  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ 登录界面 ============ */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-logo img {
  width: 44px;
  height: 44px;
}

.login-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

/* ============ 手机验证码登录表单 ============ */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.login-form .input-group {
  width: 100%;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.login-form input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.code-group {
  display: flex;
  gap: 12px;
}

.code-group input {
  flex: 1;
}

.btn-send-code {
  padding: 14px 16px;
  min-width: 120px;
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-send-code:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.btn-send-code:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-login {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-login:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-config-tip {
  padding: 16px;
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--warning);
  text-align: left;
}

.login-config-tip code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.ai-agreement {
  margin-bottom: 20px;
}

.ai-agreement label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}

.ai-agreement input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.ai-agreement a {
  color: var(--accent-primary);
  text-decoration: none;
}

.ai-agreement a:hover {
  text-decoration: underline;
}

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

/* ============ 模态框 ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

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

.modal-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.modal-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text-primary);
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

/* ============ 主应用界面 ============ */
.app-view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============ 侧边栏 ============ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-new-chat {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.sidebar-new-chat:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.sidebar-new-chat span {
  font-size: 18px;
  font-weight: 400;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-list-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: 12px;
}

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

.chat-list-item.active {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.chat-list-item-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

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

.chat-list-item-time {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-list-item-delete {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-list-item:hover .chat-list-item-delete {
  opacity: 1;
}

.chat-list-item-delete:hover {
  background: rgba(248, 81, 73, 0.2);
  color: var(--error);
}

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

.chat-list-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.chat-list-empty-text {
  font-size: 14px;
  line-height: 1.6;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-status {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-logout {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(248, 81, 73, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* ============ 移动端侧边栏 ============ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
}

.mobile-menu-btn span::before,
.mobile-menu-btn span::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  left: 0;
}

.mobile-menu-btn span::before {
  top: -6px;
}

.mobile-menu-btn span::after {
  bottom: -6px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
}

/* ============ 主内容区域 ============ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-primary);
}

/* ============ 聊天头部 ============ */
.chat-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  flex-shrink: 0;
}

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

.chat-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.btn-edit-title {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.btn-edit-title:hover {
  opacity: 1;
  background: var(--bg-hover);
}

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

.data-stats {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* ============ 消息区域 ============ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.messages-container {
  max-width: 800px;
  margin: 0 auto;
}

/* 欢迎消息 */
.welcome-message {
  text-align: center;
  padding: 60px 20px;
}

.welcome-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.welcome-message h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.welcome-message .quick-prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.welcome-message .quick-prompts button {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.welcome-message .quick-prompts button:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* ============ 消息气泡 ============ */
.message {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  flex-direction: row-reverse;
}

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

.message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

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

.message-content {
  max-width: 70%;
  min-width: 100px;
}

.message.user .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.message.assistant .message-bubble {
  background: var(--ai-bubble);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

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

.message-bubble.error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--error);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.message.user .message-meta {
  flex-direction: row-reverse;
}

.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.message-images img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-md);
  cursor: pointer;
  object-fit: cover;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.message-action-btn {
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.ai-tag {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Loading消息 */
.message.loading {
  opacity: 0.7;
}

.loading-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  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.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============ Markdown 样式 ============ */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
  margin: 16px 0 8px;
  font-weight: 600;
}

.message-bubble h1 {
  font-size: 1.4em;
}

.message-bubble h2 {
  font-size: 1.2em;
}

.message-bubble h3 {
  font-size: 1.1em;
}

.message-bubble p {
  margin: 8px 0;
}

.message-bubble ul,
.message-bubble ol {
  margin: 8px 0;
  padding-left: 24px;
}

.message-bubble li {
  margin: 4px 0;
}

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

.message-bubble pre {
  background: #1e1e2e;
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 12px 0;
}

.message-bubble pre code {
  background: transparent;
  padding: 0;
}

.message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.message-bubble th,
.message-bubble td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

.message-bubble th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

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

.message-bubble a {
  color: var(--accent-primary);
  text-decoration: none;
}

.message-bubble a:hover {
  text-decoration: underline;
}

.message-bubble strong {
  font-weight: 600;
}

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

/* ============ 快捷提示词条 ============ */
.quick-prompts-bar {
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
}

.quick-prompts-scroll {
  display: flex;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
}

.quick-prompts-bar button {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.quick-prompts-bar button:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* ============ 图片预览区域 ============ */
.image-preview-bar {
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.image-preview-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
}

.image-preview-item .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--error);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.image-upload-status {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ 输入区域 ============ */
.input-area {
  padding: 16px 24px 20px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.input-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  transition: all var(--transition-fast);
}

.input-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

#message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  outline: none;
}

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

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-attach {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.btn-send {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-send svg {
  width: 20px;
  height: 20px;
}

.input-hint {
  max-width: 800px;
  margin: 8px auto 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ============ Toast 提示 ============ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 1001;
  box-shadow: var(--shadow-md);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: rgba(248, 81, 73, 0.15);
  border-color: var(--error);
  color: var(--error);
}

.toast.success {
  background: rgba(63, 185, 80, 0.15);
  border-color: var(--success);
  color: var(--success);
}

/* ============ Loading遮罩 ============ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 17, 23, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  gap: 20px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ============ 图片预览模态框 ============ */
.image-viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1003;
  cursor: zoom-out;
}

.image-viewer-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* ============ 响应式布局 ============ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay.open {
    display: block;
  }
  
  .main-content {
    padding-top: 60px;
  }
  
  .chat-header {
    padding: 0 16px 0 70px;
  }
  
  .chat-title {
    max-width: 150px;
  }
  
  .data-stats {
    display: none;
  }
  
  .chat-messages {
    padding: 16px;
  }
  
  .message-content {
    max-width: 85%;
  }
  
  .input-area {
    padding: 12px 16px 16px;
  }
  
  .quick-prompts-bar {
    padding: 10px 16px;
  }
  
  .image-preview-bar {
    padding: 10px 16px;
  }
  
  .login-card {
    padding: 32px 24px;
  }
  
  .welcome-message {
    padding: 40px 10px;
  }
  
  .welcome-message h2 {
    font-size: 20px;
  }
  
  .welcome-message .quick-prompts {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .chat-header-left {
    gap: 8px;
  }
  
  .chat-title {
    font-size: 14px;
    max-width: 120px;
  }
  
  .btn-edit-title {
    width: 24px;
    height: 24px;
  }
  
  .message {
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .message-bubble {
    padding: 12px 14px;
    font-size: 14px;
  }
}
