.hec-scroll-showcase {
  --hec-showcase-gap: 40px;
  /* 与固定导航留出间距，可在小部件「右图 sticky 顶部偏移」或主题里覆盖 --hec-showcase-sticky-top */
  --hec-showcase-sticky-top: 96px;
  --hec-scroll-left-min: 260px;
  --hec-scroll-right-min: 320px;
  --hec-showcase-item-min-h: 60vh;
  --hec-showcase-title-mb: 14px;
  --hec-showcase-head-mb: 18px;
  display: grid;
  /* 默认约 45/55，可在小部件「左列宽度占比 / 列最小宽度」覆盖 */
  grid-template-columns: minmax(var(--hec-scroll-left-min), 45%) minmax(var(--hec-scroll-right-min), 55%);
  gap: var(--hec-showcase-gap);
  /* stretch：右列与左列同高，sticky 才有「在模块内滑动」的空间；start 时右格高度≈图高，sticky 几乎不生效 */
  align-items: stretch;
  overflow: visible;
}

.hec-scroll-showcase__left {
  display: flex;
  flex-direction: column;
  overflow: visible;
  align-self: stretch;
  min-width: 0;
}

.hec-scroll-showcase__item {
  min-height: clamp(420px, var(--hec-showcase-item-min-h), 760px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.28s ease;
}

.hec-scroll-showcase__item.is-active {
  opacity: 1;
}

.hec-scroll-showcase__head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: var(--hec-showcase-head-mb);
}

.hec-scroll-showcase__line {
  width: 28px;
  height: 1px;
  background: #525861;
}

.hec-scroll-showcase__index {
  font-size: 14px;
  font-weight: 600;
  color: #2f3439;
  letter-spacing: 0.04em;
}

.hec-scroll-showcase__title {
  margin: 0 0 var(--hec-showcase-title-mb);
  font-size: clamp(40px, 3.6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.hec-scroll-showcase__desc {
  max-width: 520px;
  font-size: 17px;
  line-height: 1.62;
}

.hec-scroll-showcase__desc p {
  margin: 0 0 12px;
}

.hec-scroll-showcase__right {
  position: relative;
  overflow: visible;
  align-self: stretch;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hec-scroll-showcase__sticky {
  position: sticky;
  top: var(--hec-showcase-sticky-top);
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: min(74vh, 760px);
  border-radius: 0;
  overflow: hidden;
  background: #0f1114;
}

/*
 * Elementor 常见 overflow:hidden / clip 会打断 position:sticky。
 * 用 :has 放宽包含本组件的祖先（需较新浏览器；无 :has 时至少 widget 自身仍可见）。
 */
.elementor-widget-hello-scroll-showcase,
.elementor-widget-hello-scroll-showcase .elementor-widget-container {
  overflow: visible !important;
}

.elementor-section:has(.hec-scroll-showcase),
.elementor-container:has(.hec-scroll-showcase),
.elementor-column:has(.hec-scroll-showcase),
.elementor-inner-section:has(.hec-scroll-showcase),
.elementor-widget-wrap:has(.hec-scroll-showcase),
.e-con:has(.hec-scroll-showcase),
.e-con-inner:has(.hec-scroll-showcase) {
  overflow: visible !important;
}

.hec-scroll-showcase__image {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  z-index: 1;
  transition:
    opacity 0.52s ease,
    transform 0.64s cubic-bezier(0.28, 0.65, 0.18, 1);
}

.hec-scroll-showcase__image.is-active {
  opacity: 1;
  z-index: 2;
}

/* 瀑布下落：整幅图移出画幅（约 100%），ease-in 略像加速下落 */
.hec-scroll-showcase__image.hec-img--out-down {
  opacity: 0;
  transform: translate3d(0, 108%, 0);
  z-index: 1;
  transition:
    opacity 0.45s ease-out,
    transform 0.58s cubic-bezier(0.55, 0.02, 0.75, 0.35);
}

.hec-scroll-showcase__image.hec-img--out-up {
  opacity: 0;
  transform: translate3d(0, -108%, 0);
  z-index: 1;
  transition:
    opacity 0.45s ease-out,
    transform 0.58s cubic-bezier(0.55, 0.02, 0.75, 0.35);
}

/* 入场起点：无 transition，避免从 0 误插值到起点 */
.hec-scroll-showcase__image.hec-img--in-from-down:not(.is-active) {
  transition: none;
  opacity: 0;
  transform: translate3d(0, 108%, 0);
  z-index: 3;
}

.hec-scroll-showcase__image.hec-img--in-from-top:not(.is-active) {
  transition: none;
  opacity: 0;
  transform: translate3d(0, -108%, 0);
  z-index: 3;
}

/* 从顶「泻入」/ 从底升起：落地略减速 */
.hec-scroll-showcase__image.hec-img--in-from-down.is-active,
.hec-scroll-showcase__image.hec-img--in-from-top.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  z-index: 3;
  transition:
    opacity 0.52s ease-out,
    transform 0.64s cubic-bezier(0.2, 0.82, 0.24, 1);
}

@media (prefers-reduced-motion: reduce) {
  .hec-scroll-showcase__image {
    transition-property: opacity;
    transition-duration: 0.22s;
  }

  .hec-scroll-showcase__image.hec-img--out-up,
  .hec-scroll-showcase__image.hec-img--out-down,
  .hec-scroll-showcase__image.hec-img--in-from-down:not(.is-active),
  .hec-scroll-showcase__image.hec-img--in-from-top:not(.is-active),
  .hec-scroll-showcase__image.hec-img--in-from-down.is-active,
  .hec-scroll-showcase__image.hec-img--in-from-top.is-active {
    transform: none !important;
  }
}

.hec-scroll-showcase__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 1024px) {
  .hec-scroll-showcase {
    /* 覆盖 Elementor 写入的百分比双列，避免小屏出现两列百分比 */
    grid-template-columns: 1fr !important;
    gap: 22px;
  }

  .hec-scroll-showcase__right {
    order: -1;
  }

  .hec-scroll-showcase__sticky {
    position: relative;
    top: 0;
    height: min(62vh, 560px);
  }

  .hec-scroll-showcase__item {
    min-height: auto;
    padding: 10px 0 22px;
    opacity: 1;
  }
}
