.scene-showcase__header {
  margin-bottom: 20px;
}

.scene-showcase__heading {
  margin: 0;
}

/* 自定义元素默认 display:inline,需设为 block 才能形成 100% 宽容器
   (否则导航的 overflow-x 横滑失效) */
.scene-showcase__inner {
  display: block;
  width: 100%;
  min-width: 0;
}

/* 场景导航:pill 风格,横向可滚动,内容不满时居中 */
.scene-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: safe center;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.scene-tabs::-webkit-scrollbar {
  display: none;
}

.scene-tabs__tab {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(var(--color-text), 0.14);
  background-color: transparent;
  color: rgba(var(--color-text), 0.7);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.scene-tabs__tab:hover {
  border-color: rgba(var(--color-text), 0.4);
}

.scene-tabs__tab.is-active {
  background-color: rgb(var(--color-text));
  border-color: rgb(var(--color-text));
  color: rgb(var(--color-page-background));
}

/* 场景舞台:各项层叠,激活项淡入,其余绝对定位叠放淡出;舞台高度跟随激活项 */
.scene-stage {
  position: relative;
}

.scene-stage__item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.scene-stage__item.is-active {
  position: relative;
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 场景面板布局:层叠切换由 .scene-stage__item 提供,此处仅定义封面+商品的横向布局 */
.scene-showcase__panel {
  display: flex;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

/* 图片占满模式:面板不再左右分栏,整图独占一行 */
.scene-showcase__panel--image-only {
  display: block;
}

/* 图片占满:整块按固定比例裁剪(object-fit: cover),各场景高度统一、切换不跳变
   PC 1920×700,移动端 1500×700(下方断点覆盖) */
.scene-showcase__figure {
  width: 100%;
  aspect-ratio: 1920 / 700;
  border-radius: 16px;
  overflow: hidden;
  background-color: rgb(var(--color-image-background));
}

.scene-showcase__figure-link {
  display: block;
  height: 100%;
  cursor: pointer;
}

.scene-showcase__figure-img,
.scene-showcase__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 未传图时的占位:填满按比例裁剪的容器 */
.scene-showcase__figure-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: rgba(var(--color-text), 0.06);
}

/* 左图 */
.scene-showcase__cover {
  position: relative;
  flex: 0 0 50%;
  max-width: 50%;
  border-radius: 12px;
  overflow: hidden;
  min-height: 100%;
  background-color: rgb(var(--color-image-background));
}

/* 封面链接:铺满整块封面,承载点击跳转 */
.scene-showcase__cover-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  cursor: pointer;
}

.scene-showcase__cover-img,
.scene-showcase__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 底部 View all(商品下方黑色圆角按钮):默认隐藏,由下方断点/模式规则开启 */
.scene-showcase__view-all-bottom {
  display: none;
}

/* PC 端:仅"商品占满(无封面)"模式在底部显示 View all(分栏模式左图本身可点击,无需按钮) */
@media screen and (min-width: 960px) {
  .scene-showcase__panel--no-cover .scene-showcase__view-all-bottom {
    display: block;
    margin-top: 24px;
    text-align: center;
  }
}

/* 右侧商品:内容整体垂直居中于左图旁 */
.scene-showcase__products {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 轮播区:左右预留安全距离容纳两侧箭头,同时收窄商品降低整体高度 */
.scene-showcase__carousel {
  position: relative;
  padding: 0 60px;
}

.scene-showcase__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(var(--color-text), 0.16);
  background-color: rgb(var(--color-page-background));
  color: rgb(var(--color-text));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--color-text), 0.12);
  transition: background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.scene-showcase__arrow--prev {
  left: 0;
}

.scene-showcase__arrow--next {
  right: 0;
}

.scene-showcase__arrow:hover {
  background-color: rgba(var(--color-text), 0.06);
}

.scene-showcase__arrow[disabled] {
  opacity: 0.35;
  cursor: default;
}

.scene-showcase__arrow .icon {
  width: 16px;
  height: 16px;
}

.scene-showcase__arrow[data-scene-prev] .icon {
  transform: rotate(90deg);
}

.scene-showcase__arrow[data-scene-next] .icon {
  transform: rotate(-90deg);
}

/* 裁剪视口:仅横向裁掉相邻页;上下用 padding 留白 + 等量负 margin 抵消,
   使卡片 hover 阴影不被裁切,又不影响外部布局 */
.scene-showcase__viewport {
  overflow: hidden;
  padding: 20px 0;
  margin: -24px 0;
  /* 横向手势不向外层/页面传递,避免整页被带着横滑 */
  overscroll-behavior-x: contain;
}

/* JS 就绪前:普通 2 列网格铺开(避免切成 flex 轨道前所有卡片挤成单行溢出) */
.scene-showcase__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0px;
  row-gap: 0px;
}

/* JS 就绪后:切成一条横向轨道,各"页"并排;翻页只平移 transform(GPU 合成,零重排零白闪) */
.scene-showcase__grid.is-carousel {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: none;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  /* 竖向滚动交给浏览器,横向手势由 JS 处理,避免 iOS 手势判定迟滞 */
  touch-action: pan-y;
}

/* 单页:占满视口宽,内部再是 2×2 网格;minmax(0,1fr) 钳住列宽防溢出 */
.scene-showcase__page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0px;
  row-gap: 0px;
}

/* 无封面:商品占满整行,PC 排成 4 列(一页 8 个 = 4×2) */
@media screen and (min-width: 960px) {
  .scene-showcase__panel--no-cover .scene-showcase__grid,
  .scene-showcase__panel--no-cover .scene-showcase__page {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.scene-showcase__grid-item {
  min-width: 0;
}

/* 仅隐藏本区块内第三方评价插件的商品评分(插件用内联 display:flex,需 !important) */
.scene-showcase .product-plugin-comment-rate-star {
  display: none !important;
}

/* 卡片基础:内边距 + 圆角(供 hover 变化) */
.scene-showcase__grid-item .card {
  padding: 12px;
  border-radius: 12px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.scene-showcase__grid-item .card__inner {
  overflow: hidden;
}

.scene-showcase__grid-item .card__media img {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* hover 效果仅在有鼠标(桌面)时生效:整卡白底+阴影、主图放大;
   移动端触摸不触发,避免卡片"卡"在悬停态 */
@media (hover: hover) {
  .scene-showcase__grid-item .card:hover {
    background-color: rgb(var(--color-page-background));
    box-shadow: 0 8px 24px rgba(var(--color-text), 0.12);
  }

  .scene-showcase__grid-item .card:hover .card__media img {
    transform: translateY(-50%) scale(1.06);
  }
}

.scene-showcase__empty {
  color: rgba(var(--color-text), 0.6);
  padding: 24px 0;
}

/* 分页小圆点 */
.scene-showcase__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}

.scene-showcase__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: rgba(var(--color-text), 0.22);
  cursor: pointer;
  transition: background-color 0.2s ease, width 0.2s ease;
}

.scene-showcase__dot.is-active {
  width: 18px;
  border-radius: 4px;
  background-color: rgb(var(--color-text));
}

/* 移动端:图片在上,商品在下 */
@media screen and (max-width: 959px) {
  /* 所有面板(含层叠隐藏的)都竖排:未激活面板仍是 flex,若保持横排会溢出产生横向滚动条 */
  /* gap 同时是移动端「封面↔商品」的上下间距,调小一些 */
  .scene-showcase__panel {
    flex-direction: column;
    gap: 5px;
  }

  .scene-showcase__cover {
    flex: none;
    max-width: 100%;
    width: 100%;
    aspect-ratio: 1500 / 700;
    min-height: 0;
  }

  .scene-showcase__figure {
    border-radius: 14px;
    aspect-ratio: 1500 / 700;
  }

  /* 移动端:隐藏两侧箭头,翻页由滑动 + 圆点触发(保持原 2×2) */
  .scene-showcase__carousel {
    padding: 0;
  }

  .scene-showcase__arrow {
    display: none !important;
  }

  .scene-showcase__page {
    /* 列间距保持,行间距(第一行↔第二行)调小 */
    column-gap: 0px;
    row-gap: 0px;
  }

  /* 移动端 View all:商品下方,黑色圆角居中(沿用主题 .button);仅无封面模式会渲染该按钮 */
  .scene-showcase__view-all-bottom {
    display: block;
    margin-top: 16px;
    text-align: center;
  }

  /* 移动端 2 列较窄:压紧卡片文字,避免价格折行显得乱 */
  .scene-showcase__grid-item .card {
    padding: 8px;
  }

  .scene-showcase__grid-item .product__title {
    font-size: 13px;
    line-height: 1.3;
  }

  /* 起订量与价格同一行,均不折行 */
  .scene-showcase__grid-item .price__container {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    column-gap: 4px;
    white-space: nowrap;
  }

  /* 起订量前缀(N starting at)保持小号 */
  .scene-showcase__grid-item .price .body4 {
    font-size: 11px;
    white-space: nowrap;
  }

  /* 价格数值:加粗放大 */
  .scene-showcase__grid-item .price__regular .price-item--regular,
  .scene-showcase__grid-item .price__sale .price-item--sale {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
  }

  /* 划线原价保持小号 */
  .scene-showcase__grid-item .price__sale .price-item--regular {
    font-size: 12px;
    white-space: nowrap;
  }
}

/* 尊重系统"减少动态效果"偏好:关闭场景切换与翻页动画 */
@media (prefers-reduced-motion: reduce) {
  .scene-stage__item {
    transition: none;
  }

  .scene-showcase__grid.is-carousel {
    transition: none;
  }

  .scene-showcase__grid-item .card,
  .scene-showcase__grid-item .card__media img {
    transition: none;
  }
}
