/* ============================================================
   XINDITAI — IMAGE CONTAINMENT FIX
   必须最后加载，最高优先级
   ============================================================ */

/* ---------- 1. 所有产品图容器：定位 + 裁切 ---------- */
.smp-art,
.srow-art,
.pm-card > figure,
.v12-reference > figure,
.ref-rows .v12-reference figure,
.x-sticky,
.studio-mosaic > div{
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* ---------- 2. 所有产品图：绝对定位 + contain ---------- */
.smp-art > img,
.srow-art > img,
.pm-card > figure > img,
.v12-reference > figure > img,
.ref-rows .v12-reference figure > img,
.x-sticky > img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  box-sizing: border-box !important;
  transform-origin: center center !important;
}

/* 内边距（用 padding 缩小内容区，object-fit 仍生效） */
.smp-art > img { padding: 10% !important; }
.srow-art > img { padding: 7% !important; }
.pm-card > figure > img { padding: 11% !important; }
.v12-reference > figure > img { padding: 9% !important; }
.ref-rows .v12-reference figure > img { padding: 8% !important; }
.x-sticky > img { padding: 5% !important; }

/* ---------- 3. 首屏马赛克图 ---------- */
.studio-mosaic img {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}
.studio-mosaic-main img { max-height: min(555px, 67vh) !important; }
.studio-mosaic-top img,
.studio-mosaic-bottom img { max-height: min(267px, 31vh) !important; padding: 8% !important; }

/* ---------- 4. 全幅缩放区：缩小、留白、不裁 ---------- */
.x-zoomwrap {
  height: 160vh !important;
  background: #141310 !important;
}
.x-zoomwrap .x-sticky {
  height: 100vh !important;
  padding: clamp(30px, 6vh, 80px) clamp(20px, 8vw, 160px) !important;
  display: grid !important;
  place-items: center !important;
}
.x-zoomwrap .x-sticky > img {
  position: relative !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  object-fit: contain !important;
}
.x-zoomwrap .x-cap {
  position: absolute !important;
  left: clamp(20px, 6vw, 90px) !important;
  bottom: clamp(30px, 7vh, 80px) !important;
  max-width: 46ch !important;
}
.x-zoomwrap .x-cap h3 {
  font-size: clamp(24px, 3.4vw, 46px) !important;
  line-height: 1.02 !important;
}

/* ---------- 5. 卡片高度统一（防止塌陷） ---------- */
.smp-art { aspect-ratio: 1 / 1 !important; }
.srow-art { aspect-ratio: 4 / 3 !important; }
.pm-card > figure { aspect-ratio: 1 / 1 !important; }
.v12-reference > figure { aspect-ratio: 1 / 1 !important; }

.ref-tiles .v12-reference > figure { aspect-ratio: 1 / 1 !important; }
.ref-duo .v12-reference > figure { aspect-ratio: 4 / 3 !important; }
.ref-stage .v12-reference > figure { aspect-ratio: 16 / 10 !important; }
.ref-wide .v12-reference > figure { aspect-ratio: 1 / 1 !important; }
.ref-wide-r .v12-reference > figure { aspect-ratio: 1 / 1 !important; }
.ref-rows .v12-reference figure { width: 92px !important; height: 92px !important; aspect-ratio: 1 / 1 !important; }

/* ---------- 6. 所有其他图片兜底：不超出容器 ---------- */
.studio-v18 main img {
  max-width: 100%;
}

/* ---------- 7. 移动端 ---------- */
@media (max-width: 640px) {
  .ref-rows .v12-reference figure { width: 64px !important; height: 64px !important; }
  .x-zoomwrap { height: 130vh !important; }
  .x-zoomwrap .x-sticky { padding: 40px 20px !important; }
  .x-zoomwrap .x-cap { left: 20px !important; bottom: 24px !important; }
  .x-zoomwrap .x-cap h3 { font-size: 26px !important; }
}


/* ---------- 8. 全幅缩放区定稿 ---------- */
.x-zoomwrap .x-sticky > img {
  max-height: 74vh !important;
  max-width: 86vw !important;
}
.x-zoomwrap .x-cap {
  z-index: 3 !important;
  padding: 14px 20px !important;
  background: rgba(20,19,16,.82) !important;
  backdrop-filter: blur(10px) !important;
  border-left: 2px solid var(--x-accent) !important;
}
.x-zoomwrap .x-cap h3 { font-size: clamp(20px, 2.6vw, 34px) !important; }
.x-zoomwrap .x-cap p { font-size: 12.5px !important; }

/* ---------- 9. 挂件首页卡：图不要太大 ---------- */
.smp-art > img { padding: 14% !important; }
.srow-art > img { padding: 10% !important; }
.pm-card > figure > img { padding: 13% !important; }
.v12-reference > figure > img { padding: 12% !important; }


/* ============================================================
   10. 工厂图网格：容器比例 = 图片比例，彻底消除裁切
   ============================================================ */
.factory-grid {
  display: grid !important;
  gap: clamp(8px, 1.2vw, 16px) !important;
}
.factory-grid figure {
  aspect-ratio: 3 / 2 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #eceae2 !important;
  border-radius: 2px !important;
  display: flex !important;
  flex-direction: column !important;
}
.factory-grid figure img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
.factory-grid figure figcaption {
  flex: 0 0 auto !important;
  padding: 10px 2px 0 !important;
  font-size: 12px !important;
}

/* 任何用 cover 且明显裁切的图，统一改 contain 兜底 */
.workshop-gallery img,
.factory-grid img { object-fit: cover !important; }

/* 移动端工厂图改单列 */
@media (max-width: 760px) {
  .factory-grid { grid-template-columns: 1fr !important; }
  .factory-grid figure { aspect-ratio: 4 / 3 !important; }
}


/* ============================================================
   11. 工厂图画廊：contain 模式，零裁切
   ============================================================ */
.factory-grid figure {
  aspect-ratio: 4 / 3 !important;
  background: #eae6dc !important;
  overflow: hidden !important;
  position: relative !important;
}
.factory-grid figure img {
  object-fit: contain !important;
  object-position: center center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 2% !important;
  background: transparent !important;
  transition: transform .85s cubic-bezier(.16,1,.3,1) !important;
}
.factory-grid figure:hover img { transform: scale(1.05) !important; }
.factory-grid figure figcaption {
  position: absolute !important;
  left: 0; right: 0; bottom: 0 !important;
  padding: 14px 12px 10px !important;
  font-size: 11.5px !important;
  letter-spacing: .04em !important;
  color: #f3f2ed !important;
  background: linear-gradient(0deg, rgba(20,19,16,.82), transparent) !important;
  z-index: 2 !important;
}

/* ============================================================
   12. 全站视觉细节增强（克制）
   ============================================================ */
/* 统一圆角 */
.pm-card, .v12-reference, .smp-card, .factory-grid figure {
  border-radius: 3px !important;
}
/* 卡片图片悬停微放大 */
.pm-card figure img, .v12-reference figure img, .smp-art img {
  transition: transform .8s cubic-bezier(.16,1,.3,1) !important;
}
.pm-card:hover figure img,
.v12-reference:hover figure img,
.smp-card:hover .smp-art img { transform: scale(1.05) !important; }
/* 卡片悬停抬升 */
.pm-card:hover, .v12-reference:hover, .smp-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 26px 44px -30px rgba(36,35,30,.45) !important;
}
/* 图片容器底色统一，避免白块突兀 */
.pm-card figure, .v12-reference figure, .smp-art {
  background: #f4f2ec !important;
}
