/* ==========================================================================
   XinHammer Pro · Dual-Sided 3D Holographic Anti-Counterfeiting Metal Pass
   Preserves Craft 1 4-Finish Brushed Anodized Metal (Chipless) +
   Angle-Gated Dual-Channel Kinegram Optical Vortex Seal & Banknote Guilloché
   ========================================================================== */

.xh-holo-scene {
  perspective: 1280px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.xh-lux-card.xh-holo-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 32%;
  --holo-alpha: 0.09;
  --holo-guilloche-alpha: 0.06;
  --holo-tx: 0px;
  --holo-ty: 0px;
  --holo-tx-inv: 0px;
  --holo-ty-inv: 0px;
  --holo-rot: 24deg;
  --sheen-pos: 42%;
  position: relative;
  overflow: visible;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 15.2rem;
  aspect-ratio: 1.586 / 1;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: grab;
  touch-action: pan-y;
  will-change: transform;
}

.xh-lux-card.xh-holo-card.is-pointer-tilting {
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.xh-lux-card.xh-holo-card.is-dragging {
  transition: none !important;
  cursor: grabbing;
  touch-action: none;
}

/* Extruded CNC Machined Metal Slab Edge & Ambient Drop Shadow */
.xh-card-slab-edge {
  position: absolute;
  inset: 0;
  border-radius: 1.35rem;
  transform: translateZ(0px);
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(15, 23, 42, 0.85));
  box-shadow:
    0 30px 64px -18px rgba(4, 8, 18, 0.58),
    0 12px 26px -12px rgba(4, 8, 18, 0.42);
}
.xh-holo-card[data-finish="lifetime"] .xh-card-slab-edge {
  background: linear-gradient(145deg, #d8b778 0%, #463925 48%, #151310 100%);
}
.xh-holo-card[data-finish="monthly"] .xh-card-slab-edge,
.xh-holo-card[data-finish="yearly"] .xh-card-slab-edge {
  background: linear-gradient(145deg, #93c5fd 0%, #1d4ed8 50%, #0b1736 100%);
}
.xh-holo-card[data-finish="single"] .xh-card-slab-edge,
.xh-holo-card[data-finish="scene"] .xh-card-slab-edge {
  background: linear-gradient(145deg, #7dd3fc 0%, #0369a1 50%, #081c34 100%);
}
.xh-holo-card[data-finish="free"] .xh-card-slab-edge {
  background: linear-gradient(145deg, #e2e8f0 0%, #64748b 50%, #1e293b 100%);
}

/* Front & Back Faces */
.xh-card-face {
  position: absolute;
  inset: 0;
  border-radius: 1.35rem;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.12rem, 2.3vw, 1.5rem) clamp(1.18rem, 2.5vw, 1.62rem);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.xh-card-front {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transform: translateZ(1.8px);
  gap: 0.85rem;
}

.xh-card-back {
  transform: rotateY(180deg) translateZ(1.8px);
  gap: 0.65rem;
}

.xh-holo-card[data-flipped="true"] .xh-card-front {
  pointer-events: none;
}
.xh-holo-card:not([data-flipped="true"]) .xh-card-back {
  pointer-events: none;
}

/* Preserve 4 Anodized Brushed Metal Finishes on Both Front & Back */
.xh-holo-card[data-finish="free"] .xh-card-face {
  background:
    repeating-linear-gradient(108deg, rgba(255, 255, 255, 0.018) 0px, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at 22% 15%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(132deg, #323a48 0%, #525e72 46%, #242b37 100%);
  border-color: rgba(226, 232, 240, 0.42);
}

.xh-holo-card[data-finish="single"] .xh-card-face,
.xh-holo-card[data-finish="scene"] .xh-card-face {
  background:
    repeating-linear-gradient(108deg, rgba(255, 255, 255, 0.016) 0px, rgba(255, 255, 255, 0.016) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at 22% 15%, rgba(186, 230, 253, 0.24), transparent 55%),
    linear-gradient(132deg, #0d1f3f 0%, #1a3f86 48%, #09152c 100%);
  border-color: rgba(147, 197, 253, 0.46);
}

.xh-holo-card[data-finish="monthly"] .xh-card-face,
.xh-holo-card[data-finish="yearly"] .xh-card-face {
  background:
    repeating-linear-gradient(108deg, rgba(255, 255, 255, 0.018) 0px, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at 24% 16%, rgba(219, 234, 254, 0.26), transparent 56%),
    linear-gradient(130deg, #101f46 0%, #1c3ca4 38%, #2e6fe2 54%, #142963 84%, #0a1430 100%);
  border-color: rgba(191, 219, 254, 0.56);
}

.xh-holo-card[data-finish="lifetime"] .xh-card-face {
  background:
    repeating-linear-gradient(108deg, rgba(243, 229, 200, 0.014) 0px, rgba(243, 229, 200, 0.014) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at 78% 18%, rgba(229, 198, 142, 0.16), transparent 52%),
    linear-gradient(135deg, #0b0d12 0%, #181a22 44%, #24201a 72%, #090a0e 100%);
  border-color: rgba(212, 175, 114, 0.52);
}

/* Broad Anisotropic Brushed Metal Specular Sheen */
.xh-card-face .xh-lux-sheen {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    112deg,
    transparent calc(var(--sheen-pos) - 24%),
    rgba(255, 255, 255, 0.04) calc(var(--sheen-pos) - 10%),
    rgba(255, 255, 255, 0.16) var(--sheen-pos),
    rgba(255, 255, 255, 0.04) calc(var(--sheen-pos) + 10%),
    transparent calc(var(--sheen-pos) + 24%)
  );
  pointer-events: none;
  z-index: 0;
}

.xh-card-face .xh-lux-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 280px at var(--mx) var(--my), rgba(255, 255, 255, 0.24), transparent 68%);
  pointer-events: none;
  mix-blend-mode: soft-light;
  z-index: 0;
}

/* Banknote Guilloché Rainbow Diffraction Field */
.xh-holo-guilloche-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.xh-holo-guilloche-field svg {
  display: block;
  width: 100%;
  height: 100%;
}
.xh-holo-foil-a {
  transform: translate3d(var(--holo-tx), var(--holo-ty), 0) rotate(var(--holo-rot));
  transform-origin: 360px 164px;
  opacity: var(--holo-guilloche-alpha);
  transition: opacity 0.22s ease;
}
.xh-holo-foil-b {
  transform: translate3d(var(--holo-tx-inv), var(--holo-ty-inv), 0) rotate(calc(var(--holo-rot) * -0.85));
  transform-origin: 360px 164px;
  opacity: var(--holo-guilloche-alpha);
  transition: opacity 0.22s ease;
}

/* Hide legacy static watermark when upgraded */
.xh-holo-card .xh-lux-guilloche {
  display: none !important;
}

/* Right-Side Optical Vortex Anti-Counterfeiting Hologram Seal */
.xh-mid-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.xh-holo-seal-wrap {
  position: relative;
  width: 4.35rem;
  height: 4.35rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.1), rgba(4, 8, 18, 0.46));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 6px 16px -6px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.xh-holo-card[data-finish="lifetime"] .xh-holo-seal-wrap {
  box-shadow:
    inset 0 0 0 1px rgba(229, 198, 142, 0.36),
    0 6px 18px -6px rgba(0, 0, 0, 0.55);
}

.xh-holo-seal-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.xh-seal-foil-a {
  transform: translate3d(var(--holo-tx), var(--holo-ty), 0) rotate(var(--holo-rot));
  transform-origin: 60px 60px;
  opacity: var(--holo-alpha);
  transition: opacity 0.2s ease;
}
.xh-seal-foil-b {
  transform: translate3d(var(--holo-tx-inv), var(--holo-ty-inv), 0) rotate(calc(var(--holo-rot) * -1));
  transform-origin: 60px 60px;
  opacity: var(--holo-alpha);
  transition: opacity 0.2s ease;
}

/* Specular Rainbow Glint Overlay across Seal */
.xh-holo-seal-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from var(--holo-rot) at 50% 50%,
    rgba(255, 95, 126, 0.34),
    rgba(255, 190, 77, 0.32),
    rgba(196, 255, 92, 0.3),
    rgba(56, 242, 199, 0.36),
    rgba(77, 166, 255, 0.36),
    rgba(182, 108, 255, 0.34),
    rgba(255, 95, 126, 0.34)
  );
  mix-blend-mode: color-dodge;
  opacity: calc(var(--holo-alpha) * 0.42);
  pointer-events: none;
}

/* Front Footer Security Tag */
.xh-holo-card .xh-lux-top,
.xh-holo-card .xh-lux-mid,
.xh-holo-card .xh-lux-foot {
  z-index: 2;
}

/* ==================== BACK FACE (防伪核验与持卡人权益背面) ==================== */
.xh-back-strip {
  position: relative;
  z-index: 2;
  margin-inline: calc(clamp(1.18rem, 2.5vw, 1.62rem) * -1);
  margin-top: -0.15rem;
  padding: 0.42rem clamp(1.18rem, 2.5vw, 1.62rem);
  background: linear-gradient(90deg, rgba(4, 7, 15, 0.78), rgba(15, 23, 42, 0.62) 55%, rgba(4, 7, 15, 0.78));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: rgba(248, 250, 252, 0.76);
}
.xh-back-strip strong {
  color: #f8fafc;
  font-weight: 700;
}
.xh-holo-card[data-finish="lifetime"] .xh-back-strip strong {
  color: #f3e5c8;
}

.xh-back-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.xh-back-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.28rem;
}
.xh-back-perks li {
  display: flex;
  align-items: baseline;
  gap: 0.44rem;
  font-size: 0.73rem;
  line-height: 1.38;
  color: rgba(248, 250, 252, 0.88);
}
.xh-back-perks li i {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.54);
  flex-shrink: 0;
}
.xh-holo-card[data-finish="lifetime"] .xh-back-perks li i {
  color: rgba(229, 198, 142, 0.82);
}

.xh-back-seal-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24rem;
}
.xh-back-seal-col .xh-holo-seal-wrap {
  width: 3.45rem;
  height: 3.45rem;
}
.xh-back-seal-caption {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
}

.xh-back-foot {
  position: relative;
  z-index: 2;
  padding-top: 0.48rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.68rem;
  color: rgba(248, 250, 252, 0.74);
}
.xh-back-foot code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.67rem;
  color: rgba(248, 250, 252, 0.9);
  background: none;
  padding: 0;
}

/* Action pills for flipping & opening standalone card showcase */
.xh-holo-toolbar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.xh-holo-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
  font-size: 0.76rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.xh-holo-pill-btn:hover {
  border-color: #2350dc;
  color: #1d4ed8;
  background: #ffffff;
}
.xh-holo-pill-btn svg {
  flex-shrink: 0;
}

/* Compact adjustments for narrow mobile & celebration modal */
.celebrate-lux-card.xh-holo-card {
  min-height: 12.8rem;
}
.celebrate-lux-card.xh-holo-card .xh-card-face {
  padding: 0.95rem 1.08rem;
}
.celebrate-lux-card.xh-holo-card .xh-holo-seal-wrap {
  width: 3.55rem;
  height: 3.55rem;
}
.celebrate-lux-card.xh-holo-card .xh-back-perks li {
  font-size: 0.68rem;
}

@media (max-width: 480px) {
  .xh-lux-card.xh-holo-card {
    aspect-ratio: auto;
    min-height: 13.8rem;
  }
  .xh-lux-card.xh-holo-card .xh-lux-top {
    gap: 0.45rem;
  }
  .xh-lux-card.xh-holo-card .xh-lux-serial {
    font-size: 0.62rem;
    letter-spacing: 0.025em;
    padding: 0.16rem 0.46rem;
    flex-shrink: 0;
  }
  .xh-lux-card.xh-holo-card .xh-lux-mid {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .xh-holo-seal-wrap {
    width: 3.45rem;
    height: 3.45rem;
  }
  .xh-mid-right-cluster {
    gap: 0.5rem;
  }
  .xh-lux-card.xh-holo-card .xh-lux-title-block h2 {
    font-size: 1.08rem;
  }
  .xh-lux-card.xh-holo-card .xh-lux-quota strong {
    font-size: 1.22rem;
  }
  .xh-back-perks li {
    font-size: 0.68rem;
    line-height: 1.32;
  }
  .xh-back-seal-col .xh-holo-seal-wrap {
    width: 2.9rem;
    height: 2.9rem;
  }
  .xh-back-strip {
    font-size: 0.6rem;
  }
}

@media (max-width: 359px) {
  .xh-holo-seal-wrap {
    width: 2.95rem;
    height: 2.95rem;
  }
  .xh-lux-card.xh-holo-card .xh-lux-quota small {
    font-size: 0.62rem;
  }
  .xh-lux-card.xh-holo-card .xh-lux-quota strong {
    font-size: 1.05rem;
  }
}
