/* 悬浮客服样式 */
.floating-contact {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-contact.collapsed {
  right: -260px;
}

/* 切换按钮 */
.floating-contact-toggle {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 100px;
  background: linear-gradient(135deg, #ff7200 0%, #ff9500 100%);
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -4px 0 16px rgba(255, 114, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.floating-contact-toggle::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.floating-contact-toggle:hover {
  background: linear-gradient(135deg, #ff9500 0%, #ffb300 100%);
  box-shadow: -6px 0 20px rgba(255, 114, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%) translateX(-2px);
}

.floating-contact-toggle:hover::after {
  left: 100%;
}

.floating-contact-toggle::before {
  content: '\203A';
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.floating-contact.collapsed .floating-contact-toggle::before {
  content: '\2039';
}

/* 客服面板 */
.floating-contact-panel {
  width: 260px;
  background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 114, 0, 0.1);
}

/* 客服标题 */
.floating-contact-header {
  background: linear-gradient(135deg, #ff7200 0%, #ff9500 100%);
  color: #fff;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  position: relative;
  overflow: hidden;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.floating-contact-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* 客服项目列表 */
.floating-contact-list {
  padding: 10px 0;
}

.floating-contact-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.3s ease;
  position: relative;
}

.floating-contact-item a {
  display: flex;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: #333;
  cursor: pointer;
}

.floating-contact-link {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
}

.floating-contact-item:last-child {
  border-bottom: none;
}

.floating-contact-item:hover {
  background: linear-gradient(90deg, #fff5f0 0%, #ffffff 100%);
  transform: translateX(-2px);
}

.floating-contact-item a:hover {
  color: #333;
}

/* 图标样式 */
.floating-contact-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  font-size: 18px;
  color: #fff;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.floating-contact-item:hover .floating-contact-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.icon-phone {
  background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.icon-email {
  background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
}

.icon-wechat {
  background: linear-gradient(135deg, #07C160 0%, #09d66f 100%);
}

.icon-qq {
  background: linear-gradient(135deg, #12B7F5 0%, #39c5f7 100%);
}

.icon-twitter {
  background: linear-gradient(135deg, #000 0%, #333 100%);
}

/* 联系信息 */
.floating-contact-info {
  flex: 1;
}

.floating-contact-label {
  font-size: 13px;
  color: #333;
  margin-bottom: 3px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.floating-contact-value {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

/* 微信二维码弹窗 */
.floating-contact-wechat .wechat-qrcode {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(7, 193, 96, 0.1);
  z-index: 10000;
  white-space: nowrap;
  border: 2px solid rgba(7, 193, 96, 0.1);
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

.floating-contact-wechat .wechat-qrcode::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.wechat-qrcode-content {
  text-align: center;
  width: 150px;
}

.wechat-qrcode-box {
  width: 150px;
  height: 150px;
  border: 3px solid #07C160;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
  font-size: 28px;
  color: #07C160;
  font-weight: 700;
  letter-spacing: 3px;
  box-shadow: inset 0 2px 8px rgba(7, 193, 96, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.wechat-qrcode-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(7, 193, 96, 0.05), transparent);
  animation: qrShine 2s infinite;
}

@keyframes qrShine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.wechat-qrcode-text {
  text-align: center;
  font-size: 13px;
  color: #07C160;
  margin-top: 12px;
  font-weight: 600;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .floating-contact {
    right: auto;
    left: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .floating-contact.collapsed {
    bottom: -100%;
  }
  
  .floating-contact-toggle {
    position: fixed;
    left: auto;
    right: 20px;
    top: auto;
    bottom: 20px;
    transform: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(255, 114, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
  }
  
  .floating-contact-toggle::before {
    content: '\2630';
    font-size: 24px;
  }
  
  .floating-contact.collapsed .floating-contact-toggle::before {
    content: '\2630';
  }
  
  .floating-contact-panel {
    width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 70vh;
    overflow-y: auto;
  }
  
  .floating-contact-header {
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .floating-contact-item {
    padding: 12px 20px;
  }
  
  .floating-contact-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  
  .floating-contact-label {
    font-size: 14px;
  }
  
  .floating-contact-value {
    font-size: 13px;
  }
  
  /* 移动端微信二维码显示在上方 */
  .floating-contact-wechat .wechat-qrcode {
    right: auto;
    left: 50%;
    top: auto;
    bottom: 100%;
    transform: translateX(-50%);
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .floating-contact-wechat .wechat-qrcode::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -8px;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    border-bottom: none;
  }
  
  .wechat-qrcode-content {
    width: 130px;
  }
  
  .wechat-qrcode-box {
    width: 130px;
    height: 130px;
    font-size: 24px;
  }
}

/* 小屏幕进一步优化 */
@media (max-width: 480px) {
  .floating-contact-toggle {
    right: 15px;
    bottom: 15px;
    width: 55px;
    height: 55px;
  }
  
  .floating-contact-toggle::before {
    font-size: 22px;
  }
  
  .floating-contact-header {
    padding: 14px 18px;
    font-size: 15px;
  }
  
  .floating-contact-item {
    padding: 11px 18px;
  }
}
