/* ============================================
   对话框 / 聊天样式
   ============================================ */

/* 底部对话输入区 */
.chat-input-area {
  padding: 0 8px 8px 8px;
  flex-shrink: 0;
}

.chat-input-container {
  background: var(--bg-surface);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  border-top: 1px solid var(--border-light);
}

.chat-options {
  margin-bottom: 8px;
}

.chat-mode-select {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  transition: border-color var(--transition-fast);
}
.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.chat-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 18px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}
.send-btn:active {
  transform: scale(0.95);
}
.send-btn:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}
.send-icon {
  display: inline-block;
  transform: rotate(-10deg);
}

.chat-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

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

.generation-status {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
}

/* 对话历史（右侧面板） */
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
}

.chat-welcome {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
}
.welcome-icon {
  font-size: 40px;
  color: var(--primary-light);
  margin-bottom: 12px;
}
.chat-welcome h4 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.chat-welcome p {
  font-size: 13px;
  margin-bottom: 16px;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-action-btn {
  padding: 8px 14px;
  border-radius: var(--border-radius);
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-light);
}
.quick-action-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* 消息气泡 */
.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.3s ease;
}
.chat-message.user {
  align-items: flex-end;
}
.chat-message.ai {
  align-items: flex-start;
}

.message-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 8px;
}

.message-bubble {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: var(--border-radius-lg);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-message.user .message-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-message.ai .message-bubble {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-light);
}

.message-time {
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* 加载指示器 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-surface-hover);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-light);
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
