/* 3D 透视卡牌、全息偏光鉴真与翻面结构 */

.inspect-hud-top {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.polar-meter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
}

.polar-label {
  color: rgba(255, 240, 210, 0.85);
  font-weight: 600;
}

.polar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.polar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #f5c85c, #00e5b8);
  transition: width 0.08s linear;
}

.polar-status {
  color: #fde68a;
  font-weight: 700;
  min-width: 78px;
  text-align: right;
}

.inspect-banner {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  animation: popElastic 0.35s var(--ease-overshoot);
}

.inspect-banner.awaken-ready {
  background: rgba(0, 229, 184, 0.18);
  border: 1px solid rgba(0, 229, 184, 0.55);
  color: #99f6e4;
}

.inspect-banner.fake-found {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.inspect-banner.clean-verified {
  background: rgba(245, 200, 92, 0.18);
  border: 1px solid rgba(245, 200, 92, 0.55);
  color: #fde68a;
}

/* 3D 卡牌舞台 */
.inspect-card-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1150px;
  padding: 6px 0;
}

.card-3d {
  width: 266px;
  height: 392px;
  position: relative;
  touch-action: none;
  cursor: grab;
  --rx: 0deg;
  --ry: 0deg;
  --gx: 50%;
  --gy: 40%;
  --polar-alpha: 0.06;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.08s ease-out;
}

.card-3d:active {
  cursor: grabbing;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.62s var(--ease-out-expo);
}

.card-3d.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6);
}

/* 卡面正面 */
.card-front {
  background: linear-gradient(160deg, #fffcf5 0%, #f1e6d2 100%);
  border: 2.5px solid #d4a54a;
  display: flex;
  flex-direction: column;
  padding: 11px 12px;
  color: #1f1c18;
}

.card-3d[data-rarity="LR"] .card-front {
  background: linear-gradient(155deg, #0b1b1d 0%, #102a2e 45%, #1d1626 100%);
  border-color: #00e5b8;
  color: #f8fafc;
  box-shadow: 0 0 36px rgba(0, 229, 184, 0.35), 0 22px 48px rgba(0, 0, 0, 0.68);
}

.card-3d[data-rarity="UR"] .card-front {
  background: linear-gradient(155deg, #21180b 0%, #362510 55%, #1f1509 100%);
  border-color: #f6b93b;
  color: #fff8eb;
  box-shadow: 0 0 32px rgba(246, 185, 59, 0.35), 0 22px 48px rgba(0, 0, 0, 0.68);
}

.card-3d[data-rarity="SSR"] .card-front {
  background: linear-gradient(155deg, #241326 0%, #341939 60%, #1d0e20 100%);
  border-color: #c06cff;
  color: #fcf4ff;
}

.card-3d[data-rarity="SR"] .card-front {
  background: linear-gradient(160deg, #eef8fc 0%, #dbeff7 100%);
  border-color: #38bdf8;
}

.card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 4;
}

.rarity-pill {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.06em;
  background: #1f1c18;
  color: #fde68a;
}

.card-3d[data-rarity="LR"] .rarity-pill {
  background: linear-gradient(90deg, #00e5b8, #f6b93b);
  color: #071917;
}

.slot-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(185, 58, 44, 0.14);
  color: #c83e2f;
}

.card-3d[data-rarity="LR"] .slot-tag,
.card-3d[data-rarity="UR"] .slot-tag,
.card-3d[data-rarity="SSR"] .slot-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #fde68a;
}

.card-title-row {
  margin-top: 6px;
  position: relative;
  z-index: 4;
}

.card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.2;
}

.card-dynasty {
  font-size: 10px;
  opacity: 0.78;
}

/* 器物视觉画框 + 偏光暗纹层 */
.card-art-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 8px 0;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(212, 165, 74, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 3;
}

.card-art-frame svg {
  width: 88%;
  height: 88%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.28));
}

/* 核心紫牛机制：只有倾斜迎光才会显现的偏光暗纹/破绽印记 */
.polar-secret-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: var(--polar-alpha);
  transition: opacity 0.08s linear;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 240, 175, 0.26), transparent 65%);
}

.polar-secret-seal {
  padding: 5px 11px;
  border-radius: 8px;
  border: 2px dashed rgba(255, 215, 110, 0.95);
  background: rgba(15, 14, 20, 0.76);
  color: #fef08a;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: rotate(-8deg);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.45);
}

.polar-secret-overlay.is-fake .polar-secret-seal {
  border-color: rgba(248, 113, 113, 0.95);
  color: #fecaca;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.55);
}

.polar-secret-sub {
  margin-top: 5px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

/* 全息箔与移动镜面反光（随 --gx --gy 动态变化） */
.card-holo-foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  mix-blend-mode: color-dodge;
  opacity: 0.42;
  background:
    linear-gradient(
      118deg,
      transparent 15%,
      rgba(0, 229, 184, 0.35) 35%,
      rgba(246, 185, 59, 0.4) 50%,
      rgba(192, 108, 255, 0.35) 65%,
      transparent 85%
    );
  background-position: var(--gx) var(--gy);
  background-size: 220% 220%;
}

.card-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background: radial-gradient(
    circle at var(--gx) var(--gy),
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.08) 28%,
    transparent 60%
  );
}

.card-bottom-info {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-brief {
  font-size: 11px;
  line-height: 1.38;
  opacity: 0.9;
}

.card-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 5px;
  border-top: 1px solid rgba(212, 165, 74, 0.3);
  font-size: 11px;
  font-weight: 700;
}

/* 卡背：明代锦缎底款验真 */
.card-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 50% 35%, rgba(212, 165, 74, 0.2), transparent 55%),
    linear-gradient(160deg, #1b1518 0%, #100d12 100%);
  border: 2.5px solid #d4a54a;
  padding: 14px;
  color: #f8eedb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.back-ornament-frame {
  flex: 1;
  border: 1px solid rgba(212, 165, 74, 0.45);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.back-seal-box {
  border: 2px solid #d94c3d;
  color: #ff8c7a;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: rgba(185, 58, 44, 0.12);
}

.back-lore-box {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 245, 224, 0.88);
}

.back-hint-pill {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(212, 165, 74, 0.16);
  color: #fde68a;
}

/* 操控条 */
.inspect-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspect-row-secondary {
  display: flex;
  gap: 6px;
}

.mini-stage-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mini-stage-btn.awaken {
  background: linear-gradient(135deg, #00bfa5, #0284c7);
  border-color: #99f6e4;
  color: #fff;
  animation: pulseGold 1.1s infinite;
}

.inspect-row-primary {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
}

/* 多卡翻牌网格（五连/三连阵列） */
.grid-cards {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: center;
  justify-items: center;
}

.grid-cards.count-5 {
  grid-template-columns: repeat(3, 1fr);
}

.mini-flip-card {
  width: 100%;
  max-width: 112px;
  aspect-ratio: 0.68;
  perspective: 800px;
  cursor: pointer;
}

.mini-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.52s var(--ease-out-expo);
}

.mini-flip-card.is-revealed .mini-flip-inner {
  transform: rotateY(180deg);
}

.mini-flip-card.is-suspense {
  animation: suspensePulse 0.44s ease-in-out;
}

.mini-face {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border: 1.5px solid rgba(212, 165, 74, 0.55);
}

.mini-back {
  background: linear-gradient(160deg, #251a1d, #130f14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mini-back-seal {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #d4a54a;
  color: #fde68a;
  font-family: var(--font-serif);
  font-size: 16px;
  display: grid;
  place-items: center;
}

.mini-front {
  transform: rotateY(180deg);
  background: #fffaf0;
  color: #1f1c18;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.mini-flip-card[data-rarity="LR"] .mini-front {
  background: #0d2326;
  color: #fff;
  border-color: #00e5b8;
  box-shadow: 0 0 18px rgba(0, 229, 184, 0.45);
}

.mini-flip-card[data-rarity="UR"] .mini-front {
  background: #2b1f0c;
  color: #fff8eb;
  border-color: #f6b93b;
  box-shadow: 0 0 16px rgba(246, 185, 59, 0.45);
}

.mini-flip-card[data-rarity="SSR"] .mini-front {
  background: #24132a;
  color: #fff;
  border-color: #c06cff;
}

.mini-front-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 800;
}

.mini-front-art {
  width: 72px;
  height: 70px;
}

.mini-front-name {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.mini-badge-handled {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #16a34a;
  color: #fff;
}

.grid-summary-bar {
  font-size: 12px;
  color: rgba(255, 240, 200, 0.85);
  margin: 6px 0;
  text-align: center;
}

.grid-footer-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.85fr;
  gap: 8px;
}

/* ===== v0.2：方向性掠射光显影（覆盖 v0.1 的悬浮提示条） ===== */
.card-3d { --mask-r: 22%; }

.polar-secret-overlay {
  position: absolute;
  inset: 0;
  display: block;
  background: none;
  pointer-events: none;
  opacity: var(--polar-alpha);
  -webkit-mask-image: radial-gradient(circle at var(--gx) var(--gy), #000 0%, rgba(0, 0, 0, 0) var(--mask-r));
  mask-image: radial-gradient(circle at var(--gx) var(--gy), #000 0%, rgba(0, 0, 0, 0) var(--mask-r));
  transition: none;
}

.polar-secret-mark {
  position: absolute;
  transform: translate(-50%, -50%) rotate(-6deg);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 215, 110, 0.95);
  background: rgba(15, 14, 20, 0.72);
  color: #fef08a;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.45);
}

.inspect-banner.clean-verified {
  background: rgba(245, 200, 92, 0.18);
  border: 1px solid rgba(245, 200, 92, 0.55);
  color: #fde68a;
}

/* ===== v0.2：AI 示意图（高精度重器） ===== */
.hd-art {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

.artifact-hd-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  -webkit-user-drag: none;
}

.hd-ai-tag {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.75);
}

.card-art-frame .hd-art {
  width: 100%;
  height: 100%;
  padding: 6px;
  box-sizing: border-box;
}

/* v0.3：透明底实拍器物放在「博物馆射灯」底座上，随稀有度换色 */
.card-art-frame:has(.hd-art) {
  background: radial-gradient(circle at 50% 42%, rgba(255, 251, 240, 0.95), rgba(224, 208, 178, 0.78) 68%, rgba(176, 152, 112, 0.62) 100%);
}
.card-3d[data-rarity="SR"] .card-art-frame:has(.hd-art) {
  background: radial-gradient(circle at 50% 42%, rgba(240, 252, 252, 0.95), rgba(184, 226, 232, 0.8) 68%, rgba(120, 178, 196, 0.62) 100%);
}
.card-3d[data-rarity="SSR"] .card-art-frame:has(.hd-art) {
  background: radial-gradient(circle at 50% 42%, rgba(122, 70, 128, 0.95), rgba(66, 30, 74, 0.96) 70%, rgba(32, 12, 38, 1) 100%);
}
.card-3d[data-rarity="UR"] .card-art-frame:has(.hd-art) {
  background: radial-gradient(circle at 50% 42%, rgba(196, 140, 52, 0.9), rgba(96, 62, 22, 0.96) 70%, rgba(40, 24, 8, 1) 100%);
}
.card-3d[data-rarity="LR"] .card-art-frame:has(.hd-art) {
  background: radial-gradient(circle at 50% 42%, rgba(24, 122, 112, 0.92), rgba(10, 52, 56, 0.97) 68%, rgba(6, 22, 26, 1) 100%);
}

.card-art-frame .artifact-hd-img {
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.42));
}
.mini-front-art .artifact-hd-img,
.thumb-art .artifact-hd-img,
.codex-item-art .artifact-hd-img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.thumb-art .hd-ai-tag,
.mini-front-art .hd-ai-tag,
.codex-item-art .hd-ai-tag,
.pf-art .hd-ai-tag {
  display: none;
}

/* v0.2 性能：提示浏览器为倾斜与翻面单独建合成层 */
.card-3d, .card-inner { will-change: transform; }
