/* ==========================================================================
   jackane宇 · 双机构 3D 双面高透亚克力真砖渲染与舞台微距封砖仪式样式 (slab-renderer.css)
   还原 PSA 经典红白方框条码砖 & BGS 拉丝银/金/黑标四小分金属砖（正反全包 + 下沉卡槽 + 防伪背标）
   ========================================================================== */

.showcase-layer.has-slab {
  --card-w: min(322px, 72vw, calc((100vh - 296px) / 1.3967), calc((100svh - 296px) / 1.3967));
}

.card.slabbed {
  margin-top: calc(var(--card-h) / -2 + 30px);
}

/* ---------- 1. 3D 亚克力真砖总成（随卡牌 0°~180° 同步翻转，卡窗中心 100% 纯净无白雾） ---------- */
.slab-rig {
  position: absolute;
  inset: -84px -18px -18px -18px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.slab-rig.clamp-in {
  animation: slab-sonic-clamp 0.44s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes slab-sonic-clamp {
  0% { scale: 1.09 1.14; filter: brightness(1.65); }
  62% { scale: 0.992 0.992; filter: brightness(1.12); }
  100% { scale: 1 1; filter: brightness(1); }
}

/* 8mm 冰透亚克力砖体侧边厚度切片（中心完全镂空） */
.slab-depth-slice {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 9px solid rgba(196, 228, 252, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.slab-depth-slice.d1 { transform: translateZ(-0.8px); }
.slab-depth-slice.d2 { transform: translateZ(-2.8px); }

/* 正面与背面全包亚克力半壳（精准夹持 .card-face 与 .card-back） */
.slab-face-front,
.slab-face-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.slab-face-front { transform: translateZ(2.8px); }
.slab-face-back { transform: rotateY(180deg) translateZ(6.8px); }

/* 外圈高透亚克力倒角边框 + 超声波磨砂压合焊线（中间 100% 透明不糊卡面） */
.slab-bezel-frame {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 9px solid rgba(224, 238, 252, 0.24);
  outline: 1.5px solid rgba(255, 255, 255, 0.56);
  outline-offset: -1.5px;
  box-shadow:
    0 32px 68px rgba(0, 0, 0, 0.78),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.44),
    inset 0 2px 8px rgba(4, 9, 20, 0.55);
}

.slab-rig.slab-bgs-bl10 .slab-bezel-frame {
  border-color: rgba(250, 204, 21, 0.24);
  outline-color: rgba(250, 204, 21, 0.78);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.88),
    0 0 28px rgba(250, 204, 21, 0.26),
    inset 0 0 0 1.5px rgba(250, 204, 21, 0.45);
}

/* 顶部铭牌舱与超声波横梁隔断 */
.slab-header-deck {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  height: 62px;
  padding: 4px 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(203, 225, 245, 0.08));
  border-bottom: 2px solid rgba(255, 255, 255, 0.36);
  overflow: hidden;
}

/* 下沉式透明内胆卡槽 + 四角防撞定位卡扣 */
.slab-well-rim {
  position: absolute;
  top: 79px;
  left: 13px;
  right: 13px;
  bottom: 13px;
  border-radius: calc(var(--card-w) * 0.052);
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 0 0 4px rgba(215, 232, 248, 0.08),
    inset 0 0 0 2px rgba(6, 10, 20, 0.45);
}

.slab-tab {
  position: absolute;
  width: 12px;
  height: 4px;
  background: rgba(255, 255, 255, 0.52);
  border-radius: 2px;
}
.slab-tab.tl { top: -3px; left: 16px; }
.slab-tab.tr { top: -3px; right: 16px; }
.slab-tab.bl { bottom: -3px; left: 16px; }
.slab-tab.br { bottom: -3px; right: 16px; }

/* 外层亚克力玻璃斜向镜面反光（平视 --tilt:0 时完全透明，倾斜时扫过整块砖面） */
.slab-glass-glare {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  opacity: calc(var(--tilt, 0) * 0.65);
  background: linear-gradient(
    116deg,
    transparent calc((var(--hx, 0.5) * 60%) - 14%),
    rgba(255, 255, 255, 0.32) calc(var(--hx, 0.5) * 60%),
    rgba(255, 255, 255, 0.08) calc((var(--hx, 0.5) * 60%) + 5%),
    transparent calc((var(--hx, 0.5) * 60%) + 16%)
  );
  pointer-events: none;
}

/* ---------- 2. PSA 经典红白方框条码铭牌（直角硬朗框，绝不印二手价格） ---------- */
.slab-flip-psa {
  width: 100%;
  height: 100%;
  padding: 4px 8px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, rgba(214, 31, 38, 0.03) 0 1px, transparent 1px 3px),
    #fbfcfe;
  border: 2.5px solid #d61f26;
  color: #0f172a;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.psa-info-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.psa-set-line { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.03em; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psa-card-line { font-size: 10.5px; font-weight: 900; color: #090d16; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psa-barcode-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.psa-barcode {
  width: 68px;
  height: 10px;
  background: repeating-linear-gradient(90deg, #090d16 0 1.5px, transparent 1.5px 3px, #090d16 3px 5.5px, transparent 5.5px 7px, #090d16 7px 8px, transparent 8px 10px);
}
.psa-cert-no { font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; color: #1e293b; }

.psa-holo-pill {
  padding: 2px 5px;
  border-radius: 2px;
  background: linear-gradient(135deg, #cbd5e1, #ffffff 42%, #94a3b8 68%, #f1f5f9);
  border: 1px solid #94a3b8;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 900;
  color: #1e293b;
  letter-spacing: 0.06em;
}

.psa-grade-col { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.psa-grade-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 900; color: #0f172a; }
.psa-grade-num { font-family: var(--font-mono); font-size: 19px; font-weight: 900; color: #090d16; }

/* ---------- 3. BGS 拉丝金属铭牌（银标 9 / 金标 9.5&10 / 黑标 Black Label 10 + 2×2 四小分） ---------- */
.slab-flip-bgs {
  width: 100%;
  height: 100%;
  padding: 4px 8px;
  border-radius: 3px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 7px;
  background: linear-gradient(108deg, #d4af37 0%, #fef08a 30%, #ca8a04 56%, #fef9c3 80%, #b4831e 100%);
  border: 1.5px solid #fef08a;
  color: #111827;
}

.slab-bgs-silver9 .slab-flip-bgs {
  background: linear-gradient(108deg, #94a3b8 0%, #f8fafc 34%, #cbd5e1 62%, #f1f5f9 84%, #94a3b8 100%);
  border-color: #e2e8f0;
}

.slab-bgs-bl10 .slab-flip-bgs {
  background: linear-gradient(112deg, #06070a 0%, #1b1915 46%, #07080c 100%);
  border: 1.5px solid #facc15;
  color: #fde047;
}

.bgs-info-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bgs-brand-line { font-family: var(--font-mono); font-size: 8px; font-weight: 900; letter-spacing: 0.06em; opacity: 0.88; }
.bgs-card-line { font-size: 10px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgs-cert-line { font-family: var(--font-mono); font-size: 8px; font-weight: 700; opacity: 0.82; }

.bgs-sub-matrix {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 1px 7px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-left: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.bgs-score-box {
  min-width: 36px;
  height: 40px;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bgs-score-kicker { font-size: 6.5px; font-weight: 900; letter-spacing: 0.04em; }
.bgs-score-num { font-family: var(--font-mono); font-size: 17px; font-weight: 900; margin-top: 2px; }

/* ---------- 4. 背面顶部回折防伪铭牌（激光防伪盾 + 校验二维码矩阵） ---------- */
.slab-back-flip {
  width: 100%;
  height: 100%;
  padding: 5px 9px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.slab-back-flip.is-psa { background: #f8fafc; border: 2px solid #d61f26; color: #0f172a; }
.slab-back-flip.is-bgs { background: linear-gradient(108deg, #1e293b, #0f172a); border: 1.5px solid #cbd5e1; color: #f8fafc; }
.slab-bgs-bl10 .slab-back-flip.is-bgs { background: #07080c; border-color: #facc15; color: #fde047; }

.slab-back-copy { display: flex; flex-direction: column; gap: 2px; font-size: 8px; line-height: 1.25; }
.slab-back-copy strong { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; }

.slab-qr-box {
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background:
    conic-gradient(#0f172a 25%, #ffffff 0 50%, #0f172a 0 75%, #ffffff 0) 0 0 / 8px 8px,
    #ffffff;
  border: 2px solid #0f172a;
  flex-shrink: 0;
}

/* ---------- 5. 盲盒搓分防伪遮挡银条 & 舞台微距十字标尺 HUD ---------- */
.slab-grade-mask {
  position: absolute;
  top: 4px;
  right: 5px;
  bottom: 4px;
  width: 58%;
  z-index: 6;
  pointer-events: auto;
  cursor: ew-resize;
  border-radius: 3px;
  background: linear-gradient(115deg, #cbd5e1 0%, #f8fafc 28%, #94a3b8 54%, #ffffff 76%, #cbd5e1 100%);
  border: 1.5px solid #ffffff;
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.38);
  color: #0f172a;
  font-size: 10.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
  user-select: none;
  touch-action: none;
  transition: transform 0.28s ease-out, opacity 0.25s ease-out;
}

.stage-caliper-hud {
  position: absolute; inset: -10px; transform: translateZ(5px); pointer-events: none;
  border: 1px dashed rgba(56, 189, 248, 0.65); border-radius: 14px;
}
.caliper-corner { position: absolute; width: 22px; height: 22px; border-color: #38bdf8; border-style: solid; opacity: 0.35; transition: opacity 0.18s, border-color 0.18s; }
.caliper-corner.active { opacity: 1; border-color: #fde047; filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.8)); }
.caliper-corner.tl { top: 4px; left: 4px; border-width: 2.5px 0 0 2.5px; }
.caliper-corner.tr { top: 4px; right: 4px; border-width: 2.5px 2.5px 0 0; }
.caliper-corner.bl { bottom: 4px; left: 4px; border-width: 0 0 2.5px 2.5px; }
.caliper-corner.br { bottom: 4px; right: 4px; border-width: 0 2.5px 2.5px 0; }

.caliper-beam {
  position: absolute; left: 0; right: 0; top: 8%; height: 2.5px;
  background: linear-gradient(90deg, transparent, #38bdf8, #ffffff, #38bdf8, transparent);
  box-shadow: 0 0 14px 2px rgba(56, 189, 248, 0.88);
  animation: caliper-scan 1.15s ease-in-out infinite;
}
@keyframes caliper-scan { 0%, 100% { top: 6%; } 50% { top: 93%; } }

.caliper-readout-bar { position: absolute; left: 50%; top: -38px; translate: -50% 0; display: flex; gap: 6px; white-space: nowrap; }
.caliper-chip {
  padding: 3px 8px; border-radius: 6px; background: rgba(8, 13, 25, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.55); color: #e0f2fe; font-family: var(--font-mono); font-size: 10.5px; font-weight: 800;
}
.caliper-chip.ten { border-color: #facc15; color: #fde047; }
