#chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
}

.chatbot-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.chatbot-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 420px;
  min-width: 380px;
  max-width: 90vw;
  height: 600px;
  min-height: 400px;
  max-height: 90vh;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10001;
  transition: width 0.3s ease, height 0.3s ease;
  will-change: transform;
}

.chatbot-window.maximized {
  width: 90vw !important;
  height: 90vh !important;
  bottom: 5vh !important;
  right: 5vw !important;
  left: 5vw !important;
  top: 5vh !important;
  transform: none !important;
}

.chatbot-window.minimized {
  width: 320px !important;
  height: 220px !important;
}

.chatbot-window.hidden {
  display: none !important;
  visibility: hidden;
  opacity: 0;
}

.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.chatbot-header:active {
  cursor: grabbing;
}

.chatbot-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-header-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.chatbot-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 静态入口按钮样式 */
.chatbot-entry-btn {
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chatbot-entry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-entry-btn:active {
  transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .chatbot-window {
    width: 90vw !important;
    height: 70vh !important;
    bottom: 10px;
    right: 5vw;
    left: 5vw;
  }
  
  .chatbot-window.maximized {
    width: 95vw !important;
    height: 95vh !important;
    bottom: 2.5vh !important;
    right: 2.5vw !important;
    left: 2.5vw !important;
    top: 2.5vh !important;
  }
  
  .chatbot-window.minimized {
    width: 250px !important;
    height: 180px !important;
  }
  
  #chatbot-widget {
    bottom: 10px;
    right: 10px;
  }
  
  .chatbot-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

/* 防止iframe内容选中 */
.chatbot-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#chatbot-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}