/* 法筑网 - AI对话浮动窗口样式 */
.fzw-ai-chat-btn {
  position: fixed;
  bottom: 30px;
  left: 30px; /* 改为左下角 */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  box-shadow: 0 4px 20px rgba(26, 115, 232, 0.4);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}
.fzw-ai-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(26, 115, 232, 0.6);
}
.fzw-ai-chat-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  pointer-events: none; /* 让点击穿透到按钮 */
}
.fzw-ai-chat-window {
  position: fixed;
  bottom: 100px;
  left: 30px; /* 改为左下角，与按钮对齐 */
  width: 360px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.fzw-ai-chat-window.show {
  display: flex;
  animation: fzwSlideUp 0.3s ease;
}
@keyframes fzwSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fzw-ai-chat-header {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fzw-ai-chat-header-info {
  display: flex;
  align-items: center;
}
.fzw-ai-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 20px;
}
.fzw-ai-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.fzw-ai-chat-header p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}
.fzw-ai-chat-phone {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-right: 8px;
}
.fzw-ai-chat-phone:hover {
  background: rgba(255,255,255,0.3);
}
.fzw-ai-chat-close {
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fzw-ai-chat-close:hover {
  background: rgba(255,255,255,0.3);
}
.fzw-ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f5f7fa;
}
.fzw-ai-chat-msg {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
}
.fzw-ai-chat-msg.user {
  flex-direction: row-reverse;
}
.fzw-ai-chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.fzw-ai-chat-msg.bot .fzw-ai-chat-msg-avatar {
  background: #1a73e8;
  color: #fff;
  margin-right: 10px;
}
.fzw-ai-chat-msg.user .fzw-ai-chat-msg-avatar {
  background: #07c160;
  color: #fff;
  margin-left: 10px;
}
.fzw-ai-chat-msg-content {
  max-width: 240px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.fzw-ai-chat-msg.bot .fzw-ai-chat-msg-content {
  background: #fff;
  color: #333;
  border-top-left-radius: 4px;
}
.fzw-ai-chat-msg.user .fzw-ai-chat-msg-content {
  background: #1a73e8;
  color: #fff;
  border-top-right-radius: 4px;
}
.fzw-ai-chat-msg-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  text-align: center;
}
.fzw-ai-chat-typing {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  border-top-left-radius: 4px;
  max-width: 80px;
}
.fzw-ai-chat-typing span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  margin: 0 2px;
  animation: fzwTyping 1.2s infinite;
}
.fzw-ai-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.fzw-ai-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fzwTyping {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}
.fzw-ai-chat-input-area {
  padding: 16px;
  border-top: 1px solid #eee;
  background: #fff;
  display: flex;
  align-items: flex-end;
}
.fzw-ai-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 80px;
  min-height: 20px;
  font-family: inherit;
}
.fzw-ai-chat-input:focus {
  border-color: #1a73e8;
}
.fzw-ai-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  border: none;
  cursor: pointer;
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fzw-ai-chat-send:hover {
  background: #0d47a1;
}
.fzw-ai-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}
.fzw-ai-chat-footer {
  text-align: center;
  padding: 8px;
  font-size: 11px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
}
@media (max-width: 480px) {
  .fzw-ai-chat-window {
    width: calc(100% - 20px);
    left: 10px;
    bottom: 80px;
    height: 70vh;
  }
  .fzw-ai-chat-btn {
    left: 10px;
    bottom: 10px;
  }
}
