.gallery img {
  cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.gallery img:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: clamp(16px, 3vw, 32px);
  background: rgba(16, 18, 28, .92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1180px, 100%);
  height: min(78vh, calc(100dvh - 118px));
  min-height: 280px;
}

.gallery-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
  background: #111;
}

.gallery-lightbox__caption {
  min-height: 24px;
  max-width: min(1180px, 100%);
  color: #fff9ef;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.gallery-lightbox__button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 249, 239, .28);
  border-radius: 999px;
  background: rgba(255, 249, 239, .14);
  color: #fff9ef;
  font: 700 24px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.gallery-lightbox__button:hover {
  background: rgba(255, 249, 239, .24);
  transform: scale(1.04);
}

.gallery-lightbox__close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover {
  transform: translateY(-50%) scale(1.04);
}

.gallery-lightbox__prev {
  left: 12px;
}

.gallery-lightbox__next {
  right: 12px;
}

body.gallery-lightbox-lock {
  overflow: hidden;
}

@media (max-width: 680px) {
  .gallery-lightbox {
    padding: 14px;
    gap: 10px;
  }

  .gallery-lightbox__stage {
    width: 100%;
    height: min(76vh, calc(100dvh - 98px));
    min-height: 220px;
  }

  .gallery-lightbox__button {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .gallery-lightbox__prev {
    left: 6px;
  }

  .gallery-lightbox__next {
    right: 6px;
  }

  .gallery-lightbox__caption {
    font-size: 13px;
  }
}
