
.mbl-creator-gallery {
  --mbl-gallery-bg: #ffffff;
  width: 100%;
  background: var(--mbl-gallery-bg);
  padding: 72px 0;
  overflow: hidden;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.mbl-creator-gallery * {
  box-sizing: border-box;
}

.mbl-creator-gallery-inner {
  width: 100%;
  margin: 0 auto;
}

.mbl-creator-gallery-header {
  max-width: 760px;
  margin: 0 auto 38px;
  padding: 0 20px;
  text-align: center;
}

.mbl-creator-gallery-header h2 {
  margin: 0 0 16px;
  color: #1f1f1f;
  font-size: 40px;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.mbl-creator-gallery-header p {
  max-width: 620px;
  margin: 0 auto;
  color: #666666;
  font-size: 15px;
  line-height: 1.75;
  font-weight: 500;
}

.mbl-gallery-mask {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.mbl-gallery-mask::before,
.mbl-gallery-mask::after {
  content: "";
  position: absolute;
  top: 0;
  width: 110px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.mbl-gallery-mask::before {
  left: 0;
  background: linear-gradient(90deg, var(--mbl-gallery-bg) 0%, rgba(255,255,255,0) 100%);
}

.mbl-gallery-mask::after {
  right: 0;
  background: linear-gradient(270deg, var(--mbl-gallery-bg) 0%, rgba(255,255,255,0) 100%);
}

.mbl-gallery-track {
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  will-change: transform;
}

/* 桌面端自动滑动速度：更慢 */
.mbl-creator-gallery.is-loaded .mbl-gallery-track {
  animation: mblGalleryScroll 96s linear infinite;
}

.mbl-gallery-mask:hover .mbl-gallery-track,
.mbl-creator-gallery.is-lightbox-open .mbl-gallery-track {
  animation-play-state: paused;
}

.mbl-gallery-item {
  flex: 0 0 auto;
  width: 245px;
  height: 310px;
  border-radius: 18px;
  overflow: hidden;
  background: #f1f1ef;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.10);
  position: relative;
  cursor: zoom-in;
}

.mbl-gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #eeeeec 8%, #f8f8f6 18%, #eeeeec 33%);
  background-size: 200% 100%;
  animation: mblGallerySkeleton 1.35s linear infinite;
  z-index: 1;
}

.mbl-gallery-item.is-img-loaded::before {
  display: none;
}

.mbl-gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 58%, rgba(0,0,0,0.28) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.mbl-gallery-item:hover::after {
  opacity: 1;
}

.mbl-gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.45s ease;
  position: relative;
  z-index: 1;
}

.mbl-gallery-item.is-img-loaded img {
  opacity: 1;
}

.mbl-gallery-item:hover img {
  transform: scale(1.06);
}

@keyframes mblGallerySkeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes mblGalleryScroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.mbl-gallery-mobile {
  display: none;
}

.mbl-creator-gallery.is-loaded .mbl-gallery-track-reverse {
  animation-name: mblGalleryScrollReverse;
}

@keyframes mblGalleryScrollReverse {
  0% {
    transform: translateX(-50%);
  }

  100% {
    transform: translateX(0);
  }
}

/* Lightbox */
.mbl-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  box-sizing: border-box;
}

.mbl-gallery-lightbox.is-active {
  display: flex;
}

.mbl-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}

.mbl-lightbox-content {
  position: relative;
  z-index: 2;
  max-width: min(92vw, 1280px);
  max-height: 88vh;
  border-radius: 16px;
  overflow: hidden;
  background: #111111;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  animation: mblLightboxZoom 0.22s ease forwards;
}

.mbl-lightbox-content img {
  display: block;
  width: auto;
  height: auto;
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}

.mbl-lightbox-close {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #111111;
  font-size: 32px;
  line-height: 40px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.mbl-lightbox-close:hover {
  transform: scale(1.06);
  background: #ffffff;
}

@keyframes mblLightboxZoom {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tablet */
@media (max-width: 991px) {
  .mbl-creator-gallery {
    padding: 58px 0;
  }

  .mbl-creator-gallery-header h2 {
    font-size: 32px;
  }

  .mbl-gallery-item {
    width: 210px;
    height: 270px;
    border-radius: 16px;
  }

  .mbl-gallery-track {
    gap: 14px;
  }
}

/* Mobile: Two Row Carousel */
@media (max-width: 575px) {
  .mbl-creator-gallery {
    padding: 44px 0;
  }

  .mbl-creator-gallery-header {
    margin-bottom: 28px;
    padding: 0 18px;
  }

  .mbl-creator-gallery-header h2 {
    font-size: 27px;
    line-height: 1.22;
    margin-bottom: 12px;
  }

  .mbl-creator-gallery-header p {
    font-size: 13px;
    line-height: 1.7;
  }

  .mbl-gallery-desktop {
    display: none;
  }

  .mbl-gallery-mobile {
    display: block;
  }

  .mbl-gallery-mask::before,
  .mbl-gallery-mask::after {
    width: 48px;
  }

  .mbl-gallery-mask-second {
    margin-top: 12px;
  }

  .mbl-gallery-track-mobile {
    gap: 12px;
  }

  /* 移动端自动滑动速度：更慢 */
  .mbl-creator-gallery.is-loaded .mbl-gallery-track-mobile {
    animation-duration: 72s;
  }

  .mbl-gallery-item {
    width: 138px;
    height: 176px;
    border-radius: 13px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  }

  .mbl-gallery-lightbox {
    padding: 18px;
  }

  .mbl-lightbox-content {
    max-width: 94vw;
    max-height: 82vh;
    border-radius: 12px;
  }

  .mbl-lightbox-content img {
    max-width: 94vw;
    max-height: 82vh;
  }

  .mbl-lightbox-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 30px;
    line-height: 36px;
  }
}
