:root {
  --pack-color: #1e38dc;
  --pack-highlight: #7ba2ff;
  --pack-shadow: #081042;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-css: linear(
    0, 0.055, 0.193, 0.378, 0.577, 0.767, 0.93, 1.056, 1.142, 1.19, 1.205,
    1.195, 1.167, 1.13, 1.089, 1.05, 1.016, 0.99, 0.972, 0.961, 0.958,
    0.96, 0.965, 0.973, 0.981, 0.989, 0.996, 1.002, 1.006, 1.008, 1
  );

  /* 卡包比例 0.69:1，内部卡牌比例 5:7 且略窄于袋宽（尺寸对齐参考工程：58vh 上限让卡牌更大） */
  --pack-h: min(420px, 58vh, 58svh, 120vw);
  --pack-w: calc(var(--pack-h) * 0.69);
  --card-w: calc(var(--pack-w) * 0.84);
  --card-h: calc(var(--card-w) * 1.4);
  --crimp-h: calc(var(--pack-h) * 0.068);
  --pack-depth: 16px;

  /* SimpleMkt 品牌设计视觉变量 */
  --smkt-green: #1A6B3A;
  --smkt-green-hover: #155830;
  --smkt-green-luminous: #32ad62;
  --focus-ring: #32ad62;
  --font-ui: "Inter Variable", Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", STSong, serif;
  --font-mono: "Berkeley Mono", "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;

  /* 默认：SimpleMkt 暗色建筑光学玻璃展厅 */
  --stage-bg: #070b09;
  --stage-vignette-bg:
    radial-gradient(62% 52% at 50% 48%, transparent 32%, rgba(5, 9, 8, 0.56) 100%),
    linear-gradient(180deg, rgba(5, 9, 8, 0.52) 0%, transparent 22%, transparent 74%, rgba(5, 9, 8, 0.68) 100%);
  --spotlight-bg:
    conic-gradient(
      from 162deg at 50% -16%,
      transparent 0deg,
      rgba(50, 173, 98, 0.05) 13deg,
      rgba(244, 250, 246, 0.11) 19deg,
      rgba(50, 173, 98, 0.05) 25deg,
      transparent 38deg
    ),
    radial-gradient(46% 36% at 50% 42%, rgba(210, 238, 222, 0.08), transparent 76%);
  --ground-shadow-bg:
    radial-gradient(closest-side, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.36) 56%, transparent);
  --grain-opacity: 0.028;

  --chrome-surface: rgba(13, 18, 16, 0.78);
  --chrome-border: rgba(255, 255, 255, 0.11);
  --chrome-specular: rgba(255, 255, 255, 0.16);
  --chrome-sep: rgba(255, 255, 255, 0.1);
  --chrome-ink: #f4f5f3;
  --chrome-muted: rgba(226, 232, 228, 0.6);
  --chrome-hover: rgba(255, 255, 255, 0.065);
  --chrome-shadow:
    0 20px 44px -12px rgba(0, 0, 0, 0.68),
    0 4px 12px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 var(--chrome-specular);

  --cta-primary-bg: linear-gradient(180deg, #218047 0%, #1A6B3A 100%);
  --cta-primary-ink: #ffffff;
  --cta-primary-border: rgba(120, 224, 160, 0.36);
  --cta-secondary-bg: rgba(255, 255, 255, 0.08);
  --cta-secondary-ink: #f4f5f3;
  --cta-secondary-border: rgba(255, 255, 255, 0.15);

  /* 底部装填坞（设计稿复刻）：坞顶流光 / 明显分隔线 / 图鉴强调 / 红点徽章 / 金币抽卡坞 */
  --dock-shine: rgba(126, 231, 183, 0.5);
  --dock-shine-2: rgba(94, 200, 255, 0.42);
  --sep-line: rgba(255, 255, 255, 0.2);
  --sep-line-core: rgba(255, 255, 255, 0.55);
  --sep-glow: rgba(126, 231, 183, 0.24);
  --binder-count-ink: #7ff0b6;
  --binder-count-glow: rgba(94, 231, 170, 0.35);
  --bar-bg: rgba(255, 255, 255, 0.12);
  --badge-ring: #10141f;
  --draw-bg: linear-gradient(180deg, rgba(255, 207, 107, 0.22), rgba(255, 207, 107, 0.04)), rgba(255, 255, 255, 0.02);
  --draw-bd: rgba(255, 207, 107, 0.38);
  --draw-bd-hover: rgba(255, 207, 107, 0.72);
  --draw-ink: #ffeac2;
  --coin: #ffd071;
  --draw-split: rgba(255, 207, 107, 0.28);
  --draw-hover-bg: rgba(255, 207, 107, 0.12);
  --draw-shine: rgba(255, 255, 255, 0.28);
  --draw-shadow: 0 10px 24px -18px rgba(255, 180, 60, 0.95);
  --draw-shadow-hover: 0 16px 32px -18px rgba(255, 180, 60, 1);
  --menu-bg: rgba(17, 22, 36, 0.97);
  --menu-solid: #111624;
  --menu-border: rgba(255, 255, 255, 0.12);
  --menu-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.9);
  --opt-hover: rgba(255, 255, 255, 0.07);
  --opt-active: rgba(255, 207, 107, 0.15);

  --holo-rainbow: repeating-linear-gradient(
    112deg,
    #ff75a8 0%,
    #ffd166 5%,
    #9eff87 10%,
    #66e3ff 15%,
    #9c8aff 20%,
    #ff75a8 25%
  );
  --holo-glitter: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='156' height='156'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.82' seed='11' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 14 0 0 0 -8.5'/></filter><rect width='156' height='156' filter='url(%23n)'/></svg>");
  --stage-noise: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='2' stitchTiles='stitch'/></filter><rect width='180' height='180' filter='url(%23g)'/></svg>");
}

/* 白昼建筑光学玻璃展台（SimpleMkt 亮色主题） */
html[data-studio-light="day"] {
  --focus-ring: #1A6B3A;
  --stage-bg: #f3f4f3;
  --stage-vignette-bg:
    radial-gradient(70% 58% at 50% 46%, rgba(255, 255, 255, 0.24) 0%, rgba(235, 238, 235, 0.42) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, transparent 20%, transparent 76%, rgba(226, 230, 226, 0.55) 100%);
  --spotlight-bg:
    radial-gradient(56% 40% at 50% 24%, rgba(255, 255, 255, 0.72), transparent 76%);
  --ground-shadow-bg:
    radial-gradient(closest-side, rgba(20, 26, 22, 0.32), rgba(20, 26, 22, 0.1) 58%, transparent);
  --grain-opacity: 0.018;

  --chrome-surface: rgba(255, 255, 255, 0.86);
  --chrome-border: #D8D8D6;
  --chrome-specular: rgba(255, 255, 255, 0.94);
  --chrome-sep: #EBEBEA;
  --chrome-ink: #141414;
  --chrome-muted: #6B6B6B;
  --chrome-hover: #F3F4F3;
  --chrome-shadow:
    0 16px 36px -12px rgba(20, 24, 20, 0.12),
    0 2px 8px rgba(20, 24, 20, 0.05),
    inset 0 1px 0 var(--chrome-specular);

  --cta-primary-bg: linear-gradient(180deg, #1e7841 0%, #1A6B3A 100%);
  --cta-primary-ink: #ffffff;
  --cta-primary-border: rgba(255, 255, 255, 0.24) ;
  --cta-secondary-bg: #F3F4F3;
  --cta-secondary-ink: #141414;
  --cta-secondary-border: #D8D8D6;

  /* 底部装填坞（白昼适配） */
  --dock-shine: rgba(26, 107, 58, 0.45);
  --dock-shine-2: rgba(59, 130, 246, 0.32);
  --sep-line: rgba(16, 24, 40, 0.14);
  --sep-line-core: rgba(16, 24, 40, 0.38);
  --sep-glow: rgba(26, 107, 58, 0.16);
  --binder-count-ink: #0a8752;
  --binder-count-glow: rgba(26, 107, 58, 0.18);
  --bar-bg: rgba(16, 24, 40, 0.1);
  --badge-ring: #ffffff;
  --draw-bg: linear-gradient(180deg, #fff3d6, #ffe6b0);
  --draw-bd: rgba(196, 127, 0, 0.3);
  --draw-bd-hover: rgba(196, 127, 0, 0.55);
  --draw-ink: #7a4a00;
  --coin: #b97300;
  --draw-split: rgba(196, 127, 0, 0.22);
  --draw-hover-bg: rgba(196, 127, 0, 0.09);
  --draw-shine: rgba(255, 255, 255, 0.85);
  --draw-shadow: 0 10px 24px -18px rgba(196, 127, 0, 0.55);
  --draw-shadow-hover: 0 16px 32px -18px rgba(196, 127, 0, 0.7);
  --menu-bg: rgba(255, 255, 255, 0.98);
  --menu-solid: #ffffff;
  --menu-border: rgba(16, 24, 40, 0.1);
  --menu-shadow: 0 20px 40px -20px rgba(16, 24, 40, 0.35);
  --opt-hover: rgba(16, 24, 40, 0.05);
  --opt-active: rgba(245, 183, 63, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow: hidden;
  background: var(--stage-bg);
  color: var(--chrome-ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s var(--ease-out), color 0.25s var(--ease-out);
}

i {
  font-style: normal;
}

button {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 顶部居中 SimpleMkt 获批品牌字标 + 右上角工具簇 ---------- */
.top-bar {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  min-height: 42px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.brand-stage-crest {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.18s var(--ease-out);
}

.brand-stage-crest:hover {
  opacity: 0.88;
}

.brand-stage-crest:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.brand-wordmark {
  display: block;
  height: clamp(26px, 3.3vh, 35px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.28));
}

html[data-studio-light="day"] .brand-wordmark {
  filter: none;
}

html[data-studio-light="dark"] .brand-wordmark-light,
html[data-studio-light="day"] .brand-wordmark-dark {
  display: none;
}

.utility-cluster {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--chrome-shadow);
}

.util-btn {
  -webkit-tap-highlight-color: transparent;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--chrome-ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.18s var(--ease-out), scale 0.16s var(--ease-out);
}

.util-btn.mute-btn {
  width: 32px;
  padding: 0;
}

.util-btn:active {
  scale: 0.94;
}

.util-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

html[data-studio-light="dark"] .icon-daylight,
html[data-studio-light="day"] .icon-darkroom {
  display: none;
}

.mute-btn .icon-sound-off,
.mute-btn[aria-pressed="true"] .icon-sound-on {
  display: none;
}

.mute-btn[aria-pressed="true"] .icon-sound-off {
  display: block;
}

/* ---------- 启动加载遮罩（黑金主题：数据就绪后淡出） ---------- */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 44% at 50% 40%, rgba(212, 165, 74, 0.1), transparent 70%),
    linear-gradient(180deg, #10150f 0%, #090d0b 100%);
  transition: opacity 0.45s var(--ease-out);
}
.boot-loader.done {
  opacity: 0;
  pointer-events: none;
}
.boot-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.boot-star {
  animation: boot-spin 1.7s cubic-bezier(0.45, 0, 0.35, 1) infinite;
  filter: drop-shadow(0 0 12px rgba(255, 198, 76, 0.35));
}
@keyframes boot-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.boot-text {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(235, 232, 224, 0.55);
  animation: boot-pulse 1.7s ease-in-out infinite;
}
@keyframes boot-pulse {
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-star,
  .boot-text { animation: none; }
}

/* ---------- 高罕出货横幅 ---------- */
.pull-banner {
  position: fixed;
  left: 50%;
  top: 74px;
  z-index: 28;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-width: calc(100vw - 28px);
  padding: 9px 22px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 22, 19, 0.94), rgba(9, 13, 11, 0.96));
  border: 1px solid rgba(236, 198, 108, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff6dc;
  white-space: nowrap;
  box-shadow:
    0 18px 40px -10px rgba(0, 0, 0, 0.65),
    0 0 28px -6px rgba(255, 198, 76, 0.35),
    inset 0 1px 0 rgba(255, 240, 196, 0.35);
  pointer-events: none;
  animation: banner-pop 0.42s var(--spring-css);
}

.pull-banner[hidden] {
  display: none;
}

.banner-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #f5ca69;
}

.banner-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

@keyframes banner-pop {
  from {
    opacity: 0;
    scale: 0.84;
    translate: -50% -10px;
  }
  to {
    opacity: 1;
    scale: 1;
    translate: -50% 0;
  }
}

/* ---------- 建筑光学玻璃三维舞台、底图与胶片微噪点 ---------- */
/* 全站图片禁止浏览器原生拖拽（含放大卡、卡面立绘、图鉴缩略图），避免拖出半透明副本 */
img {
  -webkit-user-drag: none;
  user-select: none;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 1400px;
  perspective-origin: 50% 40%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.stage-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.stage-backdrop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 54%;
  transition: opacity 0.42s var(--ease-out);
}

html[data-studio-light="dark"] .stage-backdrop-light,
html[data-studio-light="day"] .stage-backdrop-dark {
  opacity: 0;
}

html[data-studio-light="dark"] .stage-backdrop-dark {
  opacity: 0.94;
}

html[data-studio-light="day"] .stage-backdrop-light {
  opacity: 0.96;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  background: var(--stage-vignette-bg);
}

.stage-spotlight {
  position: absolute;
  inset: 0;
  background: var(--spotlight-bg);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}

.stage-grain {
  position: absolute;
  inset: 0;
  background: var(--stage-noise) 0 0 / 180px 180px repeat;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}

.stage.impact-ultra {
  animation: stage-impact-sm 260ms var(--ease-out);
}

.stage.impact-ultra::after {
  background: radial-gradient(48% 42% at 50% 48%, rgba(255, 212, 84, 0.24), rgba(50, 173, 98, 0.08) 52%, transparent 78%);
  animation: stage-flare 440ms var(--ease-out);
}

.stage.impact-secret {
  animation: stage-impact-lg 380ms var(--ease-out);
}

.stage.impact-secret::after {
  background: radial-gradient(56% 48% at 50% 48%, rgba(255, 224, 128, 0.34), rgba(255, 92, 214, 0.18) 42%, rgba(92, 230, 255, 0.1) 66%, transparent 84%);
  animation: stage-flare 580ms var(--ease-out);
}

@keyframes stage-flare {
  0% { opacity: 0.96; }
  100% { opacity: 0; }
}

@keyframes stage-impact-sm {
  0%, 100% { translate: 0 0; }
  25% { translate: -4px 3px; }
  55% { translate: 4px -2px; }
  80% { translate: -2px 1px; }
}

@keyframes stage-impact-lg {
  0%, 100% { translate: 0 0; }
  18% { translate: -7px 5px; }
  38% { translate: 7px -4px; }
  60% { translate: -5px -2px; }
  82% { translate: 3px 2px; }
}

.pack-aura {
  position: absolute;
  left: 50%;
  top: 47%;
  width: calc(var(--pack-w) * 1.56);
  height: calc(var(--pack-h) * 1.28);
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--peek-aura, rgba(255, 196, 56, 0.58)), transparent 74%);
  filter: blur(22px);
  opacity: 0;
  scale: 0.86;
  pointer-events: none;
  transition: opacity 0.38s var(--ease-out), scale 0.45s var(--ease-out);
}

.pack-aura.active {
  opacity: 0.92;
  scale: 1.05;
}

.pack-aura.god-mode {
  --peek-aura: rgba(255, 198, 64, 0.65);
  opacity: 0.76;
  scale: 1;
  animation: aura-breathe 2.2s ease-in-out infinite;
}

@keyframes aura-breathe {
  50% {
    opacity: 0.98;
    scale: 1.09;
  }
}

.scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.scene.flat {
  transform-style: flat;
  perspective: 1400px;
  perspective-origin: 50% 40%;
}

.grab-zone,
.card {
  pointer-events: auto;
}

.pack,
.card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  will-change: transform;
}

.pack {
  width: var(--pack-w);
  height: var(--pack-h);
  margin: calc(var(--pack-h) / -2) 0 0 calc(var(--pack-w) / -2);
}

.ground-shadow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--pack-w) * 1.02);
  height: calc(var(--pack-w) * 0.2);
  margin: calc(var(--pack-w) * -0.1) 0 0 calc(var(--pack-w) * -0.51);
  border-radius: 50%;
  background: var(--ground-shadow-bg);
  filter: blur(8px);
  pointer-events: none;
}

/* ---------- 镀铝复合膜补充包（热压锯齿 + 激光易撕口 + 枕式金属漫反射） ---------- */
.pouch-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(calc(var(--pack-depth) / 2));
  --tooth-w: calc(var(--pack-w) / 28);
  background:
    var(--foil-shade, none) 0 0 / 100% 100%,
    /* 上下热压封口内侧立体压痕亮线 */
    linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0 1px, rgba(255, 255, 255, 0.34) 1px 2px, transparent 3px) 0 var(--crimp-h) / 100% 5px no-repeat,
    linear-gradient(0deg, rgba(0, 0, 0, 0.46) 0 1px, rgba(255, 255, 255, 0.26) 1px 2px, transparent 3px) 0 calc(100% - var(--crimp-h)) / 100% 5px no-repeat,
    /* 上下封口精密金属压纹槽 */
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.34) 0 1.2px,
      rgba(255, 255, 255, 0.22) 1.2px 2.4px,
      rgba(0, 0, 0, 0.08) 2.4px 4.6px
    ) 0 0 / 100% var(--crimp-h) no-repeat,
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.34) 0 1.2px,
      rgba(255, 255, 255, 0.2) 1.2px 2.4px,
      rgba(0, 0, 0, 0.08) 2.4px 4.6px
    ) 0 100% / 100% var(--crimp-h) no-repeat,
    /* 袋身左右弧面体积边缘光与暗部转折 */
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.36) 0%,
      rgba(255, 255, 255, 0.24) 3.4%,
      transparent 10%,
      transparent 88%,
      rgba(255, 255, 255, 0.12) 94.5%,
      rgba(0, 0, 0, 0.44) 100%
    ) 0 50% / 100% calc(100% - 2 * var(--crimp-h)) no-repeat,
    /* 极细拉丝镀铝膜纵纹 */
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px),
    /* 枕式鼓包中心金属高光与四角收紧暗角（--pack-grad 由主题多色渐变注入，未设置回退三色） */
    var(--pack-grad,
      radial-gradient(
        78% 56% at calc(44% + var(--glint-x, 0) * 3%) 47%,
        color-mix(in srgb, var(--pack-highlight) 58%, #ffffff) 0%,
        color-mix(in srgb, var(--pack-color) 82%, var(--pack-highlight)) 34%,
        var(--pack-color) 68%,
        var(--pack-shadow) 100%
      )
    );
  /* 包装袋轮廓遮罩（完整矩形袋身 + 上下锯齿封口；原两侧激光 V 型易撕缺口已移除） */
  mask:
    conic-gradient(from 135deg at 50% 0, transparent, #000 1deg 89deg, transparent 90deg) 0 0 / var(--tooth-w) calc(var(--tooth-w) / 2) repeat-x,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 0H100V5.6C100 8 97.6 7.6 97.6 10V90C97.6 92.4 100 92 100 94.4V100H0V94.4C0 92 2.4 92.4 2.4 90V10C2.4 7.6 0 8 0 5.6Z'/></svg>") 0 50% / 100% calc(100% - var(--tooth-w)) no-repeat,
    conic-gradient(from -45deg at 50% 100%, transparent, #000 1deg 89deg, transparent 90deg) 0 100% / var(--tooth-w) calc(var(--tooth-w) / 2) repeat-x;
}

.pouch-face.back {
  transform: rotateY(180deg) translateZ(calc(var(--pack-depth) / 2));
}

.pouch-face::before,
.pouch-face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* 随倾角游走的宽幅金属镜面反光带 */
.pouch-face::before {
  background: linear-gradient(
    108deg,
    transparent 16%,
    rgba(255, 255, 255, 0.08) 28%,
    rgba(255, 255, 255, 0.34) 36%,
    rgba(255, 255, 255, 0.08) 44%,
    transparent 56%
  );
  mask: linear-gradient(transparent 6%, #000 13% 87%, transparent 94%);
  translate: calc(var(--glint-x, 0) * 6%) 0;
  opacity: var(--glint-op, 0.82);
  mix-blend-mode: soft-light;
}

.pouch-face::after {
  background: var(--foil-shine, none) 0 0 / 100% 100%;
  opacity: var(--shine-op, 0.88);
  mask: linear-gradient(90deg, rgba(0, 0, 0, 0.45), #000 40% 60%, rgba(0, 0, 0, 0.45)) calc(var(--shine-pos, 50) * 1%) 0 / 250% 100%;
}

/* 欧皇全闪包：黑金幻彩镀膜外袋 */
.pack.god-pack .pouch-face {
  background:
    var(--foil-shade, none) 0 0 / 100% 100%,
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0 1px, rgba(255, 232, 160, 0.5) 1px 2px, transparent 3px) 0 var(--crimp-h) / 100% 5px no-repeat,
    linear-gradient(0deg, rgba(0, 0, 0, 0.48) 0 1px, rgba(255, 232, 160, 0.4) 1px 2px, transparent 3px) 0 calc(100% - var(--crimp-h)) / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0 1.2px, rgba(255, 226, 138, 0.32) 1.2px 2.4px, transparent 2.4px 4.6px) 0 0 / 100% var(--crimp-h) no-repeat,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0 1.2px, rgba(255, 226, 138, 0.32) 1.2px 2.4px, transparent 2.4px 4.6px) 0 100% / 100% var(--crimp-h) no-repeat,
    linear-gradient(128deg, rgba(255, 218, 106, 0.45) 0%, rgba(255, 108, 214, 0.25) 38%, rgba(92, 224, 255, 0.28) 68%, rgba(255, 214, 102, 0.5) 100%),
    radial-gradient(80% 58% at 45% 46%, #3d3159 0%, #1c172e 58%, #0b0914 100%);
}

.gusset-slice {
  position: absolute;
}

/* ---------- 袋口彩虹喷流 ---------- */
.jet-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--pack-w);
  height: var(--pack-h);
  margin: calc(var(--pack-h) / -2) 0 0 calc(var(--pack-w) / -2);
  transform-style: preserve-3d;
  pointer-events: none;
}

.light-jet {
  position: absolute;
  left: 0;
  width: 100%;
  top: calc(10.5% - var(--pack-w) * 0.6);
  height: calc(var(--pack-w) * 0.76);
  overflow: visible;
  opacity: 0;
  transform: translateZ(-6px);
}

/* ---------- 补充包工业级烫金/丝印版式 ---------- */
.tear-label {
  position: absolute;
  left: 8.5%;
  right: 8.5%;
  top: calc(var(--crimp-h) + 1.1%);
  font: 700 calc(var(--pack-w) * 0.028) / 1 system-ui, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.tear-guide {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 11.4%;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.52) 0 4px, transparent 4px 7px);
}

/* 袋面金属内框（位于 y=20.2% 以下，避开顶部动态撕裂带） */
.pouch-foil-frame {
  position: absolute;
  left: 7.5%;
  right: 7.5%;
  top: 20.2%;
  bottom: calc(var(--crimp-h) + 2.8%);
  border-radius: calc(var(--pack-w) * 0.032);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 26%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
}

.pouch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6.5% 7% 0;
}

.brand-mark {
  font: 800 calc(var(--pack-w) * 0.105) / 0.95 -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 15%, rgba(230, 238, 255, 0.82) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.32));
}

.edition-tag {
  padding: calc(var(--pack-w) * 0.014) calc(var(--pack-w) * 0.028);
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(8, 12, 28, 0.34);
  font: 700 calc(var(--pack-w) * 0.027) / 1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  font-variant-numeric: tabular-nums;
}

.pack.god-pack .edition-tag {
  border-color: rgba(255, 218, 118, 0.72);
  background: rgba(34, 24, 8, 0.62);
  color: #ffe699;
}

/* 吉祥物背后的精密星轨金属环，让角色融于包装主视觉 */
.pouch-halo-ring {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 74%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.12),
    0 0 0 5px rgba(255, 255, 255, 0.04);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 68%);
}

.pouch-footer {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: calc(var(--crimp-h) + 4.6%);
  display: flex;
  flex-direction: column;
  gap: calc(var(--pack-w) * 0.016);
  pointer-events: none;
}

.pouch-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: calc(var(--pack-w) * 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pack-foot {
  font: 700 calc(var(--pack-w) * 0.031) / 1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
}

.pack-micro-spec {
  font: 600 calc(var(--pack-w) * 0.023) / 1 system-ui, sans-serif;
  letter-spacing: 0.15em;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
}

/* 补充包背面中封鳍片与印刷信息 */
.back-fin {
  position: absolute;
  left: 44.5%;
  width: 11%;
  top: 0;
  bottom: 0;
  z-index: 2;
  background:
    repeating-linear-gradient(rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), rgba(255, 255, 255, 0.22) 45%, rgba(0, 0, 0, 0.28));
}

.back-print-box {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 22%;
  padding: 8% 6%;
  border-radius: calc(var(--pack-w) * 0.028);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 10, 24, 0.22);
  text-align: center;
}

.back-mark {
  display: block;
  font-size: calc(var(--pack-w) * 0.088);
  margin-bottom: calc(var(--pack-w) * 0.035);
}

.back-blurb {
  margin: 0 0 calc(var(--pack-w) * 0.04);
  font: 500 calc(var(--pack-w) * 0.038) / 1.55 system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.88);
}

.back-spec {
  display: block;
  font: 600 calc(var(--pack-w) * 0.022) / 1.2 system-ui, sans-serif;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.56);
}

.back-barcode {
  position: absolute;
  left: 28%;
  right: 28%;
  bottom: calc(var(--crimp-h) + 6%);
  height: 9.2%;
  padding: 5px 8px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      90deg,
      #101218 0 2px, transparent 2px 3px,
      #101218 3px 4px, transparent 4px 7px,
      #101218 7px 10px, transparent 10px 12px
    ) content-box,
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

/* ---------- 角色表情绑定层 ---------- */
.mascot-slot {
  position: absolute;
  left: 11%;
  width: 78%;
  top: 29.5%;
  aspect-ratio: 1;
  transition: scale 0.35s var(--spring-css);
}

.char-body,
.char-drop-shadow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.mascot-slot .char-body {
  filter: hue-rotate(calc(var(--hue-shift, 0) * 1deg));
}

.char-drop-shadow {
  translate: 0 4%;
  filter: brightness(0) blur(calc(var(--pack-w) * 0.026));
  opacity: 0.42;
}

.rig-eye {
  position: absolute;
  aspect-ratio: 1 / 1.18;
  transition: opacity 0.09s, scale 0.14s var(--ease-out);
}

.rig-pupil {
  display: block;
  width: 100%;
  height: 100%;
  transition: scale 0.2s var(--ease-out);
}

.rig-mouth {
  position: absolute;
  transition: opacity 0.08s, scale 0.2s var(--ease-out);
}

.rig-joy {
  position: absolute;
  inset: 0;
  opacity: 0;
  scale: 0.86;
  transition: opacity 0.1s, scale 0.32s var(--spring-css);
  pointer-events: none;
}

.card.revealed.hovered .rig-joy {
  opacity: 1;
  scale: 1;
}

.card.revealed.hovered .rig-eye,
.card.revealed.hovered .rig-mouth {
  opacity: 0;
  scale: 0.7;
}

.rig-ouch {
  position: absolute;
  inset: 0;
  opacity: 0;
  scale: 0.84;
  transition: opacity 0.08s, scale 0.24s var(--spring-css);
  pointer-events: none;
}

.rig-sweat {
  position: absolute;
  opacity: 0;
  scale: 0.7;
  translate: 0 -42%;
  transition: opacity 0.18s, scale 0.3s var(--spring-css), translate 0.48s var(--ease-out);
  pointer-events: none;
}

.pack.tearing .mascot-slot {
  scale: 1.06 0.92;
  animation: wince-shake 90ms steps(2) infinite;
}

.pack.tearing .rig-eye,
.pack.tearing .rig-mouth {
  opacity: 0;
  scale: 1 0.1;
}

.pack.tearing .rig-ouch {
  opacity: 1;
  scale: 1;
}

.pack.wincing .rig-sweat {
  opacity: 1;
  scale: 1;
  translate: 0 0;
}

.pack.tugging .mascot-slot {
  scale: 0.95 1.07;
}

@keyframes wince-shake {
  50% {
    translate: 1.2px -0.8px;
  }
}

/* ---------- 12 段卷曲封条与金属撕裂断茬 ---------- */
.tear-flap {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  visibility: hidden;
}

.tear-flap.visible {
  visibility: visible;
}

.strip-segment {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: 0 0;
}

.strip-segment .front {
  transform: translateZ(0.45px);
}

.pouch-face.foil-lining {
  transform: rotateY(180deg) translateZ(0.45px);
  background: linear-gradient(
    97deg,
    #dde4f0,
    #ffffff 13%,
    #c3cde0 27%,
    #ffffff 45%,
    #d5deed 59%,
    #ffffff 77%,
    #c9d4e6
  );
}

.pouch-face.foil-lining::before,
.pouch-face.foil-lining::after {
  display: none;
}

.curl-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #080a16;
  opacity: 0;
}

.lip-shadow {
  position: absolute;
  inset: 0;
  z-index: 2;
  filter: drop-shadow(0 1.5px 1.4px rgba(0, 0, 0, 0.48));
}

.foil-lip {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: polygon(0 0);
  background: linear-gradient(
    100deg,
    #f3f6fb,
    #ffffff 14%,
    #b8c2d6 28%,
    #ffffff 43%,
    #c5cfe2 58%,
    #fcfdff 73%,
    #b2bdd1 87%,
    #eef1f7
  );
}

.grab-zone {
  position: absolute;
  inset: -24px -16px -8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  appearance: none;
  cursor: grab;
  touch-action: none;
  transform: translateZ(calc(var(--pack-depth) / 2 + 1px));
  -webkit-tap-highlight-color: transparent;
}

.grab-zone:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 8px;
}

.pack.tearing .grab-zone,
.pack.tugging .grab-zone {
  cursor: grabbing;
}

/* ---------- 双面 3D 典藏卡牌（精密星轨卡背 + 分区全息金属卡框） ---------- */
.card {
  width: var(--card-w);
  height: var(--card-h);
  margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  --px: 50;
  --py: 50;
  --hyp: 0;
  --aura-color: transparent;
}

.card:focus {
  outline: none;
}

.card:focus-visible .card-face,
.card:focus-visible .card-back {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.card-face,
.card-back,
.card-edge {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--card-w) * 0.075);
}

.card-edge {
  background: var(--card-edge-color, #9b9589);
  pointer-events: none;
}

.card-edge:nth-child(1) {
  transform: translateZ(-1.5px);
}
.card-edge:nth-child(2) {
  transform: translateZ(-3px);
}
.card-edge:nth-child(3) {
  transform: translateZ(-4.5px);
  box-shadow: 0 28px 46px -14px rgba(0, 0, 0, 0.68);
}

/* 精密星盘玑镂压纹卡背（Guilloché Collector Back） */
.card-back {
  transform: rotateY(180deg) translateZ(5.2px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  container-type: inline-size;
  color: #e4d3a8;
  background:
    radial-gradient(circle at 50% 47%, rgba(124, 152, 255, 0.2), transparent 58%),
    repeating-radial-gradient(circle at 50% 47%, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 9px),
    linear-gradient(155deg, #171c34 0%, #0b0e1d 52%, #14172b 100%);
  border: 1.5px solid rgba(228, 211, 168, 0.28);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.03),
    0 24px 42px -14px rgba(0, 0, 0, 0.65);
  transition: box-shadow 0.28s var(--ease-out), border-color 0.28s var(--ease-out);
}

.card-back-top,
.card-back-sub {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font: 700 3.1cqw / 1 system-ui, sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(236, 222, 186, 0.64);
}

.card-back-top {
  top: 11.5%;
}

.card-back-sub {
  bottom: 11.5%;
}

/* 悬念未翻开时的稀有度边缘光环 */
.card.settled.unrevealed:not(.rarity-r) .card-back {
  border-color: var(--aura-color);
  box-shadow:
    0 0 0 1px var(--aura-color),
    0 0 26px 3px var(--aura-color),
    0 26px 42px -14px rgba(0, 0, 0, 0.72);
}

.card.settled.unrevealed.rarity-pr .card-back {
  animation: secret-back-pulse 1.5s linear infinite;
}

@keyframes secret-back-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1.5px #ff66dc, 0 0 34px 6px rgba(255, 92, 214, 0.82), 0 26px 42px -14px rgba(0, 0, 0, 0.75);
  }
  50% {
    box-shadow: 0 0 0 1.5px #5ce6ff, 0 0 38px 8px rgba(92, 230, 255, 0.86), 0 26px 42px -14px rgba(0, 0, 0, 0.75);
  }
}

/* ---------- 卡面正面（rarity-preview 样式还原：满幅照片窗 + 逐卡配色框架 + 五档箔效果） ---------- */
.card-face {
  transform: translateZ(0.6px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  border-radius: calc(var(--card-w) * 0.075);
  background: var(--card-edge-color, #9b9589);
  color: var(--card-text-color, #503314);
  --card-secondary: var(--card-secondary-color, color-mix(in srgb, var(--card-text-color, #503314) 62%, transparent));
  --card-line: color-mix(in srgb, var(--card-secondary-color, var(--card-text-color, #503314)) 34%, transparent);
}

/* 印刷层：逐卡配色框架 + 内框细线 */
.card-print {
  position: absolute;
  inset: 0;
  padding: 6.1%;
  background: var(--card-frame-bg, linear-gradient(132deg, #fff5d5, #d5b56c 21%, #fff5cf 38%, #d2ad60 64%, #f7e8b8 85%, #c99e4e));
}

.card-print::after {
  content: "";
  position: absolute;
  inset: 2%;
  border: 1px solid rgba(255, 249, 223, 0.67);
  border-radius: 6cqw;
  pointer-events: none;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  font: 700 3.2cqw / 1.2 system-ui, sans-serif;
  letter-spacing: 0.2em;
  color: var(--card-secondary);
}

/* 满幅照片窗（照片卡）/ 立绘衬底窗（伙伴卡） */
.card-art-window {
  position: absolute;
  top: 11%;
  left: 5.4%;
  right: 5.4%;
  height: 55%;
  overflow: hidden;
  border-radius: 5cqw;
  background: var(--card-window-bg);
  box-shadow:
    inset 0 1px 3px rgba(61, 22, 59, 0.6),
    0 1px 0 rgba(255, 245, 217, 0.85);
}

.card-face .card-art-window {
  z-index: 3;   /* 彩色箔层（尤其 UR 棱镜 color-dodge）只染卡框，立绘/照片窗一律抬升到箔层之上 */
}

.card-full-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.window-label {
  position: absolute;
  bottom: 5%;
  left: 6%;
  color: #ffefca;
  font: 600 2.6cqw / 1 system-ui, sans-serif;
  letter-spacing: 0.27em;
}

.art-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 70% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.34) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 22%, rgba(0, 0, 0, 0.24) 100%);
  pointer-events: none;
}

/* 铭牌区：罗马字 + 卡名 + 稀有度徽章 */
.card-identity {
  position: absolute;
  top: 71%;
  left: 7%;
  right: 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
}

.card-roman {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 650 2.5cqw / 1.2 system-ui, sans-serif;
  letter-spacing: 0.2em;
  color: var(--card-secondary);
  margin-bottom: 1.5cqw;
}

.card-name {
  margin: 0;
  font-size: 9.5cqw;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--card-text-color, #503314);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-type {
  flex-shrink: 0;
  padding: 1.8cqw 2.6cqw;
  border: 1px solid var(--card-line);
  border-radius: 99px;
  color: var(--card-secondary);
  font: 650 3.2cqw / 1 system-ui, sans-serif;
  letter-spacing: 0.08em;
}

.card-flavour {
  position: absolute;
  top: 83%;
  left: 7%;
  right: 7%;
  margin: 0;
  font-size: 3.6cqw;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--card-secondary);
}

.card-bottom-row {
  position: absolute;
  bottom: 5.5%;
  left: 7%;
  right: 7%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--card-line);
  padding-top: 3cqw;
  font: 550 3.4cqw / 1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--card-secondary);
}

.card-bottom-row .card-rarity {
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  font-weight: 750;
  color: var(--card-text-color, #503314);
}

.rarity-gems {
  color: color-mix(in srgb, var(--card-text-color, #503314) 70%, #d99b26);
}

/* 首次解锁 NEW 角标（异画胶囊已并入卡顶编号位，不再单独输出） */
.new-badge {
  position: absolute;
  left: 8.4%;
  top: 6.8%;
  z-index: 5;
  padding: 1.3cqw 2.6cqw;
  border-radius: 99px;
  background: linear-gradient(135deg, #ff3d6e, #ff8a3d);
  color: #ffffff;
  font: 800 3.4cqw / 1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  box-shadow: 0 3px 10px rgba(255, 61, 110, 0.55);
}

/* 图鉴弹窗（stage 外）同样禁止文本选中与图片拖拽 */
.binder-sheet {
  user-select: none;
  -webkit-user-select: none;
}

/* 角色立绘在正面朝前且落定后沿 Z 轴浮出卡面；容器为全宽横带，
   立绘按原始比例 contain + 底部对齐（竖版猴子不拉伸变形，脚踩铭牌上沿） */
.char-pop {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 8%;
  height: 75%;
  transform: translateZ(1px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  opacity: 0;
  transition: transform 0.65s var(--spring-css), opacity 0.14s;
  pointer-events: none;
}

.card.front-visible .char-pop {
  opacity: 1;
}

.card.settled.front-visible .char-pop {
  transform: translateZ(calc(var(--card-w) * 0.14));
}

.char-pop .char-body {
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.38));
}

/* ---------- 五档箔效果（rarity-preview 还原） ---------- */
/* 眩光 + 清漆为全档基础层（彩虹 holo 层新卡面不再使用） */
.foil-holo,
.foil-glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
}

.foil-holo {
  display: none;
}

.foil-glare {
  background: radial-gradient(
    farthest-corner circle at calc(var(--px) * 1%) calc(var(--py) * 1%),
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.12) 38%,
    rgba(0, 0, 0, 0.3)
  );
  mix-blend-mode: overlay;
  opacity: calc(0.25 + var(--hyp) * 0.55);
}

/* 清漆：整体厚亮膜，双橱窗反光随倾斜滑动，顶边聚亮 */
.foil-clearcoat {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 0 2px 1.5px rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(0, 0, 0, 0.18);
  background:
    radial-gradient(
      42% 26% at calc(var(--px) * 1%) calc(var(--py) * 1%),
      rgba(255, 255, 255, calc(0.1 + var(--hyp) * 0.5)),
      transparent
    ),
    linear-gradient(rgba(255, 255, 255, 0.24), transparent 16%);
}

.foil-clearcoat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  mask: linear-gradient(#000 30%, transparent 88%);
  background: linear-gradient(
      112deg,
      transparent 44%,
      rgba(255, 255, 255, 0.4) 44.4%,
      rgba(255, 255, 255, 0.13) 52%,
      transparent 52.4%,
      transparent 54%,
      rgba(255, 255, 255, 0.22) 54.3%,
      rgba(255, 255, 255, 0.05) 56.4%,
      transparent 56.7%
    )
    calc((100 - var(--px)) * 1%) 0 / 220% 100%;
}

/* R · 哑光：弱眩光 + 稍强清漆 */
.card.rarity-r .foil-glare {
  opacity: calc(0.14 + var(--hyp) * 0.34);
}

.card.rarity-r .foil-clearcoat {
  opacity: 0.76;
}

/* SR · 轻高光：比 R 略亮一档 */
.card.rarity-sr .foil-glare {
  opacity: calc(0.18 + var(--hyp) * 0.4);
}

/* SSR · 拉丝金属箔 + 各向异性高光 + 慢速低对比流光边 */
.card.rarity-ssr .foil-metal {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: overlay;
  background:
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 3px, rgba(30, 34, 40, 0.12) 3px 4px, transparent 4px 7px),
    linear-gradient(115deg, rgba(88, 100, 116, 0.6) 0%, rgba(232, 238, 246, 0.85) calc(var(--px) * 1%), rgba(148, 158, 172, 0.66) calc((100 - var(--py)) * 1%), rgba(60, 72, 88, 0.66) 100%);
}

.card.rarity-ssr .border-shine {
  position: absolute;
  inset: -1px;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background: conic-gradient(
    from var(--shine-angle, 0deg),
    transparent 0 68%,
    rgba(224, 238, 255, 0.5) 80%,
    rgba(255, 255, 255, 0.92) 85%,
    rgba(224, 238, 255, 0.5) 90%,
    transparent 100%
  );
  animation: shine-travel 9s linear infinite;
}

@property --shine-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes shine-travel {
  to {
    --shine-angle: 360deg;
  }
}

/* SSSR · 熔金箔 + 硬镜面扫光 */
.card.rarity-sssr .foil-gold {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.5;
  background:
    repeating-conic-gradient(
      from calc(var(--px) * 1deg) at 50% 40%,
      transparent 0 4deg,
      rgba(255, 214, 120, 0.45) 5deg 6deg,
      transparent 7deg 12deg
    ),
    radial-gradient(
      90% 70% at calc(var(--px) * 1%) calc(var(--py) * 1%),
      rgba(255, 240, 190, 0.55),
      rgba(255, 180, 60, 0.22) 45%,
      rgba(140, 70, 12, 0.28)
    );
}

.card.rarity-sssr .hard-sweep {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: overlay;
  background: linear-gradient(
      105deg,
      transparent 42%,
      rgba(255, 248, 210, 0.65) 49%,
      rgba(255, 255, 255, 0.85) 50%,
      rgba(255, 248, 210, 0.65) 51%,
      transparent 58%
    )
    calc((100 - var(--px)) * 1%) 0 / 220% 100% no-repeat;
}

/* UR · 锥形棱镜切面 + 双层星盘旋转边框 + 紫金光晕 */
.card.rarity-ur .foil-prism {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  mix-blend-mode: color-dodge;
  opacity: calc(0.26 + var(--hyp) * 0.4);
  filter: brightness(0.85) contrast(1.4) saturate(1.55);
  background:
    repeating-conic-gradient(
      from calc(var(--px) * 1deg) at calc(var(--px) * 1%) calc(var(--py) * 1%),
      rgba(255, 90, 160, 0.3) 0 12deg,
      rgba(255, 210, 90, 0.24) 12deg 24deg,
      rgba(110, 255, 185, 0.26) 24deg 36deg,
      rgba(85, 195, 255, 0.28) 36deg 48deg,
      rgba(170, 120, 255, 0.3) 48deg 60deg
    ),
    repeating-conic-gradient(
      from calc(var(--px) * 1deg + var(--soul-angle, 0deg)) at calc(var(--px) * 1%) calc(var(--py) * 1%),
      rgba(255, 255, 255, 0.16) 0 3deg,
      transparent 3deg 15deg
    ),
    radial-gradient(
      60% 50% at calc(var(--px) * 1%) calc(var(--py) * 1%),
      rgba(255, 255, 255, 0.55),
      transparent 70%
    );
}

@property --soul-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --astro-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --astro-angle-rev {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.card.rarity-ur .astro {
  position: absolute;
  inset: -2px;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  padding: 2.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background: conic-gradient(from var(--astro-angle, 0deg), #9be8ff, #c9a6ff, #ffd76a, #7fe3d2, #9be8ff);
  animation: astro-spin 14s linear infinite;
  opacity: 0.92;
  box-shadow: 0 0 18px rgba(155, 232, 255, 0.4);
}

@keyframes astro-spin {
  to {
    --astro-angle: 360deg;
  }
}

.card.rarity-ur .astro::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background: repeating-conic-gradient(
    from var(--astro-angle-rev, 0deg),
    rgba(255, 255, 255, 0.75) 0 1deg,
    transparent 1deg 9deg
  );
  animation: astro-spin-rev 22s linear infinite;
}

@keyframes astro-spin-rev {
  to {
    --astro-angle-rev: -360deg;
  }
}

.card.rarity-ur {
  box-shadow: 0 0 34px rgba(143, 124, 214, 0.35);
}

/* 异画变体：棱镜星尘清漆增亮 */
.card.variant-prism .foil-clearcoat {
  opacity: 1;
}

/* ---------- 纸屑画布、手势轻提示与底部一体化精密控制台 ---------- */
.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bottom-chrome {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 18px));
  z-index: 25;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}

/* 纯排版引导轻语（去除伪按钮胶囊外壳） */
.gesture-hint {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chrome-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  transition: opacity 0.28s var(--ease-out), translate 0.28s var(--ease-out);
}

html[data-studio-light="day"] .gesture-hint {
  text-shadow: none;
}

.gesture-hint::before,
.gesture-hint::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.38;
}

.gesture-hint.hidden {
  opacity: 0;
  translate: 0 6px;
}

/* 一体化精密底座控制台 */
.console-dock {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px;
  border-radius: 20px;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--chrome-shadow);
  transition: background-color 0.28s var(--ease-out), border-color 0.28s var(--ease-out);
}

/* 坞顶一线流光 */
.console-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--dock-shine) 30%,
      var(--dock-shine-2) 66%,
      transparent 100%) top / 100% 1px no-repeat;
  opacity: 0.7;
}

/* hidden 永远优先 */
.console-dock [hidden] {
  display: none !important;
}

/* 分隔线：上下渐隐、中心高亮、带柔光（区域间视觉更明确） */
.console-sep {
  flex: 0 0 auto;
  align-self: center;
  width: 2px;
  height: 38px;
  margin: 0 14px;
  border-radius: 99px;
  background: linear-gradient(180deg,
      transparent 0%,
      var(--sep-line) 14%,
      var(--sep-line-core) 50%,
      var(--sep-line) 86%,
      transparent 100%);
  box-shadow: 0 0 10px var(--sep-glow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* 相邻条目隐藏时，前置分隔线一并隐藏 */
.console-sep:has(+ [hidden]) {
  display: none;
}

.console-item {
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--chrome-ink);
  text-align: left;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.28s var(--ease-out), color 0.25s var(--ease-out);
}

button.console-item {
  cursor: pointer;
}

button.console-item:active {
  scale: 0.985;
}

button.console-item:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.console-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.console-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--chrome-muted);
}

.console-val {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* 图鉴触发区：名称居左，数量+进度条上下堆叠紧随其后（一个整体） */
.binder-trigger {
  gap: 10px;
  padding: 8px 14px;
}
.binder-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--chrome-ink);
  white-space: nowrap;
}
.binder-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.binder-count {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--binder-count-ink, var(--smkt-green-luminous));
  text-shadow: 0 0 10px var(--binder-count-glow, rgba(94, 231, 170, 0.35));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.binder-bar {
  display: block;
  width: 78px;
  height: 4px;
  border-radius: 99px;
  background: var(--bar-bg, var(--chrome-sep));
  overflow: hidden;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.binder-bar > i {
  display: block;
  height: 100%;
  width: var(--binder-pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #4fd0ff, #8b8bff);
  box-shadow: 0 0 8px rgba(94, 231, 255, 0.8);
  transition: width 0.65s cubic-bezier(0.3, 1.2, 0.4, 1);
}
html[data-studio-light="day"] .binder-bar > i {
  background: linear-gradient(90deg, #1a9e6e, #3b82f6);
  box-shadow: none;
}

/* 3 格保底刻度指示灯 */
.pity-pips {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
}

.pity-pip {
  width: 5px;
  height: 14px;
  border-radius: 99px;
  background: var(--chrome-sep);
  transition: background-color 0.25s, box-shadow 0.25s;
}

.pity-pip.active {
  background: var(--smkt-green-luminous);
  box-shadow: 0 0 8px rgba(50, 173, 98, 0.55);
}

html[data-studio-light="day"] .pity-pip.active {
  background: var(--smkt-green);
  box-shadow: none;
}

.pity-meter.pity-ready .pity-pip.active {
  background: #f5c451;
  box-shadow: 0 0 10px rgba(245, 196, 81, 0.8);
}

.pity-meter.pity-ready .console-val {
  color: #f5c451;
}

html[data-studio-light="day"] .pity-meter.pity-ready .console-val {
  color: #9e6500;
}

/* 中央情境主操作按钮组 */
.console-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}

.dock-btn {
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: scale 0.16s var(--ease-out), filter 0.18s, background-color 0.18s;
}

.dock-btn[hidden] {
  display: none;
}

.dock-btn.primary {
  background: var(--cta-primary-bg);
  color: var(--cta-primary-ink);
  border: 1px solid var(--cta-primary-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 6px 16px -6px rgba(16, 48, 28, 0.45);
}

.dock-btn.secondary {
  background: var(--cta-secondary-bg);
  color: var(--cta-secondary-ink);
  border: 1px solid var(--cta-secondary-border);
}

.dock-btn:active {
  scale: 0.95;
}

.dock-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* 欧皇全闪拨杆开关 */
.luck-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chrome-sep);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: background-color 0.22s, box-shadow 0.22s;
  flex-shrink: 0;
}

.luck-switch[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(58, 42, 16, 0.72), rgba(38, 26, 56, 0.78));
  border-color: rgba(245, 198, 84, 0.55);
  color: #ffe8a3;
}

.luck-switch[aria-pressed="true"] .console-kicker {
  color: rgba(255, 224, 148, 0.72);
}

.luck-switch[aria-pressed="true"] .luck-led {
  background: #ffd454;
  box-shadow: 0 0 10px 2px rgba(255, 212, 84, 0.85);
}

/* ---------- 12 卡黑金丝绒典藏册弹窗（深色默认 + 浅色主题变量） ---------- */
.binder-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.binder-modal[hidden] {
  display: none;
}

.binder-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ms-backdrop, rgba(6, 7, 12, 0.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- 关于本系统：独立页面 /about.html（样式内置于该页面），此处仅保留入口交互 ---------- */
/* 弹窗主题变量（图鉴/活动共用；--ms-* 深色默认，浅色由 [data-modal-theme="light"] 覆盖） */
.binder-sheet {
  --ms-bg: #0b0f0c;
  --ms-border: rgba(255, 255, 255, 0.12);
  --ms-line: rgba(255, 255, 255, 0.08);
  --ms-sub: rgba(235, 232, 224, 0.6);
  --ms-title: #faf7f0;
  --ms-text2: rgba(235, 230, 218, 0.68);
  --ms-text3: #9fb0d8;
  --ms-close-bg: rgba(255, 255, 255, 0.1);
  --ms-close-line: rgba(255, 255, 255, 0.22);
  --ms-close-text: #ffffff;
  --ms-close-hover-bg: rgba(255, 255, 255, 0.18);
  --ms-chip-bg: #11162a;
  --ms-chip-line: #2a3352;
  --ms-chip-text: #9fb0d8;
  --ms-chip-hover-text: #e8ecf8;
  --ms-chip-active-bg: #16203a;
  --ms-chip-active-text: #ffd454;
  --ms-chip-active-line: rgba(255, 212, 84, 0.4);
  --ms-accent: #f5ca69;
  --ms-accent-strong: #ffe3a1;
  --ms-accent-line: rgba(236, 198, 108, 0.4);
  --ms-accent-bg: rgba(236, 198, 108, 0.1);
  --ms-accent-hover-bg: rgba(236, 198, 108, 0.2);
  --ms-slot-bg: #141724;
  --ms-slot-line: rgba(255, 255, 255, 0.1);
  --ms-slot-locked-bg: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.03), transparent 70%),
    linear-gradient(160deg, #181b29, #10121c);
  --ms-slot-locked-line: rgba(255, 255, 255, 0.06);
  --ms-slot-locked-text: rgba(255, 255, 255, 0.36);
  --ms-plaque-locked-bg: rgba(255, 255, 255, 0.025);
  --ms-plaque-locked-line: rgba(255, 255, 255, 0.05);
  --ms-q: rgba(255, 255, 255, 0.14);
  --ms-card-bg: rgba(255, 255, 255, 0.045);
  --ms-card-line: rgba(255, 255, 255, 0.09);
  --ms-card-hover-bg: rgba(255, 255, 255, 0.08);
  --ms-card-hover-line: rgba(236, 198, 108, 0.35);
  --ms-icon-bg: rgba(236, 198, 108, 0.12);
  --ms-icon-line: rgba(236, 198, 108, 0.22);
  --ms-chip2-text: #f5ca69;
  --ms-chip2-bg: rgba(236, 198, 108, 0.14);
  --ms-name: #faf7f0;
  --ms-track: rgba(255, 255, 255, 0.1);
  --ms-prog: rgba(235, 232, 224, 0.55);
  --ms-locked-ink: rgba(235, 232, 224, 0.45);
  --ms-locked-line: rgba(255, 255, 255, 0.14);
  --ms-done-bg: rgba(64, 200, 130, 0.14);
  --ms-done-text: #5ce6a0;
  --ms-empty: rgba(235, 232, 224, 0.5);
  --ms-backdrop: rgba(6, 7, 12, 0.72);
  --ms-deco-op: 1;

  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(85vh, 780px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--ms-bg);
  border: 1px solid var(--ms-border);
  color: var(--ms-title);
  box-shadow:
    0 34px 72px -16px rgba(0, 0, 0, 0.84),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  overflow: hidden;
  animation: sheet-in 0.28s var(--ease-out);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 深色丝绒渐变装饰层（浅色主题淡出） */
.binder-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(26, 107, 58, 0.18), transparent 72%),
    radial-gradient(120% 46% at 50% 0%, rgba(212, 165, 74, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(16, 23, 19, 0.88) 0%, rgba(9, 13, 11, 0.92) 100%);
  opacity: var(--ms-deco-op, 1);
  transition: opacity 0.3s ease;
}

/* 弹窗内容置于装饰层之上 */
.binder-sheet > .binder-head,
.binder-sheet > .binder-chips,
.binder-sheet > .binder-grid,
.binder-sheet > .activity-list {
  position: relative;
  z-index: 1;
}

/* 浅色主题（跟随页面白昼展台）：外壳纯浅色，卡面本身不参与换肤 */
html[data-studio-light="day"] .binder-sheet {
  --ms-bg: #eef1f6;
  --ms-border: rgba(23, 27, 38, 0.1);
  --ms-line: rgba(23, 27, 38, 0.08);
  --ms-sub: rgba(40, 48, 66, 0.62);
  --ms-title: #171b26;
  --ms-text2: rgba(40, 48, 66, 0.72);
  --ms-text3: #5a6580;
  --ms-close-bg: rgba(23, 27, 38, 0.05);
  --ms-close-line: rgba(23, 27, 38, 0.16);
  --ms-close-text: #2a3145;
  --ms-close-hover-bg: rgba(23, 27, 38, 0.1);
  --ms-chip-bg: #e8ecf3;
  --ms-chip-line: rgba(23, 27, 38, 0.12);
  --ms-chip-text: #5a6580;
  --ms-chip-hover-text: #171b26;
  --ms-chip-active-bg: #fff3d9;
  --ms-chip-active-text: #b9822a;
  --ms-chip-active-line: rgba(212, 165, 74, 0.5);
  --ms-accent: #b9822a;
  --ms-accent-strong: #9a6c1e;
  --ms-accent-line: rgba(212, 165, 74, 0.5);
  --ms-accent-bg: rgba(212, 165, 74, 0.14);
  --ms-accent-hover-bg: rgba(212, 165, 74, 0.26);
  --ms-slot-bg: #e6e9f0;
  --ms-slot-line: rgba(23, 27, 38, 0.12);
  --ms-slot-locked-bg: radial-gradient(circle at 50% 42%, rgba(23, 27, 38, 0.02), transparent 70%),
    linear-gradient(160deg, #eceef4, #dfe3ec);
  --ms-slot-locked-line: rgba(23, 27, 38, 0.1);
  --ms-slot-locked-text: rgba(40, 48, 66, 0.42);
  --ms-plaque-locked-bg: rgba(23, 27, 38, 0.05);
  --ms-plaque-locked-line: rgba(23, 27, 38, 0.08);
  --ms-q: rgba(23, 27, 38, 0.2);
  --ms-card-bg: #ffffff;
  --ms-card-line: rgba(23, 27, 38, 0.08);
  --ms-card-hover-bg: #f6f8fc;
  --ms-card-hover-line: rgba(212, 165, 74, 0.45);
  --ms-icon-bg: rgba(212, 165, 74, 0.14);
  --ms-icon-line: rgba(212, 165, 74, 0.35);
  --ms-chip2-text: #b9822a;
  --ms-chip2-bg: rgba(212, 165, 74, 0.14);
  --ms-name: #171b26;
  --ms-track: rgba(23, 27, 38, 0.12);
  --ms-prog: rgba(40, 48, 66, 0.6);
  --ms-locked-ink: rgba(40, 48, 66, 0.5);
  --ms-locked-line: rgba(23, 27, 38, 0.16);
  --ms-done-bg: rgba(46, 157, 99, 0.12);
  --ms-done-text: #1e9d5f;
  --ms-empty: rgba(40, 48, 66, 0.55);
  --ms-backdrop: rgba(236, 240, 247, 0.68);
  --ms-deco-op: 0;
}

/* 主题相关元素的换肤过渡（后文有自定义 transition 的元素以自身为准） */
.binder-sheet .binder-sub,
.binder-sheet .binder-title,
.binder-sheet .binder-reset,
.binder-sheet .binder-sort,
.binder-sheet .binder-close,
.binder-sheet .binder-section-head,
.binder-sheet .binder-slot,
.binder-sheet .binder-q,
.binder-sheet .binder-backdrop,
.binder-sheet .act-icon,
.binder-sheet .act-name,
.binder-sheet .act-chip,
.binder-sheet .act-progress,
.binder-sheet .act-empty,
.binder-sheet .modal-theme-btn {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* ---------- 弹窗主题：跟随页面暗房聚光/白昼展台自动切换（无需弹窗内按钮） ---------- */

@keyframes sheet-in {
  from {
    opacity: 0;
    scale: 0.95;
    translate: 0 12px;
  }
  to {
    opacity: 1;
    scale: 1;
    translate: 0 0;
  }
}

@keyframes sheet-out {
  from {
    opacity: 1;
    scale: 1;
    translate: 0 0;
  }
  to {
    opacity: 0;
    scale: 0.96;
    translate: 0 14px;
  }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ---------- 弹窗进出场统一动画 ---------- */
/* 大弹窗（图鉴/活动/关于）：容器 opening/closing 类驱动 sheet 与遮罩联动 */
.binder-modal.modal-opening .binder-sheet {
  animation: sheet-in 0.34s var(--ease-out) both;
}
.binder-modal.modal-closing .binder-sheet {
  animation: sheet-out 0.26s ease both;
}
.binder-modal.modal-opening .binder-backdrop {
  animation: backdrop-in 0.3s ease both;
}
.binder-modal.modal-closing .binder-backdrop {
  animation: backdrop-out 0.26s ease both;
  pointer-events: none;
}

/* 浮层类（用户信息/抽卡菜单/更新提示条）：自身开合动画 */
.user-panel.modal-opening,
.draw-menu.modal-opening,
.update-toast.modal-opening {
  animation: sheet-in 0.32s var(--ease-out) both;
}
.user-panel.modal-closing,
.draw-menu.modal-closing,
.update-toast.modal-closing {
  animation: sheet-out 0.22s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .binder-modal.modal-opening .binder-sheet,
  .binder-modal.modal-closing .binder-sheet,
  .binder-modal.modal-opening .binder-backdrop,
  .binder-modal.modal-closing .binder-backdrop,
  .user-panel.modal-opening,
  .user-panel.modal-closing,
  .draw-menu.modal-opening,
  .draw-menu.modal-closing,
  .update-toast.modal-opening,
  .update-toast.modal-closing {
    animation: none;
  }
}

.binder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ms-line, rgba(255, 255, 255, 0.08));
}

.binder-sub {
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ms-sub, rgba(235, 232, 224, 0.6));
  font-variant-numeric: tabular-nums;
}

.binder-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ms-title, #faf7f0);
}

.binder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.binder-reset,
.binder-sort,
.binder-close {
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.3s ease;
}

.binder-reset {
  border: 1px solid var(--ms-close-line, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: var(--ms-text2, rgba(235, 230, 218, 0.68));
}

.binder-sort {
  border: 1px solid var(--ms-accent-line, rgba(236, 198, 108, 0.4));
  background: var(--ms-accent-bg, rgba(236, 198, 108, 0.1));
  color: var(--ms-accent, #f5ca69);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.binder-close {
  border: 1px solid var(--ms-close-line, rgba(255, 255, 255, 0.22));
  background: var(--ms-close-bg, rgba(255, 255, 255, 0.1));
  color: var(--ms-close-text, #ffffff);
}

.binder-grid {
  padding: 20px 24px 26px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  /* 弹窗内滚动条隐藏（与活动列表一致） */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.binder-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.binder-slot {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 14px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--ms-slot-line, rgba(255, 255, 255, 0.1));
  background: var(--ms-slot-bg, #141724);
  text-align: left;
}

.binder-slot.unlocked {
  background: var(--slot-bg);
  color: var(--slot-ink);
  border-color: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  box-shadow:
    0 12px 24px -12px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: translate 0.2s var(--ease-out), box-shadow 0.2s;
}

.binder-slot.unlocked:hover {
  translate: 0 -4px;
  box-shadow:
    0 18px 32px -10px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.binder-slot.locked {
  background: var(--ms-slot-locked-bg,
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.03), transparent 70%),
    linear-gradient(160deg, #181b29, #10121c));
  color: var(--ms-slot-locked-text, rgba(255, 255, 255, 0.36));
  border-color: var(--ms-slot-locked-line, rgba(255, 255, 255, 0.06));
}

.binder-art {
  position: relative;
  width: 100%;
  flex: 1;
  margin-bottom: 7px;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--slot-win, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.binder-slot.locked .binder-art {
  border-color: rgba(255, 255, 255, 0.05);
}

.binder-art img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.32));
}

.binder-slot.locked .binder-art img {
  filter: brightness(0) invert(1) opacity(0.11);
}

/* 满幅照片卡（full_art_image）：图鉴槽位照片直出 */
.binder-full-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.binder-count-pill {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(10, 12, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.binder-foil-pill {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 99px;
  background: linear-gradient(135deg, #ffd454, #ff85e0);
  color: #1a1224;
  font-size: 10px;
  font-weight: 800;
}

.binder-plaque {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--slot-plaque, rgba(16, 18, 28, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.binder-slot.locked .binder-plaque {
  background: var(--ms-plaque-locked-bg, rgba(255, 255, 255, 0.025));
  border-color: var(--ms-plaque-locked-line, rgba(255, 255, 255, 0.05));
}

.binder-meta-name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.15;
}

.binder-meta-sub {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.74;
  font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (pointer: fine) {
  .util-btn:hover,
  button.console-item:hover {
    background: var(--chrome-hover);
    border-color: var(--chrome-border);
    box-shadow: 0 12px 24px -18px var(--sep-glow), inset 0 1px 0 var(--chrome-specular);
  }
  .luck-switch[aria-pressed="true"]:hover {
    background: linear-gradient(135deg, rgba(72, 52, 20, 0.82), rgba(48, 34, 70, 0.86));
  }
  .dock-btn:hover {
    filter: brightness(1.06);
  }
  .binder-reset:hover {
    background: var(--ms-close-hover-bg, rgba(255, 255, 255, 0.06));
    color: var(--ms-title, #ffffff);
  }
  .binder-sort:hover {
    background: var(--ms-accent-hover-bg, rgba(236, 198, 108, 0.2));
    color: var(--ms-accent-strong, #ffe3a1);
  }
  .binder-close:hover {
    background: var(--ms-close-hover-bg, rgba(255, 255, 255, 0.18));
  }
}

@media (max-width: 720px) {
  .top-bar {
    left: 14px;
    right: 14px;
  }
  .brand-wordmark {
    height: 23px;
  }
  .util-btn.mode-btn #themeModeLabel {
    display: none;
  }
  .util-btn.mode-btn {
    width: 32px;
    padding: 0;
  }
  .console-dock {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 6px;
    border-radius: 16px;
    padding: 8px;
    gap: 4px 6px;
  }
  .console-sep {
    display: none;
  }
  .console-item {
    min-height: 36px;
    padding: 6px 10px;
    gap: 6px;
  }
  .binder-trigger {
    gap: 8px;
    padding: 6px 12px;
  }
  .binder-name {
    font-size: 12.5px;
    letter-spacing: 0.08em;
  }
  .binder-bar {
    width: 60px;
  }
  .activity-trigger {
    padding: 7px 13px;
  }
  .draw-main {
    padding: 7px 11px 7px 13px;
    font-size: 12.5px;
  }
  .draw-main-cost {
    min-width: 54px;
    font-size: 12px;
  }
  .draw-main-old {
    font-size: 10.5px;
  }
  .draw-toggle {
    width: 30px;
  }
  .draw-menu {
    width: 232px;
  }
  .dock-btn {
    height: 34px;
    padding: 0 14px;
    font-size: 12.5px;
  }
  .gesture-hint {
    font-size: 11.5px;
  }
  .gesture-hint::before,
  .gesture-hint::after {
    width: 10px;
  }
  .binder-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 14px;
    gap: 10px;
  }
}

@media (pointer: coarse) {
  .card-edge:nth-child(-n + 2) {
    display: none;
  }
  .mascot-slot .char-body {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pack.tearing .mascot-slot,
  .pack-aura.god-mode,
  .card.settled.unrevealed.rarity-secret .card-back,
  .stage.impact-ultra,
  .stage.impact-secret,
  .activity-badge,
  .draw-menu,
  .draw-pill::after,
  .draw-toggle svg {
    animation: none;
    transition-duration: 0.01ms;
  }
}

/* =====================================================================
   P0 服务端化新增：余额徽章 / 抽卡装填坞 / 登录墙
   （SYSTEM_DESIGN.md v3 §7.2；仅新增 chrome 区样式，不动舞台演出样式）
   ===================================================================== */

.balance-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--chrome-muted);
  cursor: default;
}
.balance-badge .console-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--chrome-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* 抽卡数量分段选择器 */
/* 顶栏 TJISE 文字字标（替代 SimpleMkt 版权图） */
.brand-stage-crest { cursor: default; display: inline-flex; flex-direction: column; line-height: 1.15; }
.brand-stage-crest .crest-text {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #eef2ee;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.brand-stage-crest .crest-sub {
  font-size: 8.5px;
  letter-spacing: 0.32em;
  color: rgba(226, 232, 228, 0.55);
  white-space: nowrap;
}
html[data-studio-light="day"] .brand-stage-crest .crest-text { color: #14171d; text-shadow: none; }
html[data-studio-light="day"] .brand-stage-crest .crest-sub { color: rgba(20, 23, 29, 0.5); }

/* 抽卡坞（设计稿复刻）：金色胶囊 = 主按钮 + 内分隔线 + ▾ 切换，向上弹出批次菜单 */
.draw-dock {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
}
.draw-pill {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 13px;
  border: 1px solid var(--draw-bd);
  background: var(--draw-bg);
  box-shadow: var(--draw-shadow);
  overflow: hidden;
  transition: box-shadow 0.28s ease, border-color 0.28s ease, background 0.3s ease;
}
.draw-pill:hover {
  border-color: var(--draw-bd-hover);
  box-shadow: var(--draw-shadow-hover);
}
/* 掠光扫过 */
.draw-pill::after {
  content: "";
  position: absolute;
  inset: -40% -10%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 42%, var(--draw-shine) 50%, transparent 58%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
}
.draw-pill:hover::after { transform: translateX(130%); }

.draw-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px 8px 15px;
  border: 0;
  background: transparent;
  color: var(--draw-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.draw-main:hover:not(:disabled) { background: var(--draw-hover-bg); }
.draw-main:disabled { opacity: 0.45; cursor: not-allowed; }
.draw-main:focus-visible { outline: 2px solid var(--coin, #ffd071); outline-offset: -3px; }

/* 名称按「十连抽」三字预留，切换批次不跳动 */
.draw-main-name {
  flex: 0 0 auto;
  min-width: 3.15em;
  text-align: left;
  line-height: 1;
}

/* 价格固定宽度右对齐 */
.draw-main-cost {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 58px;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--coin, #ffd071);
  line-height: 1;
}
.draw-main-cost b { font-weight: 800; }
.draw-main-old {
  font-size: 11px;
  font-weight: 600;
  color: var(--draw-ink);
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.coin { vertical-align: -2px; flex: 0 0 auto; }

.draw-split {
  width: 1px;
  margin: 7px 0;
  background: var(--draw-split);
  transition: background 0.3s ease;
}

.draw-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  border: 0;
  background: transparent;
  color: var(--draw-ink);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.draw-toggle:hover { background: var(--draw-hover-bg); }
.draw-toggle:focus-visible { outline: 2px solid var(--coin, #ffd071); outline-offset: -3px; }
.draw-toggle svg { transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.5, 1); }
.draw-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* 批次菜单：向上弹出 + 箭头 */
.draw-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 70;
  width: 248px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--menu-border);
  background: var(--menu-bg);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: var(--menu-shadow);
  animation: draw-menu-in 0.22s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.draw-menu[hidden] { display: none; }
@keyframes draw-menu-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.draw-menu::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -6px;
  width: 11px;
  height: 11px;
  background: var(--menu-solid);
  border-right: 1px solid var(--menu-border);
  border-bottom: 1px solid var(--menu-border);
  border-radius: 0 0 3px 0;
  transform: rotate(45deg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.draw-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--chrome-ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.draw-option + .draw-option { margin-top: 2px; }
.draw-option:hover { background: var(--opt-hover); }
.draw-option[aria-selected="true"] { background: var(--opt-active); }
.draw-option:focus-visible { outline: 2px solid var(--coin, #ffd071); outline-offset: -2px; }
.opt-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.opt-name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--chrome-ink);
}
.draw-option[aria-selected="true"] .opt-name::after {
  content: "✓";
  margin-left: 6px;
  font-size: 11px;
  color: var(--coin, #ffd071);
}
.opt-desc {
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--chrome-muted);
}
.opt-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--coin, #ffd071);
}
.opt-old {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--chrome-muted);
  text-decoration: line-through;
}

/* 竖屏轮播：邻卡面内暗化层（opacity 加在叶子上，不破坏 preserve-3d） */
.face-dim {
  position: absolute;
  inset: 0;
  background: #04060a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}
.card.dimmed .face-dim {
  opacity: 0.55;
}

/* 竖屏轮播进度圆点 */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 0 3px;
}
.carousel-dots[hidden] {
  display: none;
}
.carousel-dots .c-count {
  font-size: 11px;
  color: var(--chrome-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  margin-right: 4px;
}
.carousel-dots .c-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--chrome-border);
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}
.carousel-dots .c-dot.active {
  background: var(--smkt-green, #32ad62);
  border-color: transparent;
  transform: scale(1.3);
}
.carousel-dots .c-dot:focus-visible {
  outline: 2px solid var(--focus-ring, #7ba2ff);
  outline-offset: 1px;
}

.draw-dock[hidden] {
  display: none;
}

.login-wall {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 90% at 50% 8%, rgba(24, 32, 28, 0.86), rgba(6, 9, 8, 0.96));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.login-wall[hidden] {
  display: none;
}
.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 38px 44px;
  border-radius: 22px;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  text-align: center;
  max-width: 92vw;
}
.login-kicker {
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--chrome-muted);
  text-transform: uppercase;
  margin: 0;
}
.login-title {
  font-size: 24px;
  color: var(--chrome-ink);
  letter-spacing: 0.06em;
  margin: 0;
}
.login-desc {
  font-size: 12.5px;
  color: var(--chrome-muted);
  margin: 0;
}
.login-btn {
  margin-top: 6px;
  padding: 12px 34px;
  border-radius: 999px;
  border: 1px solid var(--cta-primary-border);
  background: var(--cta-primary-bg);
  color: var(--cta-primary-ink);
  font-size: 14px;
  letter-spacing: 0.1em;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.login-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.login-btn:focus-visible {
  outline: 2px solid var(--focus-ring, #7ba2ff);
  outline-offset: 2px;
}
.login-btn.dev {
  background: var(--cta-secondary-bg);
  color: var(--cta-secondary-ink);
  border-color: var(--cta-secondary-border);
}
.login-error {
  font-size: 12px;
  color: #ff8fa3;
  margin: 0;
  max-width: 40ch;
}

@media (max-width: 720px) {
  .balance-badge .console-val {
    font-size: 12.5px;
  }
}

/* =====================================================================
   P0 增补：用户徽章 / 用户详情面板 / 抽卡选择菜单
   ===================================================================== */

.user-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--chrome-muted);
  cursor: pointer;
  font-family: inherit;
}
.user-badge[hidden] {
  display: none;
}
.user-badge .console-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  align-items: flex-start;
}
.user-badge .console-kicker {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--chrome-ink);
}
.user-badge .console-val {
  font-size: 11px;
  color: var(--chrome-muted);
  font-variant-numeric: tabular-nums;
}
.user-badge:focus-visible {
  outline: 2px solid var(--focus-ring, #7ba2ff);
  outline-offset: 2px;
}

.user-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 54px);
  right: 14px;
  z-index: 90;
  width: 268px;
  padding: 18px 16px 14px;
  border-radius: 18px;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.user-panel[hidden] {
  display: none;
}
.user-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--chrome-sep);
}
.user-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #32ad62, #1a6b3a);
  color: #ffffff;
  font: 800 17px / 1 var(--font-ui, system-ui, sans-serif);
  box-shadow: 0 4px 12px rgba(50, 173, 98, 0.35);
}
.user-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.user-hero-name {
  font: 700 15px / 1.2 var(--font-ui, system-ui, sans-serif);
  color: var(--chrome-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-hero-sub {
  font: 500 11px / 1 var(--font-ui, system-ui, sans-serif);
  color: var(--chrome-muted);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.user-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.user-row dt {
  color: var(--chrome-muted);
  white-space: nowrap;
}
.user-row dd {
  margin: 0;
  color: var(--chrome-ink);
  text-align: right;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.user-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.user-about-btn {
  width: 100%;
  padding: 9px 0;
  border-radius: 12px;
  border: 1px solid var(--chrome-border);
  background: var(--chrome-hover);
  color: var(--chrome-ink);
  font: 600 12.5px / 1 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: background 0.15s ease;
}
.user-about-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.user-about-btn:focus-visible {
  outline: 2px solid var(--focus-ring, #7ba2ff);
  outline-offset: 2px;
}
.logout-btn {
  width: 100%;
  margin-top: 0;
  padding: 9px 0;
  font-size: 12.5px;
}

.draw-caret {
  width: 30px;
  min-height: 46px;
  padding: 0 6px;
  border-radius: 12px;
  border: 1px solid var(--chrome-border);
  background: var(--cta-secondary-bg);
  color: var(--cta-secondary-ink);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: filter 0.15s ease;
}
.draw-caret:hover {
  filter: brightness(1.25);
}
.draw-caret[aria-expanded='true'] {
  color: #ffd454;
  border-color: rgba(255, 220, 120, 0.4);
}

.draw-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.draw-menu[hidden] {
  display: none;
}
.draw-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--chrome-ink);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.draw-menu-item:hover {
  background: var(--chrome-hover);
}
.draw-menu-item.active {
  border-color: rgba(255, 220, 120, 0.35);
  background: rgba(255, 220, 120, 0.08);
}
.draw-menu-item b {
  font-weight: 600;
}
.draw-menu-item i {
  font-style: normal;
  font-size: 11px;
  color: var(--chrome-muted);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   P2：活动中心 + 图鉴升级（筛选 chips / 分档分区 / 未收录剪影）
   ===================================================================== */

.activity-trigger { cursor: pointer; position: relative; padding: 9px 16px; }
.activity-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--chrome-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: color 0.25s ease;
}
button.activity-trigger:hover .activity-label { color: var(--chrome-ink); }
/* 可领取红点数字（右上角）：渐变+描边+弹出+呼吸 */
.activity-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #ff7a9c, #ff3d6e);
  box-shadow: 0 0 0 2px var(--badge-ring, #10141f), 0 2px 8px rgba(255, 61, 110, 0.55);
  animation: badge-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both,
    badge-pulse 2.4s ease-in-out infinite;
}
@keyframes badge-pop {
  from { transform: scale(0.2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--badge-ring, #10141f), 0 2px 8px rgba(255, 61, 110, 0.55); }
  50% { box-shadow: 0 0 0 4px rgba(255, 61, 110, 0.12), 0 2px 14px rgba(255, 61, 110, 0.85); }
}
.activity-badge[hidden] { display: none; }

/* ---------- 活动中心弹窗（卡片式 · 复用弹窗主题变量） ---------- */
.activity-sheet {
  width: min(440px, 100%);
  /* 固定高度：头部 + 恰好 3 张任务卡（约 348px），任务多时列表区内滚动 */
  height: min(348px, calc(100dvh - 32px));
  border-radius: 20px;
}
.activity-sheet .binder-head { padding: 18px 18px 14px 20px; }

.activity-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.activity-list::-webkit-scrollbar { width: 0; height: 0; display: none; }

@keyframes act-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.act-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 13px;
  border-radius: 14px;
  background: var(--ms-card-bg, rgba(255, 255, 255, 0.045));
  border: 1px solid var(--ms-card-line, rgba(255, 255, 255, 0.09));
  transition: background-color 0.3s ease, border-color 0.3s ease;
  animation: act-card-in 0.36s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.act-card:hover {
  background: var(--ms-card-hover-bg, rgba(255, 255, 255, 0.08));
  border-color: var(--ms-card-hover-line, rgba(236, 198, 108, 0.35));
}

.act-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 13px;
  background: var(--ms-icon-bg, rgba(236, 198, 108, 0.12));
  border: 1px solid var(--ms-icon-line, rgba(236, 198, 108, 0.22));
  color: var(--ms-accent, #f5ca69);
}

.act-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.act-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.act-name {
  margin: 0;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ms-name, #faf7f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.act-chip {
  flex: none;
  max-width: 100%;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 999px;
  background: var(--ms-chip2-bg, rgba(236, 198, 108, 0.14));
  color: var(--ms-chip2-text, #f5ca69);
}
.act-bar-row { display: flex; align-items: center; gap: 10px; }
.act-bar {
  position: relative;
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: var(--ms-track, rgba(255, 255, 255, 0.1));
  overflow: hidden;
}
.act-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8873b, #ffd977);
  box-shadow: 0 0 8px rgba(255, 212, 116, 0.45);
  transition: width 0.45s var(--ease-out);
}
.act-progress {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ms-prog, rgba(235, 232, 224, 0.55));
}

.act-claim {
  flex: none;
  width: 76px;
  padding: 8px 0;
  border: 0;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #241a04;
  cursor: pointer;
  background: linear-gradient(135deg, #d4a54a, #ffd977);
  box-shadow: 0 8px 20px -10px rgba(255, 198, 76, 0.65), inset 0 1px 0 rgba(255, 244, 214, 0.55);
  transition: transform 0.16s var(--ease-out), filter 0.2s, box-shadow 0.2s,
    background-color 0.25s, color 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.act-claim:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.07); }
.act-claim:not(:disabled):active { transform: translateY(0) scale(0.96); }
.act-claim:focus-visible { outline: 2px solid #f5ca69; outline-offset: 2px; }

/* 可领取：金色呼吸光效 */
.act-card[data-state="claimable"] {
  border-color: rgba(236, 198, 108, 0.45);
  animation:
    act-card-in 0.36s var(--ease-out) both,
    act-glow 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 40ms), calc(var(--i, 0) * 40ms + 0.45s);
}
@keyframes act-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 198, 76, 0); }
  50% { box-shadow: 0 0 18px 0 rgba(255, 198, 76, 0.22); }
}

/* 已领取 */
.act-card[data-state="claimed"] { opacity: 0.62; }
.act-card[data-state="claimed"] .act-bar i {
  background: linear-gradient(90deg, #2e9d63, #7fe3ab);
  box-shadow: none;
}
.act-card[data-state="claimed"] .act-claim {
  background: var(--ms-done-bg, rgba(64, 200, 130, 0.14));
  color: var(--ms-done-text, #5ce6a0);
  box-shadow: none;
  cursor: default;
}

/* 未达成 */
.act-card[data-state="locked"] .act-claim {
  background: transparent;
  color: var(--ms-locked-ink, rgba(235, 232, 224, 0.45));
  border: 1px solid var(--ms-locked-line, rgba(255, 255, 255, 0.14));
  box-shadow: none;
  cursor: not-allowed;
}
.act-card[data-state="locked"] .act-chip {
  background: var(--ms-chip2-bg, rgba(255, 255, 255, 0.06));
  color: var(--ms-locked-ink, rgba(235, 232, 224, 0.5));
}

/* 领取成功：金色扩散闪光 */
@keyframes act-claimed-flash {
  0% { box-shadow: 0 0 0 0 rgba(255, 212, 116, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(255, 212, 116, 0); }
}
.act-card.just-claimed { animation: act-claimed-flash 0.6s var(--ease-out); }

.act-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--ms-empty, rgba(235, 232, 224, 0.5));
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .act-card,
  .act-claim,
  .act-bar i { animation: none !important; transition-duration: 0.01ms !important; }
}

/* 图鉴筛选 chips 与分档分区 */
.binder-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
}
.binder-chips[hidden] { display: none; }
.binder-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--ms-chip-line, #2a3352);
  background: var(--ms-chip-bg, #11162a);
  color: var(--ms-chip-text, #9fb0d8);
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.3s ease;
}
.binder-chip:hover { color: var(--ms-chip-hover-text, #e8ecf8); }
.binder-chip.active {
  background: var(--ms-chip-active-bg, #16203a);
  color: var(--ms-chip-active-text, #ffd454);
  border-color: var(--ms-chip-active-line, rgba(255, 212, 84, 0.4));
}
/* 分区纵向堆叠：每档独占一整行（外层 .binder-grid 为网格布局，跨列占满） */
.binder-section { margin-bottom: 14px; grid-column: 1 / -1; }
.binder-section-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ms-text3, #9fb0d8);
  letter-spacing: 0.12em;
  padding: 4px 2px 8px;
}
.binder-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}
.binder-q {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: var(--ms-q, rgba(255, 255, 255, 0.14));
  font-weight: 700;
}

/* 卡背中央 logo 图（assets/brand/card-back-ck.png，透明 PNG；玑镂纹与宝石徽记已移除，logo 即卡背主视觉） */
.card-back-logo {
  position: absolute;
  left: 50%;
  top: 45%;
  translate: -50% -50%;
  width: 56%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5));
}

/* ---------- 页面右下角低调版本号（点击进入 /about.html） ---------- */
.app-version {
  position: fixed;
  right: 10px;
  bottom: 6px;
  z-index: 20;
  font: 500 10px / 1 var(--font-ui, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: rgba(128, 134, 130, 0.55);
  cursor: pointer;
  transition: color 0.15s ease;
  user-select: none;
}

.app-version:hover,
.app-version:focus-visible {
  color: rgba(50, 173, 98, 0.85);
}

html[data-studio-light="day"] .app-version {
  color: rgba(90, 100, 94, 0.5);
}

html[data-studio-light="day"] .app-version:hover,
html[data-studio-light="day"] .app-version:focus-visible {
  color: rgba(26, 107, 58, 0.8);
}

/* ---------- 热更新提示条（检测到云端新版本后顶部浮现，倒计时自动刷新） ---------- */
.update-toast {
  position: fixed;
  top: 0;
  left: 50%;
  translate: -50% 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(50, 173, 98, 0.45);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(13, 18, 16, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #e8f5ec;
  font: 600 13px / 1 var(--font-ui, system-ui, sans-serif);
  animation: update-toast-in 0.4s var(--ease-out, ease-out) both;
}

/* 关键：hidden 属性的 UA display:none 会被上面的 display:flex 覆盖，
   必须显式声明，否则提示条会在无更新时常驻显示 */
.update-toast[hidden] {
  display: none;
}

/* 白昼主题：跟随页面 data-studio-light */
html[data-studio-light="day"] .update-toast {
  border-color: rgba(26, 107, 58, 0.4);
  background: rgba(248, 250, 246, 0.95);
  box-shadow: 0 10px 30px -8px rgba(30, 60, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #17301f;
}

html[data-studio-light="day"] .update-later {
  color: rgba(23, 48, 31, 0.58);
}

html[data-studio-light="day"] .update-later:hover {
  color: #17301f;
}

@keyframes update-toast-in {
  from { translate: -50% -110%; opacity: 0; }
  to { translate: -50% 0; opacity: 1; }
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--smkt-green-luminous, #32ad62);
  box-shadow: 0 0 8px rgba(50, 173, 98, 0.8);
  animation: update-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes update-dot-pulse {
  50% { opacity: 0.35; scale: 0.8; }
}

.update-text {
  letter-spacing: 0.02em;
}

.update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #32ad62, #1a6b3a);
  color: #ffffff;
  font: 700 12px / 1 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: scale 0.16s var(--ease-out, ease-out), filter 0.16s;
}

.update-btn:hover { filter: brightness(1.12); }
.update-btn:active { scale: 0.96; }

.update-later {
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: rgba(226, 232, 228, 0.62);
  font: 600 12px / 1 var(--font-ui, system-ui, sans-serif);
  cursor: pointer;
  transition: color 0.16s;
}

.update-later:hover { color: #e8f5ec; }
