/* ============================================================
 * 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;
}

/* WebGL 不可用时的兜底：直接铺底图 */
holo-card.is-fallback .holo-card__face {
  background-image: var(--hc-art, none);
  background-size: cover;
  background-position: center;
}

/* ---------- 卡面内容 ---------- */
.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.5) 0%, rgba(10, 6, 16, 0) 42%),
    linear-gradient(0deg, rgba(10, 6, 16, 0.72) 0%, rgba(10, 6, 16, 0) 52%);
  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-art {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 245, 230, 0.4);
  background: rgba(18, 10, 24, 0.35);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}
.hc-art-tx {
  line-height: 1;
}
.hc-art:hover {
  background: rgba(255, 244, 226, 0.2);
  border-color: rgba(255, 245, 230, 0.8);
  transform: scale(1.06);
}
.hc-art:active {
  transform: scale(0.94);
}
.hc-art svg {
  width: 15px;
  height: 15px;
}
holo-card[data-art-state="busy"] .hc-art {
  opacity: 0.5;
  pointer-events: none;
}
holo-card[data-art-state="done"] .hc-art {
  border-color: #4fd08b;
  color: #b6f5d0;
}
holo-card[data-art-state="error"] .hc-art {
  border-color: #ff7b63;
  color: #ffb3a5;
}

/* 余额 */
.hc-balance {
  margin: auto 0;
  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: block;
  margin-top: 2px;
  font:
    500 clamp(26px, 2.9vw + 12px, 46px) / 1.18 Georgia,
    "Songti SC",
    serif;
  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;
}

/* 底行 */
.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-size: 0.92em;
  letter-spacing: 0.16em;
  color: rgba(255, 244, 230, 0.66);
}
.hc-tail {
  text-align: right;
  color: #ffe2ae;
}

/* 窄屏收一点 */
@media (max-width: 520px) {
  .hc-brand {
    letter-spacing: 0.08em;
  }
  .hc-tier {
    display: none;
  }
  .hc-foot {
    font-size: 10px;
  }
}
@media (max-width: 380px) {
  .hc-art {
    width: 30px;
    padding: 0;
    border-radius: 50%;
  }
  .hc-art-tx {
    display: none;
  }
}
