/* AI智能助手样式 */
.ai-assistant {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.ai-assistant-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.ai-assistant-btn:hover {
  transform: scale(1.05);
  box-shadow: none;
}

.ai-assistant-btn:active {
  transform: scale(0.95);
}

.ai-assistant-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ai-assistant-chat {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
}

.ai-assistant-chat.ai-chat-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(37, 99, 235, 0.1);
}

.ai-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.ai-chat-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.ai-message {
  display: flex;
  max-width: 85%;
  animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-message-bot {
  align-self: flex-start;
}

.ai-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.ai-message-user .ai-message-content {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-message-bot .ai-message-content {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.ai-chat-input-wrapper {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
}

.ai-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.ai-chat-input:focus {
  border-color: #2563eb;
  background: rgba(255, 255, 255, 0.1);
}

.ai-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.ai-chat-send {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #f59e0b 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.ai-chat-send:active {
  transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .ai-assistant {
    bottom: 80px;
    right: 15px;
  }

  .ai-assistant-btn {
    width: 50px;
    height: 50px;
  }

  .ai-assistant-chat {
    width: calc(100vw - 40px);
    height: 400px;
    max-height: 60vh;
    bottom: 140px;
    right: 0;
    border-radius: 16px;
  }

  .ai-assistant-chat.ai-chat-open {
    border-radius: 16px;
  }
}

