/* ============================================================
 * holo-card.css — 全息会员卡（配合 holo-card.js）
 * 结构：holo-card > .holo-card__shadow + .holo-card__rotor > __face > __canvas + __content
 * ============================================================ */

holo-card.holo-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--hc-ratio, 1.618);
  border-radius: var(--hc-radius, 18px);
  isolation: isolate;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  color: #fff;
}

/* 自定义元素还没升级完成时先别把裸文本闪出来 */
holo-card:not(:defined) {
  min-height: 120px;
}
holo-card:not(:defined) > * {
  visibility: hidden;
}

/* 卡底阴影（跟着倾斜轻微位移） */
.holo-card__shadow {
  position: absolute;
  inset: 8% 5% -4%;
  z-index: 0;
  border-radius: 28px;
  background: radial-gradient(
    62% 62% at 50% 58%,
    rgba(26, 12, 34, 0.6),
    rgba(26, 12, 34, 0) 72%
  );
  filter: blur(16px);
  pointer-events: none;
  transition: transform 0.18s linear;
}

/* 3D 转子 */
.holo-card__rotor {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-style: preserve-3d;
  will-change: transform;
}

.holo-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--hc-radius, 18px);
  border: 1px solid rgba(255, 236, 208, 0.26);
  background: #150d1d;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 44px rgba(9, 4, 16, 0.42);
}

.holo-card__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

/* Keep the artwork visible while the texture loads or when WebGL is unavailable. */
holo-card:not([data-ready]) .holo-card__face {
  background-image: var(--hc-art, none);
  background-size: cover;
  background-position: center;
}
holo-card:not([data-ready]) .holo-card__canvas {
  visibility: hidden;
}

holo-card.is-fallback .holo-card__face::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      ellipse at var(--hc-light-x, 30%) var(--hc-light-y, 32%),
      #fff6dd52,
      transparent 57%
    ),
    linear-gradient(
      119deg,
      #67d7ea30,
      transparent 26%,
      #df84ef38 51%,
      transparent 71%,
      #ffdfa242
    );
  background-size:
    100% 100%,
    220% 100%;
  mix-blend-mode: screen;
  animation: holo-fallback-sheen 7s ease-in-out infinite alternate;
}
holo-card.is-fallback.holo-card--reverse .holo-card__face::after {
  background:
    radial-gradient(
      ellipse at var(--hc-light-x, 32%) var(--hc-light-y, 26%),
      #ffda8977,
      transparent 52%
    ),
    linear-gradient(
      114deg,
      #5ab8dc33,
      transparent 31%,
      #e9bb6354 56%,
      transparent 70%,
      #e2c4916b
    );
  background-size:
    100% 100%,
    220% 100%;
}
holo-card[paused] .holo-card__face::after {
  animation-play-state: paused;
}
@keyframes holo-fallback-sheen {
  to {
    background-position:
      0 0,
      100% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  holo-card.is-fallback .holo-card__face::after {
    animation: none;
  }
}

/* ---------- 卡面内容 ---------- */
.holo-card__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: clamp(14px, 2.4%, 24px) clamp(16px, 3%, 28px);
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(10, 6, 16, 0.46) 0%, rgba(10, 6, 16, 0) 36%),
    linear-gradient(
      0deg,
      rgba(10, 6, 16, 0.78) 0%,
      rgba(10, 6, 16, 0.34) 36%,
      rgba(10, 6, 16, 0) 58%
    );
  pointer-events: none;
}

.holo-card__content > * {
  pointer-events: auto;
}

/* 顶行 */
.hc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.hc-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 6px rgba(8, 4, 14, 0.7);
}
.hc-brand svg {
  color: #f0d9a8;
}

.hc-tier {
  margin-left: auto;
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.24em;
  color: rgba(255, 246, 232, 0.82);
  text-shadow: 0 1px 5px rgba(8, 4, 14, 0.7);
}

/* 余额（贴靠「持卡人」底栏上方，不挡卡面居中主视觉） */
.hc-balance {
  margin: auto 0 2px;
  min-width: 0;
}
.hc-balance > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: clamp(10.5px, 1.1vw, 12px);
  letter-spacing: 0.08em;
  color: rgba(255, 244, 232, 0.9);
  text-shadow: 0 1px 5px rgba(8, 4, 14, 0.65);
}
.hc-balance button {
  display: grid;
  place-items: center;
  padding: 3px;
  border-radius: 6px;
  color: rgba(255, 244, 232, 0.85);
  cursor: pointer;
}
.hc-balance button:hover {
  background: rgba(255, 255, 255, 0.14);
}
.hc-balance b {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 4px;
  font-family: var(
    --font-num,
    "DIN Alternate",
    "Inter",
    "SF Pro Display",
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif
  );
  font-size: clamp(24px, 2.8vw + 10px, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.015em;
  color: #fffaf1;
  text-shadow:
    0 2px 12px rgba(8, 4, 14, 0.75),
    0 0 26px rgba(255, 214, 160, 0.18);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.hc-balance .hc-currency {
  font-size: 0.7em;
  font-weight: 600;
  line-height: 1;
  opacity: 0.92;
}
.hc-balance .hc-amount {
  line-height: 1;
}
.hc-balance .hc-masked {
  letter-spacing: 0.16em;
  line-height: 1;
}
.holo-card--pass .hc-balance b {
  font-family: var(--font-sans, "PingFang SC", "Microsoft YaHei", sans-serif);
  font-size: clamp(22px, 2.4vw + 10px, 34px);
  font-weight: 650;
  letter-spacing: 0.04em;
}

/* 底行 */
.hc-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 240, 220, 0.28);
  font-size: clamp(10px, 1vw, 11.5px);
  color: rgba(255, 246, 234, 0.88);
  text-shadow: 0 1px 5px rgba(8, 4, 14, 0.7);
}
.hc-foot strong {
  margin-left: 6px;
  font-size: 1.08em;
  letter-spacing: 0.04em;
  color: #fff;
}
.hc-no {
  display: block;
  margin-top: 3px;
  font-family: var(--font-num, "DIN Alternate", "Inter", "Segoe UI", sans-serif);
  font-size: 0.92em;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  color: rgba(255, 244, 230, 0.72);
}
.hc-tail {
  text-align: right;
  color: #ffe2ae;
}

/* ---------- 页面里的位置 ---------- */
/* 专属空间首屏：全息卡 + 专属服务并排，下接「会员会所」标题 */
.member-spread--hero {
  margin-bottom: 20px;
}
@media (min-width: 761px) {
  .vip-lounge .member-spread {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}
/* 卡面本身有上限宽度，避免大屏铺成海报 */
.holo-card--vip {
  max-width: 680px;
}
/* 「我的」页身份卡：与下方功能分组留出间距 */
.holo-card--pass {
  margin-bottom: 14px;
}
.holo-card--pass .holo-card__content {
  text-align: left;
}

/* 窄屏收一点 */
@media (max-width: 520px) {
  .hc-brand {
    letter-spacing: 0.08em;
  }
  .hc-tier {
    display: none;
  }
  .hc-foot {
    font-size: 10px;
  }
}
