/* AI助手样式 */
.ai-assistant {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* AI气泡按钮 */
.ai-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ai-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
}

.ai-bubble::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #007bff, #00d4ff, #007bff);
  border-radius: 50%;
  z-index: -1;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-bubble svg {
  width: 24px;
  height: 24px;
  color: white;
  z-index: 1;
}

/* AI侧边栏 */
.ai-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.ai-sidebar.open {
  right: 0;
}

.ai-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
}

.ai-sidebar-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.ai-close-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

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

.ai-sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ai-message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.ai-message.user {
  background: #007bff;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-message.assistant {
  background: #f3f4f6;
  color: #374151;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-input-container {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

.ai-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 14px;
  resize: none;
  max-height: 100px;
  min-height: 40px;
  outline: none;
  transition: border-color 0.2s;
}

.ai-input:focus {
  border-color: #007bff;
}

.ai-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #007bff;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.ai-send-btn:hover {
  background: #0056b3;
}

.ai-send-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* 首页底部AI提问栏 */
.ai-home-input {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

.ai-home-input .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.ai-home-input-wrapper {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.ai-home-input input {
  flex: 1;
  padding: 15px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 25px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.ai-home-input input:focus {
  border-color: #007bff;
}

.ai-home-send-btn {
  padding: 15px 30px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-home-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.ai-home-send-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 加载动画 */
.ai-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .ai-sidebar {
    width: 100%;
    right: -100%;
  }
  
  .ai-bubble {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }
  
  .ai-bubble svg {
    width: 20px;
    height: 20px;
  }
  
  .ai-home-input {
    padding: 15px;
  }
  
  .ai-home-input-wrapper {
    gap: 10px;
  }
  
  .ai-home-input input {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .ai-home-send-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* 遮罩层 */
.ai-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ai-overlay.show {
  opacity: 1;
  visibility: visible;
}
