/* floating-phone.css — 悬浮电话按钮 */

.floating-phone {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #3369D2 0%, #5b8ef0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(51, 105, 210, 0.4);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 999;
  text-decoration: none;
  animation: pulse 2s ease-in-out infinite;
}

.floating-phone:hover {
  transform: translateY(calc(-50% - 4px)) scale(1.05);
  box-shadow: 0 8px 30px rgba(51, 105, 210, 0.6);
  animation: none;
}

.floating-phone__icon {
  width: 26px;
  height: 26px;
  stroke: #fff;
  animation: ring 3s ease-in-out infinite;
}

.floating-phone:hover .floating-phone__icon {
  animation: shake 0.5s ease-in-out;
}

.floating-phone__tooltip {
  position: absolute;
  right: 70px;
  background: rgba(51, 105, 210, 0.95);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.5px;
}

.floating-phone__tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid rgba(51, 105, 210, 0.95);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.floating-phone:hover .floating-phone__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 脉冲动画 */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(51, 105, 210, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(51, 105, 210, 0.4), 0 0 0 12px rgba(51, 105, 210, 0.1);
  }
}

/* 铃声动画 */
@keyframes ring {
  0%, 10%, 20%, 100% {
    transform: rotate(0deg);
  }
  5% {
    transform: rotate(-15deg);
  }
  15% {
    transform: rotate(15deg);
  }
}

/* 抖动动画 */
@keyframes shake {
  0%, 100% {
    transform: rotate(0deg);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: rotate(-10deg);
  }
  20%, 40%, 60%, 80% {
    transform: rotate(10deg);
  }
}

/* 移动端适配 */
@media (max-width: 767px) {
  .floating-phone {
    right: 1rem;
    bottom: unset;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
  }

  .floating-phone__icon {
    width: 22px;
    height: 22px;
  }

  .floating-phone__tooltip {
    right: 60px;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
}
