/* 聊天界面样式 */

.chat-container {
  display: flex;
  height: calc(100vh - 56px); /* 减去导航栏高度 */
  background-color: var(--light-color);
}

/* 左侧边栏 - 会话列表 */
.chat-sidebar {
  width: 300px;
  background-color: var(--white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.new-chat-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.new-chat-btn:hover {
  background-color: var(--secondary-color);
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.conversation-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.conversation-item:hover {
  background-color: var(--light-color);
}

.conversation-item.active {
  background-color: #e0e7ff;
  border-left: 3px solid var(--primary-color);
}

.conversation-title {
  font-weight: 500;
  color: var(--dark-color);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* 主聊天区域 */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  background-color: var(--white);
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dark-color);
}

.chat-actions {
  display: flex;
  gap: 0.5rem;
}

.chat-action-btn {
  padding: 0.5rem;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-action-btn:hover {
  background-color: var(--light-color);
  color: var(--dark-color);
}

/* 消息区域 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: #f9fafb;
}

.message {
  display: flex;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 1rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background-color: var(--primary-color);
  color: var(--white);
}

.message.assistant .message-avatar {
  background-color: var(--success-color);
  color: var(--white);
}

.message-content {
  flex: 1;
  max-width: 70%;
}

.message.user .message-content {
  margin-left: auto;
  margin-right: 0;
}

.message-bubble {
  background-color: var(--white);
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.message.user .message-bubble {
  background-color: var(--primary-color);
  color: var(--white);
}

.message-text {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.message.user .message-time {
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
}

/* 免责声明 */
.disclaimer {
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* 输入区域 */
.chat-input-container {
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 1rem;
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  overflow-y: auto;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.send-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.send-btn:hover:not(:disabled) {
  background-color: var(--secondary-color);
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 加载动画 */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* 右侧边栏 - 使用提示 */
.chat-tips {
  width: 250px;
  background-color: var(--white);
  border-left: 1px solid var(--border-color);
  padding: 1.5rem;
  overflow-y: auto;
}

.tips-header {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.tip-item {
  background-color: var(--light-color);
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--dark-color);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.tip-item:hover {
  background-color: #e0e7ff;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.empty-state-text {
  font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .chat-tips {
    display: none;
  }
}

@media (max-width: 768px) {
  .chat-sidebar {
    position: fixed;
    left: -300px;
    height: 100%;
    z-index: 100;
    transition: left 0.3s ease;
  }
  
  .chat-sidebar.open {
    left: 0;
  }
  
  .chat-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
  }
  
  .chat-sidebar-overlay.show {
    display: block;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .message-content {
    max-width: 85%;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
  
  .chat-sidebar-overlay {
    display: none !important;
  }
} 