/*!
 * zhc-carousel.css —— 装修「轮播图」四种效果款式
 * ZHC-CR4-20261201
 *
 * 款式（props.variant）：
 *   classic 经典整屏横滑（老版，缺省）
 *   peek    横滑卡片·露边   —— 轨道 translateX，卡片 296×150，两侧露边
 *   fade    沉浸大图·进度条 —— 绝对定位叠放，激活淡入回位，底部三段进度条
 *   stack   叠层景深        —— 三张居中叠放，侧卡缩小外偏半透明
 *   cube    立体 3D         —— perspective 900，侧卡 rotateY ±38deg
 * 指示器（props.indicator）：auto（跟随款式）/ dots / progress / none
 *
 * 基准宽 390px；宽度用百分比，卡片高度按规格固定 150px，图片 object-fit:cover 不变形。
 * 颜色只读品牌变量，缺省回落到锁定配色：青蓝 #14B8A6 / 亮青 #2DD4BF / 墨蓝 #0B2A4A。
 */

/* 区块容器：四款式自己带 16px 边距与圆角，外层不再套白卡 */
.dz-sec.dz-crsec {
  margin: var(--dz-gap) 0 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.dzc {
  --dzc-ink: #0B2A4A;
  --dzc-brand: var(--brand, #14B8A6);
  --dzc-brand-2: var(--brand-2, #2DD4BF);
  --dzc-ease: cubic-bezier(.22, .61, .36, 1);
  position: relative;
  width: calc(100% - 32px);
  max-width: 496px;
  margin: 0 auto;
  color: var(--dzc-ink);
}

.dzc__stage {
  position: relative;
  height: 196px;
  border-radius: 22px;
  overflow: hidden;
  /* contain:paint 是 3D 款式的关键：普通 overflow:hidden 裁不住带 rotateY 的子元素，
     3D 卡会溢出到屏幕两边；加这条才真正把侧卡裁在舞台里 */
  contain: paint;
  background: transparent;
}

.dzc__track { position: relative; }

/* 卡片公共 */
.dzc__card {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--dz-surface, #eef2f5);
  -webkit-tap-highlight-color: transparent;
}
.dzc__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border: 0;
}
.dzc__ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--dz-sub, #98a0ab);
  background: var(--dz-surface, #eef2f5);
}
.dzc__mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68%;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(11, 42, 74, 0) 0%,
    rgba(11, 42, 74, .34) 48%,
    rgba(11, 42, 74, .86) 100%);
}
.dzc__cap {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  pointer-events: none;
}
.dzc__ttl {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: .2px;
  text-shadow: 0 1px 3px rgba(11, 42, 74, .38);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dzc__sub {
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(255, 255, 255, .88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 指示器 ---------------- */
.dzc__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 10px;
}
.dzc__dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  /* 浅色主题=墨蓝 22%；深色主题由渲染器把 --dzc-dot-off 改成半透明白 */
  background: var(--dzc-dot-off, rgba(11, 42, 74, .22));
  cursor: pointer;
  transition: width .3s var(--dzc-ease), background-color .3s var(--dzc-ease);
}
.dzc__dot.is-on {
  width: 18px;
  background: var(--dzc-brand);
}

.dzc__bars {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  gap: 6px;
}
.dzc__bar {
  flex: 1 1 0;
  height: 3px;
  border-radius: 3px;
  background: var(--dzc-bar-track, rgba(11, 42, 74, .22));
  overflow: hidden;
}
.dzc__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: #fff;
}
.dzc__fill.is-run { animation: dzcBar linear forwards; }
@keyframes dzcBar {
  from { width: 0; }
  to { width: 100%; }
}

/* ---------------- 款式 1：横滑卡片 · 露边 ---------------- */
.dzc--peek .dzc__stage { overflow: hidden; }
.dzc--peek .dzc__track {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  transition: transform .5s var(--dzc-ease);
  will-change: transform;
}
.dzc--peek .dzc__card {
  flex: 0 0 auto;
  width: calc(100% - 62px);
  height: 150px;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(11, 42, 74, .12);
}

/* ---------------- 款式 2：沉浸大图 · 进度条 ---------------- */
.dzc--fade .dzc__stage { background: var(--dzc-ink); }
.dzc--fade .dzc__track { position: absolute; inset: 0; }
.dzc--fade .dzc__card {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity .6s var(--dzc-ease), transform .6s var(--dzc-ease);
}
.dzc--fade .dzc__card.is-on { opacity: 1; transform: scale(1); }
.dzc--fade .dzc__cap { bottom: 26px; }

/* ---------------- 款式 3：叠层景深 ---------------- */
.dzc--stack .dzc__track { position: absolute; inset: 0; }
.dzc--stack .dzc__cap,
.dzc--cube .dzc__cap { opacity: 0; transition: opacity .35s var(--dzc-ease); }
.dzc--stack .dzc__card.is-on .dzc__cap,
.dzc--cube .dzc__card.is-on .dzc__cap { opacity: 1; }
.dzc--stack .dzc__card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74%;
  height: 150px;
  border-radius: 20px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: transform .5s var(--dzc-ease), opacity .5s var(--dzc-ease);
  box-shadow: 0 10px 24px rgba(11, 42, 74, .16);
  will-change: transform, opacity;
}

/* ---------------- 款式 4：立体 3D ---------------- */
.dzc--cube .dzc__stage { perspective: 900px; }
.dzc--cube .dzc__track {
  position: absolute;
  inset: 0;
  /* 透视放在卡片父级：轨道若 preserve-3d，3D 子元素会逃出舞台裁剪，两侧卡会溢出到屏幕边 */
  perspective: 900px;
}
.dzc--cube .dzc__card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  height: 150px;
  border-radius: 20px;
  opacity: 0;
  transform: translate(-50%, -50%);
  /* 注意：卡片自身不要 preserve-3d —— 一旦是 3D 渲染上下文，
     祖先舞台的 overflow:hidden 就裁不住它，两侧卡会溢出到屏幕外 */
  backface-visibility: hidden;
  transition: transform .5s var(--dzc-ease), opacity .5s var(--dzc-ease);
  box-shadow: 0 12px 28px rgba(11, 42, 74, .18);
  will-change: transform, opacity;
}

/* ---------------- 经典（老版整屏横滑）在编辑器里的预览兜底 ---------------- */
.dzc--classic { width: 100%; max-width: none; margin: 0; }
.dzc--classic .dzc__stage { height: auto; border-radius: 12px; }
.dzc--classic .dzc__card {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
}

/* 首屏外的不需要动画，省电 */
@media (prefers-reduced-motion: reduce) {
  .dzc__track,
  .dzc__card,
  .dzc__dot { transition: none !important; }
  .dzc__fill.is-run { animation: none; width: 100%; }
}
