/* 弹层样式 */
.close-btn {
  --position: 1.04vw;
  --size: 2.08vw;
  --color: #fff;
  --bg-color: #333;
  --thickness: 2px;
  width: var(--size);
  height: var(--size);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}
.close-btn::before,
.close-btn::after {
  content: '';
  position: absolute;
  width: calc(var(--size) * 0.7);
  height: var(--thickness);
  background: var(--color);
  left: 50%;
  top: 50%;
  border-radius: 1px;
}
.close-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.close-btn.circle {
  background: var(--bg-color);
  border-radius: 50%;
}
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  overflow: auto;
  /* 加载动画 */
}
.image-modal .image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
}
.image-modal .image-container img {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  margin: 20px auto;
  animation: zoom 0.3s;
}
.image-modal .loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.image-modal .close-btn {
  position: absolute;
  top: var(--position);
  right: var(--position);
  z-index: 10;
}
.loading {
  --bg: #fff;
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 10px;
  transform: translate(-50%, -50%);
  animation: rectangle infinite 1s ease-in-out -0.2s;
  background-color: var(--bg);
}
.loading:before,
.loading:after {
  position: absolute;
  width: 6px;
  height: 10px;
  content: "";
  background-color: var(--bg);
}
.loading:before {
  left: -14px;
  animation: rectangle infinite 1s ease-in-out -0.4s;
}
.loading:after {
  right: -14px;
  animation: rectangle infinite 1s ease-in-out;
}
@media screen and (max-width: 768px) {
  .close-btn {
    --position: 4vw;
    --size: 6.67vw;
  }
}
@keyframes rectangle {
  0%,
  80%,
  100% {
    height: 20px;
    box-shadow: 0 0 var(--bg);
  }
  40% {
    height: 30px;
    box-shadow: 0 -20px var(--bg);
  }
}
@keyframes zoom {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* 响应式调整 */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
  }
  .close {
    top: 10px;
    right: 15px;
    font-size: 30px;
  }
}
