.community-page .community-gallery {
  --community-gallery-slide-width: min(880px, calc(100vw - 40px));
  --community-gallery-info-card-surface: rgba(234, 242, 253, 0.44);
  position: relative;
  overflow: hidden;
  direction: ltr;
  padding: 12px 0 72px;
}

.community-page .community-gallery .community-gallery__info-card {
  position: relative;
  z-index: 2;
  width: min(930px, calc(100% - 24px));
  box-sizing: border-box;
  margin: 0 auto 23px;
  padding: 16px;
  /* 圆角：1920 视口下 12px，随视口等比缩放，最小 6px */
  border-radius: clamp(6px, 0.625vw, 12px);
  background: var(--community-gallery-info-card-surface);
  filter: drop-shadow(0 6px 6px rgba(145, 153, 163, 0.62));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.community-page .community-gallery .community-gallery__info-card::after {
  content: '';
  position: absolute;
  z-index: 1;
  bottom: -15px;
  left: 50%;
  width: 32px;
  height: 15px;
  background: var(--community-gallery-info-card-surface);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.community-page .community-gallery .community-gallery__info-card-author {
  display: flex;
  align-items: center;
  gap: 18px;
}

.community-page .community-gallery .community-gallery__info-card-avatar {
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: #241640;
}

.community-page .community-gallery .community-gallery__info-card-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: 78% 20%;
     object-position: 78% 20%;
  transform: scale(1.45);
}

.community-page .community-gallery .community-gallery__info-card-author h2 {
  margin: 0;
  color: #505050;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.community-page .community-gallery .community-gallery__info-card-body {
  /* Keep summary content and the View Gallery action visually compact. */
  --community-gallery-summary-lines: 3;

  margin-top: 10px;
  max-height: 4.26em;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.42;
  visibility: hidden;
}

.community-page .community-gallery .community-gallery__info-card-body.is-summary-ready {
  visibility: visible;
}

.community-page .community-gallery .community-gallery__info-card-body p {
  display: inline;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: #303030;
  line-height: inherit;
}

.community-page .community-gallery .community-gallery__info-card-cta {
  display: inline-flex;
  margin: 0 0 0 12px;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4a4a4a;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  vertical-align: baseline;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 200ms ease;
}

.community-page .community-gallery .community-gallery__info-card-cta:hover,
.community-page .community-gallery .community-gallery__info-card-cta:focus-visible {
  transform: translateY(-2px);
}

.community-page .community-gallery .community-gallery__info-card-cta span {
  color: transparent;
  background-image: linear-gradient(116.08553075598954deg, #29307f 0%, #cc1377 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.community-page .community-gallery .community-gallery__info-card-cta img {
  display: block;
  width: 16px;
  height: 16px;
  -o-object-fit: contain;
     object-fit: contain;
}

.community-page .community-gallery .community-gallery__swiper {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: visible;
  visibility: hidden;
  touch-action: pan-y;
}

.community-page .community-gallery .community-gallery__swiper.is-ready {
  visibility: visible;
}

.community-page .community-gallery .community-gallery__slide {
  position: relative;
  width: var(--community-gallery-slide-width);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  opacity: 1 !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
  transition: transform 0.42s ease;
  transform-origin: center;
}

.community-page .community-gallery .community-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  transform: scale(1.005);
}

.community-page .community-gallery .community-gallery__shade {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: #ffffff;
  opacity: var(--community-gallery-shade-opacity, 0);
  pointer-events: none;
  transition: opacity 0.42s ease;
}

.community-page .community-gallery .community-gallery__active-controls {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: var(--community-gallery-slide-width);
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.community-page .community-gallery .community-gallery__nav,
.community-page .community-gallery .community-gallery__cta {
  pointer-events: auto;
}

.community-page .community-gallery .community-gallery__nav {
  position: absolute;
  top: 0;
  display: flex;
  width: clamp(80px, 6.25vw, 120px);
  height: clamp(60px, 4.6875vw, 90px);
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translateY(-50%);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.community-page .community-gallery .community-gallery__nav:hover,
.community-page .community-gallery .community-gallery__nav:focus-visible {
  background: transparent;
}

.community-page .community-gallery .community-gallery__nav--prev {
  left: 0;
}

.community-page .community-gallery .community-gallery__nav--next {
  right: 0;
}

.community-page .community-gallery .community-gallery__nav img {
  display: block;
  width: clamp(80px, 6.25vw, 120px);
  height: clamp(60px, 4.6875vw, 90px);
  -o-object-fit: contain;
     object-fit: contain;
}

.community-page .community-gallery .community-gallery__nav--prev img {
  transform: rotate(90deg);
}

.community-page .community-gallery .community-gallery__nav--next img {
  transform: rotate(-90deg);
}

.community-page .community-gallery .community-gallery__cta {
  --community-gallery-cta-padding-block: 9px;
  --community-gallery-cta-padding-inline: 14px;
  --community-gallery-cta-gap: 8px;
  --community-gallery-cta-icon-size: 16px;

  position: absolute;
  top: 0;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
  padding-block: var(--community-gallery-cta-padding-block);
  padding-inline: var(--community-gallery-cta-padding-inline);
  gap: var(--community-gallery-cta-gap);
  font-family: inherit;
  font-size: 16px;
  white-space: nowrap;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.community-page .community-gallery .community-gallery__cta-icon {
  width: var(--community-gallery-cta-icon-size);
  height: var(--community-gallery-cta-icon-size);
  -o-object-fit: contain;
     object-fit: contain;
}

.community-page .community-gallery .community-gallery__cta.btn.hover::before {
  transform: scaleX(0);
}

.community-page .community-gallery .community-gallery__cta.btn.hover:hover::before,
.community-page .community-gallery .community-gallery__cta.btn.hover:focus-visible::before {
  transform: scaleX(1);
}

/* CTA：样式参考 details/common-section 的 .btn + __cta 范式，
   边框/hover 填充扫过由全局 .btn 提供，此处只负责定位与尺寸变量 */
.community-page .community-gallery .community-gallery__anchor {
  position: absolute;
  bottom: 0;
}

@media (min-width: 768px) {
  .community-page .community-gallery {
    padding-top: 21px;
    padding-bottom: 88px;
  }
}

@media (min-width: 960px) {
  .community-page .community-gallery {
    --community-gallery-viewport-height: 100vh;
    --community-gallery-page-offset: calc(
      var(--community-hero-header-offset, 80px) + 24px + 23px
    );
    --community-gallery-card-height-budget: 116px;
    --community-gallery-info-card-gap: 23px;
    --community-gallery-min-bottom-padding: 32px;
    --community-gallery-slide-height: clamp(
      0px,
      calc(
        var(--community-gallery-viewport-height)
        - var(--community-gallery-page-offset)
        - 27px
        - var(--community-gallery-card-height-budget)
        - var(--community-gallery-info-card-gap)
        - var(--community-gallery-min-bottom-padding)
      ),
      495px
    );
    --community-gallery-slide-width: min(
      880px,
      calc(100vw - 40px),
      calc(var(--community-gallery-slide-height) * 1.77778)
    );

    padding-top: 27px;
    padding-bottom: clamp(
      var(--community-gallery-min-bottom-padding),
      calc(
        var(--community-gallery-viewport-height)
        - var(--community-gallery-page-offset)
        - 27px
        - var(--community-gallery-card-height-budget)
        - var(--community-gallery-info-card-gap)
        - var(--community-gallery-slide-height)
      ),
      104px
    );
  }

  .community-page .community-gallery .community-gallery__info-card-body {
    --community-gallery-summary-lines: 2;

    height: 2.84em;
    max-height: 2.84em;
    overflow: visible;
  }

  .community-page .community-gallery .community-gallery__cta {
    --community-gallery-cta-padding-block: 10px;
    --community-gallery-cta-padding-inline: 18px;
    --community-gallery-cta-gap: 14px;
    --community-gallery-cta-icon-size: 18px;
  }

}

@media (min-width: 960px) and (max-width: 1679px) {
  .community-page .community-gallery {
    padding-top: 0;
    --community-gallery-card-height-budget: 84px;
    --community-gallery-info-card-gap: 24px;
    --community-gallery-slide-height: clamp(
      0px,
      calc(
        var(--community-gallery-viewport-height)
        - var(--community-gallery-page-offset)
        - var(--community-gallery-card-height-budget)
        - var(--community-gallery-info-card-gap)
        - var(--community-gallery-min-bottom-padding)
      ),
      540px
    );
    --community-gallery-slide-width: min(
      960px,
      calc(100vw - 40px),
      calc(var(--community-gallery-slide-height) * 1.77778)
    );
    padding-bottom: clamp(
      var(--community-gallery-min-bottom-padding),
      calc(
        var(--community-gallery-viewport-height)
        - var(--community-gallery-page-offset)
        - var(--community-gallery-card-height-budget)
        - var(--community-gallery-info-card-gap)
        - var(--community-gallery-slide-height)
      ),
      104px
    );
  }

  .community-page .community-gallery .community-gallery__info-card {
    width: min(930px, var(--community-gallery-slide-width), calc(100% - 24px));
    margin-bottom: var(--community-gallery-info-card-gap);
    padding: 10px;
  }

  .community-page .community-gallery .community-gallery__info-card::after {
    bottom: -11px;
    width: 24px;
    height: 11px;
  }

  .community-page .community-gallery .community-gallery__info-card-author {
    gap: 10px;
  }

  .community-page .community-gallery .community-gallery__info-card-avatar {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .community-page .community-gallery .community-gallery__info-card-author h2,
  .community-page .community-gallery .community-gallery__info-card-body,
  .community-page .community-gallery .community-gallery__info-card-cta {
    font-size: 12px;
  }

  .community-page .community-gallery .community-gallery__info-card-body {
    --community-gallery-summary-lines: 2;

    height: 2.6em;
    max-height: 2.6em;
    margin-top: 4px;
    line-height: 1.3;
  }
}

@supports (height: 100svh) {
  .community-page .community-gallery {
    --community-gallery-viewport-height: 100svh;
  }
}

@media (max-width: 639px) {
  .community-page .community-gallery {
    --community-gallery-slide-width: min(704px, calc(80vw - 32px));
    padding-top: 32px;
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
  }

  .community-page .community-gallery .community-gallery__info-cards {
    display: flow-root;
    order: 2;
  }

  .community-page .community-gallery .community-gallery__swiper {
    order: 1;
  }

  .community-page .community-gallery .community-gallery__info-card {
    width: calc(100% - 24px);
    margin-top: 18px;
    margin-bottom: 0;
    padding: 16px;
  }

  .community-page .community-gallery .community-gallery__info-card::after {
    top: -15px;
    right: auto;
    bottom: auto;
    left: 50%;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }

  .community-page .community-gallery .community-gallery__info-card-author {
    gap: 12px;
  }

  .community-page .community-gallery .community-gallery__info-card-body {
    max-height: 4.26em;
    margin-top: 10px;
  }

  .community-page .community-gallery .community-gallery__info-card-cta {
    font-size: 14px;
  }

  .community-page .community-gallery .community-gallery__slide {
    border-radius: 10px;
  }

  .community-page .community-gallery .community-gallery__nav {
    width: 40px;
    height: 30px;
  }

  .community-page .community-gallery .community-gallery__nav img {
    width: 40px;
    height: 30px;
  }

  .community-page .community-gallery .community-gallery__cta {
    --community-gallery-cta-padding-block: 8px;
    --community-gallery-cta-padding-inline: 12px;
    --community-gallery-cta-gap: 6px;
    --community-gallery-cta-icon-size: 14px;

    font-size: 13px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .community-page .community-gallery .community-gallery__slide,
  .community-page .community-gallery .community-gallery__shade,
  .community-page .community-gallery .community-gallery__nav,
  .community-page .community-gallery .community-gallery__info-card-cta {
    transition: none;
  }
}
