/* H5端AI悬浮聊天样式 */

/* 加载动画 */
@keyframes loading-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* AI悬浮容器 */
.ai-float-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* AI悬浮按钮 */
.ai-float-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-image: url('/assets/images/ai-button-bg.png');
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

/* .ai-float-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(31, 106, 216, 0.5);
}

.ai-float-button:active {
  transform: translateY(0);
} */

/* AI聊天框 */
.ai-float-chat {
  position: fixed;
  bottom: 0px;
  right: 0;
  width: 100vw;
  height: 70%;
  background-image: url('/assets/images/ai-chat-bg.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}
.ai-tips{
  display: flex;
  align-items: center;
  justify-content: start;
  padding-left: 24px;
  gap: 10px;
}
.ai-tips-image {
  width: 56px;
  height: 56px;
}
.ai-tips-image img{
  width: 100%;
  height: 100%;
}
.ai-tips-text{
  font-size: 16px;
  font-weight: 500;
  line-height: 19px;
}

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

/* AI聊天框头部 */
.ai-chat-header {
  /* background: #1f6ad8; */
  color: black;
  padding: 10px 24px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-chat-title{
  font-size: 20px;
  font-weight: 500;
}


.ai-chat-close {
  background: none;
  border: none;
  color: black;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.ai-chat-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* AI聊天框主体 */
.ai-chat-body {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
  background: transparent;
}

.ai-welcome-message {
  margin-bottom: 16px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.ai-box {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666;
}

.ai-chat-messages {
  overflow-y: hidden;
}

/* AI聊天框底部 */
.ai-chat-footer {
  padding: 16px;
  background: #f3f5f6;
  border-top: 1px solid #eee;
}

.ai-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ai-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 50px;
  padding: 8px 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 80px;
}

.ai-chat-input:focus {
  border-color: #1f6ad8;
  box-shadow: 0 0 0 2px rgba(31, 106, 216, 0.2);
}

.ai-send-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f6ad8;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(31, 106, 216, 0.3);
}

.ai-send-button:active {
  transform: scale(0.95);
}

/* 响应式调整 */
@media (max-width: 375px) {
  .ai-float-chat {
    width: 100vw;

  }
}

@media (max-width: 320px) {
  .ai-float-container {
    right: 15px;
    bottom: 15px;
  }
  
  .ai-float-button {
    width: 50px;
    height: 50px;
  }
  
  .ai-float-chat {
    width: 100vw;
    height: 70%;
  }
}

/* 聊天消息样式 */
.chat-message {
  margin-bottom: 12px;
  display: flex;
}

.user-message {
  justify-content: flex-end;
}

.ai-message {
  justify-content: flex-start;
}

.chat-message > div {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.user-message > div {
  background: #1f6ad8;
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message > div {
  background: white;
  color: #333;
  border: 1px solid #eee;
  border-bottom-left-radius: 4px;
}

/* 加载消息样式 */
.loading-message > div {
  display: flex;
  align-items: center;
}

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

.loading-dots span {
  width: 6px;
  height: 6px;
  background: #1f6ad8;
  border-radius: 50%;
  animation: loading-bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* 滚动条样式 */
.ai-chat-body::-webkit-scrollbar {
  width: 4px;
}

.ai-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
  background: rgba(31, 106, 216, 0.3);
  border-radius: 2px;
}

.ai-chat-body::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 106, 216, 0.5);
}
