/* 位置分组容器 */
.floating-pos-group {
  position: fixed;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  align-items: flex-end;
}

/* 不同位置对齐方式 */
.floating-pos-group.floating-pos-bottom-left {
  align-items: flex-start;
}

.floating-pos-group.floating-pos-top-left {
  align-items: flex-start;
}

.floating-pos-group.floating-pos-top-right {
  align-items: flex-end;
}

.floating-pos-group.floating-pos-center {
  align-items: center;
}

/* 各位置坐标 */
.floating-pos-group.floating-pos-bottom-right {
  bottom: 0.4rem;
  right: 0.4rem;
}

.floating-pos-group.floating-pos-bottom-left {
  bottom: 0.4rem;
  left: 0.4rem;
}

.floating-pos-group.floating-pos-top-right {
  top: 0.4rem;
  right: 0.4rem;
}

.floating-pos-group.floating-pos-top-left {
  top: 0.4rem;
  left: 0.4rem;
}

.floating-pos-group.floating-pos-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 单个飘窗 */
.floating-window {
  position: relative;
  width: auto;
  max-width: 3rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.floating-window img {
  display: block;
  width: 100%;
  min-width: 100px;
  height: auto;
  border-radius: 0.08rem;
  max-height: 200px;
}

.floating-window .floating-close {
  position: absolute;
  top: -0.12rem;
  right: -0.12rem;
  width: 0.28rem;
  height: 0.28rem;
  line-height: 0.26rem;
  text-align: center;
  background: #333;
  color: #fff;
  border-radius: 50%;
  font-size: 0.16rem;
  cursor: pointer;
  display: none;
  z-index: 2;
}

.floating-window:hover .floating-close {
  display: block;
}

/* 动画 */
.floating-window.floating-type-fixed {
  animation: floatingFadeIn 0.5s ease;
}

@keyframes floatingFadeIn {
  from {
    opacity: 0;
    transform: translateY(0.2rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-pos-center .floating-window.floating-type-fixed {
  animation: floatingCenterFadeIn 0.5s ease;
}

@keyframes floatingCenterFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 移动端适配 */
@media (max-width: 960px) {
  .floating-window {
    max-width: 2rem;
  }

  .floating-pos-group.floating-pos-bottom-right {
    bottom: 0.2rem;
    right: 0.2rem;
  }

  .floating-pos-group.floating-pos-bottom-left {
    bottom: 0.2rem;
    left: 0.2rem;
  }

  .floating-pos-group.floating-pos-top-right {
    top: 0.2rem;
    right: 0.2rem;
  }

  .floating-pos-group.floating-pos-top-left {
    top: 0.2rem;
    left: 0.2rem;
  }
}