/* ========================================
   在线客服 & 返回顶部 悬浮组件样式
   ======================================== */

/* 悬浮工具容器 */
#floating-tools {
  position: fixed;
  right: 30px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

/* 悬浮按钮通用样式 */
.floating-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  position: relative;
}

.floating-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-btn:active {
  transform: translateY(-1px);
}

/* 返回顶部按钮 */
.back-top-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.back-top-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 在线客服按钮 - 品牌红色 */
.service-btn {
  background: linear-gradient(135deg, #E50012 0%, #FF4136 100%);
  color: white;
  animation: pulse-glow 2s infinite;
}

.service-btn:hover {
  background: linear-gradient(135deg, #FF4136 0%, #E50012 100%);
  animation: none;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(229, 0, 18, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(255, 65, 54, 0.6);
  }
}

/* ========================================
   客服弹窗样式
   ======================================== */

.cs-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.cs-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.cs-modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(1) translateY(0);
  transition: transform 0.3s ease;
}

.cs-modal.hidden .cs-modal-content {
  transform: scale(0.9) translateY(20px);
}

/* 弹窗头部 */
.cs-modal-header {
  background: linear-gradient(135deg, #E50012 0%, #FF4136 100%);
  color: white;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cs-header-icon {
  font-size: 24px;
}

.cs-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.cs-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cs-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 弹窗主体 */
.cs-modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

/* 未登录提示 */
.cs-login-notice {
  text-align: center;
  padding: 40px 20px;
}

.cs-login-notice.hidden {
  display: none;
}

.cs-notice-icon {
  font-size: 48px;
  color: #e0e0e0;
  margin-bottom: 16px;
}

.cs-login-notice p {
  color: #666;
  margin-bottom: 20px;
  font-size: 15px;
}

/* 表单样式 */
.cs-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cs-form.hidden {
  display: none;
}

.cs-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.cs-form-group label .required {
  color: #e74c3c;
}

.cs-form-group select,
.cs-form-group textarea {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.cs-form-group select:focus,
.cs-form-group textarea:focus {
  outline: none;
  border-color: #E50012;
  box-shadow: 0 0 0 3px rgba(229, 0, 18, 0.1);
}

.cs-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* 消息提示 */
.cs-form-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-form-message.hidden {
  display: none;
}

.cs-form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cs-form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 提交按钮 */
.cs-form-submit {
  padding-top: 10px;
}

.cs-primary-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #E50012 0%, #FF4136 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cs-primary-btn:hover {
  background: linear-gradient(135deg, #c9000f 0%, #e53935 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(229, 0, 18, 0.3);
}

.cs-primary-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.cs-primary-btn .btn-loading.hidden {
  display: none;
}

.cs-primary-btn .btn-text.hidden {
  display: none;
}

/* 弹窗底部 */
.cs-modal-footer {
  background: #f8f9fa;
  padding: 16px 24px;
  border-top: 1px solid #eee;
}

.cs-contact-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cs-contact-info span {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cs-contact-info i {
  color: #E50012;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 480px) {
  #floating-tools {
    right: 15px;
    bottom: 15px;
  }
  
  .floating-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  .cs-modal-content {
    width: 95%;
    max-height: 85vh;
  }
  
  .cs-modal-body {
    padding: 20px;
  }
  
  .cs-contact-info {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

/* 打印时隐藏 */
@media print {
  #floating-tools,
  .cs-modal {
    display: none !important;
  }
}
