@font-face {
  font-family: 'InkTitle';
  src: url('../assets/fonts/MaShanZheng-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'InkVerse';
  src: url('../assets/fonts/ZhiMangXing-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'InkWildCursive';
  src: url('../assets/fonts/LiuJianMaoCao-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'InkRunning';
  src: url('../assets/fonts/LongCang-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'InkXiaoWei';
  src: url('../assets/fonts/ZCOOLXiaoWei-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'InkWenKai';
  src: url('../assets/fonts/LXGWWenKai-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'InkWoodblock';
  src: url('../assets/fonts/NotoSerifSC-VF.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
}

:root,
html[data-studio-light='dark'] {
  color-scheme: dark;
  --bg-deep: #0a0e13;
  --bg-mid: #141f27;
  --bg-teal: #182a34;
  --ink-ui: #ede5d4;
  --ink-muted: rgba(237, 229, 212, 0.68);
  --dock-bg: rgba(14, 19, 24, 0.86);
  --dock-band-bg: rgba(13, 19, 25, 0.72);
  --dock-border: rgba(214, 184, 118, 0.22);
  --accent-red: #b4282d;
  --accent-gold: #cfa956;
  --gold-text: #e2be6e;
  --scrollbar-thumb: rgba(237, 229, 212, 0.22);
  --scrollbar-track: transparent;
  --depth-scale: 1;
  --foil-scale: 1;
  --font-ui: 'InkWoodblock', 'InkWenKai', 'Kaiti SC', 'STKaiti', 'FangSong', 'Songti SC', 'SimSun', serif;
  --font-serif: 'InkWoodblock', 'InkWenKai', 'Kaiti SC', 'STKaiti', 'FangSong', 'Songti SC', 'SimSun', serif;
  --font-wenkai: 'InkWenKai', 'InkWoodblock', 'Kaiti SC', 'STKaiti', 'KaiTi', 'FangSong', 'Songti SC', 'SimSun', serif;
  --font-pack-title: 'InkWenKai', 'InkXiaoWei', 'Kaiti SC', 'STKaiti', 'FangSong', 'Songti SC', 'SimSun', serif;
  --font-title: 'InkTitle', 'InkWenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
  --font-verse: 'InkVerse', 'InkWenKai', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
  --font-wild: 'InkWildCursive', 'InkVerse', 'InkWenKai', 'KaiTi', serif;
  --font-running: 'InkRunning', 'InkVerse', 'InkWenKai', 'KaiTi', serif;
  --font-xiaowei: 'InkXiaoWei', 'InkWoodblock', 'Songti SC', 'SimSun', serif;
  accent-color: var(--accent-gold);
}

html[data-studio-light='light'],
html[data-studio-scene='qianshan'] {
  color-scheme: light;
  --bg-deep: #E5E7E8;
  --bg-mid: #F7F8F9;
  --bg-teal: #DFE4E6;
  --ink-ui: #1A1E22;
  --ink-muted: rgba(26, 30, 34, 0.70);
  --dock-bg: rgba(250, 251, 252, 0.88);
  --dock-band-bg: rgba(250, 251, 252, 0.78);
  --dock-border: rgba(34, 42, 48, 0.16);
  --accent-red: #AE3A36;
  --accent-gold: #9A7B46;
  --gold-text: #7F5F2B;
  --scrollbar-thumb: rgba(25, 27, 30, 0.2);
  --scrollbar-track: transparent;
}

html[data-studio-scene='luoxia'] {
  color-scheme: light;
  --bg-deep: #EFE9DF;
  --bg-mid: #FAF6F0;
  --bg-teal: #EAE0D5;
  --ink-ui: #231D18;
  --ink-muted: rgba(35, 29, 24, 0.70);
  --dock-bg: rgba(251, 247, 241, 0.90);
  --dock-band-bg: rgba(251, 247, 241, 0.80);
  --dock-border: rgba(88, 62, 44, 0.18);
  --accent-red: #B24034;
  --accent-gold: #A47A42;
  --gold-text: #865C26;
  --scrollbar-thumb: rgba(42, 32, 24, 0.22);
  --scrollbar-track: transparent;
}

html[data-studio-scene='xinghe'] {
  color-scheme: dark;
  --bg-deep: #091119;
  --bg-mid: #10202e;
  --bg-teal: #172e40;
  --ink-ui: #EFE7D8;
  --ink-muted: rgba(239, 231, 216, 0.72);
  --dock-bg: rgba(10, 19, 28, 0.84);
  --dock-band-bg: rgba(10, 19, 28, 0.72);
  --dock-border: rgba(216, 184, 114, 0.24);
  --accent-red: #b4282d;
  --accent-gold: #d6b262;
  --gold-text: #e6c478;
}

/* ---------- 开卷水墨启幕帷幕（消除首屏黑屏闪烁） ---------- */
body.is-booting .top-bar,
body.is-booting .stage,
body.is-booting .bottom-chrome {
  opacity: 0;
}

.top-bar,
.stage,
.bottom-chrome {
  transition: opacity 0.48s cubic-bezier(0.22, 0.85, 0.36, 1);
}

.ink-loader-curtain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: radial-gradient(74% 64% at 50% 44%, var(--bg-mid) 0%, var(--bg-deep) 100%);
  color: var(--ink-ui);
  opacity: 1;
  transition: opacity 0.52s cubic-bezier(0.22, 0.85, 0.36, 1), transform 0.52s cubic-bezier(0.22, 0.85, 0.36, 1);
  pointer-events: auto;
}

.ink-loader-curtain.is-dismissed {
  opacity: 0;
  transform: scale(1.028);
  pointer-events: none;
}

.ink-loader-curtain[hidden] {
  display: none;
}

.ink-loader-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ink-loader-enso {
  width: 148px;
  height: 148px;
  opacity: 0.78;
}

.ink-loader-ring {
  fill: none;
  stroke: var(--ink-ui);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 295 85;
  transform-origin: 70px 70px;
  opacity: 0.58;
  animation: loaderEnsoSpin 4.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.ink-loader-ring-thin {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 165 215;
  transform-origin: 70px 70px;
  opacity: 0.62;
  animation: loaderEnsoSpin 7.2s linear infinite reverse;
}

@keyframes loaderEnsoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ink-loader-mark {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
}

.ink-loader-title {
  font-family: var(--font-title);
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--ink-ui);
}

.ink-loader-seal {
  display: inline-grid;
  place-items: center;
  padding: 3px 2px;
  border-radius: 2px;
  background: var(--accent-red);
  color: #fbf4e6;
  font-family: var(--font-title);
  font-size: 10px;
  line-height: 1.05;
  writing-mode: vertical-rl;
  letter-spacing: 0.05em;
  transform: translateY(-2px);
}

.ink-loader-sub {
  margin: 4px 0 0;
  font-family: var(--font-xiaowei);
  font-size: 13px;
  letter-spacing: 0.34em;
  color: var(--ink-muted);
}

::selection {
  background: rgba(180, 40, 45, 0.24);
  color: var(--ink-ui);
}

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--ink-ui);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---------- 顶栏（去 SaaS 化 · 古卷轻题签与书签风） ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 28px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-mid) 56%, transparent) 0%, transparent 100%);
  pointer-events: none;
}

.brand-crest {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.seal-stamp {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: linear-gradient(155deg, #be3b36 0%, #9b2925 100%);
  border: 1px solid rgba(255, 236, 206, 0.24);
  color: #faf3e5;
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(154, 34, 30, 0.30);
}

.brand-title {
  font-family: var(--font-title);
  font-size: 32px;
  letter-spacing: 0.16em;
  color: var(--ink-ui);
  line-height: 1;
}

.brand-sub {
  font-family: var(--font-xiaowei);
  font-size: 13.5px;
  letter-spacing: 0.24em;
  color: color-mix(in srgb, var(--ink-ui) 80%, transparent);
  border-left: 1px solid color-mix(in srgb, var(--accent-gold) 48%, transparent);
  padding-left: 14px;
  line-height: 1.25;
}
html[data-studio-light='light'] .brand-sub {
  color: color-mix(in srgb, var(--ink-ui) 84%, transparent);
  text-shadow: 0 1px 6px rgba(248, 244, 236, 0.72);
}

.utility-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  pointer-events: auto;
}

.util-sep {
  width: 1px;
  height: 14px;
  background: color-mix(in srgb, var(--ink-ui) 18%, transparent);
  margin: 0 4px;
  flex-shrink: 0;
}

.util-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: color-mix(in srgb, var(--ink-ui) 86%, transparent);
  font-family: var(--font-xiaowei);
  font-size: 14px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.18s ease, background-color 0.2s ease;
}

.util-btn::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 1.5px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.22, 0.9, 0.32, 1), opacity 0.24s ease;
}

.util-btn:hover {
  color: var(--ink-ui);
  background: color-mix(in srgb, var(--accent-gold) 9%, transparent);
  transform: translateY(-1px);
}

.util-btn:hover::after,
.util-btn.is-manual::after {
  transform: scaleX(1);
  opacity: 0.88;
}

.callig-btn-seal {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent-red) 84%, transparent);
  color: #f8f0df;
  font-family: var(--font-title);
  font-size: 10.5px;
  line-height: 1;
  flex-shrink: 0;
}

.callig-btn.is-manual,
.enso-btn.is-manual {
  color: var(--gold-text);
}

.enso-btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--accent-gold);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent-gold) 55%, transparent);
  flex-shrink: 0;
}

.enso-btn.is-manual .enso-btn-dot {
  background: var(--accent-red);
  box-shadow: 0 0 7px rgba(180, 40, 45, 0.55);
}

.mute-btn {
  padding: 0 8px;
}

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

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

/* ---------- 出货横幅 ---------- */
.pull-banner[hidden],
.inspect-hud[hidden] {
  display: none;
}

.pull-banner {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 26px;
  border-radius: 6px;
  background: rgba(16, 15, 14, 0.9);
  background-image: var(--tex-paper);
  background-size: 260px 260px;
  border: 1px solid rgba(207, 169, 86, 0.55);
  color: #f4ebd8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  animation: bannerIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

html[data-studio-light='light'] .pull-banner {
  background-color: rgba(246, 240, 229, 0.96);
  border-color: rgba(154, 114, 34, 0.48);
  color: #221f1a;
  box-shadow: 0 12px 28px rgba(45, 36, 22, 0.16);
}

html[data-studio-light='light'] .banner-kicker {
  color: var(--gold-text);
}

.banner-kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--accent-gold);
}

.banner-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.14em;
}

@keyframes bannerIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ---------- 画室三维舞台（三大诗词真水墨画境：千山雪寂 / 落霞秋水 / 满船星河 · 零 SVG 剪纸山） ---------- */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-mid);
  transition: background-color 0.65s ease;
}

html[data-studio-scene='xinghe'] .stage {
  background: radial-gradient(68% 60% at 50% 42%, #132535 0%, #0b1622 60%, #070e16 100%);
}

html[data-studio-scene='qianshan'] .stage {
  background: #FAFBFB;
}

html[data-studio-scene='luoxia'] .stage {
  background: #FCF9F4;
}

.stage-backdrop,
.stage-sunlight,
.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-backdrop {
  --stage-px: 0;
  --stage-py: 0;
  overflow: hidden;
  z-index: 0;
}

/* 三大诗词真水墨全屏无边框底图层（object-fit: cover + 极轻鼠标视差 + 平滑交叉淡入淡出） */
.stage-bg-layer {
  position: absolute;
  inset: -1.4%;
  width: 102.8%;
  height: 102.8%;
  opacity: 0;
  transform: translate3d(
    calc(var(--stage-px) * -7px),
    calc(var(--stage-py) * -5px),
    0
  );
  transition: opacity 0.72s cubic-bezier(0.22, 0.85, 0.36, 1);
  will-change: opacity, transform;
  pointer-events: none;
}

html[data-studio-scene='qianshan'] .stage-bg-layer[data-scene-layer='qianshan'],
html[data-studio-scene='luoxia'] .stage-bg-layer[data-scene-layer='luoxia'],
html[data-studio-scene='xinghe'] .stage-bg-layer[data-scene-layer='xinghe'] {
  opacity: 1;
}

.stage-bg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.stage-bg-img[data-loaded='0'] {
  opacity: 0;
}

/* 144fps 轻量级水墨活画氛围微动层 */
.stage-atmo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.stage-sunlight {
  background: radial-gradient(62% 54% at 50% 34%, rgba(214, 184, 118, 0.05) 0%, transparent 72%);
  transition: opacity 0.6s ease, background 0.6s ease;
  z-index: 3;
}

html[data-studio-light='light'] .stage-sunlight {
  background: radial-gradient(
    54% 48% at 50% 44%,
    rgba(255, 255, 255, 0.24) 0%,
    transparent 70%
  );
}

/* 放大单卡赏析时，将 .scene 切为 flat（各卡保持自身 3D 立体与视角透视，按 z-index 严格分前后层，彻底杜绝任意角度旋转穿模） */
.stage.is-inspecting .scene {
  transform-style: flat;
}

/* 放大单卡赏析时，仅柔化暗沉背景卡的 .card-face/.card-back，绝不在 .card 上加 filter/opacity 以免破坏 preserve-3d 导致卡背穿帮 */
.stage.is-inspecting .card:not(.is-zoomed):not(.is-showcase) .card-face,
.stage.is-inspecting .card:not(.is-zoomed):not(.is-showcase) .card-back {
  filter: blur(2.2px) brightness(0.68);
  opacity: 0.44;
  transition: filter 0.35s ease, opacity 0.35s ease;
}

.card.unrevealed .card-face {
  visibility: hidden;
}

.card.card-prehidden {
  visibility: hidden !important;
  pointer-events: none !important;
}

.stage.is-inspecting .stage-spotlight {
  opacity: 1.35;
}

/* 揲蓍摇卦浮现的卦象篆印（自封笺正上方高位升起，绝不遮挡封包文字） */
.peek-gua {
  position: absolute;
  left: 50%;
  top: 7.5%;
  transform: translate(-50%, 10px) scale(0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-family: var(--font-title);
  font-size: 46px;
  line-height: 1;
  color: var(--gold-text);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 24;
  transition: opacity 0.35s ease, transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.peek-gua.active {
  opacity: 0.88;
  transform: translate(-50%, -6px) scale(1.02);
}

.peek-gua-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.45em;
  opacity: 0.85;
}

.stage-paper-grain {
  background-image: var(--tex-paper);
  background-size: 360px 360px;
  opacity: 0.07;
  mix-blend-mode: soft-light;
}

html[data-studio-light='light'] .stage-paper-grain {
  opacity: 0.12;
  mix-blend-mode: multiply;
}

.stage-vignette {
  background: radial-gradient(circle at 50% 45%, transparent 38%, rgba(0, 0, 0, 0.58) 100%);
  transition: opacity 0.28s ease;
}

html[data-studio-light='light'] .stage-vignette {
  background: radial-gradient(circle at 50% 45%, transparent 52%, rgba(44, 40, 32, 0.14) 100%);
}

.stage-vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 44%, transparent 24%, rgba(6, 7, 10, 0.44) 100%);
  opacity: 0;
  transition: opacity 0.26s cubic-bezier(0.22, 0.9, 0.32, 1);
  pointer-events: none;
}

.stage.focus-high-rarity .stage-vignette::after {
  opacity: 1;
}

.stage.focus-high-rarity .stage-spotlight {
  opacity: 1.55;
  transform: translate(-50%, -50%) scale(1.06);
}

.stage-spotlight {
  position: absolute;
  left: 50%;
  top: 43%;
  width: min(820px, 95vw);
  height: min(820px, 95vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 182, 114, 0.11) 0%, rgba(120, 148, 162, 0.04) 42%, transparent 72%);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.22, 0.9, 0.32, 1);
}

html[data-studio-light='light'] .stage-spotlight {
  background: radial-gradient(circle, rgba(255, 255, 252, 0.72) 0%, transparent 70%);
}

.pack-aura {
  position: absolute;
  left: 50%;
  top: 46%;
  width: clamp(390px, min(54vw, 62vh), 700px);
  height: clamp(500px, min(70vw, 80vh), 900px);
  transform: translate(-50%, -50%) scale(0.92);
  border-radius: 50%;
  background: radial-gradient(circle, var(--peek-aura, rgba(207, 169, 86, 0.30)) 0%, transparent 68%);
  filter: blur(32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.pack-aura.active {
  opacity: 0.65;
  transform: translate(-50%, -50%) scale(1.0);
}

.pack-aura.god-mode {
  opacity: 0.52;
  background: radial-gradient(circle, rgba(207, 169, 86, 0.28) 0%, rgba(176, 58, 54, 0.10) 48%, transparent 72%);
}
@media (prefers-reduced-motion: no-preference) {
  .pack-aura.god-mode {
    animation: godPulse 2.8s ease-in-out infinite;
  }
}

@keyframes godPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.42; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 0.66; }
}

.ground-shadow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: clamp(290px, min(40vw, 44vh), 490px);
  height: 40px;
  transform: translateX(-50%);
  margin-top: clamp(248px, min(33vw, 37.5vh), 420px);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.56) 0%, transparent 72%);
  filter: blur(18px);
  pointer-events: none;
}

html[data-studio-light='light'] .ground-shadow {
  background: radial-gradient(ellipse, rgba(28, 26, 22, 0.22) 0%, transparent 72%);
}

/* ---------- 3D 场景容器（显式 z-index: 12 高于 #smokeCanvas，确保残余墨烟始终位于飞出与落位卡牌的背后） ---------- */
.scene {
  position: absolute;
  inset: 0;
  z-index: 12;
  perspective: 1500px;
  perspective-origin: 50% 44%;
  transform-style: preserve-3d;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.22, 0.9, 0.32, 1);
}

.scene.cinema-push {
  transform: scale(1.016);
}

.scene.flat {
  transform-style: preserve-3d;
}

.smoke-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.unity-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 48;
}

/* ---------- 八卦异形手绘水墨封套 (#pack · 原生高精雕版清晰排版 + 阴阳轮转烫金墨相) ---------- */
.pack {
  container-type: inline-size;
  container-name: pack-body;
  /* 以悬停最大尺幅作为原生 1.0x 基准（待机略缩 0.968，悬停还原 1.000 满清，彻底消除 scale>1 拉伸发糊！） */
  --pack-base-w: clamp(404px, min(47.6vw, 57vh), 580px);
  --pack-form-scale: 1.04;
  --pack-w: calc(var(--pack-base-w) * var(--pack-form-scale));
  --pack-h: calc(var(--pack-w) * 1.3333);
  --pack-paper: #F7F3EA;
  --pack-ink: #16181B;
  --pack-accent: #4F6C74;
  --pack-seal: #B03A36;
  --pack-foil-a: #C7A258;
  --pack-foil-b: #6E8F98;
  --px: 50;
  --py: 50;
  --hyp: 0;
  position: absolute;
  left: 50%;
  top: 45%;
  width: var(--pack-w);
  height: var(--pack-h);
  margin-left: calc(var(--pack-w) * -0.5);
  margin-top: calc(var(--pack-h) * -0.5);
  transform-style: preserve-3d;
  pointer-events: auto;
  z-index: 12;
}

.pouch-drop-shadow {
  position: absolute;
  inset: 0;
  transform: translate3d(0, 18px, -12px) scale(0.96);
  background: rgba(0, 0, 0, 0.42);
  -webkit-mask-image: var(--pack-form-url);
  mask-image: var(--pack-form-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  filter: blur(22px);
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
}

html[data-studio-light='light'] .pouch-drop-shadow {
  background: rgba(34, 30, 24, 0.24);
  filter: blur(18px);
}

.pack.hovered .pouch-drop-shadow {
  transform: translate3d(
    calc((var(--px) - 50) * -0.26px),
    calc(26px + (var(--py) - 50) * -0.18px),
    -18px
  ) scale(0.99);
}

.pack.pressing .pouch-drop-shadow {
  transform: translate3d(0, 8px, -4px) scale(0.95);
  background: rgba(0, 0, 0, 0.56);
}

.pack.god-pack .pouch-drop-shadow {
  background: rgba(196, 152, 68, 0.34);
}

.pack.charging .pouch-drop-shadow {
  background: rgba(182, 58, 52, 0.34);
}

.pack.dissolving .pouch-drop-shadow,
.pack.slashed .pouch-drop-shadow {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pouch-depth-mid {
  position: absolute;
  inset: 0;
  transform: translateZ(-2.5px);
  background: rgba(18, 16, 14, 0.28);
  -webkit-mask-image: var(--pack-form-url);
  mask-image: var(--pack-form-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  pointer-events: none;
}

.pouch-wash-img,
.pouch-bagua,
.pouch-enso-img,
.seal-crest-line {
  display: none !important;
}

.pouch-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  pointer-events: none;
  background: transparent;
  overflow: visible;
  transform-style: preserve-3d;
}

.pouch-face.front {
  transform: translateZ(3px);
  color: var(--pack-ink);
}

.pouch-face.back {
  transform: translateZ(-3px) rotateY(180deg);
  display: grid;
  place-items: center;
  padding: 36px 40px;
  text-align: center;
  color: var(--pack-ink);
}

/* 核心异形手绘水墨封套本体（完整保留卷轴、行囊、驿札、折信、玄函、符囊、游卷、药包八大器形） */
.pouch-form-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.44)) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.24));
  transition: filter 0.28s ease;
}

html[data-studio-light='light'] .pouch-form-img {
  filter: drop-shadow(0 14px 24px rgba(32, 28, 22, 0.22)) drop-shadow(0 2px 4px rgba(32, 28, 22, 0.12));
}

.pack.hovered .pouch-form-img {
  filter:
    drop-shadow(0 20px 36px rgba(0, 0, 0, 0.56))
    drop-shadow(0 0 18px color-mix(in srgb, var(--pack-foil-a) 26%, transparent));
}

html[data-studio-light='light'] .pack.hovered .pouch-form-img {
  filter:
    drop-shadow(0 22px 32px rgba(32, 28, 22, 0.28))
    drop-shadow(0 0 14px color-mix(in srgb, var(--pack-foil-a) 24%, transparent));
}

/* 随视角移动的暗金/冷银流光扫掠（严格裁切于异形封套轮廓内，绝不溢出矩形框） */
.pouch-seep-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  -webkit-mask-image: var(--pack-form-url);
  mask-image: var(--pack-form-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background:
    radial-gradient(
      52% 44% at calc(var(--px) * 1%) calc(var(--py) * 1%),
      color-mix(in srgb, var(--pack-foil-a) 32%, white 22%) 0%,
      color-mix(in srgb, var(--pack-foil-b) 14%, transparent) 42%,
      transparent 74%
    ),
    linear-gradient(
      calc(115deg + (var(--px) - 50) * 1.15deg),
      transparent 24%,
      color-mix(in srgb, var(--pack-foil-a) 20%, transparent) 46%,
      rgba(255, 252, 240, 0.34) 50%,
      color-mix(in srgb, var(--pack-foil-b) 16%, transparent) 55%,
      transparent 76%
    );
  mix-blend-mode: soft-light;
  opacity: calc(0.28 + var(--hyp, 0) * 0.68);
  transition: opacity 0.25s ease;
}

.pack[data-dark='1'] .pouch-seep-sheen {
  mix-blend-mode: screen;
  opacity: calc(0.20 + var(--hyp, 0) * 0.52);
}

/* 左上角竖排引气小字（纯正雕版宋体 + 文楷兜底，高清晰实墨，绝不回退现代黑体） */
.tear-label {
  position: absolute;
  top: 13.2%;
  left: 21.8%;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: clamp(12.5px, 2.55cqi, 14px);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: 0.24em;
  white-space: nowrap;
  color: #362e26;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  z-index: 6;
}

.pack[data-dark='1'] .tear-label {
  color: #e6dac2;
}

.pack.hovered .tear-label,
.pack.pressing .tear-label {
  color: #221d18;
}

.pack[data-dark='1'].hovered .tear-label,
.pack[data-dark='1'].pressing .tear-label {
  color: #f4ebd8;
}

.lip-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.foil-lip {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* 封包全幅写意画布容器 */
.pouch-foil-frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform-style: preserve-3d;
}

/* 右上角传统竖排错落题签（全字库霞鹜文楷主标杜绝缺字混拼，配雕版宋体副标，零 filter/translateZ 发毛） */
.pouch-header {
  position: absolute;
  top: 13.2%;
  right: 21.4%;
  writing-mode: vertical-rl;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  font-family: var(--font-pack-title);
  font-size: clamp(17.5px, 3.45cqi, 21.5px);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: 0.22em;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  z-index: 6;
}

.edition-tag {
  font-family: var(--font-pack-title);
  background-image: linear-gradient(
    calc(165deg + (var(--px) - 50) * 1.1deg),
    var(--pack-ink) 0%,
    var(--pack-ink) 26%,
    var(--pack-foil-a) calc(48% + (var(--py) - 50) * 0.65%),
    var(--pack-foil-b) calc(64% + (var(--py) - 50) * 0.65%),
    var(--pack-ink) 88%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pouch-series {
  margin-top: 1.15em;
  font-family: var(--font-serif);
  font-size: clamp(12px, 2.4cqi, 13.5px);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: 0.22em;
  color: #443b32;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.pack[data-dark='1'] .pouch-series {
  color: #d8cbb2;
}

/* 全幅写意笔势层 + 江湖气韵大字「墨卷」 */
.pouch-center {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.pouch-enso-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  -webkit-mask-image: var(--pack-form-url);
  mask-image: var(--pack-form-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transform: translateZ(5px);
}

.brand-calligraphy-wrap {
  --callig-scale: 1;
  --callig-rot: 0deg;
  --callig-ox: 0px;
  --callig-oy: 0px;
  position: absolute;
  top: 41%;
  left: 48%;
  transform:
    translate(-50%, -50%)
    translate3d(
      calc(var(--callig-ox) + (var(--px) - 50) * 0.18px),
      calc(var(--callig-oy) + (var(--py) - 50) * 0.14px),
      14px
    )
    rotate(var(--callig-rot))
    scale(var(--callig-scale));
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  transition: transform 0.22s ease-out;
}

.brand-calligraphy-img {
  display: block;
  width: auto;
  height: clamp(166px, 44cqi, 256px);
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 3px 6px rgba(18, 20, 24, 0.14));
  transition: filter 0.25s ease;
}

.pack.hovered .brand-calligraphy-img {
  filter:
    drop-shadow(0 6px 12px rgba(18, 20, 24, 0.20))
    drop-shadow(0 0 10px color-mix(in srgb, var(--pack-foil-a) 32%, transparent));
}

/* 艮山玄函（深松烟黑底）：中央「墨卷」化作泥金古宣碑拓金银字 */
.pack[data-dark='1'] .brand-calligraphy-img {
  filter:
    invert(1)
    sepia(0.32)
    saturate(1.25)
    brightness(0.96)
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 8px rgba(218, 184, 102, 0.28));
}

.back-calligraphy-img {
  height: clamp(104px, 26cqi, 162px);
  margin: 0 auto 12px;
  opacity: 0.90;
}

.brand-calligraphy-chop {
  position: absolute;
  right: -1.15em;
  bottom: 0.32em;
  padding: 0.28em 0.26em;
  border-radius: 1.5px;
  border: 1px solid rgba(176, 58, 54, 0.88);
  background: linear-gradient(155deg, #BC413B 0%, #9E2E2A 100%);
  color: #FCF9F2;
  font-family: var(--font-title);
  font-size: clamp(0.60rem, 1.72cqi, 0.82rem);
  font-weight: 400;
  line-height: 1.05;
  writing-mode: vertical-rl;
  letter-spacing: 0.08em;
  opacity: 0.92;
  box-shadow: 0 2px 6px rgba(130, 28, 24, 0.26);
  transform: rotate(-1.8deg);
}

/* 八大「书体」精细化视觉调校（保证顶栏切换任意书体都大开大合、气势饱满且印章落位精准） */
.pack[data-calligraphy='wild-cursive'] .brand-calligraphy-wrap { --callig-scale: 1.06; --callig-rot: -2.2deg; --callig-oy: -2px; }
.pack[data-calligraphy='brush-bold'] .brand-calligraphy-wrap   { --callig-scale: 0.96; --callig-rot: 0deg;   --callig-oy: 2px; }
.pack[data-calligraphy='lanting-verse'] .brand-calligraphy-wrap{ --callig-scale: 1.04; --callig-rot: -1.4deg;--callig-ox: -2px; }
.pack[data-calligraphy='slender-gold'] .brand-calligraphy-wrap { --callig-scale: 0.98; --callig-rot: 0.5deg; --callig-oy: -3px; }
.pack[data-calligraphy='stele-bold'] .brand-calligraphy-wrap   { --callig-scale: 0.95; --callig-rot: 0deg;   --callig-oy: 2px; }
.pack[data-calligraphy='thunder-cursive'] .brand-calligraphy-wrap { --callig-scale: 1.08; --callig-rot: -2.5deg; }
.pack[data-calligraphy='running-wind'] .brand-calligraphy-wrap { --callig-scale: 1.05; --callig-rot: -1.8deg; }
.pack[data-calligraphy='elegant-running'] .brand-calligraphy-wrap { --callig-scale: 0.96; --callig-rot: 0.4deg; }

.pack[data-calligraphy='thunder-cursive'] .brand-calligraphy-chop { right: -0.75em; bottom: 0.55em; }
.pack[data-calligraphy='running-wind'] .brand-calligraphy-chop    { right: -0.95em; bottom: 0.42em; }
.pack[data-calligraphy='stele-bold'] .brand-calligraphy-chop      { right: -1.25em; bottom: 0.24em; }

/* 左下角疏朗卷尾小跋（雕版思源宋体实墨锐度、>=11.5px 清晰雅致，零现代黑体回退） */
.pouch-footer {
  position: absolute;
  left: 21.8%;
  bottom: 12.0%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3.5px;
  font-family: var(--font-serif);
  font-size: clamp(12px, 2.38cqi, 13.5px);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0.16em;
  color: #28221d;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  z-index: 6;
}

.pouch-foot-row {
  display: flex;
  align-items: center;
  gap: 0.72em;
  white-space: nowrap;
}

.pack-foot.right {
  color: #8f3122;
  font-weight: 700;
}

.pack[data-dark='1'] .pack-foot.right {
  color: #e4c074;
}

.pack-micro-spec {
  text-align: left;
  font-family: var(--font-serif);
  font-size: clamp(11.5px, 2.22cqi, 12.5px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.24em;
  white-space: nowrap;
  color: #524940;
}

/* 八大原创 v4 手绘水墨封套专属版心精准落位（小字、主书迹、阴阳墨圈与右下小景丝丝入扣、零压线） */
.pack[data-form='qian_scroll'] .brand-calligraphy-wrap   { top: 41.2%; left: 47.3%; }

.pack[data-form='kun_knapsack'] .tear-label              { top: 23.2%; left: 19.2%; }
.pack[data-form='kun_knapsack'] .pouch-header            { top: 23.2%; right: 19.2%; }
.pack[data-form='kun_knapsack'] .brand-calligraphy-wrap  { top: 44%; left: 49.5%; }
.pack[data-form='kun_knapsack'] .pouch-footer            { left: 19.2%; bottom: 12.8%; }

.pack[data-form='kan_letter'] .tear-label                { top: 23.8%; left: 22.0%; }
.pack[data-form='kan_letter'] .pouch-header              { top: 23.8%; right: 21.8%; }
.pack[data-form='kan_letter'] .brand-calligraphy-wrap    { top: 45%; left: 49.5%; }
.pack[data-form='kan_letter'] .pouch-footer              { left: 22.0%; bottom: 14.2%; }

.pack[data-form='li_missal'] .tear-label                 { top: 28.2%; left: 22.0%; }
.pack[data-form='li_missal'] .pouch-header               { top: 16.2%; right: 20.2%; }
.pack[data-form='li_missal'] .brand-calligraphy-wrap     { top: 43%; left: 50%; }
.pack[data-form='li_missal'] .pouch-footer               { left: 22.0%; bottom: 13.8%; }

/* 艮山玄函（松烟古函）：主标题题签精准嵌于左侧古宣题签框内，引气小字立于右畔，左下松烟留白落卷尾小跋 */
.pack[data-form='gen_tome'] .pouch-header {
  top: 17.2%;
  left: 20.4%;
  right: auto;
  align-items: center;
  gap: 6px;
  font-size: clamp(16.5px, 3.2cqi, 21px);
}
.pack[data-form='gen_tome'] .edition-tag {
  background-image: linear-gradient(
    calc(165deg + (var(--px) - 50) * 1.0deg),
    #181A1E 0%,
    #2C261C 38%,
    #8A6728 calc(52% + (var(--py) - 50) * 0.55%),
    #181A1E 88%
  );
}
.pack[data-form='gen_tome'] .pouch-series                { color: #2b2622; margin-top: 0.55em; }
.pack[data-form='gen_tome'] .tear-label                  { top: 15%; right: 22.2%; left: auto; color: #ece0c8; }
.pack[data-form='gen_tome'] .brand-calligraphy-wrap      { top: 41.5%; left: 56%; }
.pack[data-form='gen_tome'] .brand-calligraphy-img       { height: clamp(154px, 40cqi, 234px); }
.pack[data-form='gen_tome'] .pouch-footer                { left: 18%; bottom: 12.8%; color: #efe5cf; }
.pack[data-form='gen_tome'] .pack-micro-spec             { color: #cfc3aa; }

.pack[data-form='zhen_pouch'] .tear-label                { top: 22.8%; left: 23.2%; }
.pack[data-form='zhen_pouch'] .pouch-header              { top: 22.8%; right: 23.8%; }
.pack[data-form='zhen_pouch'] .brand-calligraphy-wrap    { top: 44.5%; left: 50%; }
.pack[data-form='zhen_pouch'] .brand-calligraphy-img     { height: clamp(148px, 38cqi, 220px); }
.pack[data-form='zhen_pouch'] .pouch-footer              { left: 23.8%; bottom: 13.8%; }

.pack[data-form='xun_scroll'] .tear-label                { top: 15.2%; left: 22.8%; }
.pack[data-form='xun_scroll'] .pouch-header              { top: 15.2%; right: 22.4%; }
.pack[data-form='xun_scroll'] .brand-calligraphy-wrap    { top: 41.2%; left: 47.5%; }
.pack[data-form='xun_scroll'] .brand-calligraphy-img     { height: clamp(154px, 40cqi, 234px); }
.pack[data-form='xun_scroll'] .pouch-footer              { left: 22.8%; bottom: 13.2%; }

.pack[data-form='dui_packet'] .tear-label                { top: 17.2%; left: 20.2%; }
.pack[data-form='dui_packet'] .pouch-header              { top: 17.2%; right: 20.2%; }
.pack[data-form='dui_packet'] .brand-calligraphy-wrap    { top: 41.5%; left: 49.5%; }
.pack[data-form='dui_packet'] .pouch-footer              { left: 20.2%; bottom: 13.8%; }

.back-print-box {
  position: relative;
  z-index: 3;
}

.back-blurb {
  margin: 0 0 10px;
  font-size: clamp(0.74rem, 2.2cqi, 1.02rem);
  line-height: 1.75;
  color: color-mix(in srgb, var(--pack-ink) 74%, transparent);
}

.back-spec {
  font-size: clamp(0.62rem, 1.8cqi, 0.84rem);
  letter-spacing: 0.20em;
  color: color-mix(in srgb, var(--pack-ink) 50%, transparent);
}

/* 剑气破封斜切上半封碎片与蓄力 / 消融状态 */
.pack-slash-top {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 8;
}

.pack-slash-top[hidden] {
  display: none;
}

.pack-slash-top .front {
  transform: translateZ(3.5px);
}

.pack-slash-top .foil-lining {
  transform: rotateY(180deg) translateZ(0.45px);
  background-color: #FAF9F6;
}

.pack.dissolving .pouch-face,
.pack.dissolving .pouch-depth-mid,
.pack.slashed .pouch-depth-mid {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.grab-zone {
  position: absolute;
  inset: -10px;
  background: transparent;
  border: 0;
  cursor: grab;
  z-index: 20;
  transform: translateZ(14px);
  touch-action: none;
}

.pack.pressing .grab-zone {
  cursor: grabbing;
}

.grab-zone:disabled {
  pointer-events: none;
}

/* ---------- 3D 水墨分层闪卡 (.card，原生高分排版，放大时 scale<=1 杜绝马赛克) ---------- */
.card {
  --card-w: clamp(320px, 34vw, 410px);
  --card-h: calc(var(--card-w) * 1.44);
  position: absolute;
  left: 50%;
  top: 46%;
  width: var(--card-w);
  height: var(--card-h);
  margin-left: calc(var(--card-w) * -0.5);
  margin-top: calc(var(--card-h) * -0.5);
  transform-style: preserve-3d;
  cursor: pointer;
  pointer-events: none;
  outline: none;
}

.card.settled {
  pointer-events: auto;
}

.card:focus-visible .card-face,
.card:focus-visible .card-back {
  box-shadow: 0 0 0 2px var(--accent-gold), 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- 阶段 3.4：未翻转水墨写意卡背（延续《浮生纪事》形散意不散 + 视角暗金/冷银烫印 + 昆特级悬停手感） ---------- */
.card-back {
  --px: 50;
  --py: 50;
  --hyp: 0;
  --back-ink: #1a1c20;
  --back-accent: #566e76;
  --back-foil-a: #c6a054;
  --back-foil-b: #74929c;
  position: absolute;
  inset: 0;
  border-radius: 16px;
  transform: translateZ(-3.5px) rotateY(180deg);
  backface-visibility: hidden;
  background-color: #f8f6f0;
  background-image:
    var(--tex-paper),
    radial-gradient(85% 75% at 50% 42%, rgba(255, 255, 252, 0.72) 0%, transparent 72%),
    linear-gradient(158deg, #fcfbf8 0%, #f5f2ea 58%, #ede8dc 100%);
  background-size: 300px 300px, 100% 100%, 100% 100%;
  color: var(--back-ink);
  border: 1px solid rgba(58, 52, 42, 0.16);
  box-shadow:
    inset 0 0 0 6px rgba(252, 250, 245, 0.75),
    inset 0 0 0 7px rgba(84, 74, 58, 0.12),
    0 20px 42px rgba(0, 0, 0, 0.44);
  overflow: hidden;
  transition: box-shadow 0.28s ease, border-color 0.28s ease;
}

html[data-studio-light='light'] .card-back {
  box-shadow:
    inset 0 0 0 6px rgba(252, 250, 245, 0.8),
    inset 0 0 0 7px rgba(84, 74, 58, 0.14),
    0 16px 32px rgba(32, 28, 22, 0.22);
}

/* 随 3D 视角移动的暗金/冷银流光扫掠（复用卡包高定烫印工艺） */
.card-back-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    radial-gradient(
      62% 52% at calc(var(--px) * 1%) calc(var(--py) * 1%),
      color-mix(in srgb, var(--back-foil-a) 34%, white 24%) 0%,
      color-mix(in srgb, var(--back-foil-b) 14%, transparent) 44%,
      transparent 74%
    ),
    linear-gradient(
      calc(118deg + (var(--px) - 50) * 1.25deg),
      transparent 22%,
      color-mix(in srgb, var(--back-foil-a) 24%, transparent) 45%,
      rgba(255, 252, 242, 0.42) 50%,
      color-mix(in srgb, var(--back-foil-b) 18%, transparent) 55%,
      transparent 78%
    );
  mix-blend-mode: soft-light;
  opacity: calc(0.24 + var(--hyp, 0) * 0.74);
  transition: opacity 0.22s ease;
}

/* 开放式飞白墨圈与右下淡墨远山意象（形散意不散，75%~85% 素白留白） */
.card-back-enso {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 66%;
  height: 66%;
  transform: translate(
    calc(-50% + (var(--px) - 50) * 0.16px),
    calc(-50% + (var(--py) - 50) * 0.14px)
  );
  object-fit: contain;
  opacity: 0.72;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 5px rgba(20, 22, 26, 0.10));
}

.card-back-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.card-back-art.back-base {
  transform: translate3d(
    calc((var(--px) - 50) * -0.10px),
    calc((var(--py) - 50) * -0.08px),
    0
  );
}

/* Tier 1 零 Context 活墨微动：右下动态画意层（树梢、剑穗、流云、竹叶）随视角与风场根部锚定微摆 */
.card-back-art.back-motifs {
  transform-origin: 76% 88%;
  animation: cardBackMotifSway 4.8s ease-in-out infinite;
  will-change: transform;
}

@keyframes cardBackMotifSway {
  0%, 100% {
    transform: translate3d(
      calc((var(--px) - 50) * 0.14px),
      calc((var(--py) - 50) * 0.11px),
      0
    ) rotate(-0.45deg) skewX(-0.7deg);
  }
  50% {
    transform: translate3d(
      calc((var(--px) - 50) * 0.14px + 1.8px),
      calc((var(--py) - 50) * 0.11px - 1.1px),
      0
    ) rotate(0.75deg) skewX(0.95deg);
  }
}

/* Tier 2 全局唯一共享 WebGL2 24x36 网格微动画布（仅对悬停卡背或神/逸卡背投射 R/G/B 三通道真网格变形） */
.card-back-live-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.card-back-live-canvas.is-live-active {
  opacity: 0.92;
}

.card-back.has-live-mesh .card-back-art {
  opacity: 0.18;
  transition: opacity 0.24s ease;
}

/* 逸品悬停玄机层：悬停时黑金松烟底纹下浮现第二层古墨星图与剑气微光 */
.card-back-secret-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transform: scale(0.97) rotate(-2deg);
  transition: opacity 0.36s ease, transform 0.55s cubic-bezier(0.22, 0.9, 0.32, 1);
  mix-blend-mode: screen;
}

.card.unrevealed.rarity-yi.is-hovered .card-back-secret-stars {
  opacity: 0.86;
  transform: scale(1.02) rotate(0deg);
}

/* 卡背竖排微字与视角变色烫印（右上主标 + 左下小跋，按原生 380-410px 卡面尺寸标定） */
.card-back-kicker {
  position: absolute;
  top: 10.5%;
  right: 11%;
  writing-mode: vertical-rl;
  font-family: var(--font-title);
  font-size: 26px;
  letter-spacing: 0.26em;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 3;
  background-image: linear-gradient(
    calc(162deg + (var(--px) - 50) * 1.1deg),
    var(--back-ink) 0%,
    var(--back-ink) 28%,
    var(--back-foil-a) calc(50% + (var(--py) - 50) * 0.65%),
    var(--back-foil-b) calc(64% + (var(--py) - 50) * 0.65%),
    var(--back-ink) 90%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-back-sub {
  position: absolute;
  top: 12.5%;
  left: 11.5%;
  writing-mode: vertical-rl;
  font-family: var(--font-xiaowei);
  font-size: 15px;
  letter-spacing: 0.32em;
  color: var(--back-accent);
  opacity: 0.78;
  z-index: 3;
}

.card-back-colophon {
  position: absolute;
  left: 11.5%;
  bottom: 9.5%;
  font-family: var(--font-xiaowei);
  font-size: 13.5px;
  letter-spacing: 0.26em;
  color: color-mix(in srgb, var(--back-ink) 52%, transparent);
  z-index: 3;
}

/* 偏心朱砂/古金小篆印（替代死板居中方框） */
.card-back-seal {
  position: absolute;
  right: 12.5%;
  bottom: 10%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  border: 1px solid rgba(176, 58, 54, 0.78);
  font-family: var(--font-title);
  font-size: 20px;
  line-height: 1;
  color: #faf6ee;
  background: linear-gradient(155deg, #ba3f39 0%, #982b27 100%);
  box-shadow: 0 3px 10px rgba(152, 43, 39, 0.24);
  transform: rotate(-2deg);
  z-index: 3;
}

/* 高品阶卡背入场悬念流光扫掠（仅播放一次，绝不俗气闪烁） */
.card-back-tease {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  background: linear-gradient(
    118deg,
    transparent 26%,
    color-mix(in srgb, var(--back-foil-a) 55%, white 30%) 50%,
    transparent 74%
  );
  transform: translateX(-120%);
}

.card.tease-glint .card-back-tease {
  animation: backTeaseSweep 0.92s cubic-bezier(0.22, 0.85, 0.32, 1) forwards;
}

@keyframes backTeaseSweep {
  0%   { opacity: 0; transform: translateX(-115%); }
  22%  { opacity: 0.85; }
  78%  { opacity: 0.72; }
  100% { opacity: 0; transform: translateX(125%); }
}

/* 五品稀有度卡背克制差异化（凡品素宣亚光 vs 能品竹青宣双玉框 vs 妙品冷银青瓷 vs 神品泥金瑞霭 vs 逸品松烟黑金星图） */
.card.rarity-fan .card-back {
  --back-accent: #5e5a52;
  --back-foil-a: #988e7c;
  --back-foil-b: #6e685d;
  background-color: #f6f2e8;
}

.card.rarity-fan .card-back-sheen {
  opacity: calc(0.08 + var(--hyp, 0) * 0.26);
}

.card.rarity-neng .card-back {
  --back-ink: #17241e;
  --back-accent: #3d6b56;
  --back-foil-a: #86b89c;
  --back-foil-b: #4b7d67;
  background-color: #ecf3ee;
  background-image:
    var(--tex-paper),
    radial-gradient(85% 75% at 50% 42%, rgba(244, 252, 247, 0.82) 0%, transparent 72%),
    linear-gradient(158deg, #f4faf6 0%, #e7f0ea 58%, #dce8e0 100%);
  border-color: rgba(68, 114, 92, 0.42);
  box-shadow:
    inset 0 0 0 5px rgba(244, 250, 246, 0.82),
    inset 0 0 0 6.5px rgba(74, 124, 100, 0.34),
    inset 0 0 0 10px rgba(244, 250, 246, 0.65),
    inset 0 0 0 11px rgba(74, 124, 100, 0.18),
    0 0 16px rgba(78, 130, 104, 0.16),
    0 20px 42px rgba(0, 0, 0, 0.45);
}

.card.rarity-neng .card-back-seal {
  border-color: rgba(62, 116, 92, 0.86);
  background: linear-gradient(155deg, #477d64 0%, #2f5b47 100%);
  box-shadow: 0 3px 10px rgba(47, 91, 71, 0.28);
}

.card.rarity-miao .card-back {
  --back-accent: #4c6f7c;
  --back-foil-a: #b8cfd6;
  --back-foil-b: #5c8492;
  background-color: #f3f6f7;
  background-image:
    var(--tex-paper),
    radial-gradient(85% 75% at 50% 42%, rgba(248, 252, 253, 0.76) 0%, transparent 72%),
    linear-gradient(158deg, #f8fbfb 0%, #edf2f3 60%, #e4ecee 100%);
  border-color: rgba(92, 132, 146, 0.44);
  box-shadow:
    inset 0 0 0 6px rgba(246, 250, 251, 0.78),
    inset 0 0 0 7px rgba(92, 132, 146, 0.24),
    0 0 22px rgba(92, 132, 146, 0.22),
    0 20px 42px rgba(0, 0, 0, 0.46);
}

.card.rarity-shen .card-back {
  --back-accent: #9a7632;
  --back-foil-a: #e2be6c;
  --back-foil-b: #b48c3e;
  background-color: #faf6ec;
  background-image:
    var(--tex-paper),
    radial-gradient(82% 72% at 50% 42%, rgba(255, 250, 236, 0.80) 0%, transparent 72%),
    linear-gradient(158deg, #fdfbf4 0%, #f5eedc 58%, #ece2ca 100%);
  border-color: rgba(207, 169, 86, 0.64);
  box-shadow:
    inset 0 0 0 6px rgba(252, 248, 238, 0.8),
    inset 0 0 0 7px rgba(207, 169, 86, 0.42),
    0 0 28px rgba(207, 169, 86, 0.28),
    0 22px 46px rgba(0, 0, 0, 0.50);
}

.card.rarity-shen .card-back-seal {
  border-color: rgba(207, 169, 86, 0.88);
  background: linear-gradient(155deg, #cfa650 0%, #987128 100%);
  box-shadow: 0 3px 12px rgba(176, 132, 46, 0.34);
}

/* 逸品：松烟墨拓泥金典藏卡背（与艮山玄函同脉，一眼惊艳且不失典雅） */
.card.rarity-yi .card-back {
  --back-ink: #efe4cc;
  --back-accent: #d4b064;
  --back-foil-a: #f0cf7e;
  --back-foil-b: #c8463e;
  background-color: #171a20;
  background-image:
    var(--tex-paper),
    radial-gradient(78% 68% at 50% 42%, rgba(214, 178, 98, 0.14) 0%, transparent 68%),
    linear-gradient(158deg, #21252e 0%, #15181e 56%, #0f1116 100%);
  border-color: rgba(218, 178, 92, 0.72);
  box-shadow:
    inset 0 0 0 6px rgba(22, 25, 32, 0.85),
    inset 0 0 0 7px rgba(218, 178, 92, 0.46),
    0 0 34px rgba(196, 62, 54, 0.30),
    0 0 18px rgba(218, 178, 92, 0.22),
    0 24px 50px rgba(0, 0, 0, 0.58);
}

.card.rarity-yi .card-back-enso {
  filter: invert(1) sepia(0.42) saturate(1.4) brightness(0.95) drop-shadow(0 0 10px rgba(218, 178, 92, 0.28));
  opacity: 0.82;
}

.card.rarity-yi .card-back-sheen {
  mix-blend-mode: screen;
  opacity: calc(0.22 + var(--hyp, 0) * 0.56);
}

.card.rarity-yi .card-back-colophon {
  color: rgba(236, 224, 198, 0.52);
}

.card.unrevealed.is-hovered .card-back {
  border-color: color-mix(in srgb, var(--back-foil-a) 72%, rgba(80, 72, 58, 0.3));
  box-shadow:
    inset 0 0 0 6px rgba(252, 250, 245, 0.72),
    inset 0 0 0 7px color-mix(in srgb, var(--back-foil-a) 46%, transparent),
    0 28px 54px rgba(0, 0, 0, 0.56),
    0 0 26px color-mix(in srgb, var(--back-foil-a) 26%, transparent);
}

.card.unrevealed.rarity-yi.is-hovered .card-back {
  box-shadow:
    inset 0 0 0 6px rgba(22, 25, 32, 0.85),
    inset 0 0 0 7px rgba(232, 194, 108, 0.65),
    0 28px 56px rgba(0, 0, 0, 0.64),
    0 0 38px rgba(204, 68, 56, 0.38);
}

/* 卡牌厚边 */
.card-edge {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: var(--card-edge-color, #b9afa0);
  pointer-events: none;
}
.card-edge:nth-child(1) { transform: translateZ(-1px); }
.card-edge:nth-child(2) { transform: translateZ(-2px); }
.card-edge:nth-child(3) { transform: translateZ(-3px); }

/* 卡面 */
.card-face {
  --px: 50;
  --py: 50;
  --hyp: 0;
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  overflow: hidden;
  transform-style: preserve-3d;
  contain: layout style;
  background-color: #f6f1e6;
  background-image: var(--tex-paper);
  background-size: 320px 320px;
  color: #1c1b18;
  box-shadow:
    inset 0 0 0 1px rgba(90, 78, 60, 0.3),
    0 20px 40px rgba(0, 0, 0, 0.44);
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.card.rarity-miao .card-face {
  box-shadow: inset 0 0 0 1.5px rgba(125, 143, 179, 0.55), 0 22px 44px rgba(0, 0, 0, 0.48);
}

.card.rarity-shen .card-face {
  box-shadow:
    inset 0 0 0 2px rgba(207, 169, 86, 0.85),
    0 0 28px rgba(207, 169, 86, 0.25),
    0 22px 48px rgba(0, 0, 0, 0.54);
}

.card.rarity-yi .card-face {
  box-shadow:
    inset 0 0 0 2px rgba(192, 57, 43, 0.82),
    inset 0 0 0 4px rgba(207, 169, 86, 0.55),
    0 0 34px rgba(192, 57, 43, 0.34),
    0 24px 52px rgba(0, 0, 0, 0.58);
}

.card-inner-frame {
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  border: 1px solid rgba(45, 40, 32, 0.16);
  pointer-events: none;
  z-index: 6;
}

.card.rarity-shen .card-inner-frame {
  border-color: rgba(186, 142, 48, 0.5);
}

.card.rarity-yi .card-inner-frame {
  border-color: rgba(180, 40, 45, 0.42);
}

/* ---------- 画窗：四层水墨动态晕染视差核心（无框直入宣纸，杜绝贴图方框感） ---------- */
.art-window {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background-color: transparent;
  overflow: hidden;
  transform-style: preserve-3d;
  contain: layout style;
  border: 0;
}

.ink-layer {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: contain;
  pointer-events: none;
  will-change: transform, opacity;
  transition: opacity 0.22s ease;
  -webkit-mask-image: radial-gradient(96% 96% at 50% 50%, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
  mask-image: radial-gradient(96% 96% at 50% 50%, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
}

.layer-base {
  mix-blend-mode: multiply;
  z-index: 1;
}

/* 关键防白框与防闪烁修复：
 * 1. 当 .art-window 尚未挂上 .layered 时，必须解除 transform-style: preserve-3d 与 contain: layout style 的堆栈隔离，
 *    让 .layer-base 的 mix-blend-mode: multiply 从第 0 毫秒起直接与 .card-face 宣纸/异彩底色相乘融合，彻底消除首次开卡 1-2s 的白底方框！
 * 2. 同时严格隐藏未解码完毕的分层 img，待 Worker 图层单帧原子切换后再恢复 preserve-3d 3D 视差。
 */
.art-window:not(.layered) {
  transform-style: flat;
  contain: none;
}

.art-window:not(.layered) .layer-base {
  will-change: auto;
}

.art-window:not(.layered) .layer-mist,
.art-window:not(.layered) .layer-wash,
.art-window:not(.layered) .layer-bloom,
.art-window:not(.layered) .layer-bloom-b,
.art-window:not(.layered) .layer-crest,
.art-window:not(.layered) .layer-ink,
.art-window:not(.layered) .layer-p2-back,
.art-window:not(.layered) .layer-p2-front,
.art-window:not(.layered) .layer-p3-back,
.art-window:not(.layered) .layer-p3-mid,
.art-window:not(.layered) .layer-p3-front,
.art-window:not(.layered) .layer-p35-float,
.art-window:not(.layered) .layer-veil-inner,
.art-window:not(.layered) .layer-veil-body,
.art-window:not(.layered) .layer-veil-garment,
.art-window:not(.layered) .layer-lenti-veil-inner,
.art-window:not(.layered) .layer-lenti-veil-body,
.art-window:not(.layered) .layer-lenti-veil-garment,
.art-window:not(.layered) .layer-edge-glint,
.art-window:not(.layered) .layer-angle-refract {
  opacity: 0 !important;
  visibility: hidden;
  transition: none !important;
}

.art-window.layered .layer-base {
  opacity: 0;
  visibility: hidden;
}

/* 第 1 层：远山淡烟（向深处沉入） */
.layer-mist {
  z-index: 2;
  opacity: 0.45;
  transform: translate3d(
    calc((var(--px) - 50) * -0.11px * var(--depth-scale)),
    calc((var(--py) - 50) * -0.11px * var(--depth-scale)),
    2px
  );
}

.card.rarity-fan .layer-mist {
  opacity: 0.25;
}

/* 第 2 层：中景淡墨晕染 */
.layer-wash {
  z-index: 2;
  opacity: 0.94;
  transform: translate3d(
    calc((var(--px) - 50) * -0.05px * var(--depth-scale)),
    calc((var(--py) - 50) * -0.05px * var(--depth-scale)),
    5px
  );
}

/* 第 3 层：高罕动态水墨晕染层（随卡片转动角度呼吸舒卷、定向晕散） */
.layer-bloom {
  z-index: 3;
  opacity: 0;
  mix-blend-mode: multiply;
  transform-origin: calc(var(--px) * 1%) calc(var(--py) * 1%);
  transform: translate3d(
    calc((var(--px) - 50) * 0.04px * var(--depth-scale)),
    calc((var(--py) - 50) * 0.04px * var(--depth-scale)),
    8px
  ) scale(calc(1 + var(--hyp) * 0.025 * var(--depth-scale)));
}

.layer-bloom-b {
  z-index: 3;
  opacity: 0;
  mix-blend-mode: multiply;
  transform-origin: calc((100 - var(--px)) * 1%) calc((100 - var(--py)) * 1%);
  transform: translate3d(
    calc((var(--px) - 50) * -0.07px * var(--depth-scale)),
    calc((var(--py) - 50) * -0.07px * var(--depth-scale)),
    7px
  ) scale(calc(1.01 + var(--hyp) * 0.03 * var(--depth-scale)));
}

.card.rarity-miao .layer-bloom {
  opacity: calc((0.18 + var(--hyp) * 0.42) * var(--foil-scale));
  -webkit-mask-image: radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 18%, transparent 78%);
  mask-image: radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 18%, transparent 78%);
}

.card.rarity-shen .layer-bloom {
  opacity: calc((0.14 + var(--hyp) * 0.36) * var(--foil-scale));
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 22%, rgba(0, 0, 0, 0.25) 58%, transparent 88%);
  mask-image: radial-gradient(ellipse 75% 65% at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 22%, rgba(0, 0, 0, 0.25) 58%, transparent 88%);
}

.card.rarity-shen .layer-bloom-b {
  opacity: calc((0.1 + var(--hyp) * 0.24) * var(--foil-scale));
  filter: sepia(0.55) saturate(1.5);
}

.card.rarity-yi .layer-bloom {
  opacity: calc((0.18 + var(--hyp) * 0.42) * var(--foil-scale));
  -webkit-mask-image: radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 26%, rgba(0, 0, 0, 0.3) 62%, transparent 92%);
  mask-image: radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), #000 26%, rgba(0, 0, 0, 0.3) 62%, transparent 92%);
}

.card.rarity-yi .layer-bloom-b {
  opacity: calc((0.14 + var(--hyp) * 0.32) * var(--foil-scale));
  filter: hue-rotate(calc((var(--px) - 50) * 1.4deg)) saturate(1.35);
}

/* 第 4 层：近景浓墨主体层（无 CSS filter，保持 4K 矢量级锐利度） */
.layer-ink {
  z-index: 4;
  image-rendering: high-quality;
  transform: translate3d(
    calc((var(--px) - 50) * 0.13px * var(--depth-scale)),
    calc((var(--py) - 50) * 0.13px * var(--depth-scale)),
    12px
  );
}

/* 墨线流光层（与浓墨主体完全同位同频，用 edge alpha 做稀疏遮罩，照亮笔锋而不糊白底） */
.layer-edge-glint {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  -webkit-mask-image: var(--edge-url);
  mask-image: var(--edge-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  mix-blend-mode: screen;
  transform: translate3d(
    calc((var(--px) - 50) * 0.13px * var(--depth-scale)),
    calc((var(--py) - 50) * 0.13px * var(--depth-scale)),
    13px
  );
}

.card.rarity-neng .layer-edge-glint {
  opacity: calc((0.18 + var(--hyp) * 0.45) * var(--foil-scale));
  background: linear-gradient(
    115deg,
    transparent calc(var(--px, 50) * 1% - 34%),
    rgba(110, 198, 214, 0.72) calc(var(--px, 50) * 1%),
    transparent calc(var(--px, 50) * 1% + 34%)
  );
}

.card.rarity-miao .layer-edge-glint {
  opacity: calc((0.22 + var(--hyp) * 0.55) * var(--foil-scale));
  background: linear-gradient(
    125deg,
    transparent calc(var(--px, 50) * 1% - 34%),
    rgba(162, 190, 255, 0.85) calc(var(--px, 50) * 1% - 12%),
    rgba(255, 244, 210, 0.9) calc(var(--px, 50) * 1%),
    transparent calc(var(--px, 50) * 1% + 32%)
  );
}

.card.rarity-shen .layer-edge-glint {
  opacity: calc((0.28 + var(--hyp) * 0.68) * var(--foil-scale));
  background: linear-gradient(
    120deg,
    transparent calc(var(--px, 50) * 1% - 34%),
    rgba(255, 218, 120, 0.95) calc(var(--px, 50) * 1% - 10%),
    rgba(255, 252, 232, 1) calc(var(--px, 50) * 1%),
    rgba(220, 168, 62, 0.9) calc(var(--px, 50) * 1% + 12%),
    transparent calc(var(--px, 50) * 1% + 36%)
  );
}

.card.rarity-yi .layer-edge-glint {
  opacity: min(0.72, calc((0.20 + var(--hyp) * 0.42) * min(var(--foil-scale), 1.6)));
  background: linear-gradient(
    calc(var(--px, 50) * 1.4deg + 110deg),
    transparent calc(var(--px, 50) * 1% - 34%),
    rgba(242, 206, 122, 0.88) calc(var(--px, 50) * 1% - 10%),
    rgba(255, 248, 224, 0.96) calc(var(--px, 50) * 1%),
    rgba(196, 152, 68, 0.78) calc(var(--px, 50) * 1% + 12%),
    transparent calc(var(--px, 50) * 1% + 36%)
  );
}

/* ---------- P1 翻牌定格非粒子顶奢特效：墨骨先定后渗晕 + 墨骨边缘一次性游金扫掠 + 舞台活墨微动 ---------- */
.card.just-revealed .art-window.layered .layer-wash,
.card.just-revealed .art-window.layered .layer-p2-back {
  animation: inkWashSeep 0.36s cubic-bezier(0.18, 0.88, 0.32, 1) both;
}

.card.just-revealed .art-window.layered .layer-mist,
.card.just-revealed .art-window.layered .layer-p3-back {
  animation: inkMistSeep 0.44s cubic-bezier(0.18, 0.88, 0.32, 1) 0.04s both;
}

@keyframes inkWashSeep {
  0% {
    opacity: 0.08;
    transform: translate3d(0, 0, 5px) scale(0.955);
  }
  100% {
    opacity: 0.94;
    transform: translate3d(
      calc((var(--px) - 50) * -0.05px * var(--depth-scale)),
      calc((var(--py) - 50) * -0.05px * var(--depth-scale)),
      5px
    ) scale(1);
  }
}

@keyframes inkMistSeep {
  0% {
    opacity: 0.04;
    transform: translate3d(0, 0, 2px) scale(0.94);
  }
  100% {
    opacity: 0.45;
    transform: translate3d(
      calc((var(--px) - 50) * -0.11px * var(--depth-scale)),
      calc((var(--py) - 50) * -0.11px * var(--depth-scale)),
      2px
    ) scale(1);
  }
}

.card.glint-sweep .layer-edge-glint {
  animation: edgeGlintSweep 0.72s cubic-bezier(0.2, 0.85, 0.3, 1) both;
}

@keyframes edgeGlintSweep {
  0% {
    opacity: 0.95;
    filter: brightness(1.65);
    -webkit-mask-position: center;
  }
  45% {
    opacity: 1;
    filter: brightness(1.9);
  }
  100% {
    opacity: calc((0.26 + var(--hyp) * 0.62) * var(--foil-scale));
    filter: brightness(1);
  }
}

/* 舞台正面神品/逸品即时活墨微动（不新建 WebGL Context，纯 GPU 合成层驱动躯干呼吸与云气微流） */
.card.stage-live-breath.revealed:not(.is-zoomed) .art-window.layered .layer-ink {
  transform-origin: 50% 92%;
  animation: stageInkBreath 3.5s ease-in-out infinite;
}

.card.stage-live-breath.revealed:not(.is-zoomed) .art-window.layered .layer-mist {
  animation: stageMistFlow 5.4s ease-in-out infinite;
}

@keyframes stageInkBreath {
  0%, 100% {
    transform: translate3d(
      calc((var(--px) - 50) * 0.13px * var(--depth-scale)),
      calc((var(--py) - 50) * 0.13px * var(--depth-scale)),
      12px
    ) scaleY(1) rotate(0deg);
  }
  50% {
    transform: translate3d(
      calc((var(--px) - 50) * 0.13px * var(--depth-scale) + 0.9px),
      calc((var(--py) - 50) * 0.13px * var(--depth-scale) - 1.1px),
      12px
    ) scaleY(1.008) rotate(0.28deg);
  }
}

@keyframes stageMistFlow {
  0%, 100% {
    transform: translate3d(
      calc((var(--px) - 50) * -0.11px * var(--depth-scale) - 1.5px),
      calc((var(--py) - 50) * -0.11px * var(--depth-scale)),
      2px
    );
  }
  50% {
    transform: translate3d(
      calc((var(--px) - 50) * -0.11px * var(--depth-scale) + 2.2px),
      calc((var(--py) - 50) * -0.11px * var(--depth-scale) - 1.2px),
      2px
    );
  }
}

/* ---------- 宣纸闪卡工艺层（严密贴合画窗平面，旋转零溢边） ---------- */
.foil-ink-holo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transform: translateZ(0.6px);
  -webkit-mask-image: radial-gradient(84% 82% at 50% 48%, #000 30%, rgba(0, 0, 0, 0.46) 64%, transparent 94%);
  mask-image: radial-gradient(84% 82% at 50% 48%, #000 30%, rgba(0, 0, 0, 0.46) 64%, transparent 94%);
}

.card.rarity-neng .foil-ink-holo {
  opacity: calc((0.12 + var(--hyp) * 0.24) * var(--foil-scale));
  background: radial-gradient(
    circle at calc(var(--px) * 1%) calc(var(--py) * 1%),
    rgba(130, 198, 210, 0.22) 0%,
    transparent 60%
  );
  mix-blend-mode: multiply;
}

.card.rarity-miao .foil-ink-holo,
.card.variant-mica .foil-ink-holo {
  opacity: calc((0.16 + var(--hyp) * 0.36) * var(--foil-scale));
  background-image:
    var(--tex-mica),
    radial-gradient(circle at calc(var(--px) * 1%) calc(var(--py) * 1%), rgba(175, 200, 240, 0.32) 0%, transparent 62%);
  background-size: 180px 180px, 100% 100%;
  background-position: calc((var(--px) - 50) * 0.2px) calc((var(--py) - 50) * 0.2px), center;
  mix-blend-mode: soft-light;
}

.card.rarity-shen .foil-ink-holo,
.card.variant-gold .foil-ink-holo {
  opacity: calc((0.22 + var(--hyp) * 0.44) * var(--foil-scale));
  background-color: transparent;
  background-image:
    var(--tex-gold),
    var(--tex-mica),
    radial-gradient(ellipse 68% 58% at calc(var(--px) * 1%) calc(var(--py) * 1%), rgba(244, 214, 134, 0.32) 0%, transparent 72%);
  background-size: 260px 260px, 180px 180px, 100% 100%;
  background-position: calc((var(--px) - 50) * 0.35px) calc((var(--py) - 50) * 0.35px), 0 0, center;
  mix-blend-mode: soft-light;
}

.card.rarity-yi .foil-ink-holo {
  opacity: calc((0.26 + var(--hyp) * 0.5) * var(--foil-scale));
  background-image:
    var(--tex-gold),
    var(--tex-mica),
    radial-gradient(
      circle at calc(var(--px) * 1%) calc(var(--py) * 1%),
      rgba(245, 206, 104, 0.28) 0%,
      rgba(96, 198, 190, 0.18) 42%,
      transparent 76%
    );
  background-size: 240px 240px, 160px 160px, 100% 100%;
  mix-blend-mode: soft-light;
}

/* 第 5 细分脊锋层（十重破境起开启）与五阶实时 WebGL 活墨 Live2D 层 */
.layer-crest {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  transform: translate3d(
    calc((var(--px) - 50) * 0.06px * var(--depth-scale)),
    calc((var(--py) - 50) * 0.06px * var(--depth-scale)),
    10px
  );
}

.living-ink-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  transform: translateZ(0.5px);
}

/* 12 阶专属：36×54 分层网格程序化微动（伪骨骼活画）前景主体渲染层（与 .ink-layer 保持 100% 相同 108% 画幅与 contain 比例，零大小圈错位） */
.living-mesh-canvas {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: contain;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  -webkit-mask-image: radial-gradient(96% 96% at 50% 50%, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
  mask-image: radial-gradient(96% 96% at 50% 50%, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.10px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.10px * var(--wb-subj-depth, 1)),
    calc(4px + var(--wb-subj-depth, 1) * 3.2px)
  ) scale(var(--wb-subj-scale, 1));
}

.card[data-live2d='1'][data-mesh-ready='1'] .living-mesh-canvas {
  opacity: 1;
}

/* 当 12 阶 36×54 伪骨骼网格就绪时，它已完整承载 cutout 主体水墨，必须同步隐藏底下全部静态重影层，彻底根治水平或倾斜时的大小圈双影！ */
.card[data-live2d='1'][data-mesh-ready='1'] .layer-ink,
.card[data-live2d='1'][data-mesh-ready='1'] .layer-wash,
.card[data-live2d='1'][data-mesh-ready='1'] .layer-crest,
.card[data-live2d='1'][data-mesh-ready='1'] .layer-bloom,
.card[data-live2d='1'][data-mesh-ready='1'] .layer-bloom-b {
  opacity: 0 !important;
  transition: opacity 0.18s ease;
}

/* ========== 十二极境（Tier 4）：分卷帙（data-series）多层错相 Live2D 活墨呼吸系统 ========== */
/* 使用独立 translate / rotate / scale 属性，与 3D 视差 transform: translate3d() 完美叠加、互不覆盖 */
@keyframes l2dMistBillow {
  0%, 100% { translate: 0px 0px; scale: 1 1; }
  50% { translate: calc(7px * var(--l2d-sway, 1)) calc(-4px * var(--l2d-sway, 1)); scale: calc(1 + 0.035 * var(--l2d-sway, 1)) calc(1 + 0.015 * var(--l2d-sway, 1)); }
}
@keyframes l2dBeastTorso {
  0%, 100% { translate: 0px 0px; scale: 1 1; rotate: 0deg; }
  45% { translate: 0px calc(-3.8px * var(--l2d-amp, 1)); scale: calc(1 + 0.025 * var(--l2d-amp, 1)) calc(1 - 0.015 * var(--l2d-amp, 1)); rotate: calc(-0.8deg * var(--l2d-amp, 1)); }
  75% { translate: calc(1.6px * var(--l2d-amp, 1)) calc(-1.5px * var(--l2d-amp, 1)); scale: calc(1 - 0.008 * var(--l2d-amp, 1)) calc(1 + 0.022 * var(--l2d-amp, 1)); rotate: calc(0.6deg * var(--l2d-amp, 1)); }
}
@keyframes l2dBeastPlume {
  0%, 100% { translate: 0px 0px; scale: 1 1; rotate: 0deg; }
  35% { translate: calc(-4.5px * var(--l2d-sway, 1)) calc(-3px * var(--l2d-sway, 1)); scale: calc(1 + 0.038 * var(--l2d-sway, 1)) calc(1 - 0.018 * var(--l2d-sway, 1)); rotate: calc(1.8deg * var(--l2d-sway, 1)); }
  70% { translate: calc(4.8px * var(--l2d-sway, 1)) calc(2.2px * var(--l2d-sway, 1)); scale: calc(1 - 0.015 * var(--l2d-sway, 1)) calc(1 + 0.032 * var(--l2d-sway, 1)); rotate: calc(-1.6deg * var(--l2d-sway, 1)); }
}
@keyframes l2dNarrativeBoat {
  0%, 100% { translate: calc(-3px * var(--l2d-amp, 1)) 0px; rotate: calc(-0.5deg * var(--l2d-amp, 1)); }
  50% { translate: calc(4.5px * var(--l2d-amp, 1)) calc(-2.8px * var(--l2d-amp, 1)); rotate: calc(0.6deg * var(--l2d-amp, 1)); }
}
@keyframes l2dNarrativeWave {
  0%, 100% { translate: calc(5px * var(--l2d-sway, 1)) 0px; scale: calc(1 + 0.02 * var(--l2d-sway, 1)) 1; }
  50% { translate: calc(-6.5px * var(--l2d-sway, 1)) calc(-2px * var(--l2d-sway, 1)); scale: calc(1 + 0.045 * var(--l2d-sway, 1)) calc(1 + 0.016 * var(--l2d-sway, 1)); }
}
@keyframes l2dArchSteady {
  0%, 100% { scale: 1 1; }
  50% { scale: calc(1 + 0.01 * var(--l2d-amp, 1)) calc(1 + 0.01 * var(--l2d-amp, 1)); }
}
@keyframes l2dArchCloud {
  0%, 100% { translate: calc(-6px * var(--l2d-sway, 1)) 0px; scale: calc(1 + 0.015 * var(--l2d-sway, 1)) 1; }
  50% { translate: calc(7.5px * var(--l2d-sway, 1)) calc(-3.5px * var(--l2d-sway, 1)); scale: calc(1 + 0.045 * var(--l2d-sway, 1)) calc(1 + 0.022 * var(--l2d-sway, 1)); }
}
@keyframes l2dWeaponHover {
  0%, 100% { translate: 0px calc(2px * var(--l2d-amp, 1)); rotate: calc(-0.6deg * var(--l2d-amp, 1)); scale: 1 1; }
  50% { translate: 0px calc(-6px * var(--l2d-amp, 1)); rotate: calc(0.7deg * var(--l2d-amp, 1)); scale: calc(1 + 0.02 * var(--l2d-amp, 1)) calc(1 + 0.02 * var(--l2d-amp, 1)); }
}
@keyframes l2dElixirVapor {
  0%, 100% { translate: 0px calc(2px * var(--l2d-amp, 1)); scale: 0.99 1.01; }
  50% { translate: 0px calc(-6.5px * var(--l2d-amp, 1)); scale: calc(1 + 0.035 * var(--l2d-amp, 1)) calc(1 + 0.042 * var(--l2d-amp, 1)); }
}
@keyframes l2dHeroBreath {
  0%, 100% { translate: 0px 0px; scale: 1 1; rotate: 0deg; }
  48% { translate: 0px calc(-2.4px * var(--l2d-amp, 1)); scale: calc(1 + 0.012 * var(--l2d-amp, 1)) calc(1 + 0.016 * var(--l2d-amp, 1)); rotate: calc(-0.32deg * var(--l2d-amp, 1)); }
}
@keyframes l2dHeroRobe {
  0%, 100% { translate: 0px 0px; scale: 1 1; rotate: 0deg; }
  40% { translate: calc(3.2px * var(--l2d-sway, 1)) calc(-1.8px * var(--l2d-sway, 1)); scale: calc(1 + 0.024 * var(--l2d-sway, 1)) calc(1 - 0.01 * var(--l2d-sway, 1)); rotate: calc(0.85deg * var(--l2d-sway, 1)); }
  75% { translate: calc(-2.8px * var(--l2d-sway, 1)) calc(1.2px * var(--l2d-sway, 1)); scale: calc(1 - 0.008 * var(--l2d-sway, 1)) calc(1 + 0.02 * var(--l2d-sway, 1)); rotate: calc(-0.65deg * var(--l2d-sway, 1)); }
}

@media (prefers-reduced-motion: no-preference) {
  /* 默认通用 Live2D 呼吸 */
  .card[data-tier='4'][data-live2d='1'] .layer-mist {
    animation: l2dMistBillow 5.2s ease-in-out infinite;
  }
  .card[data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-tier='4'][data-live2d='1'] .layer-crest {
    animation: l2dBeastPlume 4.4s ease-in-out infinite;
  }
  .card[data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-tier='4'][data-live2d='1'] .layer-edge-glint,
  .card[data-tier='4'][data-live2d='1'] .layer-lenticular-b {
    animation: l2dBeastTorso 3.6s ease-in-out infinite;
  }

  /* 0. 人物志：侠客温润胸息起伏 + 宽袖丝带/发梢错相拂风 */
  .card[data-series='人物志'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='人物志'][data-tier='4'][data-live2d='1'] .layer-edge-glint,
  .card[data-series='人物志'][data-tier='4'][data-live2d='1'] .layer-lenticular-b {
    animation: l2dHeroBreath 3.8s ease-in-out infinite;
  }
  .card[data-series='人物志'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='人物志'][data-tier='4'][data-live2d='1'] .layer-crest {
    animation: l2dHeroRobe 3.2s ease-in-out infinite;
  }

  /* 1. 生灵志：灵兽胸腹呼吸起伏 + 尾羽长鬃错相摆动 */
  .card[data-series='生灵志'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='生灵志'][data-tier='4'][data-live2d='1'] .layer-edge-glint {
    animation: l2dBeastTorso 3.1s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  }
  .card[data-series='生灵志'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='生灵志'][data-tier='4'][data-live2d='1'] .layer-crest {
    animation: l2dBeastPlume 2.7s ease-in-out infinite;
  }

  /* 2. 浮生纪事：烟水行舟横向摇曳 + 远山雾浪流转 */
  .card[data-series='浮生纪事'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='浮生纪事'][data-tier='4'][data-live2d='1'] .layer-edge-glint {
    animation: l2dNarrativeBoat 4.8s ease-in-out infinite;
  }
  .card[data-series='浮生纪事'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='浮生纪事'][data-tier='4'][data-live2d='1'] .layer-mist {
    animation: l2dNarrativeWave 5.6s ease-in-out infinite;
  }

  /* 3. 山河风物 & 宗门王庭：静态建筑山岳巍然不动，唯云岚绕檐舒卷 */
  .card[data-series='山河风物'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='山河风物'][data-tier='4'][data-live2d='1'] .layer-edge-glint,
  .card[data-series='宗门王庭'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='宗门王庭'][data-tier='4'][data-live2d='1'] .layer-edge-glint {
    animation: l2dArchSteady 7.5s ease-in-out infinite;
  }
  .card[data-series='山河风物'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='山河风物'][data-tier='4'][data-live2d='1'] .layer-mist,
  .card[data-series='宗门王庭'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='宗门王庭'][data-tier='4'][data-live2d='1'] .layer-mist {
    animation: l2dArchCloud 4.6s ease-in-out infinite;
  }

  /* 4. 神兵谱：名器凌空微悬颤吟 + 寒芒吞吐 */
  .card[data-series='神兵谱'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='神兵谱'][data-tier='4'][data-live2d='1'] .layer-edge-glint,
  .card[data-series='神兵谱'][data-tier='4'][data-live2d='1'] .layer-crest {
    animation: l2dWeaponHover 2.9s ease-in-out infinite;
  }

  /* 5. 百草丹石 & 道途秘典：丹气药香袅袅上浮 + 周天吐纳 */
  .card[data-series='百草丹石'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='百草丹石'][data-tier='4'][data-live2d='1'] .layer-bloom,
  .card[data-series='道途秘典'][data-tier='4'][data-live2d='1'] .layer-wash,
  .card[data-series='道途秘典'][data-tier='4'][data-live2d='1'] .layer-bloom {
    animation: l2dElixirVapor 3.8s ease-in-out infinite;
  }
}

/* ========== 藏经阁五重升阶（1 / 2 / 5 / 10 / 12）阶梯递进视觉体系 ========== */
/* 〇、初印 · 素楮本真（1卷）：收束视差与金箔，还原安静平面的初印宣纸本真感 */
.card[data-tier='0'] {
  --depth-scale: 0.42;
  --foil-scale: 0.25;
}
.card[data-tier='0'] .layer-edge-glint,
.card[data-tier='0'] .foil-diamond,
.card[data-tier='0'] .layer-crest,
.card[data-tier='0'] .layer-bloom,
.card[data-tier='0'] .layer-bloom-b {
  opacity: 0 !important;
}
.card[data-tier='0'] .foil-ink-holo {
  opacity: calc(0.06 + var(--hyp, 0) * 0.10) !important;
}

/* 一、二重境 · 叠嶂浮岚（2卷）：破纸立体浮雕 + 真实纸面墨影 + 绫罗流光带 + 初染铜金双阑框（1->2 阶跃迁 = 2等） */
.card[data-tier='1'] {
  --depth-scale: 2.35;
  --foil-scale: 1.25;
}
.card[data-tier='1'] .foil-diamond,
.card[data-tier='1'] .layer-crest {
  opacity: 0 !important;
}
.card[data-tier='1'] .layer-mist {
  opacity: 0.62;
  transform: translate3d(
    calc((var(--px) - 50) * -0.14px * var(--depth-scale)),
    calc((var(--py) - 50) * -0.14px * var(--depth-scale)),
    1px
  ) scale(1.03);
}
.card[data-tier='1'] .layer-bloom {
  opacity: calc(0.26 + var(--hyp, 0) * 0.36) !important;
}
.card[data-tier='1'] .card-inner-frame {
  border-color: rgba(188, 146, 64, 0.64);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 182, 0.42), 0 0 8px rgba(196, 152, 68, 0.16);
}
.card[data-tier='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .layer-ink {
  filter: drop-shadow(
    calc((50 - var(--px, 50)) * 0.24px)
    calc((50 - var(--py, 50)) * 0.24px + 3px)
    6px
    rgba(24, 20, 15, 0.30)
  );
}

/* 二、五重境 · 曜金星芒（5卷）：专属高定闪膜成型 + 云母星钻闪砂 + 前景灵气浮尘 + 鎏金/寒银双阑宝框（2->5 阶跃迁 = 2等） */
.card[data-tier='2'] {
  --depth-scale: 2.85;
  --foil-scale: 2.35;
}
.card[data-tier='2'] .layer-edge-glint {
  opacity: calc(0.42 + var(--hyp, 0) * 0.38) !important;
}
.card[data-tier='2'] .foil-diamond {
  opacity: calc(0.44 + var(--hyp, 0) * 0.52) !important;
}
.card[data-tier='2'] .foil-ink-holo,
.card[data-tier='3'] .foil-ink-holo,
.card[data-tier='4'] .foil-ink-holo {
  opacity: calc(0.46 + var(--hyp, 0) * 0.46) !important;
  background-color: transparent;
  background-image:
    var(--tex-gold),
    var(--tex-mica),
    radial-gradient(
      ellipse 84% 76% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 224, 130, 0.42) 0%,
      rgba(130, 220, 205, 0.28) 45%,
      transparent 84%
    ),
    radial-gradient(
      ellipse 80% 72% at calc(100% - var(--px, 50) * 1%) calc(100% - var(--py, 50) * 1%),
      rgba(225, 185, 248, 0.24) 0%,
      rgba(255, 245, 210, 0.22) 48%,
      transparent 86%
    );
  background-size: 160px 160px, 140px 140px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
  background-position:
    calc((var(--px) - 50) * 0.45px) calc((var(--py) - 50) * 0.45px),
    calc((50 - var(--px)) * 0.3px) calc((50 - var(--py)) * 0.3px),
    center,
    center;
  mix-blend-mode: soft-light;
}

.card[data-tier='2'] .card-inner-frame {
  border-width: 1.5px;
  border-color: rgba(218, 174, 76, 0.90);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 174, 0.65), 0 0 14px rgba(216, 172, 74, 0.34);
}
.card[data-tier='2'] .card-face {
  box-shadow:
    inset 0 0 0 1px rgba(214, 170, 74, 0.55),
    0 0 14px rgba(212, 169, 76, 0.20),
    0 18px 38px rgba(0, 0, 0, 0.34);
}

.card[data-tier='3'] .card-inner-frame,
.card[data-tier='4'] .card-inner-frame {
  border-width: 1.5px;
  border-color: rgba(238, 196, 88, 0.98);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 244, 194, 0.84),
    inset 0 0 12px rgba(238, 192, 78, 0.26),
    0 0 22px rgba(228, 184, 78, 0.54);
}
/* 十重破境 / 十二极境专属：皇家典藏四隅鎏金回字角花（无需额外 DOM，零遮挡画面） */
.card[data-tier='3'] .card-inner-frame::before,
.card[data-tier='4'] .card-inner-frame::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) top left / 18px 2px no-repeat,
    linear-gradient(to bottom, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) top left / 2px 18px no-repeat,
    linear-gradient(to left, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) top right / 18px 2px no-repeat,
    linear-gradient(to bottom, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) top right / 2px 18px no-repeat,
    linear-gradient(to right, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) bottom left / 18px 2px no-repeat,
    linear-gradient(to top, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) bottom left / 2px 18px no-repeat,
    linear-gradient(to left, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) bottom right / 18px 2px no-repeat,
    linear-gradient(to top, rgba(232, 182, 66, 0.95), rgba(232, 182, 66, 0.95)) bottom right / 2px 18px no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 224, 128, 0.72));
}
.card[data-tier='3'][data-finish='silver'] .card-inner-frame::before,
.card[data-tier='4'][data-finish='silver'] .card-inner-frame::before {
  background:
    linear-gradient(to right, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) top left / 18px 2px no-repeat,
    linear-gradient(to bottom, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) top left / 2px 18px no-repeat,
    linear-gradient(to left, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) top right / 18px 2px no-repeat,
    linear-gradient(to bottom, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) top right / 2px 18px no-repeat,
    linear-gradient(to right, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) bottom left / 18px 2px no-repeat,
    linear-gradient(to top, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) bottom left / 2px 18px no-repeat,
    linear-gradient(to left, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) bottom right / 18px 2px no-repeat,
    linear-gradient(to top, rgba(188, 222, 252, 0.96), rgba(188, 222, 252, 0.96)) bottom right / 2px 18px no-repeat;
  filter: drop-shadow(0 0 5px rgba(178, 218, 255, 0.82));
}
.card[data-tier='3'] .card-plaque,
.card[data-tier='4'] .card-plaque {
  border-top-color: rgba(224, 178, 72, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 246, 210, 0.85);
}

/* 三、十重境 · 墨脊神锋（10卷）：六层浮雕全开 + 笔锋边缘高强流金走芒（Edge Glint）+ 灵元外框共鸣 */
.card[data-tier='3'],
.card[data-tier='4'] {
  --depth-scale: 3.45;
  --foil-scale: 3.45;
}

.card[data-tier='4'] {
  --depth-scale: 3.7;
  --foil-scale: 3.7;
}

.card[data-tier='3'] .layer-edge-glint,
.card[data-tier='4'] .layer-edge-glint {
  opacity: calc(0.58 + var(--hyp, 0) * 0.42) !important;
  background: linear-gradient(
    calc(var(--px, 50) * 1.4deg + 108deg),
    transparent calc(var(--px, 50) * 1% - 36%),
    rgba(255, 214, 102, 0.98) calc(var(--px, 50) * 1% - 14%),
    rgba(255, 252, 236, 1) calc(var(--px, 50) * 1%),
    rgba(136, 232, 216, 0.92) calc(var(--px, 50) * 1% + 10%),
    rgba(218, 165, 58, 0.95) calc(var(--px, 50) * 1% + 20%),
    transparent calc(var(--px, 50) * 1% + 40%)
  );
  filter: drop-shadow(0 0 4px rgba(255, 218, 116, 0.55));
}

.card[data-tier='3'] .foil-diamond,
.card[data-tier='4'] .foil-diamond {
  opacity: calc(0.38 + var(--hyp, 0) * 0.56) !important;
}

.card[data-tier='3'] .layer-crest,
.card[data-tier='4'] .layer-crest {
  opacity: 0.94 !important;
}

.card[data-tier='3'] .layer-bloom-b,
.card[data-tier='4'] .layer-bloom-b {
  opacity: calc(0.22 + var(--hyp, 0) * 0.34) !important;
}

.card[data-tier='3'] .card-face {
  box-shadow:
    inset 0 0 0 2px rgba(226, 182, 78, 0.92),
    0 0 32px rgba(226, 182, 78, 0.38),
    0 0 16px var(--el-tint, rgba(212, 175, 90, 0.32)),
    0 22px 46px rgba(0, 0, 0, 0.44);
}

.card[data-tier='3'] .art-window,
.card[data-tier='4'] .art-window {
  overflow: visible;
}

.card[data-tier='3'] .art-window > .layer-mist,
.card[data-tier='3'] .art-window > .layer-wash,
.card[data-tier='3'] .art-window > .layer-bloom,
.card[data-tier='3'] .art-window > .layer-bloom-b,
.card[data-tier='3'] .art-window > .living-ink-canvas,
.card[data-tier='3'] .art-window > .foil-ink-holo,
.card[data-tier='3'] .art-window > .foil-diamond,
.card[data-tier='3'] .art-window > .foil-glare,
.card[data-tier='3'] .art-window > .lenticular-ridges,
.card[data-tier='4'] .art-window > .layer-mist,
.card[data-tier='4'] .art-window > .layer-wash,
.card[data-tier='4'] .art-window > .layer-bloom,
.card[data-tier='4'] .art-window > .layer-bloom-b,
.card[data-tier='4'] .art-window > .living-ink-canvas,
.card[data-tier='4'] .art-window > .foil-ink-holo,
.card[data-tier='4'] .art-window > .foil-diamond,
.card[data-tier='4'] .art-window > .foil-glare,
.card[data-tier='4'] .art-window > .lenticular-ridges {
  clip-path: inset(0 round 6px 6px 2px 2px);
}

.card[data-tier='3'] .layer-ink,
.card[data-tier='3'] .layer-edge-glint,
.card[data-tier='4'] .layer-ink,
.card[data-tier='4'] .layer-edge-glint {
  transform: translate3d(
    calc((var(--px) - 50) * 0.16px * var(--depth-scale)),
    calc((var(--py) - 50) * 0.16px * var(--depth-scale)),
    16px
  ) scale(1.032);
}

/* 五重化境光晕边框 */
.card[data-tier='4'] .card-face {
  box-shadow:
    inset 0 0 0 1.5px rgba(224, 184, 88, 0.85),
    0 0 36px rgba(212, 175, 90, 0.38),
    0 24px 48px rgba(0, 0, 0, 0.45);
}

/* ========== 八大水墨雅韵独立特效异色材质系统（彻底去除中央大白圈 · 随形水墨纸晕护笔触 · 倾侧多色权重流转） ========== */

/* 彻底禁用旧版固定在画窗中央的椭圆形大白圈 ::before */
.card[data-alt='azure_gold'] .art-window::before,
.card[data-alt='vermilion_flame'] .art-window::before,
.card[data-alt='star_night'] .art-window::before,
.card[data-alt='jade_crackle'] .art-window::before,
.card[data-alt='amber_gilt'] .art-window::before,
.card[data-alt='peach_blossom'] .art-window::before {
  display: none !important;
}

/* 深底/矿彩异色统一保持高清分层原画与光栅异画的【正向本真色彩】（严禁 invert() 导致变透视片！） */
.card[data-alt='azure_gold'] .layer-ink,
.card[data-alt='azure_gold'] .living-mesh-canvas,
.card[data-alt='azure_gold'] .layer-wash,
.card[data-alt='azure_gold'] .layer-crest,
.card[data-alt='azure_gold'] .layer-mist,
.card[data-alt='azure_gold'] .layer-lenticular-b,
.card[data-alt='vermilion_flame'] .layer-ink,
.card[data-alt='vermilion_flame'] .living-mesh-canvas,
.card[data-alt='vermilion_flame'] .layer-wash,
.card[data-alt='vermilion_flame'] .layer-crest,
.card[data-alt='vermilion_flame'] .layer-mist,
.card[data-alt='vermilion_flame'] .layer-lenticular-b,
.card[data-alt='star_night'] .layer-ink,
.card[data-alt='star_night'] .living-mesh-canvas,
.card[data-alt='star_night'] .layer-wash,
.card[data-alt='star_night'] .layer-crest,
.card[data-alt='star_night'] .layer-mist,
.card[data-alt='star_night'] .layer-lenticular-b,
.card[data-alt='jade_crackle'] .layer-ink,
.card[data-alt='jade_crackle'] .living-mesh-canvas,
.card[data-alt='jade_crackle'] .layer-wash,
.card[data-alt='jade_crackle'] .layer-crest,
.card[data-alt='jade_crackle'] .layer-mist,
.card[data-alt='jade_crackle'] .layer-lenticular-b,
.card[data-alt='amber_gilt'] .layer-ink,
.card[data-alt='amber_gilt'] .living-mesh-canvas,
.card[data-alt='amber_gilt'] .layer-wash,
.card[data-alt='amber_gilt'] .layer-crest,
.card[data-alt='amber_gilt'] .layer-mist,
.card[data-alt='amber_gilt'] .layer-lenticular-b,
.card[data-alt='peach_blossom'] .layer-ink,
.card[data-alt='peach_blossom'] .living-mesh-canvas,
.card[data-alt='peach_blossom'] .layer-wash,
.card[data-alt='peach_blossom'] .layer-crest,
.card[data-alt='peach_blossom'] .layer-mist,
.card[data-alt='peach_blossom'] .layer-lenticular-b {
  mix-blend-mode: normal;
}
.card[data-alt='azure_gold'] .layer-bloom,
.card[data-alt='azure_gold'] .layer-bloom-b,
.card[data-alt='vermilion_flame'] .layer-bloom,
.card[data-alt='vermilion_flame'] .layer-bloom-b,
.card[data-alt='star_night'] .layer-bloom,
.card[data-alt='star_night'] .layer-bloom-b,
.card[data-alt='jade_crackle'] .layer-bloom,
.card[data-alt='jade_crackle'] .layer-bloom-b,
.card[data-alt='amber_gilt'] .layer-bloom,
.card[data-alt='amber_gilt'] .layer-bloom-b,
.card[data-alt='peach_blossom'] .layer-bloom,
.card[data-alt='peach_blossom'] .layer-bloom-b {
  opacity: 0.16;
  mix-blend-mode: soft-light;
}
.card[data-alt='azure_gold'] .layer-base,
.card[data-alt='vermilion_flame'] .layer-base,
.card[data-alt='star_night'] .layer-base,
.card[data-alt='jade_crackle'] .layer-base,
.card[data-alt='amber_gilt'] .layer-base,
.card[data-alt='peach_blossom'] .layer-base {
  mix-blend-mode: multiply;
}

/* 所有异色画窗与卡身浑然一体：去除画窗生硬内框线，让水墨底纹与卡面无缝交融 */
.card[data-alt='azure_gold'] .art-window,
.card[data-alt='vermilion_flame'] .art-window,
.card[data-alt='star_night'] .art-window,
.card[data-alt='jade_crackle'] .art-window,
.card[data-alt='amber_gilt'] .art-window,
.card[data-alt='peach_blossom'] .art-window,
.card[data-alt='emerald_bamboo'] .art-window,
.card[data-alt='phantom_violet'] .art-window {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* 1. 青绿金碧（北宋王希孟《千里江山图》与金碧山水皇家矿彩：头青石青 · 孔雀石绿 · 24K 泥金勾山轮廓 + 随形泥金翠玉护墨纸晕） */
.card[data-alt='azure_gold'] .card-face {
  background: linear-gradient(
    calc(154deg + (var(--px, 50) - 50) * 0.7deg),
    #0e324c 0%,
    #145248 48%,
    #1f5844 76%,
    #3b381d 100%
  );
  color: #f9efd2;
  box-shadow:
    inset 0 0 0 1.5px rgba(238, 194, 86, 0.82),
    0 0 22px rgba(42, 168, 136, 0.28),
    0 20px 44px rgba(8, 28, 32, 0.56);
}
.card[data-alt='azure_gold'] .art-window {
  background:
    radial-gradient(
      ellipse 82% 72% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(244, 198, 78, 0.42) 0%,
      rgba(36, 152, 122, 0.34) 48%,
      transparent 88%
    ),
    linear-gradient(
      calc(158deg + (var(--px, 50) - 50) * 0.75deg),
      #0f3552 0%,
      #13584c 52%,
      #224c38 100%
    );
}
.card[data-alt='azure_gold'] .layer-ink,
.card[data-alt='azure_gold'] .living-mesh-canvas,
.card[data-alt='azure_gold'] .layer-lenticular-b {
  filter:
    drop-shadow(0 0 2.5px rgba(255, 248, 222, 0.92))
    drop-shadow(0 0 8px rgba(242, 206, 118, 0.68))
    drop-shadow(0 0 18px rgba(72, 204, 168, 0.44)) !important;
}
.card[data-alt='azure_gold'] .layer-wash,
.card[data-alt='azure_gold'] .layer-crest {
  filter:
    drop-shadow(0 0 4px rgba(252, 238, 196, 0.72))
    drop-shadow(0 0 12px rgba(106, 214, 182, 0.48));
}
.card[data-alt='azure_gold'] .card-plaque {
  background: linear-gradient(180deg, rgba(16, 48, 46, 0.95) 0%, #0b2426 100%);
  border-top-color: rgba(238, 194, 86, 0.46);
}

/* 2. 丹砂余烬（#8795A0 冷烟青灰主调与炉火橙红倾侧交融 + 余烬将燃 + 随形纸晕零白圈） */
.card[data-alt='vermilion_flame'] .card-face {
  background: linear-gradient(
    calc(162deg + (var(--px, 50) - 50) * 0.65deg),
    #8795a0 0%,
    #6e7b85 52%,
    #7e4d3b 100%
  );
  color: #f7f2ec;
  box-shadow: inset 0 0 0 1.5px rgba(226, 126, 78, 0.54), 0 20px 44px rgba(42, 48, 54, 0.48);
}
.card[data-alt='vermilion_flame'] .art-window {
  background:
    radial-gradient(
      ellipse 85% 75% at calc(100% - var(--px, 50) * 1%) calc(85% - (var(--py, 50) - 50) * 0.4%),
      rgba(224, 98, 52, 0.44) 0%,
      rgba(135, 149, 160, 0.15) 58%,
      transparent 90%
    ),
    linear-gradient(
      calc(162deg + (var(--px, 50) - 50) * 0.65deg),
      #8795a0 0%,
      #6e7b85 52%,
      #7e4d3b 100%
    );
}
.card[data-alt='vermilion_flame'] .layer-ink,
.card[data-alt='vermilion_flame'] .layer-lenticular-b {
  filter:
    drop-shadow(0 0 3px rgba(245, 240, 234, 0.72))
    drop-shadow(0 0 10px rgba(235, 224, 214, 0.45));
}
.card[data-alt='vermilion_flame'] .layer-wash,
.card[data-alt='vermilion_flame'] .layer-crest {
  filter: drop-shadow(0 0 6px rgba(240, 234, 226, 0.52));
}
.card[data-alt='vermilion_flame'] .card-plaque {
  background: linear-gradient(180deg, rgba(96, 92, 92, 0.42) 0%, rgba(74, 58, 54, 0.78) 100%);
  border-top-color: rgba(224, 122, 74, 0.26);
}

/* 3. 紫微星夜（改回深邃靛蓝星空主调 + 略微点缀一缕紫微星云渐变 + 零白圈） */
.card[data-alt='star_night'] .card-face {
  background: linear-gradient(
    calc(152deg + (var(--px, 50) - 50) * 0.65deg),
    #141e38 0%,
    #182648 54%,
    #0c1224 100%
  );
  color: #efe7d4;
  box-shadow: inset 0 0 0 1.5px rgba(154, 178, 228, 0.50), 0 20px 44px rgba(10, 14, 30, 0.58);
}
.card[data-alt='star_night'] .art-window {
  background:
    radial-gradient(
      ellipse 78% 72% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(86, 56, 138, 0.24) 0%,
      rgba(28, 54, 108, 0.22) 52%,
      transparent 86%
    ),
    linear-gradient(
      calc(152deg + (var(--px, 50) - 50) * 0.65deg),
      #141e38 0%,
      #182648 54%,
      #0c1224 100%
    );
}
.card[data-alt='star_night'] .layer-ink,
.card[data-alt='star_night'] .layer-lenticular-b {
  filter:
    drop-shadow(0 0 2.5px rgba(236, 242, 255, 0.88))
    drop-shadow(0 0 8px rgba(198, 216, 250, 0.68))
    drop-shadow(0 0 18px rgba(154, 182, 238, 0.42));
}
.card[data-alt='star_night'] .layer-wash,
.card[data-alt='star_night'] .layer-crest {
  filter:
    drop-shadow(0 0 4px rgba(226, 236, 255, 0.72))
    drop-shadow(0 0 12px rgba(178, 202, 244, 0.46));
}
.card[data-alt='star_night'] .card-plaque {
  background: linear-gradient(180deg, rgba(18, 28, 54, 0.45) 0%, rgba(12, 18, 36, 0.82) 100%);
  border-top-color: rgba(154, 182, 230, 0.22);
}

/* 4. 金乌日蚀（去白圈！左上天际虚化水墨日蚀 + 赤金·暖赭·玄黑随角度交融 + 随形阳气纸晕） */
.card[data-alt='jade_crackle'] .card-face {
  background: linear-gradient(
    calc(150deg + (var(--px, 50) - 50) * 0.7deg),
    #461c13 0%,
    #281511 54%,
    #141111 100%
  );
  color: #fae9cc;
  box-shadow: inset 0 0 0 1.5px rgba(232, 146, 64, 0.62), 0 20px 44px rgba(36, 14, 10, 0.54);
}
.card[data-alt='jade_crackle'] .art-window {
  background:
    radial-gradient(
      ellipse 78% 72% at calc(24% + (var(--px, 50) - 50) * 0.35%) calc(22% + (var(--py, 50) - 50) * 0.35%),
      rgba(218, 96, 38, 0.42) 0%,
      rgba(124, 42, 22, 0.24) 52%,
      transparent 86%
    ),
    linear-gradient(
      calc(156deg + (var(--px, 50) - 50) * 0.8deg),
      #5c2214 0%,
      #361711 50%,
      #171313 100%
    );
  border-color: rgba(232, 146, 64, 0.46);
}
.card[data-alt='jade_crackle'] .layer-ink,
.card[data-alt='jade_crackle'] .layer-lenticular-b {
  filter:
    drop-shadow(0 0 2.5px rgba(255, 240, 214, 0.86))
    drop-shadow(0 0 8px rgba(246, 204, 142, 0.64))
    drop-shadow(0 0 18px rgba(218, 136, 64, 0.38));
}
.card[data-alt='jade_crackle'] .layer-wash,
.card[data-alt='jade_crackle'] .layer-crest {
  filter:
    drop-shadow(0 0 4px rgba(252, 232, 198, 0.68))
    drop-shadow(0 0 12px rgba(232, 176, 106, 0.42));
}
.card[data-alt='jade_crackle'] .card-plaque {
  background: linear-gradient(180deg, rgba(44, 21, 16, 0.96) 0%, #1b110f 100%);
  border-top-color: rgba(232, 146, 64, 0.36);
}

/* 5. 泥金古宣（去白圈！皇天后土玄黑·古铜·鎏金随角度交融 + 随形泥金纸晕） */
.card[data-alt='amber_gilt'] .card-face {
  background: linear-gradient(
    calc(155deg + (var(--px, 50) - 50) * 0.65deg),
    #2d2214 0%,
    #1b150e 56%,
    #100d0a 100%
  );
  color: #f8e9c4;
  box-shadow: inset 0 0 0 1.5px rgba(226, 184, 86, 0.72), 0 22px 46px rgba(10, 8, 5, 0.62);
}
.card[data-alt='amber_gilt'] .art-window {
  background:
    radial-gradient(
      ellipse 80% 74% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(168, 124, 48, 0.38) 0%,
      rgba(86, 62, 24, 0.22) 54%,
      transparent 88%
    ),
    linear-gradient(
      calc(162deg + (var(--px, 50) - 50) * 0.75deg),
      #332615 0%,
      #1f170e 52%,
      #120e0a 100%
    );
  border-color: rgba(226, 184, 86, 0.42);
}
.card[data-alt='amber_gilt'] .layer-ink,
.card[data-alt='amber_gilt'] .layer-lenticular-b {
  filter:
    drop-shadow(0 0 2.5px rgba(252, 240, 210, 0.86))
    drop-shadow(0 0 8px rgba(234, 202, 132, 0.64))
    drop-shadow(0 0 18px rgba(196, 152, 68, 0.38));
}
.card[data-alt='amber_gilt'] .layer-wash,
.card[data-alt='amber_gilt'] .layer-crest {
  filter:
    drop-shadow(0 0 4px rgba(246, 230, 192, 0.68))
    drop-shadow(0 0 12px rgba(214, 174, 96, 0.42));
}
.card[data-alt='amber_gilt'] .card-plaque {
  background: linear-gradient(180deg, rgba(30, 23, 14, 0.97) 0%, #140f09 100%);
  border-top-color: rgba(226, 184, 86, 0.40);
}

/* 6. 沧溟潮汐（去白圈！深海蓝·沧溟青·月华银随角度交融 + 随形月华纸晕） */
.card[data-alt='peach_blossom'] .card-face {
  background: linear-gradient(
    calc(165deg + (var(--px, 50) - 50) * 0.65deg),
    #173a6a 0%,
    #122e56 54%,
    #0c1f3c 100%
  );
  color: #edf6ff;
  box-shadow: inset 0 0 0 1.5px rgba(138, 196, 244, 0.54), 0 20px 44px rgba(10, 32, 68, 0.54);
}
.card[data-alt='peach_blossom'] .art-window {
  background:
    radial-gradient(
      ellipse 80% 74% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(72, 146, 204, 0.40) 0%,
      rgba(28, 78, 136, 0.24) 54%,
      transparent 88%
    ),
    linear-gradient(
      calc(170deg + (var(--px, 50) - 50) * 0.75deg),
      #214e8a 0%,
      #153768 56%,
      #0e2548 100%
    );
  border-color: rgba(148, 202, 248, 0.42);
}
.card[data-alt='peach_blossom'] .layer-ink,
.card[data-alt='peach_blossom'] .layer-lenticular-b {
  filter:
    drop-shadow(0 0 2.5px rgba(236, 246, 255, 0.88))
    drop-shadow(0 0 8px rgba(192, 224, 252, 0.66))
    drop-shadow(0 0 18px rgba(132, 186, 238, 0.40));
}
.card[data-alt='peach_blossom'] .layer-wash,
.card[data-alt='peach_blossom'] .layer-crest {
  filter:
    drop-shadow(0 0 4px rgba(226, 240, 255, 0.70))
    drop-shadow(0 0 12px rgba(168, 208, 246, 0.44));
}
.card[data-alt='peach_blossom'] .card-plaque {
  background: linear-gradient(180deg, rgba(20, 48, 90, 0.96) 0%, #102950 100%);
  border-top-color: rgba(148, 202, 248, 0.32);
}

/* 7. 竹林深幽（手绘水墨竹宣 + 随晃动流转的竹影青翠与暖阳微晕） */
.card[data-alt='emerald_bamboo'] .card-face {
  background: linear-gradient(
    calc(152deg + (var(--px, 50) - 50) * 0.6deg),
    #eef5ef 0%,
    #dfece1 56%,
    #cfe2d3 100%
  );
  box-shadow: inset 0 0 0 1.5px rgba(58, 108, 76, 0.50), 0 18px 38px rgba(32, 68, 46, 0.22);
}
.card[data-alt='emerald_bamboo'] .art-window {
  background:
    radial-gradient(
      circle at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(244, 248, 218, 0.48) 0%,
      rgba(176, 212, 184, 0.24) 54%,
      transparent 86%
    ),
    linear-gradient(
      calc(155deg + (var(--px, 50) - 50) * 0.7deg),
      #f6faf6 0%,
      #e6f0e7 56%,
      #d0e2d4 100%
    );
  border-color: rgba(58, 108, 76, 0.36);
}
.card[data-alt='emerald_bamboo'] .layer-wash,
.card[data-alt='emerald_bamboo'] .layer-crest {
  filter: sepia(0.14) hue-rotate(94deg) saturate(1.12) contrast(1.04);
}
.card[data-alt='emerald_bamboo'] .card-plaque {
  background: linear-gradient(180deg, rgba(244, 249, 245, 0.96) 0%, #d9e8dc 100%);
  border-top-color: rgba(58, 108, 76, 0.28);
}

/* 8. 紫气东来（东升紫气·朝霞火烧云·破晓金辉三色随角度丝滑交融） */
.card[data-alt='phantom_violet'] .card-face {
  background: linear-gradient(
    calc(172deg + (var(--px, 50) - 50) * 0.7deg),
    #e5d4f2 0%,
    #f0d6e6 52%,
    #f6d0b6 100%
  );
  box-shadow: inset 0 0 0 1.5px rgba(164, 98, 152, 0.56), 0 18px 38px rgba(102, 54, 96, 0.26);
}
.card[data-alt='phantom_violet'] .art-window {
  background:
    radial-gradient(
      ellipse 80% 72% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 198, 136, 0.42) 0%,
      rgba(186, 134, 218, 0.28) 54%,
      transparent 88%
    ),
    linear-gradient(
      calc(176deg + (var(--px, 50) - 50) * 0.8deg),
      #c9b0e6 0%,
      #e6c3dd 46%,
      #f8bc92 100%
    );
  border-color: rgba(164, 98, 152, 0.42);
}
.card[data-alt='phantom_violet'] .layer-wash,
.card[data-alt='phantom_violet'] .layer-crest {
  filter: sepia(0.22) hue-rotate(-46deg) saturate(1.18) contrast(1.04);
}
.card[data-alt='phantom_violet'] .card-plaque {
  background: linear-gradient(180deg, rgba(248, 232, 241, 0.96) 0%, #ecd0c2 100%);
  border-top-color: rgba(164, 98, 152, 0.30);
}

/* 深色/矿彩铭牌异色共通文字与名家签字亮色适配（青绿金碧 / 丹砂余烬 / 紫微星夜 / 金乌日蚀 / 泥金古宣 / 沧溟潮汐） */
.card[data-alt='azure_gold'] .card-title,
.card[data-alt='vermilion_flame'] .card-title,
.card[data-alt='star_night'] .card-title,
.card[data-alt='jade_crackle'] .card-title,
.card[data-alt='amber_gilt'] .card-title,
.card[data-alt='peach_blossom'] .card-title { color: #f8f0df; }

.card[data-alt='azure_gold'] .card-verse,
.card[data-alt='vermilion_flame'] .card-verse,
.card[data-alt='star_night'] .card-verse,
.card[data-alt='jade_crackle'] .card-verse,
.card[data-alt='amber_gilt'] .card-verse,
.card[data-alt='peach_blossom'] .card-verse { color: rgba(244, 234, 218, 0.88); }

.card[data-alt='azure_gold'] .card-series-tag,
.card[data-alt='vermilion_flame'] .card-series-tag,
.card[data-alt='star_night'] .card-series-tag,
.card[data-alt='jade_crackle'] .card-series-tag,
.card[data-alt='amber_gilt'] .card-series-tag,
.card[data-alt='peach_blossom'] .card-series-tag {
  color: rgba(248, 226, 168, 0.96);
  border-color: rgba(226, 188, 96, 0.48);
}

.card[data-alt='azure_gold'] .card-serial,
.card[data-alt='vermilion_flame'] .card-serial,
.card[data-alt='star_night'] .card-serial,
.card[data-alt='jade_crackle'] .card-serial,
.card[data-alt='amber_gilt'] .card-serial,
.card[data-alt='peach_blossom'] .card-serial { color: rgba(238, 228, 206, 0.80); }

.card[data-alt='azure_gold'] .card-rarity-seal,
.card[data-alt='vermilion_flame'] .card-rarity-seal,
.card[data-alt='star_night'] .card-rarity-seal,
.card[data-alt='jade_crackle'] .card-rarity-seal,
.card[data-alt='amber_gilt'] .card-rarity-seal,
.card[data-alt='peach_blossom'] .card-rarity-seal { color: rgba(248, 236, 206, 0.94); }

.card[data-alt='azure_gold'] .card-element-badge,
.card[data-alt='vermilion_flame'] .card-element-badge,
.card[data-alt='star_night'] .card-element-badge,
.card[data-alt='jade_crackle'] .card-element-badge,
.card[data-alt='amber_gilt'] .card-element-badge,
.card[data-alt='peach_blossom'] .card-element-badge {
  background: rgba(14, 32, 36, 0.86);
  color: #f6e8c2;
  border-color: rgba(224, 184, 88, 0.58);
}

.card[data-alt='azure_gold'] .card-sig-text,
.card[data-alt='vermilion_flame'] .card-sig-text,
.card[data-alt='star_night'] .card-sig-text,
.card[data-alt='jade_crackle'] .card-sig-text,
.card[data-alt='amber_gilt'] .card-sig-text,
.card[data-alt='peach_blossom'] .card-sig-text {
  color: #f8df96;
  text-shadow: 0 0 10px rgba(10, 22, 28, 0.92);
}

/* 抽卡掉落异色印签 & 玄藏殿异色色点样式 */
.chroma-badge-stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 9;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.12em;
  background: rgba(18, 17, 22, 0.88);
  border: 1px solid rgba(224, 184, 88, 0.78);
  color: #f8e2a2;
  pointer-events: none;
}

.chroma-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.sanctuary-alt-btn.chroma-locked {
  opacity: 0.82;
  color: color-mix(in srgb, var(--binder-ink) 74%, transparent);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--binder-ink) 24%, transparent);
}
.sanctuary-alt-btn.chroma-locked:hover {
  opacity: 1;
  color: var(--binder-ink);
}

.sanctuary-alt-btn.chroma-unlocked::after {
  content: ' · 藏';
  font-size: 9.5px;
  color: var(--binder-gold);
}

/* 玄藏重绘异画：与卡身暖宣无缝相融（去除生硬画窗内框阴影） */
.card[data-alt-form='true_alt'] .art-window,
.card[data-alt='true_alt'] .art-window {
  border-color: transparent;
  box-shadow: none;
}
.card[data-alt-form='true_alt'] .layer-crest,
.card[data-alt='true_alt'] .layer-crest {
  filter: contrast(1.05) saturate(1.06);
}
.card[data-alt-form='true_alt'][data-hand-alt='0'] .layer-base,
.card[data-alt-form='true_alt'][data-hand-alt='0'] .layer-ink,
.card[data-alt-form='true_alt'][data-hand-alt='0'] .layer-wash,
.card[data-alt-form='true_alt'][data-hand-alt='0'] .layer-crest {
  transform: scale(1.12) translateY(-2%);
}
.card[data-alt-form='true_alt'][data-hand-alt='0'] .layer-ink {
  filter: contrast(1.18) drop-shadow(0 0 10px rgba(207, 169, 86, 0.42));
}

/* ---------- 名家书法亲签落款（与人物志高手联动） ---------- */
.card-signature {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.card[data-signed='1'] .card-signature {
  opacity: 0.94;
  transform: translateY(0);
}

.card-sig-text {
  writing-mode: vertical-rl;
  font-family: var(--font-wild);
  font-size: 16px;
  line-height: 1.05;
  letter-spacing: 0.14em;
  color: #1c1915;
  text-shadow: 0 0 8px rgba(248, 242, 228, 0.9), 0 1px 2px rgba(207, 169, 86, 0.45);
}

.card-signature[data-sig-font='cursive'] .card-sig-text {
  font-family: var(--font-wild);
  font-size: 19px;
  letter-spacing: 0.08em;
  transform: rotate(-1.5deg);
}
.card-signature[data-sig-font='running'] .card-sig-text {
  font-family: var(--font-running);
  font-size: 17px;
  letter-spacing: 0.14em;
}
.card-signature[data-sig-font='slender'] .card-sig-text {
  font-family: var(--font-xiaowei);
  font-size: 13.5px;
  letter-spacing: 0.22em;
}
.card-signature[data-sig-font='bold'] .card-sig-text {
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 0.12em;
}
.card-signature[data-sig-font='verse'] .card-sig-text {
  font-family: var(--font-verse);
  font-size: 17.5px;
  letter-spacing: 0.10em;
  transform: rotate(1deg);
}

.card[data-alt='star_ink'] .card-sig-text {
  color: #f4d88c;
  text-shadow: 0 0 10px rgba(20, 24, 42, 0.92);
}

.card[data-alt-form='true_alt'] .card-sig-text,
.card[data-alt-form='lenticular'] .card-sig-text {
  color: #f6e6b8;
  text-shadow:
    0 1px 3px rgba(14, 12, 10, 0.92),
    0 0 10px rgba(18, 15, 11, 0.78),
    0 0 4px rgba(207, 169, 86, 0.45);
}

.card-sig-seal {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background: #b4282d;
  color: #faf3e4;
  font-family: var(--font-title);
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(180, 40, 45, 0.35);
}

/* ---------- holo-card-studio 光栅双态（倾侧映现 A/B，已去白底透明 cutout，零白框）与星钻全息微光 ---------- */
.layer-lenticular-b {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: contain;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  mix-blend-mode: normal;
  -webkit-mask-image: radial-gradient(96% 96% at 50% 50%, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
  mask-image: radial-gradient(96% 96% at 50% 50%, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
  transform: translate3d(
    calc((var(--px) - 50) * 0.09px * var(--depth-scale)),
    calc((var(--py) - 50) * 0.09px * var(--depth-scale)),
    10px
  );
  transition: opacity 0.08s linear;
}

.layer-lenticular-b:not([data-cutout='1']) {
  opacity: 0 !important;
}

.card[data-alt-form='lenticular'] .art-window:not(.layered) .layer-base,
.card[data-alt-form='lenticular'] .layer-ink,
.card[data-alt-form='lenticular'] .layer-wash,
.card[data-alt-form='lenticular'] .layer-mist,
.card[data-alt-form='lenticular'] .layer-crest,
.card[data-alt-form='lenticular'] .layer-bloom,
.card[data-alt-form='lenticular'] .layer-bloom-b {
  opacity: calc(1 - var(--lenti-mix, 0));
  transition: opacity 0.06s linear;
}

.card[data-alt-form='lenticular'] .art-window.layered .layer-base {
  opacity: 0;
  visibility: hidden;
}

.card[data-alt-form='lenticular'] .layer-lenticular-b[data-cutout='1'] {
  opacity: var(--lenti-mix, 0);
}

.lenticular-ridges {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  transform: translateZ(14px);
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.14) 0px,
    rgba(255, 255, 255, 0.14) 1px,
    rgba(30, 26, 20, 0.05) 1px,
    rgba(30, 26, 20, 0.05) 2.5px
  );
  -webkit-mask-image: radial-gradient(92% 88% at 50% 48%, #000 54%, rgba(0, 0, 0, 0.42) 80%, transparent 98%);
  mask-image: radial-gradient(92% 88% at 50% 48%, #000 54%, rgba(0, 0, 0, 0.42) 80%, transparent 98%);
  mix-blend-mode: overlay;
  transition: opacity 0.25s ease;
}

.card[data-alt-form='lenticular'] .lenticular-ridges {
  opacity: calc(0.45 + var(--hyp, 0) * 0.4);
}

/* 细碎星钻全息箔层（严密贴合画窗平面，四周羽化融入卡身宣纸、旋转零溢边、零贴片方框） */
.foil-diamond {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  transform: translateZ(15px);
  background-image:
    var(--tex-mica),
    radial-gradient(
      ellipse 78% 70% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 244, 210, 0.30) 0%,
      rgba(164, 232, 240, 0.18) 42%,
      transparent 82%
    );
  background-size: 160px 160px, 100% 100%;
  background-repeat: repeat, no-repeat;
  background-position:
    calc(var(--px, 50) * 0.6px) calc(var(--py, 50) * 0.6px),
    center;
  -webkit-mask-image: radial-gradient(90% 86% at 50% 48%, #000 46%, rgba(0, 0, 0, 0.35) 76%, transparent 98%);
  mask-image: radial-gradient(90% 86% at 50% 48%, #000 46%, rgba(0, 0, 0, 0.35) 76%, transparent 98%);
  mix-blend-mode: color-dodge;
  transition: opacity 0.28s ease;
}

/* 第 6 层（RuiC-card-skill 专属）：前景悬浮装饰特效层（effectsDepth，漂浮于近景浓墨主体之前，具有更大视差位移） */
.layer-fg-effects {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background-image:
    var(--tex-gold),
    var(--tex-mica),
    radial-gradient(
      circle at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 230, 148, 0.36) 0%,
      rgba(156, 224, 206, 0.16) 36%,
      transparent 74%
    );
  background-size: 200px 200px, 130px 130px, 100% 100%;
  background-repeat: repeat, repeat, no-repeat;
  background-position:
    calc((var(--px, 50) - 50) * -0.65px) calc((var(--py, 50) - 50) * -0.65px),
    calc((var(--px, 50) - 50) * 0.85px) calc((var(--py, 50) - 50) * 0.85px),
    center;
  -webkit-mask-image: radial-gradient(84% 80% at 50% 48%, #000 32%, rgba(0, 0, 0, 0.5) 70%, transparent 94%);
  mask-image: radial-gradient(84% 80% at 50% 48%, #000 32%, rgba(0, 0, 0, 0.5) 70%, transparent 94%);
  mix-blend-mode: screen;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.22px * var(--depth-scale, 1) * var(--wb-fx-depth, 1)),
    calc((var(--py, 50) - 50) * 0.22px * var(--depth-scale, 1) * var(--wb-fx-depth, 1)),
    20px
  );
  transition: opacity 0.22s ease;
}

.card[data-tier='3'] .layer-fg-effects,
.card[data-tier='4'] .layer-fg-effects {
  opacity: calc(0.24 + var(--hyp, 0) * 0.38);
  background-image:
    var(--tex-gold),
    var(--tex-mica),
    radial-gradient(
      ellipse 62% 54% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(248, 224, 152, 0.34) 0%,
      rgba(218, 198, 148, 0.14) 42%,
      transparent 74%
    ),
    radial-gradient(
      ellipse 46% 42% at calc(100% - var(--px, 50) * 1%) calc(100% - var(--py, 50) * 1%),
      rgba(176, 214, 206, 0.20) 0%,
      transparent 68%
    );
  background-size: 185px 185px, 128px 128px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
  background-position:
    calc((var(--px, 50) - 50) * -0.75px) calc((var(--py, 50) - 50) * -0.75px),
    calc((var(--px, 50) - 50) * 0.95px) calc((var(--py, 50) - 50) * 0.95px),
    center,
    center;
}

/* 互补拆层景深与实时调参台覆盖钩子：
 * - 1阶/2阶/5阶 使用 2 层互补拆图（p2-back 54% + p2-front 46%）
 * - 10阶 使用 3 层互补拆图（p3-back 33% + p3-mid 34% + p3-front 33%）
 * - 正视（px=50, py=50）时所有图层严格同比例同原点无损合为 100% 原画，倾侧时按深度错落展开！
 */
.layer-p2-back {
  z-index: 2;
  image-rendering: high-quality;
  transform: translate3d(
    calc((var(--px, 50) - 50) * -0.072px * var(--wb-bg-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * -0.072px * var(--wb-bg-depth, var(--depth-scale, 1))),
    1px
  ) scale(var(--wb-subj-scale, 1));
}
.layer-p3-back {
  z-index: 2;
  image-rendering: high-quality;
  transform: translate3d(
    calc((var(--px, 50) - 50) * -0.088px * var(--wb-bg-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * -0.088px * var(--wb-bg-depth, var(--depth-scale, 1))),
    1px
  ) scale(var(--wb-subj-scale, 1));
}
.layer-p3-mid {
  z-index: 3;
  image-rendering: high-quality;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.014px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.014px * var(--wb-subj-depth, var(--depth-scale, 1))),
    7px
  ) scale(var(--wb-subj-scale, 1));
}
.layer-p2-front {
  z-index: 4;
  image-rendering: high-quality;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.095px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.095px * var(--wb-subj-depth, var(--depth-scale, 1))),
    10px
  ) scale(var(--wb-subj-scale, 1));
}
.layer-p3-front {
  z-index: 4;
  image-rendering: high-quality;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.115px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.115px * var(--wb-subj-depth, var(--depth-scale, 1))),
    14px
  ) scale(var(--wb-subj-scale, 1));
}
.card[data-workbench-active='1'] .layer-p2-front {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.095px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.095px * var(--wb-subj-depth, 1)),
    calc(3px + var(--wb-subj-depth, 1) * 3.1px)
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-workbench-active='1'] .layer-p3-front,
.card[data-workbench-active='1'] .layer-edge-glint {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.115px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.115px * var(--wb-subj-depth, 1)),
    calc(4px + var(--wb-subj-depth, 1) * 3.6px)
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-workbench-active='1'] .layer-p3-mid {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.014px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.014px * var(--wb-subj-depth, 1)),
    calc(3px + var(--wb-subj-depth, 1) * 1.4px)
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-workbench-active='1'] .layer-p2-back {
  transform: translate3d(
    calc((var(--px, 50) - 50) * -0.072px * var(--wb-bg-depth, 1)),
    calc((var(--py, 50) - 50) * -0.072px * var(--wb-bg-depth, 1)),
    1px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-workbench-active='1'] .layer-p3-back {
  transform: translate3d(
    calc((var(--px, 50) - 50) * -0.088px * var(--wb-bg-depth, 1)),
    calc((var(--py, 50) - 50) * -0.088px * var(--wb-bg-depth, 1)),
    1px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
/* 12 阶 WebGL2 网格画布已在着色器内部执行三层互补视差，外层不再叠加大位移避免边缘越界 */
.card[data-live2d='1'][data-mesh-ready='1'] .living-mesh-canvas {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.045px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.045px * var(--wb-subj-depth, 1)),
    10px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-workbench-active='1'] .layer-fg-effects {
  opacity: calc(var(--wb-fx-opacity, 0) * (0.64 + var(--hyp, 0) * 0.56 * var(--wb-foil-sense, 1))) !important;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.22px * var(--wb-fx-depth, 1.5)),
    calc((var(--py, 50) - 50) * 0.22px * var(--wb-fx-depth, 1.5)),
    22px
  ) !important;
}
/* 前景与底层共享温柔的矿物设色润泽度与随角悬浮墨影（普通宣纸底） */
.card[data-workbench-active='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .layer-p2-front,
.card[data-workbench-active='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .layer-p3-front,
.card[data-workbench-active='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .living-mesh-canvas {
  filter:
    saturate(calc(0.94 + var(--wb-tint-alpha, 0.20) * 0.52))
    contrast(calc(0.99 + var(--wb-tint-alpha, 0.20) * 0.08))
    drop-shadow(
      calc((50 - var(--px, 50)) * 0.24px)
      calc((50 - var(--py, 50)) * 0.24px + 3px)
      5.5px
      rgba(22, 18, 13, var(--wb-shadow-alpha, 0))
    ) !important;
}
.card[data-workbench-active='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .layer-p2-back,
.card[data-workbench-active='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .layer-p3-back,
.card[data-workbench-active='1']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .layer-p3-mid {
  filter:
    saturate(calc(0.94 + var(--wb-tint-alpha, 0.20) * 0.44))
    contrast(calc(0.99 + var(--wb-tint-alpha, 0.20) * 0.06)) !important;
}
/* 异色（Chroma）与高阶闪卡工艺零冲突融合：深底/矿彩异色自适应高光余量衰减系数 --chroma-foil-damp */
.card {
  --chroma-foil-damp: 1;
}
.card[data-alt='azure_gold'],
.card[data-alt='star_night'],
.card[data-alt='jade_crackle'],
.card[data-alt='amber_gilt'],
.card[data-alt='peach_blossom'],
.card[data-alt='vermilion_flame'] {
  --chroma-foil-damp: 0.56;
}
.card[data-alt='emerald_bamboo'],
.card[data-alt='phantom_violet'] {
  --chroma-foil-damp: 0.72;
}
.card[data-workbench-active='1'] .foil-ink-holo {
  opacity: calc(var(--wb-foil-alpha, 0.35) * var(--chroma-foil-damp, 1) * (0.66 + var(--hyp, 0) * 0.65 * var(--wb-foil-sense, 1))) !important;
}
/* 当卡牌为 8 大异色时，全画窗覆膜转为随倾角游走的柔化聚光窗，保护异色星空/千里江山/深海底色永不发白过曝 */
.card[data-alt='azure_gold'] .foil-ink-holo,
.card[data-alt='vermilion_flame'] .foil-ink-holo,
.card[data-alt='star_night'] .foil-ink-holo,
.card[data-alt='jade_crackle'] .foil-ink-holo,
.card[data-alt='amber_gilt'] .foil-ink-holo,
.card[data-alt='peach_blossom'] .foil-ink-holo,
.card[data-alt='emerald_bamboo'] .foil-ink-holo,
.card[data-alt='phantom_violet'] .foil-ink-holo {
  -webkit-mask-image: radial-gradient(
    ellipse calc(64% * var(--wb-glint-spread, 1)) calc(58% * var(--wb-glint-spread, 1))
    at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
    #000 0%,
    rgba(0, 0, 0, 0.55) 48%,
    rgba(0, 0, 0, 0.14) 76%,
    transparent 96%
  );
  mask-image: radial-gradient(
    ellipse calc(64% * var(--wb-glint-spread, 1)) calc(58% * var(--wb-glint-spread, 1))
    at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
    #000 0%,
    rgba(0, 0, 0, 0.55) 48%,
    rgba(0, 0, 0, 0.14) 76%,
    transparent 96%
  );
}
.card[data-workbench-active='1'] .foil-diamond {
  opacity: calc(var(--wb-diamond-alpha, 0) * (0.64 + var(--hyp, 0) * 0.68 * var(--wb-foil-sense, 1))) !important;
}
/* 笔锋流金走芒（Edge Glint）：柔和漫射打光光圈驱动的真金压印描金，由 --wb-gilt-boost 分阶加深 24K 古金鎏金质感 */
.card[data-workbench-active='1'] .layer-edge-glint {
  opacity: min(1, calc(var(--wb-glint-alpha, 0) * (0.64 + var(--hyp, 0) * 0.50 * var(--wb-foil-sense, 1)) * min(1.38, var(--wb-gilt-boost, 1)))) !important;
  background:
    radial-gradient(
      ellipse calc(72% * var(--wb-glint-spread, 1)) calc(64% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 248, 212, 0.98) 0%,
      rgba(244, 198, 82, 0.90) 38%,
      rgba(202, 148, 46, 0.38) 70%,
      transparent 95%
    ),
    rgba(232, 184, 68, 0.26);
  filter: brightness(calc(1.08 + (var(--wb-gilt-boost, 1) - 0.9) * 0.24)) drop-shadow(0 0 calc(4px * var(--wb-gilt-boost, 1)) rgba(242, 198, 82, 0.72));
}
/* 3.5 层深鎏模式（10/13 阶非异色宣纸）：采用真金箔压印显色（normal 叠合赤金-明金-古铜高光），彻底告别浅宣纸 screen 泛白，让笔脊真如 24K 烫金压印！ */
.card[data-workbench-active='1'][data-layer-mode='3.5']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']):not([data-finish='silver']) .layer-edge-glint {
  mix-blend-mode: normal !important;
  opacity: min(0.96, calc(var(--wb-glint-alpha, 0.9) * (0.56 + var(--hyp, 0) * 0.52 * var(--wb-foil-sense, 1)))) !important;
  background:
    radial-gradient(
      ellipse calc(68% * var(--wb-glint-spread, 1)) calc(58% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 246, 196, 0.98) 0%,
      rgba(232, 178, 56, 0.94) 32%,
      rgba(176, 122, 28, 0.72) 62%,
      rgba(138, 92, 20, 0.22) 86%,
      transparent 100%
    ),
    linear-gradient(
      calc(126deg + (var(--px, 50) - 50) * 0.8deg),
      rgba(164, 114, 28, 0.22) 0%,
      rgba(236, 186, 68, 0.48) 48%,
      rgba(156, 108, 26, 0.20) 100%
    ) !important;
  filter: contrast(1.12) drop-shadow(0 0 4px rgba(218, 164, 48, 0.55)) !important;
}
/* 5 阶鎏金（非冷银/非异色）同样在笔锋处显露温润赤金箔意，与 2 阶清浅素光形成鲜明贵气分水岭 */
.card[data-workbench-active='1'][data-tier='2']:not([data-series='舆图']):not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']):not([data-finish='silver']) .layer-edge-glint {
  mix-blend-mode: normal !important;
  opacity: min(0.76, calc(var(--wb-glint-alpha, 0.72) * (0.42 + var(--hyp, 0) * 0.44 * var(--wb-foil-sense, 1)))) !important;
  background:
    radial-gradient(
      ellipse calc(64% * var(--wb-glint-spread, 1)) calc(56% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 244, 198, 0.94) 0%,
      rgba(222, 172, 62, 0.80) 36%,
      rgba(168, 120, 34, 0.40) 68%,
      transparent 94%
    ),
    rgba(196, 148, 48, 0.16) !important;
}
/* 光栅竖纹仅在真正处于「光栅双态」时生效，绝不在原画/异画上出现突兀灰竖纹矩形框！ */
.card[data-alt-form='lenticular'][data-workbench-active='1'] .lenticular-ridges {
  opacity: var(--wb-ridge-alpha, 0) !important;
}

/* ========== 六大水墨国风原创打光光圈材质体系（全系采用游廊柔光光圈 · 彻底废除廉价直线光柱与生硬方框贴片） ========== */

/* 1. 素宣原画（基准：清宁柔和的暖宣天光光圈 + 允许极微弱笔脊初芒） */
.card[data-finish='original'] .foil-diamond,
.card[data-finish='original'] .layer-fg-effects {
  opacity: 0 !important;
}
.card[data-finish='original'] .foil-ink-holo {
  background-image:
    radial-gradient(
      ellipse calc(58% * var(--wb-glint-spread, 1)) calc(52% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 248, 228, 0.42) 0%,
      rgba(232, 214, 174, 0.16) 46%,
      transparent 82%
    ) !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='original'] .foil-glare {
  opacity: calc(0.14 + var(--hyp, 0) * 0.16) !important;
  background: radial-gradient(
    ellipse 54% 48% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
    rgba(255, 252, 242, 0.44) 0%,
    rgba(244, 232, 202, 0.12) 48%,
    transparent 80%
  ) !important;
  mix-blend-mode: soft-light !important;
}

/* 2. 珠光虹彩（低饱和贝母淡彩双光圈：藕荷/月青/暖玉三色如晨雾漫晕，绝不艳俗） */
.card[data-finish='pearl'] .foil-ink-holo {
  background-image:
    var(--tex-mica),
    radial-gradient(
      ellipse calc(56% * var(--wb-glint-spread, 1)) calc(50% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(232, 188, 206, 0.40) 0%,
      rgba(242, 224, 176, 0.30) 38%,
      rgba(176, 218, 212, 0.22) 66%,
      transparent 90%
    ),
    radial-gradient(
      ellipse calc(48% * var(--wb-glint-spread, 1)) calc(44% * var(--wb-glint-spread, 1)) at calc(100% - var(--px, 50) * 1%) calc(100% - var(--py, 50) * 1%),
      rgba(196, 186, 228, 0.34) 0%,
      rgba(176, 212, 226, 0.22) 52%,
      transparent 88%
    ) !important;
  background-size: 160px 160px, 100% 100%, 100% 100% !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  filter: saturate(1.06);
  mix-blend-mode: soft-light !important;
}
.card[data-finish='pearl'] .foil-glare {
  opacity: calc(0.24 + var(--hyp, 0) * 0.28 * var(--wb-foil-sense, 1)) !important;
  background:
    radial-gradient(
      ellipse 48% 42% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 248, 242, 0.50) 0%,
      rgba(218, 232, 228, 0.16) 50%,
      transparent 82%
    ) !important;
  mix-blend-mode: soft-light !important;
}

/* 3. 丝绸流光（2阶主力 · 游廊素绫双漫射光圈：低饱和暖米金主光圈 + 对向浅青玉次光圈，彻底废除斜条光柱！） */
.card[data-finish='silk'] .foil-ink-holo {
  background-image:
    radial-gradient(
      ellipse calc(56% * var(--wb-glint-spread, 1)) calc(50% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(246, 224, 172, 0.46) 0%,
      rgba(228, 206, 158, 0.24) 42%,
      transparent 82%
    ),
    radial-gradient(
      ellipse calc(42% * var(--wb-glint-spread, 1)) calc(38% * var(--wb-glint-spread, 1)) at calc(88% - var(--px, 50) * 0.72%) calc(84% - var(--py, 50) * 0.68%),
      rgba(186, 212, 204, 0.30) 0%,
      rgba(214, 220, 208, 0.12) 48%,
      transparent 80%
    ) !important;
  background-size: 100% 100%, 100% 100% !important;
  background-repeat: no-repeat, no-repeat !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='silk'] .foil-glare {
  opacity: calc(0.24 + var(--hyp, 0) * 0.28 * var(--wb-foil-sense, 1)) !important;
  background:
    radial-gradient(
      ellipse 44% 40% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 250, 236, 0.56) 0%,
      rgba(242, 228, 194, 0.18) 46%,
      transparent 78%
    ),
    radial-gradient(
      ellipse 30% 28% at calc(20% + (100 - var(--px, 50)) * 0.6%) calc(22% + (100 - var(--py, 50)) * 0.55%),
      rgba(202, 222, 218, 0.24) 0%,
      transparent 74%
    ) !important;
  mix-blend-mode: soft-light !important;
}

/* 4. 冷银拉丝（月华清银漫射光圈 + 仅沿焦墨线条游走的寒霜银锋，彻底废除竖条激光柱！） */
.card[data-finish='silver'] .foil-ink-holo {
  background-image:
    var(--tex-mica),
    radial-gradient(
      ellipse calc(52% * var(--wb-glint-spread, 1)) calc(46% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(216, 230, 244, 0.48) 0%,
      rgba(176, 198, 220, 0.24) 44%,
      transparent 82%
    ),
    radial-gradient(
      ellipse calc(38% * var(--wb-glint-spread, 1)) calc(34% * var(--wb-glint-spread, 1)) at calc(86% - var(--px, 50) * 0.72%) calc(82% - var(--py, 50) * 0.68%),
      rgba(196, 214, 232, 0.26) 0%,
      transparent 78%
    ) !important;
  background-size: 165px 165px, 100% 100%, 100% 100% !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='silver'] .foil-glare {
  opacity: calc(0.24 + var(--hyp, 0) * 0.30 * var(--wb-foil-sense, 1)) !important;
  background: radial-gradient(
    ellipse 42% 38% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
    rgba(244, 250, 255, 0.56) 0%,
    rgba(194, 216, 236, 0.18) 46%,
    transparent 78%
  ) !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='silver'] .layer-edge-glint {
  background:
    radial-gradient(
      ellipse calc(72% * var(--wb-glint-spread, 1)) calc(62% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(248, 252, 255, 0.98) 0%,
      rgba(182, 214, 244, 0.86) 36%,
      rgba(142, 182, 220, 0.34) 68%,
      transparent 94%
    ),
    rgba(194, 218, 242, 0.22) !important;
  filter: brightness(1.18) drop-shadow(0 0 5px rgba(186, 218, 248, 0.72)) !important;
}
.card[data-finish='silver']:not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame']) .card-inner-frame {
  border-color: rgba(182, 200, 224, 0.86) !important;
  box-shadow: inset 0 0 0 1px rgba(240, 248, 255, 0.62), 0 0 14px rgba(176, 198, 226, 0.34) !important;
}

/* 5. 泥金烫金（古宣烛影柔金光圈 + 细碎洒金箔 + 24K 赤金笔锋走芒，温雅大气不刺眼） */
.card[data-finish='gold'] .foil-ink-holo {
  background-image:
    var(--tex-gold),
    radial-gradient(
      ellipse calc(58% * var(--wb-glint-spread, 1)) calc(50% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(248, 218, 134, 0.56) 0%,
      rgba(222, 178, 86, 0.30) 42%,
      rgba(178, 136, 56, 0.10) 70%,
      transparent 90%
    ),
    radial-gradient(
      ellipse calc(38% * var(--wb-glint-spread, 1)) calc(34% * var(--wb-glint-spread, 1)) at calc(88% - var(--px, 50) * 0.72%) calc(84% - var(--py, 50) * 0.68%),
      rgba(232, 198, 122, 0.24) 0%,
      transparent 78%
    ) !important;
  background-size: 190px 190px, 100% 100%, 100% 100% !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-position:
    calc((var(--px, 50) - 50) * 0.45px * var(--wb-foil-sense, 1)) calc((var(--py, 50) - 50) * 0.45px * var(--wb-foil-sense, 1)),
    center,
    center !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='gold'] .foil-glare {
  opacity: calc(0.28 + var(--hyp, 0) * 0.32 * var(--wb-foil-sense, 1)) !important;
  background: radial-gradient(
    ellipse 46% 40% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
    rgba(255, 244, 206, 0.62) 0%,
    rgba(236, 196, 102, 0.20) 48%,
    transparent 80%
  ) !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='gold'] .layer-edge-glint {
  background:
    radial-gradient(
      ellipse calc(74% * var(--wb-glint-spread, 1)) calc(64% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(255, 248, 214, 0.98) 0%,
      rgba(244, 198, 86, 0.90) 38%,
      rgba(210, 154, 48, 0.36) 70%,
      transparent 94%
    ),
    rgba(232, 186, 74, 0.24) !important;
  filter: brightness(1.18) drop-shadow(0 0 5px rgba(244, 198, 82, 0.72)) !important;
}

/* 6. 浮雕肌理（彻底废除糊脸同心圆与方框斜纹！改用边缘深度羽化融纸的「竹帘古宣微纹 + 温玉漫射光圈」，与卡身宣纸浑然一体零接缝） */
.card[data-finish='relief'] .foil-ink-holo,
.card[data-finish='textured_etch'] .foil-ink-holo {
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 250, 236, 0.08) 0px,
      rgba(255, 250, 236, 0.08) 1px,
      rgba(132, 114, 82, 0.035) 1px,
      rgba(132, 114, 82, 0.035) 3.5px
    ),
    radial-gradient(
      ellipse calc(58% * var(--wb-glint-spread, 1)) calc(52% * var(--wb-glint-spread, 1)) at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
      rgba(248, 232, 192, 0.44) 0%,
      rgba(216, 194, 148, 0.20) 44%,
      transparent 82%
    ),
    radial-gradient(
      ellipse calc(40% * var(--wb-glint-spread, 1)) calc(36% * var(--wb-glint-spread, 1)) at calc(86% - var(--px, 50) * 0.72%) calc(82% - var(--py, 50) * 0.68%),
      rgba(214, 196, 162, 0.22) 0%,
      transparent 76%
    ) !important;
  background-size: 100% 100%, 100% 100%, 100% 100% !important;
  background-repeat: no-repeat, no-repeat, no-repeat !important;
  -webkit-mask-image: radial-gradient(78% 76% at 50% 48%, #000 22%, rgba(0, 0, 0, 0.36) 58%, transparent 88%) !important;
  mask-image: radial-gradient(78% 76% at 50% 48%, #000 22%, rgba(0, 0, 0, 0.36) 58%, transparent 88%) !important;
  mix-blend-mode: soft-light !important;
}
.card[data-finish='relief'] .foil-glare,
.card[data-finish='textured_etch'] .foil-glare {
  opacity: calc(0.24 + var(--hyp, 0) * 0.28 * var(--wb-foil-sense, 1)) !important;
  background: radial-gradient(
    ellipse 48% 42% at calc(var(--px, 50) * 1%) calc(var(--py, 50) * 1%),
    rgba(255, 248, 228, 0.54) 0%,
    rgba(226, 206, 164, 0.16) 46%,
    transparent 78%
  ) !important;
  -webkit-mask-image: radial-gradient(78% 76% at 50% 48%, #000 24%, rgba(0, 0, 0, 0.35) 60%, transparent 90%) !important;
  mask-image: radial-gradient(78% 76% at 50% 48%, #000 24%, rgba(0, 0, 0, 0.35) 60%, transparent 90%) !important;
  mix-blend-mode: soft-light !important;
}

/* ========== 阶段 3：异色（Chroma）与高阶笔触流金（Edge Glint）专属和谐色盘 ========== */
.card[data-alt='star_night'] .layer-edge-glint {
  background:
    linear-gradient(
      calc((var(--px, 50) - 50) * 0.95deg * var(--wb-foil-sense, 1) + 122deg),
      transparent calc(20% + var(--px, 50) * 0.58% - 34% * var(--wb-glint-spread, 1)),
      rgba(176, 198, 255, 0.98) calc(20% + var(--px, 50) * 0.58% - 13% * var(--wb-glint-spread, 1)),
      rgba(248, 250, 255, 1) calc(20% + var(--px, 50) * 0.58%),
      rgba(214, 182, 255, 0.96) calc(20% + var(--px, 50) * 0.58% + 13% * var(--wb-glint-spread, 1)),
      transparent calc(20% + var(--px, 50) * 0.58% + 34% * var(--wb-glint-spread, 1))
    ),
    rgba(186, 206, 255, 0.28) !important;
  filter: brightness(1.22) drop-shadow(0 0 6px rgba(188, 206, 255, 0.88)) !important;
}
.card[data-alt='peach_blossom'] .layer-edge-glint {
  background:
    linear-gradient(
      calc((var(--px, 50) - 50) * 0.95deg * var(--wb-foil-sense, 1) + 122deg),
      transparent calc(20% + var(--px, 50) * 0.58% - 34% * var(--wb-glint-spread, 1)),
      rgba(138, 224, 255, 0.98) calc(20% + var(--px, 50) * 0.58% - 13% * var(--wb-glint-spread, 1)),
      rgba(244, 252, 255, 1) calc(20% + var(--px, 50) * 0.58%),
      rgba(164, 212, 252, 0.96) calc(20% + var(--px, 50) * 0.58% + 13% * var(--wb-glint-spread, 1)),
      transparent calc(20% + var(--px, 50) * 0.58% + 34% * var(--wb-glint-spread, 1))
    ),
    rgba(148, 224, 255, 0.28) !important;
  filter: brightness(1.22) drop-shadow(0 0 6px rgba(146, 224, 255, 0.88)) !important;
}
.card[data-alt='jade_crackle'] .layer-edge-glint,
.card[data-alt='vermilion_flame'] .layer-edge-glint {
  background:
    linear-gradient(
      calc((var(--px, 50) - 50) * 0.95deg * var(--wb-foil-sense, 1) + 122deg),
      transparent calc(20% + var(--px, 50) * 0.58% - 34% * var(--wb-glint-spread, 1)),
      rgba(255, 156, 78, 0.98) calc(20% + var(--px, 50) * 0.58% - 13% * var(--wb-glint-spread, 1)),
      rgba(255, 244, 214, 1) calc(20% + var(--px, 50) * 0.58%),
      rgba(244, 186, 86, 0.96) calc(20% + var(--px, 50) * 0.58% + 13% * var(--wb-glint-spread, 1)),
      transparent calc(20% + var(--px, 50) * 0.58% + 34% * var(--wb-glint-spread, 1))
    ),
    rgba(248, 172, 86, 0.28) !important;
  filter: brightness(1.22) drop-shadow(0 0 6px rgba(255, 168, 86, 0.88)) !important;
}
.card[data-alt='azure_gold'] .layer-edge-glint,
.card[data-alt='emerald_bamboo'] .layer-edge-glint {
  background:
    linear-gradient(
      calc((var(--px, 50) - 50) * 0.95deg * var(--wb-foil-sense, 1) + 122deg),
      transparent calc(20% + var(--px, 50) * 0.58% - 34% * var(--wb-glint-spread, 1)),
      rgba(248, 198, 72, 0.98) calc(20% + var(--px, 50) * 0.58% - 13% * var(--wb-glint-spread, 1)),
      rgba(255, 252, 228, 1) calc(20% + var(--px, 50) * 0.58%),
      rgba(72, 224, 186, 0.96) calc(20% + var(--px, 50) * 0.58% + 13% * var(--wb-glint-spread, 1)),
      transparent calc(20% + var(--px, 50) * 0.58% + 34% * var(--wb-glint-spread, 1))
    ),
    rgba(238, 192, 78, 0.32) !important;
  filter: brightness(1.24) drop-shadow(0 0 6px rgba(242, 196, 78, 0.88)) !important;
}

/* Live2D 动效调试台手动动作模式与倍速覆盖 */
.card[data-l2d-force='1'] .layer-mist {
  animation: l2dMistBillow calc(5.2s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='hero'] .layer-ink,
.card[data-l2d-force='1'][data-l2d-mode='hero'] .layer-edge-glint,
.card[data-l2d-force='1'][data-l2d-mode='hero'] .layer-lenticular-b {
  animation: l2dHeroBreath calc(3.8s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='hero'] .layer-wash,
.card[data-l2d-force='1'][data-l2d-mode='hero'] .layer-crest {
  animation: l2dHeroRobe calc(3.2s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='beast'] .layer-ink,
.card[data-l2d-force='1'][data-l2d-mode='beast'] .layer-edge-glint,
.card[data-l2d-force='1'][data-l2d-mode='auto'] .layer-ink,
.card[data-l2d-force='1'][data-l2d-mode='auto'] .layer-edge-glint {
  animation: l2dBeastTorso calc(3.1s / var(--l2d-speed, 1)) cubic-bezier(0.42, 0, 0.58, 1) infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='beast'] .layer-wash,
.card[data-l2d-force='1'][data-l2d-mode='beast'] .layer-crest,
.card[data-l2d-force='1'][data-l2d-mode='auto'] .layer-wash,
.card[data-l2d-force='1'][data-l2d-mode='auto'] .layer-crest {
  animation: l2dBeastPlume calc(2.7s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='narrative'] .layer-ink,
.card[data-l2d-force='1'][data-l2d-mode='narrative'] .layer-edge-glint {
  animation: l2dNarrativeBoat calc(4.6s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='narrative'] .layer-wash,
.card[data-l2d-force='1'][data-l2d-mode='narrative'] .layer-mist {
  animation: l2dNarrativeWave calc(5.2s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='arch'] .layer-ink,
.card[data-l2d-force='1'][data-l2d-mode='arch'] .layer-edge-glint {
  animation: l2dArchSteady calc(7.2s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='arch'] .layer-wash,
.card[data-l2d-force='1'][data-l2d-mode='arch'] .layer-mist {
  animation: l2dArchCloud calc(4.4s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='weapon'] .layer-ink,
.card[data-l2d-force='1'][data-l2d-mode='weapon'] .layer-edge-glint,
.card[data-l2d-force='1'][data-l2d-mode='weapon'] .layer-crest {
  animation: l2dWeaponHover calc(2.8s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='1'][data-l2d-mode='elixir'] .layer-wash,
.card[data-l2d-force='1'][data-l2d-mode='elixir'] .layer-bloom,
.card[data-l2d-force='1'][data-l2d-mode='elixir'] .layer-ink {
  animation: l2dElixirVapor calc(3.6s / var(--l2d-speed, 1)) ease-in-out infinite !important;
}
.card[data-l2d-force='0'] .layer-ink,
.card[data-l2d-force='0'] .layer-edge-glint,
.card[data-l2d-force='0'] .layer-wash,
.card[data-l2d-force='0'] .layer-crest,
.card[data-l2d-force='0'] .layer-mist,
.card[data-l2d-force='0'] .layer-bloom {
  animation: none !important;
}

.card.rarity-shen .foil-diamond,
.card.rarity-yi .foil-diamond,
.card[data-tier='2'] .foil-diamond,
.card[data-tier='3'] .foil-diamond,
.card[data-tier='4'] .foil-diamond,
.card[data-alt-form='lenticular'] .foil-diamond {
  opacity: calc(0.2 + var(--hyp, 0) * 0.52);
}

.card[data-alt='star_ink'] .foil-diamond,
.card[data-alt='frost_jade'] .foil-diamond {
  opacity: calc(0.32 + var(--hyp, 0) * 0.58);
}

/* 八方灵元矿彩与普通卡升阶特效 */
.card[data-element='flame'] { --el-tint: rgba(196, 68, 42, 0.32); --el-ink: #a63420; }
.card[data-element='ice'] { --el-tint: rgba(82, 158, 192, 0.30); --el-ink: #35677e; }
.card[data-element='poison'] { --el-tint: rgba(74, 154, 108, 0.30); --el-ink: #356a4c; }
.card[data-element='thunder'] { --el-tint: rgba(118, 102, 198, 0.32); --el-ink: #51448c; }
.card[data-element='tide'] { --el-tint: rgba(56, 132, 148, 0.30); --el-ink: #2a616d; }
.card[data-element='wind'] { --el-tint: rgba(96, 144, 118, 0.28); --el-ink: #476856; }
.card[data-element='soul'] { --el-tint: rgba(138, 92, 168, 0.30); --el-ink: #66447a; }
.card[data-element='earth'] { --el-tint: rgba(162, 122, 66, 0.28); --el-ink: #72552c; }

.card[data-element][data-tier='1'] .art-window::after,
.card[data-element][data-tier='2'] .art-window::after,
.card[data-element][data-tier='3'] .art-window::after,
.card[data-element][data-tier='4'] .art-window::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(
    74% 68% at calc(var(--px) * 1%) calc(var(--py) * 1%),
    var(--el-tint, transparent) 0%,
    transparent 64%
  );
  -webkit-mask-image: radial-gradient(88% 84% at 50% 48%, #000 42%, rgba(0, 0, 0, 0.35) 74%, transparent 96%);
  mask-image: radial-gradient(88% 84% at 50% 48%, #000 42%, rgba(0, 0, 0, 0.35) 74%, transparent 96%);
  mix-blend-mode: multiply;
  opacity: calc(0.28 + var(--hyp) * 0.34);
}

.card-element-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font-family: var(--font-title);
  font-size: 12px;
  line-height: 1;
  color: var(--el-ink, #3c3730);
  border: 1px solid color-mix(in srgb, var(--el-ink, #3c3730) 42%, transparent);
  background: color-mix(in srgb, var(--el-tint, rgba(60, 55, 48, 0.1)) 42%, rgba(255, 255, 255, 0.65));
  flex-shrink: 0;
}

.card[data-alt='star_ink'] .card-element-badge {
  background: rgba(24, 29, 44, 0.85);
  color: #efe2be;
  border-color: rgba(212, 175, 90, 0.45);
}

/* 宣纸反光扫光 */
.foil-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  transform: translateZ(0.9px);
  opacity: calc(0.14 + var(--hyp) * 0.24);
  -webkit-mask-image: radial-gradient(82% 78% at 50% 48%, #000 28%, rgba(0, 0, 0, 0.36) 62%, transparent 92%);
  mask-image: radial-gradient(82% 78% at 50% 48%, #000 28%, rgba(0, 0, 0, 0.36) 62%, transparent 92%);
  background: radial-gradient(
    75% 65% at calc(var(--px) * 1%) calc(var(--py) * 1%),
    rgba(255, 251, 240, 0.55) 0%,
    rgba(255, 251, 240, 0.12) 42%,
    transparent 74%
  );
  mix-blend-mode: soft-light;
}

/* ---------- 题跋与印章层（零视差，锚定卡底） ---------- */
.card-plaque {
  position: relative;
  z-index: 7;
  padding: 10px 10px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, rgba(246, 241, 230, 0.94) 0%, #f3ecdd 100%);
  border-top: 1px solid rgba(40, 35, 28, 0.12);
}

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-title {
  font-family: var(--font-title);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #181714;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title.is-long-title {
  font-size: clamp(14.5px, 1.75vw, 19.5px);
  letter-spacing: 0.02em;
}

.card-series-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(40, 35, 28, 0.22);
  color: rgba(40, 35, 28, 0.78);
  white-space: nowrap;
  flex-shrink: 0;
}

.card-verse {
  margin: 0;
  font-family: var(--font-title), 'STKaiti', 'KaiTi', serif;
  font-size: clamp(13px, 1.55vw, 17px);
  line-height: 1.32;
  letter-spacing: 0.05em;
  color: rgba(34, 31, 26, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 3px;
  font-size: 11.5px;
  color: rgba(40, 35, 28, 0.64);
}

.card-serial {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-rarity-seal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

.seal-box {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1;
  color: #f8f1e4;
  background: #5c574f;
}

.card.rarity-neng .seal-box { background: #3f5f6b; }
.card.rarity-miao .seal-box { background: #54688f; }
.card.rarity-shen .seal-box { background: #b5892e; }
.card.rarity-yi .seal-box { background: #b4282d; }

.foil-stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.14em;
  background: rgba(246, 241, 230, 0.88);
  border: 1px solid rgba(181, 137, 46, 0.65);
  color: #8a6418;
  pointer-events: none;
}

.new-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.14em;
  background: var(--accent-red);
  color: #f9f2e4;
  pointer-events: none;
}

/* ---------- 放大赏析签条与分层微调条 ---------- */
.inspect-hud {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inspect-omen {
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-border);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold-text);
  white-space: nowrap;
}

.depth-inspector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--dock-bg);
  background-image: var(--tex-paper);
  background-size: 240px 240px;
  border: 1px solid var(--dock-border);
  color: var(--ink-ui);
  font-size: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.depth-toggle,
.depth-lore,
.depth-rubbing,
.depth-close {
  border: 1px solid var(--dock-border);
  background: transparent;
  color: var(--ink-ui);
  border-radius: 4px;
  padding: 3px 10px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.depth-rubbing {
  border-color: rgba(207, 169, 86, 0.48);
  color: var(--gold-text);
}
.depth-rubbing:hover {
  background: rgba(207, 169, 86, 0.16);
  border-color: var(--accent-gold);
}

.depth-lore {
  background: rgba(184, 50, 44, 0.16);
  border-color: rgba(200, 74, 62, 0.56);
  color: #f3c9b8;
  font-weight: 600;
}
.depth-lore:hover {
  background: rgba(184, 50, 44, 0.28);
  border-color: rgba(216, 92, 78, 0.82);
}
html[data-studio-light='light'] .depth-lore {
  background: rgba(168, 43, 39, 0.12);
  border-color: rgba(168, 43, 39, 0.48);
  color: #8f221e;
}
html[data-studio-light='light'] .depth-lore:hover {
  background: rgba(168, 43, 39, 0.20);
}

.depth-toggle[aria-pressed='true'] {
  background: rgba(207, 169, 86, 0.18);
  border-color: var(--accent-gold);
  color: var(--gold-text);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---------- 底部控制台（去 SaaS 化 · 两端羽化半透古卷案几带 + 玉签朱印风） ---------- */
.bottom-chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 20px max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.gesture-hint {
  margin: 0;
  font-family: var(--font-xiaowei);
  font-size: clamp(13px, 1.05vw, 15px);
  letter-spacing: 0.24em;
  color: color-mix(in srgb, var(--ink-ui) 82%, transparent);
  transition: opacity 0.28s ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.32);
}
html[data-studio-light='light'] .gesture-hint {
  color: color-mix(in srgb, var(--ink-ui) 88%, transparent);
  text-shadow: 0 1px 8px rgba(248, 244, 236, 0.88), 0 0 14px rgba(248, 244, 236, 0.72);
}

.gesture-hint.hidden {
  opacity: 0;
}

.console-dock {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 44px;
  border-radius: 0;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--dock-band-bg) 8%,
    var(--dock-band-bg) 92%,
    transparent 100%
  );
  box-shadow: none;
  pointer-events: auto;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
}

.console-dock::before,
.console-dock::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent-gold) 44%, transparent) 16%,
    color-mix(in srgb, var(--accent-gold) 52%, transparent) 50%,
    color-mix(in srgb, var(--accent-gold) 44%, transparent) 84%,
    transparent 100%
  );
}

.console-dock::before {
  top: 0;
}

.console-dock::after {
  bottom: 0;
  opacity: 0.55;
}

.console-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-ui);
  font-family: inherit;
  text-align: left;
  position: relative;
}

.binder-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--gold-text);
}

button.console-item {
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s ease, transform 0.16s ease;
}

button.console-item:hover {
  background: color-mix(in srgb, var(--accent-gold) 12%, transparent);
  transform: translateY(-1px);
}

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

.console-kicker {
  font-family: var(--font-xiaowei);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.console-val {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.binder-bar {
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink-ui) 16%, transparent);
  overflow: hidden;
}

.binder-bar > i {
  display: block;
  height: 100%;
  width: var(--binder-pct, 0%);
  background: linear-gradient(90deg, var(--accent-gold), var(--gold-text));
  transition: width 0.3s ease;
}

.console-sep {
  width: 1px;
  height: 30px;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--ink-ui) 24%, transparent) 50%,
    transparent
  );
  flex-shrink: 0;
}

.pity-pips {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pity-pip {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  transform: rotate(45deg);
  border: 1.2px solid color-mix(in srgb, var(--ink-ui) 42%, transparent);
  background: transparent;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.pity-pip.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 7px color-mix(in srgb, var(--accent-gold) 58%, transparent);
}

.pity-meter.pity-ready .console-val {
  color: var(--gold-text);
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-btn {
  position: relative;
  height: 46px;
  padding: 0 24px;
  border-radius: 3px;
  font-family: var(--font-xiaowei);
  font-size: 16.5px;
  font-weight: 400;
  letter-spacing: 0.18em;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.16s ease, opacity 0.16s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.dock-btn:hover {
  transform: translateY(-1px);
}

.dock-btn.primary {
  background: linear-gradient(155deg, #be3b36 0%, #982824 100%);
  border-color: rgba(245, 220, 178, 0.34);
  color: #fbf4e6;
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 222, 0.18),
    0 4px 14px rgba(154, 34, 30, 0.28);
}

.dock-btn.primary:hover {
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 222, 0.28),
    0 6px 18px rgba(168, 38, 34, 0.38);
}

.dock-btn.secondary {
  background: color-mix(in srgb, var(--ink-ui) 4%, transparent);
  border-color: color-mix(in srgb, var(--accent-gold) 44%, transparent);
  color: var(--ink-ui);
}

.dock-btn.secondary:hover {
  background: color-mix(in srgb, var(--accent-gold) 12%, transparent);
  border-color: var(--accent-gold);
}

.luck-led {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  transform: rotate(45deg);
  border: 1.2px solid color-mix(in srgb, var(--ink-ui) 38%, transparent);
  background: transparent;
  transition: background-color 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.luck-switch[aria-pressed='true'] .luck-led {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
}

/* ---------- 原生顶层藏经阁弹窗（水墨宣笺双光统一版） ---------- */
.binder-dialog {
  --binder-bg: #141418;
  --binder-bg-alt: #1b1b20;
  --binder-surface: rgba(255, 252, 244, 0.035);
  --binder-surface-hover: rgba(207, 169, 86, 0.1);
  --binder-ink: #efe7d6;
  --binder-muted: rgba(239, 231, 214, 0.6);
  --binder-subtle: rgba(239, 231, 214, 0.42);
  --binder-rule: rgba(239, 231, 214, 0.12);
  --binder-rule-strong: rgba(207, 169, 86, 0.34);
  --binder-gold: #e4c475;
  --binder-thumb-bg: #efe8d8;
  --binder-thumb-locked: rgba(239, 231, 214, 0.045);
  --binder-wash: radial-gradient(ellipse at 14% 0%, rgba(207, 169, 86, 0.09) 0%, transparent 52%),
    radial-gradient(ellipse at 92% 100%, rgba(180, 40, 45, 0.08) 0%, transparent 48%);

  border: 0;
  padding: 0;
  margin: auto;
  background: transparent;
  max-width: min(1650px, calc(100vw - 24px));
  max-height: min(94vh, 1180px);
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 0.22s ease,
    transform 0.24s cubic-bezier(0.2, 0.85, 0.25, 1),
    display 0.24s,
    overlay 0.24s;
  transition-behavior: allow-discrete;
}

html[data-studio-light='light'] .binder-dialog {
  --binder-bg: #f4eee1;
  --binder-bg-alt: #ece4d3;
  --binder-surface: rgba(34, 30, 24, 0.03);
  --binder-surface-hover: rgba(154, 114, 34, 0.09);
  --binder-ink: #221f1a;
  --binder-muted: rgba(34, 31, 26, 0.64);
  --binder-subtle: rgba(34, 31, 26, 0.44);
  --binder-rule: rgba(34, 31, 26, 0.13);
  --binder-rule-strong: rgba(154, 114, 34, 0.42);
  --binder-gold: #8c6216;
  --binder-thumb-bg: #f8f3e8;
  --binder-thumb-locked: rgba(34, 31, 26, 0.045);
  --binder-wash: radial-gradient(ellipse at 12% 0%, rgba(34, 30, 24, 0.055) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 96%, rgba(154, 114, 34, 0.08) 0%, transparent 48%);
}

.binder-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .binder-dialog[open] {
    opacity: 0;
    transform: translateY(12px) scale(0.975);
  }
}

/* 强制阻断后台滚动链（遵守 dialog 规范） */
dialog:modal {
  overscroll-behavior: contain;
}

.binder-dialog::backdrop {
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}

html[data-studio-light='light'] .binder-dialog::backdrop {
  background: rgba(36, 32, 26, 0.36);
}

.binder-sheet {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background-color: var(--binder-bg);
  background-image: var(--binder-wash);
  color: var(--binder-ink);
  border: 1px solid var(--binder-rule-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.56);
}

html[data-studio-light='light'] .binder-sheet {
  background-image: var(--binder-wash), var(--tex-paper);
  background-size: 100% 100%, 384px 384px;
  box-shadow: 0 26px 56px rgba(42, 34, 22, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.binder-sheet::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 6px;
  border: 1px solid var(--binder-rule);
  pointer-events: none;
  z-index: 1;
}

.binder-search {
  height: 30px;
  width: 196px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
  color: var(--binder-ink);
  font-size: 12px;
  font-family: inherit;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.binder-search:focus {
  border-color: var(--binder-gold);
  outline: none;
}

.binder-search::placeholder {
  color: var(--binder-subtle);
}

.binder-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 7px 24px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--binder-muted);
  border-bottom: 1px solid var(--binder-rule);
  background: var(--binder-surface);
}

.binder-summary strong {
  color: var(--binder-gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 天下势力卷宗栏 ---------- */
.binder-factions-wrap {
  padding: 9px 24px 8px;
  border-bottom: 1px solid var(--binder-rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.binder-factions {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.binder-factions::-webkit-scrollbar {
  display: none;
}

.faction-tab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px 7px;
  border-radius: 5px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
  color: var(--binder-muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}

.faction-tab:hover {
  border-color: var(--binder-rule-strong);
  color: var(--binder-ink);
  transform: translateY(-1px);
}

.faction-tab::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: var(--fac-pct, 0%);
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
  opacity: 0.72;
  transition: width 0.3s ease;
}

.faction-tab.active {
  border-color: var(--binder-gold);
  background: var(--binder-surface-hover);
  color: var(--binder-ink);
}

.faction-tab-name {
  font-family: var(--font-title);
  font-size: 15px;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.faction-tab-count {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--binder-subtle);
}

.faction-tab.active .faction-tab-count {
  color: var(--binder-gold);
}

.binder-faction-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--binder-muted);
  padding-left: 8px;
  border-left: 2px solid var(--accent-red);
}

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

.binder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--binder-rule);
}

.binder-sub {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--binder-muted);
}

.binder-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: var(--binder-ink);
}

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

.binder-owned-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--binder-muted);
  cursor: pointer;
}
.binder-owned-toggle[hidden] {
  display: none !important;
}

.binder-atlas-btn,
.binder-reset,
.binder-close {
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  border: 1px solid var(--binder-rule);
  background: transparent;
  color: var(--binder-ink);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.binder-atlas-btn:hover,
.binder-reset:hover {
  border-color: var(--binder-rule-strong);
  background: var(--binder-surface);
}

.binder-atlas-btn[aria-pressed='true'] {
  background: var(--binder-surface-hover);
  border-color: var(--binder-gold);
  color: var(--binder-gold);
  font-weight: 600;
}

.binder-close {
  background: var(--accent-red);
  border-color: transparent;
  color: #f9f2e4;
}

.binder-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--binder-rule);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-chip {
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--binder-rule);
  background: transparent;
  color: var(--binder-muted);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.filter-chip:hover {
  border-color: var(--binder-rule-strong);
  color: var(--binder-ink);
}

.filter-chip.active {
  background: var(--binder-surface-hover);
  border-color: var(--binder-gold);
  color: var(--binder-ink);
}

.binder-grid {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 28px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  grid-auto-flow: dense;
  gap: 16px;
  align-content: start;
  touch-action: pan-y;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

@supports not (scrollbar-color: auto) {
  .binder-grid { scrollbar-width: auto; }
  .binder-grid::-webkit-scrollbar { width: 8px; }
  .binder-grid::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
}

.binder-grid[hidden],
.binder-atlas[hidden] {
  display: none;
}

.binder-sheet.is-atlas-open .binder-summary-bar,
.binder-sheet.is-atlas-open .binder-factions-wrap,
.binder-sheet.is-atlas-open .binder-filters {
  display: none;
}

.binder-atlas {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

.atlas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.atlas-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--binder-muted);
}

.atlas-toolbar-copy strong {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--binder-ink);
}

.atlas-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.atlas-toolbar-actions button,
.atlas-tabs button {
  white-space: nowrap;
  flex-shrink: 0;
}

.atlas-toolbar-actions .filter-chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

html:not([data-studio-light='light']) .atlas-toolbar-actions .filter-chip {
  background: rgba(255, 255, 255, 0.04);
}

.atlas-toolbar-actions .filter-chip.active {
  background: linear-gradient(180deg, rgba(168, 128, 48, 0.24), rgba(168, 128, 48, 0.12));
  border-color: var(--binder-gold);
  color: var(--binder-gold);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(140, 98, 22, 0.15);
}

.atlas-canvas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
  max-width: min(980px, calc(64vh * 1.7778));
  width: 100%;
  height: auto;
  flex-shrink: 0;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--binder-rule-strong);
  background: #f4efe4;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.atlas-canvas[data-mode='ensemble'],
.atlas-canvas[data-mode='chronicle_grid'] {
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
  max-width: min(1040px, 96%);
  background: transparent;
  border: 0;
  box-shadow: none;
  gap: 14px;
  overflow: visible;
}

.beast-chronicle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  width: 100%;
}

.beast-chronicle-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.beast-chronicle-reqs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.beast-req-lbl {
  font-size: 11px;
  color: var(--binder-muted);
  letter-spacing: 0.06em;
}

.sanctuary-fixed-tier-pill {
  grid-column: 1 / -1;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--binder-gold) 58%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--binder-gold) 15%, transparent), transparent);
  color: var(--binder-gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}

.ensemble-grand-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(207, 169, 86, 0.58);
  background: #f6f2e8;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.34);
  cursor: pointer;
}

.ensemble-grand-frame.is-locked img {
  filter: grayscale(0.92) brightness(0.42) blur(2px);
}

.ensemble-grand-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.3s ease;
}

.ensemble-grand-frame:not(.is-locked):hover img {
  transform: scale(1.02);
}

.ensemble-grand-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 18px 20px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(12, 14, 18, 0.82) 100%);
  color: #f6efe0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.ensemble-grand-overlay strong {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.14em;
}

.ensemble-grand-overlay p {
  margin: 3px 0 0;
  font-size: 12px;
  color: rgba(246, 239, 224, 0.78);
}

.ensemble-roster-bar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.ensemble-roster-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
  color: var(--binder-ink);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.16s ease;
}

.ensemble-roster-chip:hover {
  border-color: var(--binder-gold);
  transform: translateY(-2px);
}

.ensemble-roster-chip.is-locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.ensemble-roster-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: #f8f5ee;
}

.atlas-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  background: #f4efe4;
  cursor: default;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
}

.atlas-tile.owned {
  cursor: pointer;
}

.atlas-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.26s ease;
}

.atlas-tile.owned:hover img {
  transform: scale(1.025);
}

.atlas-tile.locked img {
  opacity: 0.78;
  filter: sepia(0.14) contrast(0.95);
}

.atlas-canvas[data-preview='owned'] .atlas-tile.locked img {
  opacity: 0.14;
  filter: grayscale(1);
}

.atlas-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px dashed rgba(68, 52, 34, 0.16);
  opacity: 0.45;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.atlas-canvas[data-preview='full'] .atlas-tile.owned::after {
  opacity: 0.14;
}

.atlas-tile.owned:hover::after {
  opacity: 0.85;
  border: 1px solid rgba(154, 114, 34, 0.72);
}

.atlas-tile-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  background: rgba(246, 240, 228, 0.88);
  color: #241e18;
  border: 1px solid rgba(90, 68, 42, 0.3);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.atlas-tile.locked .atlas-tile-badge {
  color: rgba(36, 30, 24, 0.72);
}

.atlas-tile-state {
  font-size: 10px;
  color: #8c6216;
  font-weight: 600;
}

.atlas-tile.locked .atlas-tile-state {
  color: rgba(96, 78, 56, 0.76);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .atlas-tile img,
  .atlas-tile::after {
    transition: none;
  }
  .atlas-tile.owned:hover img {
    transform: none;
  }
}

.binder-slot {
  border-radius: 7px;
  padding: 8px;
  background: var(--binder-surface);
  border: 1px solid var(--binder-rule);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  color: var(--binder-ink);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.binder-slot.owned:hover {
  transform: translateY(-2px);
  border-color: var(--binder-gold);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.binder-slot.locked {
  opacity: 0.44;
  cursor: default;
}

.binder-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  background-color: var(--binder-thumb-bg);
  background-image: var(--tex-paper);
  background-size: 200px 200px;
  box-shadow: inset 0 0 18px rgba(45, 36, 22, 0.11);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.binder-tier-pill {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(20, 20, 24, 0.86);
  color: #f4d685;
  border: 1px solid rgba(212, 175, 90, 0.55);
}

.binder-slot.locked .binder-thumb {
  background-color: var(--binder-thumb-locked);
  background-image: none;
  box-shadow: none;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--binder-subtle);
}

.binder-thumb img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.binder-slot-name {
  font-family: var(--font-title);
  font-size: 15.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.binder-slot-faction {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--binder-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.binder-slot.locked .binder-slot-faction {
  color: var(--binder-subtle);
}

.binder-slot-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--binder-muted);
}

/* ---------- 藏经阁独立玄藏鉴赏与升阶预览殿（随藏经阁 1.5× 等比例放大） ---------- */
.binder-sanctuary {
  position: absolute;
  inset: 0;
  z-index: 12;
  background-color: var(--binder-bg);
  color: var(--binder-ink);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  overflow: hidden;
}

.binder-sanctuary.is-grand-view {
  grid-template-columns: minmax(0, 1.42fr) minmax(390px, 0.58fr);
}

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

.sanctuary-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 24px 68px;
  background: radial-gradient(circle at 48% 45%, rgba(44, 42, 38, 0.65) 0%, #101014 74%);
  overflow: hidden;
  perspective: 1600px;
}

html[data-studio-light='light'] .sanctuary-stage {
  background: radial-gradient(circle at 48% 44%, #fbf7ee 0%, #ebe2cf 78%);
}

.sanctuary-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(218, 186, 112, 0.16) 0%, transparent 56%);
}

html[data-studio-light='light'] .sanctuary-spotlight {
  background: radial-gradient(circle at 50% 42%, rgba(168, 130, 52, 0.1) 0%, transparent 58%);
}

.sanctuary-mount {
  position: relative;
  width: clamp(320px, min(37vw, 54vh), 500px);
  aspect-ratio: 100 / 144;
  perspective: 1600px;
  transform-style: preserve-3d;
}

.sanctuary-mount.is-grand-mount {
  width: clamp(460px, min(58vw, 102vh), 880px);
  aspect-ratio: 3 / 2;
}

.card.is-sanctuary {
  position: relative;
  left: auto;
  top: auto;
  margin: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.card.is-sanctuary .card-plaque {
  padding: 10px 14px 9px;
  gap: 4px;
}

.card.is-sanctuary .card-title {
  font-size: clamp(19px, 2.2vw, 28px);
}

.card.is-sanctuary .card-title.is-long-title {
  font-size: clamp(16.5px, 1.8vw, 22px);
  letter-spacing: 0.02em;
}

.card.is-sanctuary .card-series-tag {
  font-size: 12px;
  padding: 2px 8px;
}

.card.is-sanctuary .card-verse {
  font-size: clamp(14px, 1.5vw, 19px);
}

.card.is-sanctuary .card-foot-row {
  font-size: 13px;
}

.sanctuary-stage-tip {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
  white-space: nowrap;
  font-family: var(--font-xiaowei);
  font-size: 13.5px;
  letter-spacing: 0.30em;
  color: rgba(232, 214, 174, 0.68);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
}

html[data-studio-light='light'] .sanctuary-stage-tip {
  color: rgba(58, 50, 38, 0.66);
  text-shadow: none;
}

.sanctuary-panel {
  border-inline-start: 1px solid var(--binder-rule);
  background-color: var(--binder-bg-alt);
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  font-size: 13.5px;
}

html[data-studio-light='light'] .sanctuary-panel {
  background-image: var(--tex-paper);
  background-size: 384px 384px;
}

.sanctuary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.sanctuary-meta {
  display: block;
  font-size: 11px;
  color: var(--binder-gold);
  letter-spacing: 0.08em;
  line-height: 1.45;
}

.sanctuary-name {
  margin: 3px 0 0;
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--binder-ink);
}

.sanctuary-count-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--binder-surface-hover);
  border: 1px solid var(--binder-rule-strong);
  color: var(--binder-gold);
}

.sanctuary-verse {
  margin: 0;
  font-family: var(--font-verse);
  font-size: 16px;
  color: var(--binder-muted);
  line-height: 1.5;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--binder-rule);
}

.sanctuary-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sanctuary-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--binder-muted);
}

.sanctuary-tier-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sanctuary-tier-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
  color: var(--binder-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.sanctuary-tier-btn:hover {
  border-color: var(--binder-rule-strong);
  color: var(--binder-ink);
}

.sanctuary-tier-btn.active {
  border-color: var(--binder-gold);
  background: var(--binder-surface-hover);
  color: var(--binder-ink);
}

.sanctuary-tier-btn .tier-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--binder-surface);
  border: 1px solid var(--binder-rule);
  color: var(--binder-muted);
}

.sanctuary-tier-btn.unlocked .tier-tag {
  background: rgba(68, 148, 106, 0.16);
  border-color: rgba(68, 148, 106, 0.4);
  color: #7cd4a6;
}

html[data-studio-light='light'] .sanctuary-tier-btn.unlocked .tier-tag {
  color: #1f6b46;
}

.sanctuary-alt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sanctuary-alt-btn {
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--binder-rule);
  background: transparent;
  color: var(--binder-muted);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.sanctuary-alt-btn[aria-pressed='true'] {
  border-color: var(--binder-gold);
  background: var(--binder-surface-hover);
  color: var(--binder-ink);
}

.sanctuary-tier-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--binder-muted);
  background: var(--binder-surface);
  border: 1px solid var(--binder-rule);
  border-radius: 6px;
  padding: 9px 11px;
}

/* 五重升阶 · 造化法度可视化进度条与图层拆解谱 */
.sanctuary-progress-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--binder-surface);
  border: 1px solid var(--binder-rule);
}

.sanctuary-step-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 4px;
}

.sanctuary-step-track::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 11px;
  height: 2px;
  background: var(--binder-rule);
  z-index: 0;
}

.sanctuary-step-fill {
  position: absolute;
  left: 16px;
  top: 11px;
  height: 2px;
  background: linear-gradient(90deg, #9f7828, var(--binder-gold));
  z-index: 0;
  transition: width 0.28s ease;
}

.sanctuary-step-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--binder-muted);
  font-family: inherit;
}

.sanctuary-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 600;
  background: var(--binder-bg-alt);
  border: 1.5px solid var(--binder-rule-strong);
  color: var(--binder-muted);
  transition: all 0.2s ease;
}

.sanctuary-step-node.is-reached .sanctuary-step-dot {
  border-color: var(--binder-gold);
  color: var(--binder-gold);
}

.sanctuary-step-node.is-active .sanctuary-step-dot {
  background: var(--binder-gold);
  border-color: var(--binder-gold);
  color: #16140f;
  box-shadow: 0 0 10px rgba(207, 169, 86, 0.55);
  transform: scale(1.12);
}

.sanctuary-step-lbl {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sanctuary-step-node.is-active .sanctuary-step-lbl {
  color: var(--binder-ink);
  font-weight: 600;
}

.sanctuary-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.sanctuary-meter-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sanctuary-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 10.5px;
  color: var(--binder-muted);
  white-space: nowrap;
}

.sanctuary-meter-head strong {
  color: var(--binder-ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sanctuary-meter-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(128, 118, 102, 0.18);
  overflow: hidden;
}

.sanctuary-meter-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #8e6c26, var(--binder-gold));
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sanctuary-delta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
}

.sanctuary-delta-pill {
  font-size: 10px;
  padding: 1.5px 6px;
  border-radius: 3px;
  background: rgba(207, 169, 86, 0.14);
  border: 1px solid rgba(207, 169, 86, 0.36);
  color: var(--binder-ink);
}

.sanctuary-layer-note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--binder-muted);
  border-top: 1px dashed var(--binder-rule);
  padding-top: 5px;
}

/* 设计师实时测试调参台（大白话滑块 + 闪卡工艺 / Live2D 双分页，供测试各等级参数组合） */
.wb-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px dashed var(--binder-rule);
  padding-bottom: 6px;
}

.wb-tabs {
  display: flex;
  gap: 5px;
}

.wb-tab-btn {
  padding: 3px 9px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  border: 1px solid var(--binder-rule-strong);
  background: var(--binder-bg-alt);
  color: var(--binder-muted);
  transition: all 0.16s ease;
}

.wb-tab-btn.is-active {
  background: var(--binder-gold);
  border-color: var(--binder-gold);
  color: #16140f;
  font-weight: 600;
}

.wb-action-group {
  display: flex;
  gap: 4px;
}

.wb-mini-btn {
  padding: 2.5px 7px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  border: 1px solid var(--binder-rule-strong);
  background: rgba(207, 169, 86, 0.10);
  color: var(--binder-ink);
}

.wb-mini-btn:hover {
  border-color: var(--binder-gold);
  background: rgba(207, 169, 86, 0.22);
}

.wb-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.wb-chip-label {
  font-size: 10.5px;
  color: var(--binder-muted);
  margin-right: 2px;
}

.wb-chip {
  padding: 2px 7px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  border: 1px solid var(--binder-rule);
  background: var(--binder-bg-alt);
  color: var(--binder-muted);
}

.wb-chip.is-active {
  border-color: var(--binder-gold);
  background: rgba(207, 169, 86, 0.22);
  color: var(--binder-ink);
  font-weight: 600;
}

.wb-sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding-top: 2px;
}

.wb-slider-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  color: var(--binder-ink);
}

.wb-slider-head span {
  color: var(--binder-muted);
}

.wb-slider-head code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--binder-gold);
  font-weight: 600;
}

.wb-range {
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: #c9a24b;
  cursor: pointer;
}

.wb-status-tip {
  font-size: 10.5px;
  line-height: 1.38;
  color: var(--binder-muted);
  background: rgba(207, 169, 86, 0.08);
  border: 1px dashed rgba(207, 169, 86, 0.32);
  border-radius: 4px;
  padding: 4px 7px;
}

.wb-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(180, 40, 45, 0.16);
  border: 1px solid rgba(212, 86, 78, 0.65);
  font-size: 10.5px;
  color: #f8e4d8;
}

.wb-confirm-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.wb-confirm-btn {
  padding: 2px 8px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  border: 1px solid rgba(212, 86, 78, 0.8);
  background: #b4282d;
  color: #fff5ec;
  font-weight: 600;
}

.wb-cancel-btn {
  padding: 2px 8px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  border: 1px solid var(--binder-rule-strong);
  background: var(--binder-bg-alt);
  color: var(--binder-ink);
}

.wb-record-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 4px;
  background: rgba(14, 15, 19, 0.45);
  border: 1px solid var(--binder-rule);
  font-size: 10px;
}

.wb-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--binder-muted);
}

.wb-record-head strong {
  color: var(--binder-gold);
}

.wb-record-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  line-height: 1.4;
  color: var(--binder-ink);
  word-break: break-all;
  user-select: all;
}

/* ---------- 藏经阁五重解封典籍传记面板（人物小传 / 浮生纪事纪传体 / 宗门世家志） ---------- */
.sanctuary-lore-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sanctuary-lore-style {
  font-size: 10.5px;
  padding: 1.5px 7px;
  border-radius: 3px;
  border: 1px solid rgba(207, 169, 86, 0.45);
  background: rgba(207, 169, 86, 0.12);
  color: var(--binder-gold);
  letter-spacing: 0.08em;
}

.sanctuary-lore-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
}

.lore-era {
  font-size: 11px;
  color: var(--binder-gold);
  letter-spacing: 0.05em;
}

.lore-short {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--binder-ink);
}

.lore-relations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-top: 2px;
}

.lore-rel-label {
  font-size: 10.5px;
  color: var(--binder-muted);
}

.lore-rel-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(207, 169, 86, 0.34);
  background: rgba(207, 169, 86, 0.08);
  color: var(--binder-ink);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.lore-rel-chip:hover {
  border-color: var(--binder-gold);
  background: rgba(207, 169, 86, 0.22);
}

.lore-rel-chip em {
  font-style: normal;
  color: var(--binder-muted);
  font-size: 10px;
}

.lore-chapters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.lore-chapter {
  padding: 7px 9px;
  border-radius: 4px;
  border-left: 2.5px solid var(--binder-gold);
  background: rgba(16, 17, 22, 0.24);
}

html[data-studio-light='light'] .lore-chapter {
  background: rgba(242, 236, 223, 0.72);
}

.lore-chapter.is-preview {
  border-left-color: rgba(207, 169, 86, 0.55);
  border-left-style: dashed;
}

.lore-chapter.is-locked {
  border-left-color: var(--binder-rule-strong);
  opacity: 0.68;
}

.lore-ch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 11px;
}

.lore-ch-head strong {
  color: var(--binder-ink);
  letter-spacing: 0.05em;
}

.lore-ch-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid var(--binder-rule);
  color: var(--binder-muted);
}

.lore-chapter.is-unlocked .lore-ch-badge {
  border-color: rgba(108, 178, 134, 0.55);
  color: #7cc99a;
}

html[data-studio-light='light'] .lore-chapter.is-unlocked .lore-ch-badge {
  color: #2d6e47;
}

.lore-chapter.is-preview .lore-ch-badge {
  border-color: rgba(207, 169, 86, 0.5);
  color: var(--binder-gold);
}

.lore-ch-text {
  margin: 0;
  font-size: 11.8px;
  line-height: 1.65;
  color: var(--binder-ink);
  text-align: justify;
}

.lore-chapter.is-locked .lore-ch-text {
  color: var(--binder-muted);
  font-style: italic;
}

.sanctuary-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.sanctuary-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid var(--binder-rule);
  background: transparent;
  color: var(--binder-ink);
}

.sanctuary-btn.secondary[aria-pressed='true'] {
  border-color: var(--binder-gold);
  background: var(--binder-surface-hover);
  color: var(--binder-gold);
}

.sanctuary-btn.primary {
  flex: 1;
  border-color: transparent;
  background: linear-gradient(135deg, #c9a24b, #9f7828);
  color: #16140f;
  font-weight: 600;
}

.sanctuary-btn.primary:disabled {
  background: var(--binder-surface);
  border-color: var(--binder-rule);
  color: var(--binder-subtle);
  cursor: default;
}

.sanctuary-btn.back {
  background: var(--accent-red);
  border-color: transparent;
  color: #f9f2e4;
}

@media (max-width: 760px) {
  .binder-sanctuary {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  .sanctuary-stage {
    padding: 18px 16px 14px;
    min-height: 360px;
  }
  .sanctuary-mount {
    width: min(276px, 68vw);
  }
  .sanctuary-panel {
    border-inline-start: 0;
    border-top: 1px solid rgba(237, 229, 212, 0.12);
    overflow-y: visible;
  }
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .inspect-hud {
    bottom: 82px;
    max-width: calc(100vw - 20px);
  }
  .depth-inspector {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    padding: 6px 12px;
  }
  .binder-head {
    flex-direction: column;
    align-items: stretch;
  }
  .binder-actions {
    flex-wrap: wrap;
  }
  .binder-search {
    flex: 1 1 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pack-aura.god-mode {
    animation: none;
  }
}

/* =========================================================================
   舆图系列无缝融合 + 六合巨幅卡（6×卡面尺寸复用框架） + 新增 3 套 Live2D 动效
   ========================================================================= */

/* 1. 舆图系列卡面无缝融合：彻底消除满幅手绘地图与宣纸卡面/铭牌间的矩形分离边 */
.card[data-series='舆图'] .art-window,
.card.is-grand-card .art-window {
  background: transparent;
  overflow: hidden !important;
}
.card[data-series='舆图'] .ink-layer {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 88%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 3.5%, #000 88%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 3.5%, #000 96.5%, transparent 100%);
  mask-composite: intersect;
}
.card[data-series='舆图'] .layer-mist,
.card[data-series='舆图'] .layer-wash,
.card[data-series='舆图'] .layer-crest,
.card[data-series='舆图'] .layer-bloom,
.card[data-series='舆图'] .layer-bloom-b {
  opacity: 0.14 !important;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.02px * var(--wb-bg-depth, 0.6)),
    calc((var(--py, 50) - 50) * 0.02px * var(--wb-bg-depth, 0.6)),
    2px
  ) scale(1.01) !important;
}
.card[data-series='舆图'] .layer-ink,
.card[data-series='舆图'] .layer-edge-glint {
  inset: 0;
  width: 100%;
  height: 100%;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.04px * var(--wb-subj-depth, 0.8)),
    calc((var(--py, 50) - 50) * 0.04px * var(--wb-subj-depth, 0.8)),
    6px
  ) scale(calc(1.015 + (var(--wb-subj-scale, 1) - 1) * 0.5)) !important;
}

/* 2. 藏经阁「六合巨幅卡」（cardSize: 'grand_6' = 3列 × 2行 = 整整 6 份普通卡面大小！） */
.binder-slot.is-grand-card {
  grid-column: span 3;
  grid-row: span 2;
  padding: 12px 14px 14px;
  gap: 8px;
  border-color: rgba(207, 169, 86, 0.52);
  background: linear-gradient(155deg, rgba(207, 169, 86, 0.09) 0%, var(--binder-surface) 46%, rgba(180, 40, 45, 0.06) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(207, 169, 86, 0.24);
}
.binder-slot.is-grand-card .binder-thumb {
  flex: 1 1 auto;
  aspect-ratio: 16 / 9;
  padding: 6px;
}
.binder-slot.is-grand-card .binder-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.binder-slot.is-grand-card .binder-slot-name {
  font-size: 20px;
  letter-spacing: 0.1em;
}
.binder-slot.is-grand-card .binder-slot-faction {
  font-size: 12px;
}
.binder-slot.is-grand-card .binder-slot-meta {
  font-size: 12px;
}
.binder-grand-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, rgba(162, 34, 38, 0.92), rgba(122, 22, 26, 0.94));
  color: #f9eac4;
  border: 1px solid rgba(232, 196, 112, 0.72);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

/* 3. 玄藏殿「六合巨幅卡」专属全景装裱框架（复用于大世界舆图及未来势力全家福/生灵合卷） */
.card.is-sanctuary.is-grand-card .card-face {
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.card.is-sanctuary.is-grand-card .card-inner-frame {
  inset: 7px;
  border-radius: 10px;
  border-width: 1.5px;
  border-color: rgba(196, 156, 74, 0.56);
}
.card.is-sanctuary.is-grand-card .art-window {
  flex: 1 1 auto;
  height: auto;
  border-radius: 8px;
}
.card.is-sanctuary.is-grand-card .card-plaque {
  flex: 0 0 auto;
  margin-top: 6px;
  padding: 7px 14px 5px;
  border-top: 1px solid rgba(176, 140, 68, 0.32);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'head foot'
    'verse foot';
  align-items: center;
  gap: 2px 16px;
}
.card.is-sanctuary.is-grand-card .card-head-row {
  grid-area: head;
  justify-content: flex-start;
  gap: 8px;
}
.card.is-sanctuary.is-grand-card .card-verse {
  grid-area: verse;
  margin: 0;
  font-size: clamp(13px, 1.15vw, 16px);
}
.card.is-sanctuary.is-grand-card .card-foot-row {
  grid-area: foot;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.card.is-sanctuary.is-grand-card .card-title {
  font-size: clamp(19px, 1.75vw, 26px);
}
.grand-card-seal {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 12;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.16em;
  background: rgba(164, 34, 38, 0.88);
  color: #f9edd0;
  border: 1px solid rgba(232, 198, 118, 0.7);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}
.grand-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  z-index: 11;
  pointer-events: none;
  border-color: rgba(196, 152, 66, 0.82);
  border-style: solid;
  border-width: 0;
}
.grand-corner.tl { top: 11px; left: 11px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 4px; }
.grand-corner.tr { top: 11px; right: 11px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 4px; }
.grand-corner.bl { bottom: 11px; left: 11px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 4px; }
.grand-corner.br { bottom: 11px; right: 11px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 4px; }

/* 4. 正常游玩模式（非 ?demo=all）精简玩家端升阶摘要条 */
.wb-player-note {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wb-player-note strong {
  font-size: 13px;
  color: var(--binder-gold);
  letter-spacing: 0.06em;
}
.wb-player-note span {
  font-size: 12px;
  color: var(--binder-muted);
}

/* 5. 新增三大世界观专属 12 级 Live2D CSS 呼吸与微动编排 */
@keyframes l2dCartoSteady {
  0%, 100% { scale: 1.005 1.005; translate: 0px 0px; }
  50% { scale: calc(1.005 + 0.008 * var(--l2d-amp, 1)) calc(1.005 + 0.008 * var(--l2d-amp, 1)); translate: 0px calc(-1.2px * var(--l2d-amp, 1)); }
}
@keyframes l2dCartoCloud {
  0%, 100% { translate: calc(-5px * var(--l2d-sway, 1)) calc(1.5px * var(--l2d-sway, 1)); opacity: 0.14; }
  50% { translate: calc(6px * var(--l2d-sway, 1)) calc(-2px * var(--l2d-sway, 1)); opacity: 0.24; }
}
@keyframes l2dSwordPoise {
  0%, 100% { translate: 0px 0px; rotate: 0deg; scale: 1 1; }
  42% { translate: calc(1.2px * var(--l2d-amp, 1)) calc(-3.4px * var(--l2d-amp, 1)); rotate: calc(-0.45deg * var(--l2d-amp, 1)); scale: calc(1 + 0.014 * var(--l2d-amp, 1)) calc(1 + 0.014 * var(--l2d-amp, 1)); }
  52% { translate: calc(-0.8px * var(--l2d-amp, 1)) calc(-3.8px * var(--l2d-amp, 1)); rotate: calc(0.25deg * var(--l2d-amp, 1)); }
}
@keyframes l2dSwordMist {
  0%, 100% { translate: calc(-6px * var(--l2d-sway, 1)) calc(2px * var(--l2d-sway, 1)); }
  50% { translate: calc(7px * var(--l2d-sway, 1)) calc(-3px * var(--l2d-sway, 1)); }
}
@keyframes l2dSigilBreathe {
  0%, 100% { translate: 0px 0px; scale: 1 1; }
  50% { translate: 0px calc(-3px * var(--l2d-amp, 1)); scale: calc(1 + 0.018 * var(--l2d-amp, 1)) calc(1 + 0.018 * var(--l2d-amp, 1)); }
}
@keyframes l2dSigilAura {
  0%, 100% { rotate: calc(-1.2deg * var(--l2d-sway, 1)); scale: 1 1; }
  50% { rotate: calc(1.2deg * var(--l2d-sway, 1)); scale: calc(1 + 0.025 * var(--l2d-sway, 1)) calc(1 + 0.025 * var(--l2d-sway, 1)); }
}

@media (prefers-reduced-motion: no-preference) {
  .card[data-series='舆图'][data-tier='4'][data-live2d='1'] .layer-ink,
  .card[data-series='舆图'][data-tier='4'][data-live2d='1'] .layer-edge-glint,
  .card[data-l2d-force='1'][data-l2d-mode='cartography'] .layer-ink,
  .card[data-l2d-force='1'][data-l2d-mode='cartography'] .layer-edge-glint {
    animation: l2dCartoSteady calc(6.4s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-series='舆图'][data-tier='4'][data-live2d='1'] .layer-mist,
  .card[data-l2d-force='1'][data-l2d-mode='cartography'] .layer-mist,
  .card[data-l2d-force='1'][data-l2d-mode='cartography'] .layer-wash {
    animation: l2dCartoCloud calc(7.6s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='sword_resonance'] .layer-ink,
  .card[data-l2d-force='1'][data-l2d-mode='sword_resonance'] .layer-edge-glint,
  .card[data-l2d-force='1'][data-l2d-mode='sword_resonance'] .layer-lenticular-b {
    animation: l2dSwordPoise calc(3.0s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='sword_resonance'] .layer-mist,
  .card[data-l2d-force='1'][data-l2d-mode='sword_resonance'] .layer-wash {
    animation: l2dSwordMist calc(3.8s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='sigil_orbit'] .layer-ink,
  .card[data-l2d-force='1'][data-l2d-mode='sigil_orbit'] .layer-edge-glint {
    animation: l2dSigilBreathe calc(4.2s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='sigil_orbit'] .layer-wash,
  .card[data-l2d-force='1'][data-l2d-mode='sigil_orbit'] .layer-crest,
  .card[data-l2d-force='1'][data-l2d-mode='sigil_orbit'] .layer-mist {
    animation: l2dSigilAura calc(5.4s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
}

/* 6. 中小屏幕自适应保护（确保 2× 底部栏与 6× 六合巨幅卡在窄屏下绝不溢出） */
@media (max-width: 1120px) {
  .console-dock { gap: 10px; padding: 9px 14px; }
  .console-val { font-size: 16px; }
  .console-kicker { font-size: 12px; }
  .dock-btn { height: 42px; padding: 0 18px; font-size: 15px; }
  .binder-slot.is-grand-card { grid-column: span 2; grid-row: span 2; }
  .binder-sanctuary.is-grand-view { grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); }
  .sanctuary-mount.is-grand-mount { width: clamp(340px, 50vw, 600px); }
}
@media (max-width: 760px) {
  .binder-slot.is-grand-card { grid-column: 1 / -1; grid-row: span 1; }
  .binder-sanctuary.is-grand-view { grid-template-columns: 1fr; }
  .sanctuary-mount.is-grand-mount { width: min(92vw, 460px); }
}

/* 7. 12 阶四大世界观伪骨骼活画模式辅助图层协同（配合 36×54 WebGL2 细分网格主体） */
@media (prefers-reduced-motion: no-preference) {
  .card[data-l2d-force='1'][data-l2d-mode='spirit_breeze'] .layer-wash,
  .card[data-l2d-force='1'][data-l2d-mode='spirit_breeze'] .layer-crest {
    animation: l2dHeroRobe calc(3.3s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='blade_resonance'] .layer-edge-glint {
    animation: l2dSwordPoise calc(2.8s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='blade_resonance'] .layer-mist,
  .card[data-l2d-force='1'][data-l2d-mode='blade_resonance'] .layer-wash {
    animation: l2dSwordMist calc(3.6s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='elixir_aura'] .layer-wash,
  .card[data-l2d-force='1'][data-l2d-mode='elixir_aura'] .layer-bloom {
    animation: l2dElixirVapor calc(3.8s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
  .card[data-l2d-force='1'][data-l2d-mode='shanshui_flow'] .layer-mist,
  .card[data-l2d-force='1'][data-l2d-mode='shanshui_flow'] .layer-wash {
    animation: l2dNarrativeWave calc(5.2s / var(--l2d-speed, 1)) ease-in-out infinite !important;
  }
}

/* 8. 全鉴调试版（?demo=all）通俗化可视化调试工作台与案几古雅工坊印签入口 */
.top-wb-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 3px;
  font-family: var(--font-xiaowei);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  color: var(--gold-text);
  background: color-mix(in srgb, var(--accent-gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-gold) 48%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-gold) 14%, transparent);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.16s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.top-wb-shortcut-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--accent-gold) 18%, transparent);
  border-color: var(--accent-gold);
  color: var(--ink-ui);
}
.top-wb-seal {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent-gold) 82%, transparent);
  color: #161410;
  font-family: var(--font-title);
  font-size: 11px;
  line-height: 1;
}

/* 藏经阁纪年排序徽标（由古及今 / 由今溯古时清晰标注纪元与澄历年份） */
.binder-era-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 4;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: var(--font-xiaowei);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  line-height: 1.25;
  color: #f6efe0;
  background: rgba(18, 22, 26, 0.78);
  border: 1px solid rgba(207, 169, 86, 0.45);
  pointer-events: none;
}
html[data-studio-light='light'] .binder-era-badge {
  color: #241e16;
  background: rgba(248, 244, 234, 0.92);
  border-color: rgba(142, 108, 48, 0.44);
}
.binder-sort-group .filter-chip.active {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: color-mix(in srgb, var(--accent-red) 10%, transparent);
}

.wb-quick-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(207, 169, 86, 0.07);
  border: 1px solid var(--binder-rule-strong);
  margin-bottom: 4px;
}

.wb-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.wb-quick-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--binder-gold);
  min-width: 64px;
}

.wb-group-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.wb-group-card {
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid var(--binder-rule);
  background: rgba(16, 14, 11, 0.18);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wb-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--binder-gold);
  border-bottom: 1px dashed var(--binder-rule);
  padding-bottom: 3px;
}

.wb-group-title small {
  font-size: 10px;
  font-weight: 400;
  color: var(--binder-muted);
}

.wb-slider-desc {
  font-size: 9.5px;
  line-height: 1.28;
  color: var(--binder-muted);
  opacity: 0.88;
}

/* 9. 互补拆层（2层 / 2.5层重浮 / 3层互补 / 3.5层加深鎏金浮雕）与 13 阶伪骨骼零重叠终极规则 */

/* 9A. 默认 2 层互补拆图 (p2-back + p2-front)，隐藏 3 层与 3.5 层精微浮雕层 */
.card .art-window.layered > .layer-p2-back,
.card .art-window.layered > .layer-p2-front {
  opacity: 1;
  visibility: inherit;
}
.card .art-window > .layer-p3-back,
.card .art-window > .layer-p3-mid,
.card .art-window > .layer-p3-front,
.card .art-window > .layer-p35-float {
  opacity: 0;
  visibility: hidden;
}

/* 9B. 3 层与 3.5 层模式（data-layer-mode='3' / '3.5'，或未设置 layerMode 时的 10/13 阶）：
 * 仅当画窗实际挂载了 3 层互补节点（[data-has-p3='1']）时才切为 3 层并隐藏 2 层；
 * 主舞台轻量开包卡未挂载 p3 节点时安全保留 2 层互补拆图，绝不白板！ */
.card[data-layer-mode='3'] .art-window.layered[data-has-p3='1'] > .layer-p2-back,
.card[data-layer-mode='3'] .art-window.layered[data-has-p3='1'] > .layer-p2-front,
.card[data-layer-mode='3.5'] .art-window.layered[data-has-p3='1'] > .layer-p2-back,
.card[data-layer-mode='3.5'] .art-window.layered[data-has-p3='1'] > .layer-p2-front,
.card:not([data-layer-mode])[data-tier='3'] .art-window.layered[data-has-p3='1'] > .layer-p2-back,
.card:not([data-layer-mode])[data-tier='3'] .art-window.layered[data-has-p3='1'] > .layer-p2-front,
.card:not([data-layer-mode])[data-tier='4'] .art-window.layered[data-has-p3='1'] > .layer-p2-back,
.card:not([data-layer-mode])[data-tier='4'] .art-window.layered[data-has-p3='1'] > .layer-p2-front {
  opacity: 0 !important;
  visibility: hidden !important;
}
.card[data-layer-mode='3'] .art-window.layered[data-has-p3='1'] > .layer-p3-back,
.card[data-layer-mode='3'] .art-window.layered[data-has-p3='1'] > .layer-p3-mid,
.card[data-layer-mode='3'] .art-window.layered[data-has-p3='1'] > .layer-p3-front,
.card[data-layer-mode='3.5'] .art-window.layered[data-has-p3='1'] > .layer-p3-back,
.card[data-layer-mode='3.5'] .art-window.layered[data-has-p3='1'] > .layer-p3-mid,
.card[data-layer-mode='3.5'] .art-window.layered[data-has-p3='1'] > .layer-p3-front,
.card:not([data-layer-mode])[data-tier='3'] .art-window.layered[data-has-p3='1'] > .layer-p3-back,
.card:not([data-layer-mode])[data-tier='3'] .art-window.layered[data-has-p3='1'] > .layer-p3-mid,
.card:not([data-layer-mode])[data-tier='3'] .art-window.layered[data-has-p3='1'] > .layer-p3-front,
.card:not([data-layer-mode])[data-tier='4'] .art-window.layered[data-has-p3='1'] > .layer-p3-back,
.card:not([data-layer-mode])[data-tier='4'] .art-window.layered[data-has-p3='1'] > .layer-p3-mid,
.card:not([data-layer-mode])[data-tier='4'] .art-window.layered[data-has-p3='1'] > .layer-p3-front {
  opacity: 1;
  visibility: inherit;
}

/* 9B-2. 2.5 层重浮精微层（生灵/宗门/纪事 5阶 & 道途/神兵/百草/山河 2阶）与 3.5 层深鎏浮雕层（全非舆图 10/13阶）：
 * 正视 0 位移零膨胀，倾侧时在主体大块前景前方再悬浮半层高显著焦墨笔脊、器饰与矿彩细节！ */
.layer-p35-float {
  z-index: 5;
  image-rendering: high-quality;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
.card[data-layer-mode='2.5'] .art-window.layered[data-has-p35='1'] > .layer-p35-float {
  opacity: calc(0.24 + var(--hyp, 0) * 0.72);
  visibility: inherit;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.140px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.140px * var(--wb-subj-depth, var(--depth-scale, 1))),
    17px
  ) scale(var(--wb-subj-scale, 1)) !important;
  filter:
    contrast(1.06)
    saturate(1.12)
    drop-shadow(
      calc((50 - var(--px, 50)) * 0.18px)
      calc((50 - var(--py, 50)) * 0.18px + 2.2px)
      3.5px
      rgba(24, 18, 12, 0.30)
    ) !important;
}
.card[data-layer-mode='3.5'] .art-window.layered[data-has-p35='1'] > .layer-p35-float {
  opacity: calc(0.32 + var(--hyp, 0) * 0.68);
  visibility: inherit;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.162px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.162px * var(--wb-subj-depth, var(--depth-scale, 1))),
    21px
  ) scale(var(--wb-subj-scale, 1)) !important;
  filter:
    contrast(1.08)
    saturate(1.18)
    drop-shadow(
      calc((50 - var(--px, 50)) * 0.22px)
      calc((50 - var(--py, 50)) * 0.22px + 2.6px)
      4px
      rgba(22, 16, 10, 0.34)
    )
    drop-shadow(0 0 4.5px rgba(236, 188, 72, 0.44)) !important;
}

/* 9B-3. 五阶分阶实体装裱框工艺递进（非舆图系）：1阶清雅线框 -> 2阶铜银内框 -> 5阶双阑鎏金框 -> 10/13阶皇家24K重鎏回角框 */
.card[data-workbench-active='1']:not([data-series='舆图']):not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame'])[data-tier='1'] .card-inner-frame {
  border-color: rgba(182, 152, 86, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 222, 0.45), 0 0 10px rgba(186, 152, 76, 0.18);
}
.card[data-workbench-active='1']:not([data-series='舆图']):not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame'])[data-tier='2'] .card-inner-frame {
  border-color: rgba(212, 168, 68, 0.88);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 244, 206, 0.68),
    inset 0 0 0 3.5px rgba(196, 150, 56, 0.28),
    0 0 16px rgba(214, 168, 68, 0.32);
}
.card[data-workbench-active='1']:not([data-series='舆图']):not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame'])[data-tier='3'] .card-inner-frame,
.card[data-workbench-active='1']:not([data-series='舆图']):not([data-alt='azure_gold']):not([data-alt='star_night']):not([data-alt='jade_crackle']):not([data-alt='amber_gilt']):not([data-alt='peach_blossom']):not([data-alt='vermilion_flame'])[data-tier='4'] .card-inner-frame {
  border-color: rgba(226, 178, 62, 0.96);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 248, 214, 0.82),
    inset 0 0 0 4px rgba(216, 166, 54, 0.40),
    0 0 22px rgba(224, 176, 62, 0.44);
}
.card[data-workbench-active='1']:not([data-series='舆图'])[data-tier='2'] .card-plaque,
.card[data-workbench-active='1']:not([data-series='舆图'])[data-tier='3'] .card-plaque,
.card[data-workbench-active='1']:not([data-series='舆图'])[data-tier='4'] .card-plaque {
  border-top-color: rgba(208, 164, 66, 0.56);
}
.card[data-workbench-active='1']:not([data-series='舆图'])[data-tier='3'] .card-plaque,
.card[data-workbench-active='1']:not([data-series='舆图'])[data-tier='4'] .card-plaque {
  box-shadow: inset 0 1px 0 rgba(255, 244, 200, 0.72);
}

/* 9C. 舆图系列无缝铺满兼容 */
.card[data-series='舆图'] .art-window > .layer-p2-back,
.card[data-series='舆图'] .art-window > .layer-p2-front,
.card[data-series='舆图'] .art-window > .layer-p3-back,
.card[data-series='舆图'] .art-window > .layer-p3-mid,
.card[data-series='舆图'] .art-window > .layer-p3-front {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 9D. 深底/矿彩异色对 2 层/3 层/3.5 层互补拆图的随形护墨纸晕兼容 */
.card[data-alt='azure_gold'] .layer-p2-front,
.card[data-alt='azure_gold'] .layer-p3-front,
.card[data-alt='azure_gold'] .layer-p3-mid,
.card[data-alt='azure_gold'] .layer-p2-back,
.card[data-alt='azure_gold'] .layer-p3-back,
.card[data-alt='azure_gold'] .layer-p35-float {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 2.5px rgba(255, 248, 222, 0.90))
    drop-shadow(0 0 8px rgba(242, 206, 118, 0.64))
    drop-shadow(0 0 16px rgba(72, 204, 168, 0.40)) !important;
}
.card[data-alt='star_night'] .layer-p2-front,
.card[data-alt='star_night'] .layer-p3-front,
.card[data-alt='star_night'] .layer-p3-mid,
.card[data-alt='star_night'] .layer-p2-back,
.card[data-alt='star_night'] .layer-p3-back,
.card[data-alt='star_night'] .layer-p35-float,
.card[data-alt='star_night'] .living-mesh-canvas {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 2.5px rgba(236, 242, 255, 0.88))
    drop-shadow(0 0 8px rgba(198, 216, 250, 0.66))
    drop-shadow(0 0 16px rgba(154, 182, 238, 0.40)) !important;
}
.card[data-alt='vermilion_flame'] .layer-p2-front,
.card[data-alt='vermilion_flame'] .layer-p3-front,
.card[data-alt='vermilion_flame'] .layer-p3-mid,
.card[data-alt='vermilion_flame'] .layer-p2-back,
.card[data-alt='vermilion_flame'] .layer-p3-back,
.card[data-alt='vermilion_flame'] .layer-p35-float,
.card[data-alt='vermilion_flame'] .living-mesh-canvas {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 3px rgba(245, 240, 234, 0.72))
    drop-shadow(0 0 10px rgba(235, 224, 214, 0.45)) !important;
}
.card[data-alt='jade_crackle'] .layer-p2-front,
.card[data-alt='jade_crackle'] .layer-p3-front,
.card[data-alt='jade_crackle'] .layer-p3-mid,
.card[data-alt='jade_crackle'] .layer-p2-back,
.card[data-alt='jade_crackle'] .layer-p3-back,
.card[data-alt='jade_crackle'] .layer-p35-float,
.card[data-alt='jade_crackle'] .living-mesh-canvas {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 2.5px rgba(255, 240, 214, 0.86))
    drop-shadow(0 0 8px rgba(246, 204, 142, 0.62))
    drop-shadow(0 0 16px rgba(218, 136, 64, 0.38)) !important;
}
.card[data-alt='amber_gilt'] .layer-p2-front,
.card[data-alt='amber_gilt'] .layer-p3-front,
.card[data-alt='amber_gilt'] .layer-p3-mid,
.card[data-alt='amber_gilt'] .layer-p2-back,
.card[data-alt='amber_gilt'] .layer-p3-back,
.card[data-alt='amber_gilt'] .layer-p35-float,
.card[data-alt='amber_gilt'] .living-mesh-canvas {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 2.5px rgba(252, 240, 210, 0.86))
    drop-shadow(0 0 8px rgba(234, 202, 132, 0.62))
    drop-shadow(0 0 16px rgba(196, 152, 68, 0.38)) !important;
}
.card[data-alt='peach_blossom'] .layer-p2-front,
.card[data-alt='peach_blossom'] .layer-p3-front,
.card[data-alt='peach_blossom'] .layer-p3-mid,
.card[data-alt='peach_blossom'] .layer-p2-back,
.card[data-alt='peach_blossom'] .layer-p3-back,
.card[data-alt='peach_blossom'] .layer-p35-float,
.card[data-alt='peach_blossom'] .living-mesh-canvas {
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 2.5px rgba(236, 246, 255, 0.88))
    drop-shadow(0 0 8px rgba(192, 224, 252, 0.64))
    drop-shadow(0 0 16px rgba(132, 186, 238, 0.40)) !important;
}

/* 9E. 13 阶 36×54 三层半互补伪骨骼网格就绪时的终极零重影锁 */
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p2-back,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p2-front,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p3-back,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p3-mid,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p3-front,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p35-float {
  opacity: 0 !important;
  visibility: hidden !important;
  animation: none !important;
}
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-edge-glint {
  animation: none !important;
}

/* 9F. 光栅双态（右倾切换 · 零重叠终极锁）：正视/左倾时 --lenti-mix=0 纯原画，右倾超阈 --lenti-mix=1 纯异画零重影 */
.card[data-alt-form='lenticular'] .art-window.layered > .layer-p2-back,
.card[data-alt-form='lenticular'] .art-window.layered > .layer-p2-front,
.card[data-alt-form='lenticular'] .art-window.layered > .layer-p3-back,
.card[data-alt-form='lenticular'] .art-window.layered > .layer-p3-mid,
.card[data-alt-form='lenticular'] .art-window.layered > .layer-p3-front,
.card[data-alt-form='lenticular'] .art-window.layered > .layer-p35-float,
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .living-mesh-canvas {
  opacity: clamp(0, calc(1 - var(--lenti-mix, 0) * 1.15), 1) !important;
  transition: opacity 0.05s linear !important;
}
/* 13 阶网格就绪时，静态分层在光栅模式下仍维持隐藏，由 living-mesh-canvas 承担原画层淡出 */
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p2-back,
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p2-front,
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p3-back,
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p3-mid,
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p3-front,
.card[data-alt-form='lenticular'][data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-p35-float {
  opacity: 0 !important;
}
/* 非 10/12 阶在光栅模式下隐藏 3 层；10/12 阶仅在挂载了 p3 时隐藏 2 层 */
.card[data-alt-form='lenticular'][data-tier='3'] .art-window[data-has-p3='1'] > .layer-p2-back,
.card[data-alt-form='lenticular'][data-tier='3'] .art-window[data-has-p3='1'] > .layer-p2-front,
.card[data-alt-form='lenticular'][data-tier='4'] .art-window[data-has-p3='1'] > .layer-p2-back,
.card[data-alt-form='lenticular'][data-tier='4'] .art-window[data-has-p3='1'] > .layer-p2-front {
  opacity: 0 !important;
}
.card[data-alt-form='lenticular'] .art-window > .layer-edge-glint {
  opacity: calc(var(--wb-glint-alpha, 0.7) * clamp(0, calc(1 - var(--lenti-mix, 0) * 1.35), 1)) !important;
}
.card[data-alt-form='lenticular'] .art-window > .layer-lenticular-b[data-cutout='1'] {
  opacity: clamp(0, calc((var(--lenti-mix, 0) - 0.06) * 1.15), 1) !important;
  transition: opacity 0.05s linear !important;
}

/* ============================================================================
 * 10. 人物志温和防撕裂景深校准 · 升阶倾角点睛折光微芒 · 四位红颜 10/12 阶双层衣袂视差
 * ============================================================================ */

/* 10A. 人物志（data-series='人物志'）：因 ink-worker 已升级「全脸+肤色护手锁+整体人像锁定」，现彻底解放至 0.94× 立体大浮雕景深！ */
.card[data-series='人物志'] .layer-p2-back {
  transform: translate3d(
    calc((var(--px, 50) - 50) * -0.068px * var(--wb-bg-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * -0.068px * var(--wb-bg-depth, var(--depth-scale, 1))),
    1px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-series='人物志'] .layer-p2-front {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.090px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.090px * var(--wb-subj-depth, var(--depth-scale, 1))),
    11px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-series='人物志'] .layer-p3-back {
  transform: translate3d(
    calc((var(--px, 50) - 50) * -0.082px * var(--wb-bg-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * -0.082px * var(--wb-bg-depth, var(--depth-scale, 1))),
    1px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-series='人物志'] .layer-p3-mid {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.014px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.014px * var(--wb-subj-depth, var(--depth-scale, 1))),
    7px
  ) scale(var(--wb-subj-scale, 1)) !important;
}
.card[data-series='人物志'] .layer-p3-front {
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.108px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.108px * var(--wb-subj-depth, var(--depth-scale, 1))),
    15px
  ) scale(var(--wb-subj-scale, 1)) !important;
}

/* 10B. 升阶倾角点睛折光微芒（.layer-angle-refract）：严格锁在毛笔焦墨轮廓脊线内，绝不漫染留白与眼睛，随倾角微微折射珠金微芒 */
.layer-angle-refract {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  -webkit-mask-image: var(--edge-url, none);
  mask-image: var(--edge-url, none);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(
      ellipse 44% 38% at calc(var(--px, 50) * 1.15% - 7%) calc(var(--py, 50) * 1.15% - 7%),
      rgba(255, 246, 214, 0.92) 0%,
      rgba(232, 206, 144, 0.42) 34%,
      rgba(176, 218, 224, 0.18) 62%,
      transparent 82%
    ),
    radial-gradient(
      ellipse 34% 30% at calc(100% - var(--px, 50) * 0.85%) calc(100% - var(--py, 50) * 0.85%),
      rgba(238, 204, 218, 0.48) 0%,
      rgba(182, 222, 216, 0.24) 48%,
      transparent 78%
    );
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.082px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.082px * var(--wb-subj-depth, var(--depth-scale, 1))),
    13.5px
  ) scale(var(--wb-subj-scale, 1));
  transition: opacity 0.14s ease;
}
.card[data-tier='1'] .art-window.layered > .layer-angle-refract {
  opacity: calc(var(--hyp, 0) * 0.20);
}
.card[data-tier='2'] .art-window.layered > .layer-angle-refract {
  opacity: calc(var(--hyp, 0) * 0.30);
}
.card[data-tier='3'] .art-window.layered > .layer-angle-refract,
.card[data-tier='4'] .art-window.layered > .layer-angle-refract {
  opacity: calc(var(--hyp, 0) * 0.38);
}
.card[data-alt-form='lenticular'] .art-window > .layer-angle-refract {
  opacity: calc(var(--hyp, 0) * 0.34 * clamp(0, calc(1 - var(--lenti-mix, 0) * 1.35), 1)) !important;
}

/* 10C. 留宵会四位红颜（虞绾朱/曲回绡/商绯晚/晏雪蘅）10/12 阶专属：双层衣袂视差 + 倾角蝉翼透纱
 * - 1/2/5 阶（data-tier='0','1','2'）：完全隐藏 veil 图层，严格走普通人物志护脸景深；
 * - 10 阶（data-tier='3'）且 data-veil-ready='1'：
 *     · 正视（--veil-peek=0）：veil-body + veil-garment 100% 精准拼合为本真常服，veil-inner 完全隐匿；
 *     · 倾侧（--veil-peek=0→1）：veil-garment（外裳/裙袂/鞋履）在三维空间浮起错位，并沿倾角高光区自然化薄如蝉翼透纱，
 *       显现同原点锁死、零双头重影的底层灵雾私服（冰雾/血雾/青烟/绯烟花瓣）！
 * - 12 阶（data-tier='4'）网格就绪后由 WebGL2 36×54 着色器同步驱动全部三层与活墨微动，静态 veil 图层隐藏零重影。
 */
.art-window > .layer-veil-inner,
.art-window > .layer-veil-body,
.art-window > .layer-veil-garment,
.art-window > .layer-lenti-veil-inner,
.art-window > .layer-lenti-veil-body,
.art-window > .layer-lenti-veil-garment {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  image-rendering: high-quality;
}

.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-p2-back,
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-p2-front,
.card[data-tier='4'][data-veil-ready='1'] .art-window.layered > .layer-p2-back,
.card[data-tier='4'][data-veil-ready='1'] .art-window.layered > .layer-p2-front,
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-p3-back,
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-p3-mid,
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-p3-front,
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-p35-float,
.card[data-tier='4'][data-veil-ready='1'] .art-window.layered > .layer-p3-back,
.card[data-tier='4'][data-veil-ready='1'] .art-window.layered > .layer-p3-mid,
.card[data-tier='4'][data-veil-ready='1'] .art-window.layered > .layer-p3-front,
.card[data-tier='4'][data-veil-ready='1'] .art-window.layered > .layer-p35-float {
  opacity: 0 !important;
  visibility: hidden !important;
}

.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-veil-inner,
.card[data-tier='4'][data-veil-ready='1']:not([data-mesh-ready='1']) .art-window.layered > .layer-veil-inner {
  z-index: 2;
  visibility: inherit;
  opacity: clamp(0, calc(var(--veil-peek, 0) * 1.48), 1);
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.032px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.032px * var(--wb-subj-depth, var(--depth-scale, 1))),
    3px
  ) scale(var(--wb-subj-scale, 1));
  transition: opacity 0.08s linear;
}
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-veil-body,
.card[data-tier='4'][data-veil-ready='1']:not([data-mesh-ready='1']) .art-window.layered > .layer-veil-body {
  z-index: 3;
  visibility: inherit;
  opacity: clamp(0.45, calc(1 - var(--veil-peek, 0) * 0.50), 1);
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.032px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.032px * var(--wb-subj-depth, var(--depth-scale, 1))),
    3.4px
  ) scale(var(--wb-subj-scale, 1));
  transition: opacity 0.08s linear;
}
.card[data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-veil-garment,
.card[data-tier='4'][data-veil-ready='1']:not([data-mesh-ready='1']) .art-window.layered > .layer-veil-garment {
  z-index: 4;
  visibility: inherit;
  opacity: clamp(0.24, calc(1 - var(--veil-peek, 0) * 0.72), 1);
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.135px * var(--wb-subj-depth, var(--depth-scale, 1))),
    calc((var(--py, 50) - 50) * 0.135px * var(--wb-subj-depth, var(--depth-scale, 1))),
    15px
  ) scale(var(--wb-subj-scale, 1));
  filter: drop-shadow(
    calc((var(--px, 50) - 50) * -0.14px)
    calc((var(--py, 50) - 50) * -0.10px)
    8px rgba(24, 18, 14, calc(0.16 * var(--veil-peek, 0)))
  );
  transition: opacity 0.08s linear;
}

/* 12 阶 WebGL2 网格就绪后隐藏静态 veil 图层（由着色器同步驱动） */
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-veil-inner,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-veil-body,
.card[data-live2d='1'][data-mesh-ready='1'] .art-window > .layer-veil-garment {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 光栅双态模式下的双层衣袂兼容：正视/左倾显示原画衣袂，右倾切换至异画（且四位红颜右倾异画亦同步透现灵雾双层衣袂！） */
.card[data-alt-form='lenticular'][data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-veil-inner {
  opacity: calc(clamp(0, calc(var(--veil-peek, 0) * 1.48), 1) * clamp(0, calc(1 - var(--lenti-mix, 0) * 1.18), 1)) !important;
}
.card[data-alt-form='lenticular'][data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-veil-body {
  opacity: calc(clamp(0.45, calc(1 - var(--veil-peek, 0) * 0.50), 1) * clamp(0, calc(1 - var(--lenti-mix, 0) * 1.18), 1)) !important;
}
.card[data-alt-form='lenticular'][data-tier='3'][data-veil-ready='1'] .art-window.layered > .layer-veil-garment {
  opacity: calc(clamp(0.24, calc(1 - var(--veil-peek, 0) * 0.72), 1) * clamp(0, calc(1 - var(--lenti-mix, 0) * 1.18), 1)) !important;
}
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='3'] .art-window > .layer-lenticular-b,
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='4'] .art-window > .layer-lenticular-b {
  opacity: 0 !important;
  visibility: hidden !important;
}
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='3'] .art-window > .layer-lenti-veil-inner,
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='4'] .art-window > .layer-lenti-veil-inner {
  z-index: 4;
  visibility: inherit;
  opacity: calc(clamp(0, calc((var(--lenti-mix, 0) - 0.06) * 1.15), 1) * clamp(0, calc(var(--veil-peek, 0) * 1.38), 1)) !important;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.032px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.032px * var(--wb-subj-depth, 1)),
    3.5px
  ) scale(var(--wb-subj-scale, 1));
}
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='3'] .art-window > .layer-lenti-veil-body,
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='4'] .art-window > .layer-lenti-veil-body {
  z-index: 4;
  visibility: inherit;
  opacity: calc(clamp(0, calc((var(--lenti-mix, 0) - 0.06) * 1.15), 1) * clamp(0.46, calc(1 - var(--veil-peek, 0) * 0.48), 1)) !important;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.032px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.032px * var(--wb-subj-depth, 1)),
    3.8px
  ) scale(var(--wb-subj-scale, 1));
}
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='3'] .art-window > .layer-lenti-veil-garment,
.card[data-alt-form='lenticular'][data-lenti-veil-ready='1'][data-tier='4'] .art-window > .layer-lenti-veil-garment {
  z-index: 5;
  visibility: inherit;
  opacity: calc(clamp(0, calc((var(--lenti-mix, 0) - 0.06) * 1.15), 1) * clamp(0.28, calc(1 - var(--veil-peek, 0) * 0.68), 1)) !important;
  transform: translate3d(
    calc((var(--px, 50) - 50) * 0.135px * var(--wb-subj-depth, 1)),
    calc((var(--py, 50) - 50) * 0.135px * var(--wb-subj-depth, 1)),
    15px
  ) scale(var(--wb-subj-scale, 1));
}

/* ============================================================================
 * 11. 藏经阁水墨江湖视觉重构 · 筛选交互升级 · 卷尾山河落款尾跋（消除红圈大片空洞）
 * ============================================================================ */
.binder-jianghu-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  color: #2c3138;
}
html:not([data-studio-light='light']) .binder-jianghu-backdrop {
  color: #a8b4c4;
}
.binder-ink-mountains {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 320px;
  opacity: 0.72;
}
html:not([data-studio-light='light']) .binder-ink-mountains {
  opacity: 0.24;
}
.binder-watermark-vertical {
  position: absolute;
  right: 18px;
  bottom: 42px;
  writing-mode: vertical-rl;
  font-family: var(--font-title);
  font-size: 20px;
  letter-spacing: 0.42em;
  color: currentColor;
  opacity: 0.085;
  user-select: none;
}

.binder-head,
.binder-summary-bar,
.binder-factions-wrap,
.binder-filters,
.binder-scroll-body,
.binder-atlas {
  position: relative;
  z-index: 2;
}

.binder-head {
  padding: 14px 24px 11px;
  background: linear-gradient(180deg, rgba(164, 132, 74, 0.07) 0%, transparent 100%);
}
.binder-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.binder-pavilion-seal {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1;
  color: #fbf4e6;
  background: linear-gradient(145deg, #a82b27 0%, #7d1e1a 100%);
  border: 1px solid rgba(255, 224, 178, 0.35);
  box-shadow: 0 4px 12px rgba(125, 30, 26, 0.28), inset 0 0 0 2px rgba(255, 240, 214, 0.16);
  flex-shrink: 0;
}

.binder-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.binder-search-ico {
  position: absolute;
  left: 11px;
  font-size: 13px;
  color: var(--binder-muted);
  pointer-events: none;
}
.binder-search-wrap .binder-search {
  width: 212px;
  padding-left: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}
html:not([data-studio-light='light']) .binder-search-wrap .binder-search {
  background: rgba(255, 255, 255, 0.05);
}

.binder-status-seg {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--binder-rule);
  background: var(--binder-surface);
  gap: 2px;
}
.status-seg-btn {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--binder-muted);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.status-seg-btn:hover {
  color: var(--binder-ink);
}
.status-seg-btn.active {
  background: linear-gradient(180deg, rgba(168, 128, 48, 0.22), rgba(168, 128, 48, 0.12));
  color: var(--binder-gold);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(154, 114, 34, 0.34);
}

.binder-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 24px;
  border-bottom: 1px solid var(--binder-rule);
  background: var(--binder-surface);
}
.binder-summary-bar .binder-summary {
  padding: 0;
  border: 0;
  background: transparent;
}
.binder-filter-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.binder-match-count {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--binder-muted);
  font-variant-numeric: tabular-nums;
}
.binder-clear-filters {
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(168, 43, 39, 0.42);
  background: rgba(168, 43, 39, 0.10);
  color: #a12925;
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.14s ease;
}
html:not([data-studio-light='light']) .binder-clear-filters {
  color: #e68c84;
  border-color: rgba(230, 140, 132, 0.42);
}
.binder-clear-filters:hover {
  background: rgba(168, 43, 39, 0.18);
  transform: translateY(-1px);
}
.binder-clear-filters[hidden] {
  display: none;
}

.binder-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 24px 9px;
  background: linear-gradient(180deg, rgba(34, 30, 24, 0.02), rgba(34, 30, 24, 0.005));
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.filter-row-split {
  gap: 8px 14px;
}
.filter-subrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-row-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(154, 114, 34, 0.32);
  background: rgba(154, 114, 34, 0.10);
  color: var(--binder-gold);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  flex-shrink: 0;
}
.filter-row-sep {
  width: 1px;
  height: 18px;
  background: var(--binder-rule);
  flex-shrink: 0;
}
.binder-filters .filter-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}
html:not([data-studio-light='light']) .binder-filters .filter-chip {
  background: rgba(255, 255, 255, 0.03);
}
.binder-filters .filter-chip:hover {
  transform: translateY(-1px);
}
.binder-filters .filter-chip.active {
  background: linear-gradient(180deg, rgba(168, 128, 48, 0.20), rgba(168, 128, 48, 0.10));
  border-color: var(--binder-gold);
  color: var(--binder-gold);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(140, 98, 22, 0.12);
}

.binder-scroll-body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}
.binder-scroll-body[hidden] {
  display: none;
}
.binder-scroll-body > .binder-grid {
  flex: 0 0 auto;
  overflow: visible;
  padding: 18px 26px 14px;
}

.binder-slot {
  background: rgba(252, 248, 239, 0.72);
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 8px rgba(38, 30, 18, 0.05);
}
html:not([data-studio-light='light']) .binder-slot {
  background: rgba(24, 24, 28, 0.72);
}
.binder-slot.owned:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(38, 30, 18, 0.14), 0 0 0 1px rgba(176, 134, 48, 0.45);
}
.binder-slot.owned.rarity-yi {
  border-color: rgba(168, 43, 39, 0.28);
}
.binder-slot.owned.rarity-shen {
  border-color: rgba(164, 124, 42, 0.30);
}
.binder-slot-count {
  font-weight: 600;
  color: var(--binder-gold);
  font-variant-numeric: tabular-nums;
}

/* 卷尾水墨山河落款尾跋（稀疏列表自动撑开墨韵留白与远山景致，告别红圈空洞） */
.binder-colophon {
  margin-top: auto;
  padding: 26px 32px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}
.binder-colophon.is-spacious {
  padding-top: 44px;
  padding-bottom: 42px;
}
.binder-colophon-rule {
  width: min(760px, 92%);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--binder-subtle);
  font-size: 10.5px;
  letter-spacing: 0.24em;
}
.binder-colophon-rule i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--binder-rule-strong), transparent);
}
.binder-colophon-inner {
  width: min(760px, 92%);
  padding: 14px 20px;
  border-radius: 8px;
  border: 1px solid var(--binder-rule);
  background: linear-gradient(135deg, rgba(252, 248, 239, 0.72), rgba(240, 232, 214, 0.48));
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
html:not([data-studio-light='light']) .binder-colophon-inner {
  background: linear-gradient(135deg, rgba(24, 24, 28, 0.74), rgba(16, 17, 21, 0.56));
}
.binder-colophon-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.binder-colophon-copy strong {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--binder-ink);
}
.binder-colophon-copy p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  letter-spacing: 0.05em;
  color: var(--binder-muted);
}
.binder-colophon-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.binder-colophon-action {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--binder-gold);
  background: rgba(154, 114, 34, 0.12);
  color: var(--binder-gold);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.14s ease;
}
.binder-colophon-action:hover {
  background: rgba(154, 114, 34, 0.22);
  transform: translateY(-1px);
}
.binder-colophon-action[hidden] {
  display: none;
}
.binder-colophon-seal {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1.5px solid rgba(168, 43, 39, 0.72);
  color: #a12925;
  font-family: var(--font-title);
  font-size: 11px;
  line-height: 1.15;
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0.84;
  transform: rotate(-3deg);
  user-select: none;
}
html:not([data-studio-light='light']) .binder-colophon-seal {
  color: #d96e68;
  border-color: rgba(217, 110, 104, 0.65);
}

.binder-empty-scroll {
  grid-column: 1 / -1;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.binder-empty-seal {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1.5px solid rgba(168, 43, 39, 0.55);
  color: #a12925;
  font-family: var(--font-title);
  font-size: 18px;
  display: grid;
  place-items: center;
}
.binder-empty-scroll strong {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.12em;
}
.binder-empty-scroll p {
  margin: 0;
  font-size: 12px;
  color: var(--binder-muted);
}
.binder-empty-reset {
  margin-top: 6px;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--binder-gold);
  background: rgba(154, 114, 34, 0.14);
  color: var(--binder-gold);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

/* 9G. 预挂载未出包卡 & 未翻开卡面铁锁：严禁任何子图层穿透卡包或卡背（置于全样式表绝对最末） */
.card.card-prehidden,
.card.card-prehidden *,
.card.unrevealed .card-face,
.card.unrevealed .card-face * {
  visibility: hidden !important;
  pointer-events: none !important;
}


/* =========================================================================
 * 紫微斗数 · 每日流日问卦仪式 + 每日余卷配额 + 正式版阶位预览锁样式
 * ========================================================================= */
.ziwei-btn {
  position: relative;
  border-color: rgba(212, 175, 92, 0.42) !important;
  color: inherit;
}
.ziwei-btn-star {
  color: #c89a3c;
  font-size: 13px;
  line-height: 1;
}
.ziwei-btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8322c;
  display: inline-block;
  margin-left: 2px;
}
.ziwei-btn-dot[hidden] {
  display: none;
}

.quota-meter {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 2px 6px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.quota-meter:hover {
  background: rgba(212, 175, 92, 0.12);
}
.quota-meter.is-empty .console-val {
  color: #c84b3c;
}
.quota-meter.is-blessed .console-val {
  color: #c99a3b;
}

.sanctuary-tier-btn.tier-preview-locked,
.sanctuary-step-node.is-preview-locked {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.55);
}
.sanctuary-tier-btn.tier-preview-locked:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: none;
}

/* =========================================================================
 * 紫微斗数 · 三幕式去框化水墨松烟幽境 + 古墨泥金浑天星盘 + 宣纸天机卷
 * ========================================================================= */
.ziwei-dialog {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #efe7d6;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.34s ease, display 0.34s, overlay 0.34s;
  transition-behavior: allow-discrete;
}
.ziwei-dialog[open] {
  opacity: 1;
}
@starting-style {
  .ziwei-dialog[open] {
    opacity: 0;
  }
}
.ziwei-dialog::backdrop {
  background: radial-gradient(66% 62% at 36% 48%, rgba(20, 22, 26, 0.84) 0%, rgba(9, 10, 13, 0.94) 100%);
  backdrop-filter: blur(10px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.ziwei-void {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 无硬边框的松烟水墨幽境雾霭层 */
.ziwei-void-mist {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 58% at 34% 52%, rgba(212, 174, 92, 0.07) 0%, transparent 66%),
    radial-gradient(ellipse 46% 42% at 76% 44%, rgba(168, 52, 46, 0.045) 0%, transparent 68%),
    radial-gradient(circle at 50% 50%, transparent 56%, rgba(4, 5, 7, 0.52) 100%);
}

/* 顶部无框题签与小印（与主界面顶栏一脉相承） */
.ziwei-head {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px) 8px;
}
.ziwei-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ziwei-seal {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #ba342d 0%, #8c201b 100%);
  color: #fcf5e8;
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 400;
  border: 1px solid rgba(255, 226, 184, 0.34);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.ziwei-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ziwei-title {
  margin: 0;
  font-family: var(--font-pack-title);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: #f6ebd5;
  line-height: 1.15;
}
.ziwei-date-line {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(232, 218, 190, 0.72);
}
.ziwei-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ziwei-head-link {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  color: rgba(239, 230, 212, 0.84);
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
}
.ziwei-head-link:hover {
  color: #f4d282;
  transform: translateY(-1px);
}
.ziwei-head-link[hidden],
.ziwei-head-sep[hidden] {
  display: none;
}
.ziwei-head-sep {
  width: 1px;
  height: 13px;
  background: rgba(226, 196, 134, 0.28);
}

/* 中央悬浮舞台：左古墨泥金星盘 · 右宣纸天机卷 */
.ziwei-stage-wrap {
  position: relative;
  z-index: 3;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 1.05fr) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  width: min(1240px, 94vw);
  margin: 0 auto;
  padding: 8px 16px 26px;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .ziwei-stage-wrap {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 18px;
  }
}

.ziwei-astrolabe-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.68s cubic-bezier(0.22, 1, 0.36, 1);
}
.ziwei-void[data-act='result'] .ziwei-astrolabe-stage {
  transform: translateX(-8px) scale(0.97);
}
.ziwei-wheel-host {
  position: relative;
  width: min(76vw, 470px);
  aspect-ratio: 1;
  touch-action: none;
}
.ziwei-astrolabe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.ziwei-astrolabe-canvas:active {
  cursor: grabbing;
}
.ziwei-core-a11y {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24%;
  height: 24%;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: none;
}
.ziwei-core-a11y:focus-visible {
  outline: 2px solid #e6c26e;
  outline-offset: 6px;
}
.ziwei-wheel-tip {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: rgba(232, 218, 190, 0.72);
  text-align: center;
}

/* 右侧阅读区：彻底去框化 */
.ziwei-reading-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 540px;
  width: 100%;
  justify-self: center;
}
.ziwei-precast-scroll[hidden],
.ziwei-casting-veil[hidden],
.ziwei-result-scroll[hidden] {
  display: none !important;
}

/* 第一幕：无框古籍卦引 */
.ziwei-precast-scroll {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 6px 12px 26px;
  border-left: 1px solid rgba(214, 178, 98, 0.34);
}
.ziwei-pillar-row {
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: 0.24em;
  color: #d9b66a;
}
.ziwei-precast-title {
  margin: 0;
  font-family: var(--font-pack-title);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  letter-spacing: 0.10em;
  color: #f8eed9;
  line-height: 1.35;
}
.ziwei-precast-desc {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.9;
  color: rgba(238, 228, 208, 0.82);
}
.ziwei-odds-beads {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(214, 178, 98, 0.20);
}
.ziwei-bead-item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: rgba(242, 232, 212, 0.88);
}
.ziwei-bead {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ziwei-bead.is-calm { background: #8c8272; }
.ziwei-bead.is-high { background: #cfa756; }
.ziwei-bead.is-supreme { background: #c43c35; border: 1px solid #f2cf82; }
.ziwei-bead-name {
  letter-spacing: 0.08em;
}
.ziwei-bead-val {
  margin-left: auto;
  font-style: normal;
  color: #ebd08c;
  letter-spacing: 0.06em;
}

/* 第二幕：演卦凌空题字 */
.ziwei-casting-veil {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 6px 20px 26px;
  border-left: 1px solid rgba(214, 178, 98, 0.34);
  animation: zwFadeSoft 0.35s ease;
}
.ziwei-casting-kicker {
  font-family: var(--font-pack-title);
  font-size: 24px;
  letter-spacing: 0.20em;
  color: #f3d793;
}
.ziwei-casting-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.14em;
  color: rgba(238, 228, 208, 0.78);
}
@keyframes zwFadeSoft {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 第三幕：宣纸 / 松烟天机卷舒展（彻底去盒化、卷轴自然舒展） */
.ziwei-result-scroll {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 30px 24px;
  background:
    linear-gradient(180deg, rgba(249, 244, 232, 0.96) 0%, rgba(242, 234, 217, 0.95) 55%, rgba(235, 224, 202, 0.96) 100%);
  background-image:
    var(--tex-paper),
    linear-gradient(180deg, rgba(249, 244, 232, 0.96) 0%, rgba(238, 228, 207, 0.96) 100%);
  color: #241e18;
  border-top: 2px solid #9e7c3e;
  border-bottom: 2px solid #9e7c3e;
  border-radius: 2px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.52),
    inset 0 12px 18px -12px rgba(96, 72, 36, 0.22),
    inset 0 -12px 18px -12px rgba(96, 72, 36, 0.22);
  animation: zwScrollUnfurl 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ziwei-result-scroll::before,
.ziwei-result-scroll::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  height: 5px;
  background: linear-gradient(90deg, #5c4322 0%, #9b773c 18%, #cfb06a 50%, #9b773c 82%, #5c4322 100%);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}
.ziwei-result-scroll::before { top: -4px; }
.ziwei-result-scroll::after { bottom: -4px; }

.ziwei-result-scroll[data-tier='supreme'] {
  background-image:
    var(--tex-paper),
    radial-gradient(ellipse 85% 42% at 50% 0%, rgba(226, 184, 86, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(252, 246, 230, 0.98) 0%, rgba(242, 231, 206, 0.97) 100%);
}

@keyframes zwScrollUnfurl {
  from {
    opacity: 0;
    clip-path: inset(0 0 88% 0);
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
  }
}

.ziwei-scroll-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(112, 88, 52, 0.20);
}
.ziwei-verdict-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ziwei-pattern-tag {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #7d5d28;
}
.ziwei-grade-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(28px, 3vw, 35px);
  font-weight: 400;
  letter-spacing: 0.10em;
  color: #1e1812;
  line-height: 1.15;
}
.ziwei-result-scroll[data-tier='supreme'] .ziwei-grade-title {
  color: #8b201b;
}

/* 右上角传统朱砂/泥金竖印（取代圆角大标签） */
.ziwei-bonus-seal {
  flex-shrink: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  padding: 7px 6px;
  border: 1.5px solid #a82b25;
  border-radius: 2px;
  color: #a82b25;
  background: rgba(168, 43, 37, 0.06);
  font-family: var(--font-pack-title);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.16em;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(168, 43, 37, 0.18);
  transform: rotate(-1.6deg);
}
.ziwei-bonus-seal .zw-seal-num {
  text-combine-upright: all;
  letter-spacing: 0;
  font-weight: 700;
}
.ziwei-bonus-seal[data-tier='supreme'] {
  background: linear-gradient(160deg, #b52c26 0%, #8c1e19 100%);
  color: #fff5df;
  border-color: #d6aa4e;
  box-shadow: 0 4px 14px rgba(146, 34, 28, 0.34), inset 0 0 0 1px rgba(255, 228, 168, 0.35);
}

/* 四枚传统错落方印（彻底废弃圆角胶囊！） */
.ziwei-sihua-chops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.zw-chop-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-wenkai);
  font-size: 13.5px;
  color: #2f271e;
}
.zw-chop-pair:nth-child(2) { transform: translateY(1px); }
.zw-chop-pair:nth-child(3) { transform: translateY(-1px); }
.zw-chop-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}
.zw-chop-mark.is-lu { background: #b4322b; color: #fff7ea; }
.zw-chop-mark.is-quan { background: #8e6924; color: #fff7ea; }
.zw-chop-mark.is-ke { background: #2f6c64; color: #f4fbf9; }
.zw-chop-mark.is-ji {
  background: transparent;
  border: 1.3px solid #594f47;
  color: #4b423b;
}
.zw-chop-star {
  letter-spacing: 0.08em;
}

.ziwei-summary-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.82;
  color: #362e26;
}

/* 今日宜 / 今日忌：去框化极简双栏 + 干笔飞白竖墨线分隔 */
.ziwei-yiji-scroll {
  display: grid;
  grid-template-columns: 1fr 14px 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 10px 4px;
  border-top: 1px dashed rgba(112, 88, 52, 0.24);
  border-bottom: 1px dashed rgba(112, 88, 52, 0.24);
}
.ziwei-feibai-divider {
  width: 14px;
  height: 100%;
  min-height: 86px;
  color: #5b4d3c;
  align-self: stretch;
}
.ziwei-yiji-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ziwei-yiji-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-wenkai);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #4d4033;
}
.ziwei-mini-chop {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 2px;
  font-family: var(--font-title);
  font-size: 13px;
  line-height: 1;
}
.ziwei-mini-chop.is-yi {
  background: #ae2f28;
  color: #fff6e8;
}
.ziwei-mini-chop.is-ji {
  border: 1.2px solid #5b524a;
  color: #4c443d;
  background: rgba(66, 58, 50, 0.07);
}
.ziwei-yiji-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-serif);
  font-size: 13px;
  color: #2f2820;
  letter-spacing: 0.04em;
}
.ziwei-yiji-col ul li::before {
  content: "· ";
  color: #9b7a42;
  font-weight: 700;
}

/* 今日江湖日签（世界观人物联动） */
.ziwei-world-sign {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0 6px;
}
.ziwei-sign-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 11.5px;
}
.ziwei-sign-tag {
  padding: 1px 6px;
  border: 1px solid rgba(140, 102, 36, 0.42);
  color: #7c591c;
  letter-spacing: 0.12em;
}
.ziwei-sign-who {
  font-family: var(--font-wenkai);
  font-size: 13px;
  color: #282018;
  font-weight: 600;
}
.ziwei-sign-affinity {
  margin-left: auto;
  color: #9f2d27;
  letter-spacing: 0.05em;
}
.ziwei-sign-quote {
  margin: 0;
  font-family: var(--font-wenkai);
  font-size: 13.5px;
  line-height: 1.65;
  color: #463b2f;
  letter-spacing: 0.06em;
}

/* 卷尾吉时与朱砂泥金封缄印签按钮（废除扁平黄条！） */
.ziwei-scroll-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}
.ziwei-meta-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-serif);
  font-size: 12px;
  color: #5e503f;
}
.ziwei-meta-dot {
  opacity: 0.5;
}
.ziwei-seal-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px 7px 10px;
  border-radius: 3px;
  border: 1.5px solid #9f2a24;
  background: linear-gradient(155deg, #b5322b 0%, #8a1f1a 100%);
  color: #fdf4e3;
  font-family: var(--font-pack-title);
  font-size: 15px;
  letter-spacing: 0.16em;
  cursor: pointer;
  box-shadow:
    0 6px 18px rgba(132, 30, 24, 0.30),
    inset 0 0 0 1px rgba(242, 206, 134, 0.36);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.ziwei-seal-cta:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.06);
  box-shadow:
    0 10px 24px rgba(132, 30, 24, 0.38),
    inset 0 0 0 1px rgba(248, 220, 158, 0.58);
}
.ziwei-cta-chop {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 2px;
  border: 1px solid rgba(246, 214, 146, 0.65);
  background: rgba(246, 214, 146, 0.14);
  color: #fae0a4;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1;
}

/* 藏经阁：余墨计数器、今日择域按钮、新录标记与普通版紫微高照状态 */
.binder-inkdrop-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(168, 128, 48, 0.38);
  background: rgba(168, 128, 48, 0.10);
  color: var(--binder-gold);
  font-family: var(--font-serif);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.binder-factions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.binder-factions-bar .binder-factions {
  flex: 1;
  min-width: 0;
}
.binder-wish-btn {
  flex-shrink: 0;
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid var(--binder-rule-strong);
  background: var(--binder-surface);
  color: var(--binder-gold);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.binder-wish-btn:hover,
.binder-wish-btn.is-active {
  background: rgba(168, 43, 39, 0.16);
  border-color: rgba(184, 50, 44, 0.56);
  color: #f3c4b8;
}
html[data-studio-light='light'] .binder-wish-btn.is-active {
  color: #8f221e;
}
.binder-wish-btn[hidden] {
  display: none;
}
.binder-slot-new-tag {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 4;
  padding: 1px 5px;
  border-radius: 2px;
  background: #ae2f28;
  color: #fff6e8;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* 藏经阁底部独立 16:9 典藏巨幅横卷专区（与上方竖版小图彻底分陈，互不混排） */
.binder-grand-section {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px dashed var(--binder-rule-strong);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.binder-grand-section.is-only {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.binder-grand-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.binder-grand-section-seal {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  padding: 4px 8px;
  border-radius: 2px;
  border: 1px solid rgba(180, 44, 38, 0.72);
  background: linear-gradient(150deg, #b5322b, #8b1f1a);
  color: #fdf3df;
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.14em;
  line-height: 1.1;
}
.binder-grand-section-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.binder-grand-section-copy strong {
  font-family: var(--font-wenkai);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--binder-ink);
}
.binder-grand-section-copy span {
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--binder-muted);
  letter-spacing: 0.04em;
}
.binder-grand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.binder-grand-grid .binder-slot.is-grand-card {
  grid-column: auto;
  grid-row: auto;
}
@media (max-width: 760px) {
  .binder-grand-grid {
    grid-template-columns: 1fr;
  }
}
.luck-switch.is-locked {
  opacity: 0.68;
}
.luck-switch.is-blessed .luck-led {
  background: #d8a642;
  box-shadow: 0 0 0 2px rgba(216, 166, 66, 0.25);
}

/* =========================================================================
 * 精修润色：全鉴折叠调参台、叠纱藏韵提示签、重修二次确认与水墨细卷滚动条
 * ========================================================================= */
.wb-drawer-toggle-bar {
  margin-top: 8px;
  display: flex;
}
.wb-drawer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px dashed var(--binder-rule-strong);
  background: var(--binder-surface);
  color: var(--binder-ink);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}
.wb-drawer-toggle-btn:hover,
.wb-drawer-toggle-btn.is-open {
  background: var(--binder-surface-hover);
  border-style: solid;
  border-color: var(--binder-gold);
}
.wb-drawer-badge {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: linear-gradient(135deg, #b8322c, #8a1f1b);
  color: #fff5e6;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.wb-drawer-toggle-btn small {
  margin-left: auto;
  font-size: 11px;
  color: var(--binder-muted);
}

.sanctuary-veil-hint {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid rgba(207, 169, 86, 0.36);
  background: rgba(207, 169, 86, 0.10);
  color: var(--binder-gold);
  font-size: 11px;
  letter-spacing: 0.05em;
  cursor: help;
}

.binder-reset.is-confirming {
  border-color: #c83e37 !important;
  background: rgba(184, 50, 44, 0.22) !important;
  color: #ffdcd8 !important;
  font-weight: 600;
}
html[data-studio-light='light'] .binder-reset.is-confirming {
  color: #8f221e !important;
  background: rgba(184, 50, 44, 0.14) !important;
}

/* 水墨风细滚动条（标准 scrollbar-color / scrollbar-width + WebKit @supports 回退） */
.sanctuary-panel,
.binder-scroll-body,
.ziwei-stage-wrap {
  --scrollbar-thumb: rgba(212, 175, 92, 0.56);
  --scrollbar-track: rgba(24, 22, 20, 0.55);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
html[data-studio-light='light'] .sanctuary-panel,
html[data-studio-light='light'] .binder-scroll-body {
  --scrollbar-thumb: rgba(96, 76, 44, 0.58);
  --scrollbar-track: rgba(226, 217, 198, 0.72);
}
@supports not (scrollbar-color: auto) {
  .sanctuary-panel,
  .binder-scroll-body,
  .ziwei-stage-wrap {
    scrollbar-width: auto;
  }
  .sanctuary-panel::-webkit-scrollbar,
  .binder-scroll-body::-webkit-scrollbar,
  .ziwei-stage-wrap::-webkit-scrollbar {
    width: 7px;
    height: 7px;
  }
  .sanctuary-panel::-webkit-scrollbar-thumb,
  .binder-scroll-body::-webkit-scrollbar-thumb,
  .ziwei-stage-wrap::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
  }
  .sanctuary-panel::-webkit-scrollbar-track,
  .binder-scroll-body::-webkit-scrollbar-track,
  .ziwei-stage-wrap::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

/* =========================================================================
 * 移动端常见尺寸 & 自动旋转（竖屏 / 短横屏 / 平板）专项适配
 * ========================================================================= */
html,
body {
  height: 100dvh;
  overscroll-behavior: none;
}
#grabZone,
.ziwei-astrolabe-canvas {
  touch-action: none;
}

/* 1. 手机竖屏（常见 360×780 ~ 430×932，覆盖 <= 680px） */
@media (max-width: 680px) {
  .top-bar {
    padding: max(10px, env(safe-area-inset-top)) 12px 8px;
    gap: 8px;
  }
  .brand-sub {
    display: none;
  }
  .brand-title {
    font-size: 20px;
    white-space: nowrap;
  }
  .brand-seal {
    width: 24px;
    height: 24px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .utility-cluster {
    gap: 6px;
  }
  /* 竖屏窄宽下收起次级书体/墨相装饰开关与冗余竖线，保留紫微问卦、画室切换与静音，确保顶栏清爽单行不折行 */
  #calligStyleBtn,
  #ensoStyleBtn,
  .util-sep {
    display: none;
  }
  .util-btn {
    padding: 5px 8px;
    font-size: 12px;
    gap: 4px;
    white-space: nowrap;
  }

  .pack {
    --pack-base-w: clamp(232px, min(74vw, 44dvh), 332px);
    --pack-form-scale: 1.0;
  }
  .stage-dock {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: 100%;
    padding: 0 8px;
  }
  .gesture-hint {
    font-size: 11.5px;
    margin-bottom: 6px;
    max-width: 92vw;
    text-align: center;
  }
  .console-dock {
    width: min(100%, 440px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--dock-bg) 92%, transparent);
    border: 1px solid var(--dock-border);
  }
  .console-sep {
    display: none;
  }
  .console-kicker {
    font-size: 10.5px;
  }
  .console-val {
    font-size: 13.5px;
  }
  .console-item {
    gap: 6px;
  }
  .binder-mini-bar {
    width: 28px;
  }
  .dock-btn {
    padding: 7px 14px;
    font-size: 13px;
  }

  .inspect-hud {
    bottom: calc(112px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
    gap: 6px;
  }
  .inspect-omen {
    font-size: 11px;
    padding: 4px 10px;
    text-align: center;
  }
  .inspect-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
  }

  /* 藏经阁：手机竖屏全屏铺开 + 横向可滑筛选栏 + 双列竖卡 */
  .binder-dialog {
    padding: 0;
  }
  .binder-sheet {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
  .binder-head {
    flex-wrap: wrap;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  }
  .binder-head-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .binder-search {
    flex: 1 1 140px;
    min-width: 120px;
  }
  .binder-summary-bar,
  .binder-factions-wrap,
  .binder-filters {
    padding-left: 12px;
    padding-right: 12px;
  }
  .binder-factions,
  .binder-filter-row,
  .binder-subrow,
  .filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .binder-factions-bar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .binder-scroll-body > .binder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 12px 16px;
  }
  .binder-slot {
    padding: 8px;
  }
  .binder-slot-name {
    font-size: 13.5px;
  }
  .binder-grand-grid {
    grid-template-columns: 1fr;
  }

  /* 紫微三幕问卦：手机竖屏上下流畅排布 */
  .ziwei-head {
    padding: max(10px, env(safe-area-inset-top)) 14px 8px;
  }
  .ziwei-title {
    font-size: 18px;
  }
  .ziwei-date-line {
    font-size: 11px;
  }
  .ziwei-stage-wrap {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
    align-content: start;
  }
  .ziwei-wheel-host {
    width: min(76vw, 300px);
    height: min(76vw, 300px);
  }
  .ziwei-result-scroll {
    padding: 18px 16px;
    gap: 12px;
  }
  .ziwei-grade-title {
    font-size: 24px;
  }
  .ziwei-yiji-scroll {
    gap: 8px;
  }
  .ziwei-scroll-foot {
    justify-content: center;
  }
}

/* 2. 手机横屏自动旋转（如 844×390 / 780×360，短高度宽屏） */
@media (orientation: landscape) and (max-height: 540px) {
  .top-bar {
    padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
  }
  .brand-sub {
    display: none;
  }
  .brand-title {
    font-size: 18px;
  }
  .brand-seal {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .top-btn {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .pack {
    --pack-base-w: clamp(146px, min(30vw, 43dvh), 218px);
    --pack-form-scale: 1.0;
  }
  .stage-dock {
    bottom: max(4px, env(safe-area-inset-bottom));
  }
  .gesture-hint {
    font-size: 11px;
    margin-bottom: 3px;
  }
  .console-dock {
    padding: 4px 14px;
    gap: 10px;
  }
  .console-kicker {
    font-size: 10px;
  }
  .console-val {
    font-size: 13px;
  }
  .dock-btn {
    padding: 5px 12px;
    font-size: 12px;
  }
  .inspect-hud {
    bottom: 56px;
    gap: 4px;
  }
  .inspect-omen {
    display: none;
  }

  /* 手机横屏紫微问卦：保持左盘右卷双栏并排，右卷独立可滚 */
  .ziwei-head {
    padding: 6px max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
  }
  .ziwei-title {
    font-size: 16px;
  }
  .ziwei-stage-wrap {
    grid-template-columns: minmax(210px, 0.78fr) minmax(0, 1.22fr);
    gap: 16px;
    padding: 4px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
    align-items: center;
  }
  .ziwei-wheel-host {
    width: min(60dvh, 224px);
    height: min(60dvh, 224px);
  }
  .ziwei-wheel-tip {
    font-size: 10.5px;
  }
  .ziwei-reading-panel {
    max-height: calc(100dvh - 66px);
    overflow-y: auto;
    padding-right: 4px;
  }
  .ziwei-result-scroll {
    padding: 14px 16px;
    gap: 10px;
  }
  .ziwei-grade-title {
    font-size: 22px;
  }

  /* 手机横屏藏经阁与玄藏殿 */
  .binder-dialog {
    padding: 0;
  }
  .binder-sheet {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
  .binder-head {
    padding: 6px 14px;
  }
  .binder-summary-bar {
    display: none;
  }
  .binder-sanctuary {
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
    grid-template-rows: 1fr;
  }
  .sanctuary-stage {
    padding: 8px;
  }
  .sanctuary-mount {
    width: min(46dvh, 210px);
  }
}
