/* 商品三视图（原名「商品白底图」）· 单商品位 + 三组胶囊（角度 / 投影 / 尺寸）
 * ============================================================================
 * 只做本功能需要的两块：一个大上传位（方图预览更接近电商主图）、三组胶囊。
 * 其余（banner / 卡片 / 补充要求 / 效果示例 / 结果区 / toast）复用 xt-* 与 ix-*。
 * ⚠️ 按项目规约：所有选择器带 #sub-whitebg 作用域，不碰 style.css。
 * ⚠️ 类名统一 wb- 前缀，与 of-/pu-/fm-/ms- 不重名。
 * ========================================================================== */

/* ── 商品上传位 ─────────────────────────────────────────────── */
#sub-whitebg .wb-drop {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 320px;
  border: 1.5px dashed #f0c9a8;
  border-radius: 16px;
  background: #fffaf6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

#sub-whitebg .wb-drop:active { background: #fff2e8; }
#sub-whitebg .wb-drop.drag { border-color: var(--primary); background: #fff2e8; }
#sub-whitebg .wb-drop.has-img { border-style: solid; border-color: #ffdcbf; background: #fff; }
#sub-whitebg .wb-drop.has-img .wb-hint { display: none; }
#sub-whitebg .wb-drop.has-img .wb-prev { display: block; }
#sub-whitebg .wb-drop.has-img .wb-del { display: block; }

#sub-whitebg .wb-hint { text-align: center; padding: 0 10px; pointer-events: none; }

#sub-whitebg .wb-plus {
  font-size: 24px;
  line-height: 1;
  color: #d8a67a;
  font-weight: 300;
}

#sub-whitebg .wb-hint-t {
  margin-top: 8px;
  font-size: 12.5px;
  color: #9a7b62;
  line-height: 1.5;
}

#sub-whitebg .wb-prev {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #faf7f4;
}

#sub-whitebg .wb-del {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 15px;
  line-height: 24px;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}

#sub-whitebg .wb-ok { color: #12a05c; font-weight: 700; margin-left: 4px; }

#sub-whitebg .wb-cap {
  margin-top: 6px;
  font-size: 11.5px;
  color: #9a7b62;
  text-align: center;
  line-height: 1.4;
}

/* ── 胶囊：角度 / 投影 / 尺寸 ───────────────────────────────── */
#sub-whitebg .wb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

#sub-whitebg .wb-chip {
  border: 1px solid #f0d8c4;
  background: #fff;
  color: #8a6a52;
  border-radius: 10px;
  padding: 9px 0;
  font-size: 12.5px;
  line-height: 1.1;
  cursor: pointer;
  flex: 1 1 calc(50% - 8px);
  text-align: center;
  transition: all .15s;
}

#sub-whitebg .wb-chips.wb-3 .wb-chip { flex: 1 1 calc(33.33% - 8px); }
#sub-whitebg .wb-chips.wb-4 .wb-chip { flex: 1 1 calc(25% - 8px); }

#sub-whitebg .wb-chip.active {
  border-color: var(--primary);
  background: #fff2e8;
  color: var(--primary);
  font-weight: 600;
}

#sub-whitebg .wb-chip small {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 400;
  color: #b09a86;
}

#sub-whitebg .wb-chip.active small { color: #d98a55; }

#sub-whitebg .wb-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #9a8b80;
}

/* ── 上传建议 ───────────────────────────────────────────────── */
#sub-whitebg .wb-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

#sub-whitebg .wb-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid rgba(79, 70, 229, 0.10);
  font-size: 13px;
  line-height: 1.55;
}

#sub-whitebg .wb-tip b {
  flex: 0 0 auto;
  min-width: 62px;
  color: #4f46e5;
  font-weight: 600;
}

#sub-whitebg .wb-tip span { color: #4b5563; flex: 1 1 auto; }

/* ── 白底图结果：给一圈极淡描边，避免和卡片背景糊在一起 ─────── */
#sub-whitebg .wb-stage {
  background: #f3f1ee;
  border-radius: 12px;
  padding: 8px;
}

#sub-whitebg .wb-stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05);
}

@media (max-width: 360px) {
  #sub-whitebg .wb-chips.wb-4 .wb-chip { flex: 1 1 calc(50% - 8px); }
}

/* 三视图期间尺寸档被锁（点了会提示），视觉上淡出，避免用户以为坏了 */
#sub-whitebg .wb-chips.wb-locked {
  opacity: .45;
}

/* 案例图统一用横版；小屏按卡片宽度自适应缩小，再用最大高度兜底，避免在平板上拉得过高 */
@media (max-width: 640px) {
  #sub-whitebg .xt-sample-img {
    width: auto;
    max-width: 100%;
    max-height: 190px;
    margin-left: auto;
    margin-right: auto;
  }
}
