/* 任运图案库 · 视觉系统
   颜色全部取自 CI：棋盘黄 #FFBD45、棋盘绿 #489872、狮头绿 #2AAC80、黑色描边。
   规则：粗黑描边 + 实心投影 = 贴纸；按下去时投影收回 = 实体按键。 */

/* 完整官方字库随包提供，离线时与联网时使用同一套字形。 */
@font-face {
  font-family: "Bungee";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/Bungee-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "ZCOOL QingKe HuangYou";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ZCOOLQingKeHuangYou-Regular.ttf") format("truetype");
}

:root {
  --ink: #141414;
  --paper: #ffffff;
  --yellow: #FFBD45;
  --yellow-hi: #FFD36E;
  --green: #2AAC80;
  --green-2: #489872;
  --field: #0F3B2D;
  --field-2: #0A2C21;
  --red: #F0414E;
  --pink: #FF5FA2;
  --sky: #8FD3FF;
  --mint: #B8F0D6;
  --muted: #5E6B64;

  --bw: 3px;
  --sh: 5px 5px 0 var(--ink);
  --sh-up: 7px 8px 0 var(--ink);
  --sh-down: 1px 1px 0 var(--ink);

  --f-display: "ZCOOL QingKe HuangYou", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --f-num: "Bungee", "Arial Black", "PingFang SC", sans-serif;
  --f-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

  --pop: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--field); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--field);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg.i { width: 1em; height: 1em; flex: none; }
.display { font-family: var(--f-display); font-weight: 900; font-synthesis: none; }

:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; border-radius: 12px; }

/* ---------- 实体按键 ---------- */
.press {
  border: var(--bw) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .14s var(--out), box-shadow .14s var(--out), background-color .2s;
}
.press:hover { transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--ink); }
.press:active, .press.is-down { transform: translate(3px, 3px); box-shadow: var(--sh-down); transition-duration: .05s; }

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr minmax(240px, 560px) 1fr; align-items: center; gap: 16px;
  padding: 10px var(--gutter);
  background: var(--ink); color: #fff;
  border-bottom: 3px solid #000;
}
.hud-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; justify-self: start; min-width: 0; }
.hud-logo {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--yellow); border: 3px solid #fff; display: grid; place-items: center; overflow: hidden;
  transition: transform .4s var(--pop);
}
.hud-brand:hover .hud-logo { transform: rotate(-14deg) scale(1.08); }
.hud-logo img { width: 86%; }
.hud-name { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.hud-name b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 22px; letter-spacing: 1px; white-space: nowrap; }
.hud-name small { font-family: var(--f-num); font-size: 9.5px; letter-spacing: 1.6px; color: var(--yellow); white-space: nowrap; }

.search {
  position: relative; display: flex; align-items: center; height: 46px;
  background: #fff; color: var(--ink); border: 3px solid #fff; border-radius: 999px;
  padding: 0 8px 0 16px; gap: 10px;
  transition: box-shadow .2s var(--out), transform .2s var(--out);
}
.search:focus-within { box-shadow: 0 0 0 4px var(--yellow); transform: scale(1.015); }
.search > .i { font-size: 20px; color: var(--ink); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: 600 16px/1 var(--f-body); color: var(--ink);
}
.search input::placeholder { color: #8a948f; font-weight: 500; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font: 700 12px/1 var(--f-num); padding: 6px 8px; border-radius: 8px;
  border: 2px solid var(--ink); background: var(--yellow); box-shadow: 2px 2px 0 var(--ink);
}
.search-clear {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #fff;
  display: grid; place-items: center; font-size: 14px; padding: 0;
}
.search:focus-within kbd, .search.has-q kbd { display: none; }

.hud-right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.meter {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 6px;
  border-radius: 999px; border: 2px solid #3a3a3a; background: #1f1f1f; color: #fff;
  font: 700 13px/1 var(--f-num); letter-spacing: .5px;
  transition: border-color .2s, transform .2s var(--pop);
}
.meter:hover { border-color: var(--yellow); transform: scale(1.04); }
.meter b { color: var(--yellow); font-weight: 400; }
.ring { width: 30px; height: 30px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; }
.ring .track { stroke: #3a3a3a; }
.ring .fill { stroke: var(--yellow); stroke-linecap: round; transition: stroke-dashoffset .8s var(--pop); }
.meter-label { font-family: var(--f-body); font-size: 12px; font-weight: 600; color: #bbb; letter-spacing: 0; white-space: nowrap; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: #1f1f1f; border: 2px solid #3a3a3a; color: #fff; font-size: 20px; padding: 0;
  transition: border-color .2s, transform .2s var(--pop);
}
.icon-btn:hover { border-color: var(--yellow); transform: rotate(-8deg) scale(1.06); }
.icon-btn:active { transform: scale(.9); }

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  background-color: var(--yellow);
  background-image: radial-gradient(rgba(20, 20, 20, .13) 1.3px, transparent 1.6px);
  background-size: 15px 15px;
  padding: clamp(22px, 4vw, 44px) var(--gutter) 8px;
}
.hero { transition: padding-top .45s var(--out); }
.hero-fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s var(--out), opacity .3s; }
.hero-fold-in { min-height: 0; overflow: hidden; padding: 0 14px 16px 0; margin: 0 -14px -16px 0; }
.searching .hero { padding-top: 6px; }
.searching .hero-fold { grid-template-rows: 0fr; opacity: 0; }
.hero-fold.no-anim, .hero-fold.no-anim + .roster, .searching .hero.no-anim { transition: none; }
.hero-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.eyebrow {
  margin: 0 0 10px; display: inline-flex; align-items: center; gap: 8px;
  font: 400 12px/1 var(--f-num); letter-spacing: 2px;
  background: var(--ink); color: var(--yellow); padding: 7px 12px 6px; border-radius: 999px;
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero h1 {
  margin: 0; font-family: var(--f-display); font-weight: 900; font-synthesis: none;
  font-size: clamp(52px, 7.4vw, 112px); line-height: .92; letter-spacing: 2px; color: var(--ink);
}
.hero h1 em {
  font-style: normal; color: #fff; display: inline-block;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-3deg); transform-origin: left bottom;
}
.hero-line {
  margin: 16px 0 0; height: 1.5em; overflow: hidden;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: clamp(18px, 2.2vw, 26px);
}
.hero-line span { display: inline-block; }
.hero-line q { quotes: "“" "”"; }

/* 今日运势卡 */
.fortune {
  position: relative; width: 196px; height: 252px; padding: 0; border: 0; background: none;
  perspective: 1100px; transform: rotate(4deg); margin: 0 6px 10px 0;
  transition: transform .35s var(--pop);
}
.fortune:hover { transform: rotate(1deg) translateY(-6px) scale(1.02); }
.f-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transition: transform .8s var(--pop);
}
.fortune.flipped .f-inner { transform: rotateY(180deg); }
.f-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 4px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.f-back {
  background: repeating-conic-gradient(var(--yellow) 0 25%, var(--green-2) 0 50%) 0 0 / 44px 44px;
}
.f-back .f-medal {
  width: 112px; height: 112px; border-radius: 50%; background: #fff; border: 4px solid var(--ink);
  display: grid; place-items: center; box-shadow: 4px 4px 0 var(--ink);
  animation: wobble 3.2s ease-in-out infinite;
}
.f-back .f-medal img { width: 82%; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.04); } }
.f-back b {
  margin-top: 16px; background: var(--ink); color: #fff; padding: 8px 16px 7px; border-radius: 12px;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 24px; letter-spacing: 2px;
}
.f-back small { margin-top: 8px; font: 700 13px/1 var(--f-body); background: #fff; border: 2px solid var(--ink); padding: 5px 10px; border-radius: 999px; }
.f-front { background: #fff; transform: rotateY(180deg); justify-content: flex-start; }
.f-pic { width: 100%; height: 138px; display: grid; place-items: center; background: var(--mint); border-bottom: 4px solid var(--ink); padding: 14px; }
.f-pic img { max-height: 100%; object-fit: contain; }
.f-txt { padding: 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.f-txt em { font: 400 13px/1 var(--f-num); font-style: normal; color: var(--muted); }
.f-txt b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 21px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-yj { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.f-yj i { font-style: normal; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--green); color: #fff; border: 2px solid var(--ink); font-size: 12px; }
.f-yj i.ji { background: var(--red); margin-left: 4px; }
.f-txt small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* 选角 */
.roster {
  --tw: clamp(104px, calc((100vw - 2 * var(--gutter) - 9 * 14px) / 10), 140px);
  display: flex; gap: 14px; overflow-x: auto; overflow-y: visible;
  padding: 54px 4px 28px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter);
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.roster::-webkit-scrollbar { display: none; }
.tile {
  --c: #fff;
  position: relative; flex: none; width: var(--tw); height: calc(var(--tw) * 1.16); padding: 0;
  background: var(--c); border: var(--bw) solid var(--ink); border-radius: 22px; box-shadow: var(--sh);
  scroll-snap-align: start;
  transition: transform .32s var(--pop), box-shadow .32s var(--pop), filter .3s;
}
.tile .face {
  position: absolute; left: 50%; bottom: 40px; width: calc(var(--tw) * 1.06); height: calc(var(--tw) * 1.06); object-fit: contain;
  transform: translateX(-50%); transform-origin: 50% 100%;
  filter: drop-shadow(3px 4px 0 rgba(20, 20, 20, .28));
  transition: transform .4s var(--pop);
  pointer-events: none;
}
.tile.photo .face {
  width: 100px; height: 100px; bottom: 50px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--ink); filter: none; box-shadow: 3px 3px 0 var(--ink);
}
.tile .plate {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px 0 12px;
  background: var(--ink); color: #fff; border-radius: 0 0 18px 18px;
}
.tile .plate b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: clamp(14px, calc(var(--tw) * .125), 17px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .plate em { font: 400 13px/1 var(--f-num); font-style: normal; color: var(--yellow); }
.tile .p1 {
  position: absolute; top: -14px; right: -12px; z-index: 2;
  font: 400 14px/1 var(--f-num); color: #fff; background: var(--red);
  border: 3px solid var(--ink); border-radius: 10px; padding: 6px 8px 5px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: scale(0) rotate(-20deg); transition: transform .35s var(--pop);
}
.tile:hover { transform: translateY(-6px) rotate(-1.5deg); box-shadow: var(--sh-up); }
.tile:hover .face { transform: translateX(-50%) scale(1.1) rotate(-5deg); }
.tile:active { transform: translateY(2px) scale(.97); box-shadow: 2px 2px 0 var(--ink); transition-duration: .06s; }
.tile.on { transform: translateY(-12px) rotate(-2deg); box-shadow: 8px 12px 0 var(--ink); }
.tile.on .face { transform: translateX(-50%) scale(1.14) rotate(-4deg); }
.tile.on .p1 { transform: scale(1) rotate(12deg); }
.roster.has-pick .tile:not(.on) { filter: saturate(.72); }
.roster.has-pick .tile:not(.on):hover { filter: none; }
.tile-all { --c: var(--ink); }
.tile-all .all-mark {
  position: absolute; inset: 0 0 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--yellow); font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 30px; letter-spacing: 2px;
}
.tile-all .all-mark .i { font-size: 44px; transition: transform .4s var(--pop); }
.tile-all:hover .all-mark .i, .tile-all.on .all-mark .i { transform: rotate(-12deg) translateY(-4px) scale(1.12); }
.tile-all .plate { border-top: 2px dashed #444; }

.roster .tile { opacity: 0; }
.ready .roster .tile { animation: tileDrop .62s var(--pop) backwards; animation-delay: calc(var(--i) * 55ms + 120ms); opacity: 1; }
@keyframes tileDrop { from { opacity: 0; transform: translateY(-70px) rotate(8deg) scale(.8); } }

.checker-edge {
  height: 36px;
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--yellow) 0 50%) 0 0 / 36px 36px;
  border-bottom: 3px solid var(--ink);
}

/* ---------- 图案墙 ---------- */
.board {
  min-height: 70vh;
  padding: 26px var(--gutter) 150px;
  background-color: var(--field);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='132' viewBox='0 0 240 132'%3E%3Cg fill='%23ffffff' fill-opacity='.045' font-family='Arial Black,Arial,sans-serif' font-weight='900' font-size='24' transform='rotate(-22 120 66)'%3E%3Ctext x='-6' y='44'%3ERENYUN%3C/text%3E%3Ctext x='114' y='110'%3ERENYUN%3C/text%3E%3C/g%3E%3C/svg%3E");
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 22px; color: #fff; scroll-margin-top: 84px; }
.board-title { margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: clamp(28px, 3.4vw, 40px); line-height: 1; }
.board-title b {
  font: 400 16px/1 var(--f-num); color: var(--ink); background: var(--yellow);
  border: 3px solid var(--ink); border-radius: 999px; padding: 6px 10px 5px; box-shadow: 3px 3px 0 #000;
}
.board-title b.bump { animation: bump .45s var(--pop); }
@keyframes bump { 40% { transform: scale(1.35) rotate(-8deg); } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .32);
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--pop), box-shadow .2s;
}
.chip:hover { border-color: #fff; transform: translateY(-2px); }
.chip:active { transform: scale(.94); }
.chip.on { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 #000; }
.chip .i { font-size: 15px; }
.chip.alpha-chip.on { background: var(--mint); }
.tool-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg-label { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .78); }

/* 底色切换（全站同步） */
.seg {
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 3px; box-shadow: 3px 3px 0 #000;
  isolation: isolate;
}
.seg button {
  position: relative; z-index: 1; border: 0; background: transparent; height: 34px; padding: 0 14px;
  font-weight: 800; font-size: 14px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink); white-space: nowrap; transition: color .2s;
}
.seg button .sw { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--ink); flex: none; }
.seg button .sw.chk { background: repeating-conic-gradient(#cfd5d2 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.seg button .sw.wht { background: #fff; }
.seg .thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px;
  transition: transform .38s var(--pop);
}
.seg[data-v="white"] .thumb { transform: translateX(100%); }
.seg button.off { color: #9aa29e; cursor: not-allowed; }
.seg button.off .sw { border-style: dashed; border-color: #9aa29e; }
.seg.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.active-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 20px;
  animation: rise .35s var(--pop);
}
.af-lbl { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .62); margin-right: 2px; }
.af {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 10px; border-radius: 999px;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); font-weight: 800; font-size: 13px;
  box-shadow: 2px 2px 0 #000; transition: transform .2s var(--pop);
}
.af img { width: 22px; height: 22px; margin-left: -4px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ink); object-fit: cover; }
.af .i { font-size: 14px; padding: 2px; border-radius: 50%; background: rgba(20, 20, 20, .12); box-sizing: content-box; }
.af:hover { transform: translateY(-2px); }
.af:hover .i { background: var(--ink); color: #fff; }
.af:active { transform: scale(.93); }
.af-clear { border: 0; background: none; color: #fff; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; }
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
}
.card {
  --c: #fff;
  position: relative; background: #fff; border: var(--bw) solid var(--ink); border-radius: 20px; box-shadow: var(--sh);
  cursor: pointer; outline: none; transform-style: preserve-3d;
  transition: transform .28s var(--out), box-shadow .28s var(--out);
}
.card:not(.in) { opacity: 0; }
.card.in { animation: cardIn .55s var(--pop) backwards; animation-delay: var(--d, 0ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.86) rotate(-3deg); } }
.card:hover, .card:focus-visible {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px);
  box-shadow: 8px 10px 0 var(--ink);
}
.card:focus-visible { box-shadow: 8px 10px 0 var(--ink), 0 0 0 4px var(--yellow); }
.card.is-down { transform: translate(3px, 3px) scale(.975) !important; box-shadow: 1px 1px 0 var(--ink) !important; transition-duration: .06s; }
.pic {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 11%;
  border-radius: 17px 17px 0 0; overflow: hidden; background: #fff;
}
.pic img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .45s var(--pop); }
.card:hover .pic img { transform: scale(1.08) rotate(-2deg); }
.card.scene .pic { padding: 0; }
.card.scene .pic img { width: 100%; height: 100%; object-fit: cover; }
.card.scene:hover .pic img { transform: scale(1.06); }
.sheen {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .7), transparent 42%),
    linear-gradient(115deg, transparent 28%, rgba(255, 189, 69, .28) 44%, rgba(143, 211, 255, .28) 56%, transparent 72%);
  mix-blend-mode: soft-light;
}
.card:hover .sheen { opacity: 1; }
.tag {
  position: absolute; left: 10px; bottom: 10px; font-size: 11px; font-weight: 800; line-height: 1;
  padding: 4px 7px; border-radius: 6px; border: 2px solid var(--ink);
}
.tag-orig { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag-wait { background: #fff; border-style: dashed; color: var(--muted); }
.chip em { font: 400 11px/1 var(--f-num); font-style: normal; opacity: .6; }
.chip.on em { opacity: .8; }
.chip:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.bag-open { display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; border-radius: 12px; }
.btn-orig {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 8px;
  font-size: 13.5px; font-weight: 800; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  border-radius: 8px; transition: background-color .2s;
}
.btn-orig:hover { background: var(--mint); }
.btn-orig .i { font-size: 18px; }
.btn-orig.loading { opacity: .5; pointer-events: none; }
.card .no {
  position: absolute; top: 10px; left: 11px; font: 400 11.5px/1 var(--f-num); letter-spacing: .5px;
  background: #fff; padding: 3px 5px 2px; border-radius: 6px; color: var(--ink);
}
.card.scene .no { border: 2px solid var(--ink); }
.fav {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; color: var(--ink);
  display: grid; place-items: center; font-size: 18px; box-shadow: 2px 2px 0 var(--ink);
  transition: transform .25s var(--pop), background-color .2s, color .2s;
}
.fav .i { fill: none; stroke: currentColor; stroke-width: 2.4; }
.fav:hover { transform: scale(1.12) rotate(-8deg); }
.fav:active { transform: scale(.85); }
.fav.on { background: var(--red); color: #fff; }
.fav.on .i { fill: currentColor; }
.fav.pop { animation: heartPop .5s var(--pop); }
@keyframes heartPop { 30% { transform: scale(1.45) rotate(-12deg); } 60% { transform: scale(.9); } }
.qdl {
  position: absolute; right: 8px; top: calc(100% - 92px); z-index: 2; height: 34px; padding: 0 10px 0 8px;
  border-radius: 999px; border: 2.5px solid var(--ink); background: var(--yellow); color: var(--ink);
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink);
  opacity: 0; transform: translateY(8px) scale(.9); pointer-events: none;
  transition: opacity .2s, transform .3s var(--pop);
}
.qdl .i { font-size: 16px; stroke-width: 2.8; }
.card:hover .qdl, .card:focus-within .qdl { opacity: 1; transform: none; pointer-events: auto; }
.qdl:active { transform: scale(.9) !important; }
.meta { border-top: var(--bw) solid var(--ink); padding: 9px 12px 11px; }
.meta .t {
  margin: 0; font-weight: 800; font-size: 15px; line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all;
}
.meta .t mark { background: var(--yellow); border-radius: 3px; padding: 0 1px; }
.meta .sub { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.card { display: flex; flex-direction: column; }
.card .meta { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); flex: none; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; padding: 40px 0 20px; gap: 12px; }
.empty img { width: 120px; animation: wobble 2.6s ease-in-out infinite; }
.empty h3 { margin: 0; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 30px; }
.empty p { margin: 0; color: rgba(255, 255, 255, .75); }
.empty .chips { justify-content: center; }

.foot { margin-top: 56px; color: rgba(255, 255, 255, .5); font-size: 12px; text-align: center; line-height: 1.8; }
.foot b { color: rgba(255, 255, 255, .8); }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 85;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px 14px;
  background: var(--ink); border: 3px solid #000; border-radius: 999px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .35), 0 0 0 3px rgba(255, 255, 255, .12);
}
.dock-btn {
  position: relative; width: 70px; height: 52px; border: 0; background: transparent; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 700; border-radius: 16px;
  transition: background-color .2s, transform .2s var(--pop);
}
.dock-btn .i { font-size: 22px; }
.dock-btn:hover { background: #262626; }
.dock-btn:active { transform: scale(.9); }
.badge {
  position: absolute; top: 2px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--red); color: #fff; border: 2px solid var(--ink); font: 400 11px/18px var(--f-num); text-align: center;
}
.badge.zero { background: #3a3a3a; color: #aaa; }
.badge.bump { animation: bump .5s var(--pop); }
.dock-btn.bump { animation: bagBump .55s var(--pop); }
@keyframes bagBump { 30% { transform: scale(1.25) rotate(-10deg); } 60% { transform: scale(.92) rotate(4deg); } }
.gacha-btn {
  position: relative; width: 82px; height: 82px; margin: -34px 6px 0; border-radius: 50%; padding: 0;
  background: var(--red); border: 4px solid var(--ink); color: #fff;
  box-shadow: 0 7px 0 var(--ink), inset 0 -8px 0 rgba(0, 0, 0, .18), inset 0 6px 0 rgba(255, 255, 255, .3);
  display: grid; place-items: center;
  transition: transform .1s, box-shadow .1s;
}
.gacha-btn::before {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 3px dashed var(--yellow); opacity: .9;
  animation: spin 9s linear infinite;
}
.gacha-btn span {
  position: relative; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 22px; letter-spacing: 1px;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
}
.gacha-btn:hover { animation: gachaWiggle .5s; }
.gacha-btn:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--ink), inset 0 -4px 0 rgba(0, 0, 0, .18); animation: none; }
.gacha-btn.nudge { animation: gachaNudge 1s var(--pop); }
@keyframes gachaWiggle { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes gachaNudge { 20% { transform: translateY(-10px) scale(1.06); } 40% { transform: translateY(0) scale(.97); } 60% { transform: translateY(-4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- NPC：皇冠任运 ---------- */
.host { position: fixed; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 84; pointer-events: none; }
.host-face {
  pointer-events: auto; position: relative; width: 78px; height: 78px; border-radius: 50%; padding: 0;
  background: var(--yellow); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  transition: transform .25s var(--pop);
}
.host-face img {
  position: absolute; left: 50%; bottom: 2px; width: 92px; max-width: none; transform: translateX(-50%);
  animation: bob 2.8s ease-in-out infinite; transform-origin: 50% 100%;
}
.host-face:hover { transform: scale(1.08) rotate(-6deg); }
.host-face:active { transform: scale(.92); }
.host-face.react img { animation: hostReact .55s var(--pop); }
@keyframes bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px) rotate(-2deg); } }
@keyframes hostReact { 0% { transform: translateX(-50%) scale(.7); } 50% { transform: translateX(-50%) scale(1.18) rotate(-6deg); } 100% { transform: translateX(-50%) scale(1); } }
.host-bubble {
  position: absolute; left: 92px; bottom: 34px; white-space: nowrap;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 8px 14px 7px;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 19px; box-shadow: 3px 3px 0 var(--ink);
  transform-origin: 0 100%; transform: scale(0); opacity: 0;
  transition: transform .3s var(--pop), opacity .2s;
}
.host-bubble::before {
  content: ""; position: absolute; left: -12px; bottom: 10px; width: 16px; height: 16px;
  background: #fff; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg) skew(10deg, 10deg);
}
.host-bubble.show { transform: scale(1); opacity: 1; }

/* ---------- 图鉴卡（详情） ---------- */
.detail { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 3vh 4vw; }
.backdrop { position: absolute; inset: 0; background: rgba(6, 22, 16, .82); overflow: hidden; }
.sunburst {
  position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(var(--c, var(--yellow)) 0 7deg, transparent 7deg 20deg);
  opacity: .2; animation: spin 50s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0, transparent 46%); mask: radial-gradient(circle, #000 0, transparent 46%);
}
.dcard {
  position: relative; width: min(1120px, 100%); height: min(720px, 94vh);
  display: grid; grid-template-columns: 1.22fr 1fr;
  background: #fff; border: 4px solid var(--ink); border-radius: 28px; box-shadow: 12px 12px 0 var(--ink);
  overflow: hidden;
}
.stage {
  /* 原 PNG 的透明画布可伸出取景框；只裁绘制，不建立会被焦点带动的内部滚动区。 */
  position: relative; overflow: clip; border-right: 4px solid var(--ink); background: #fff; cursor: zoom-in;
  touch-action: pan-y;
}
.stage::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(#e3e7e5 0 25%, #fff 0 50%) 0 0 / 28px 28px;
  clip-path: inset(0 0 0 0); transition: clip-path .5s var(--out);
}
.stage[data-bg="white"]::before { clip-path: inset(0 0 0 100%); }
.stage-img {
  position: absolute; inset: 11% 9% 14%;
  transition: transform .35s var(--out);
}
.stage-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .25s; }
.stage.zoom { cursor: zoom-out; }
.stage.zoom .stage-img { transform: scale(2.2); }
.stage-no {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  font: 400 22px/1 var(--f-num); background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px;
  padding: 7px 12px 5px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-4deg);
}
.stage-new {
  position: absolute; top: 20px; right: 18px; z-index: 2;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 20px; color: #fff;
  background: var(--red); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px 5px; box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(6deg) scale(0);
}
.stage-new.show { animation: stamp .7s var(--pop) forwards; }
@keyframes stamp { 0% { transform: rotate(-20deg) scale(2.6); opacity: 0; } 60% { transform: rotate(8deg) scale(.92); opacity: 1; } 100% { transform: rotate(6deg) scale(1); opacity: 1; } }
.stage-foot {
  position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none;
}
.stage-foot > * { pointer-events: auto; }
.stage-hint { font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, .9); padding: 5px 9px; border-radius: 8px; border: 2px solid #d8ddda; }
.stage-stamp {
  position: absolute; left: 50%; top: 46%; z-index: 3; pointer-events: none;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 64px; color: var(--yellow);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--ink);
  transform: translate(-50%, -50%) rotate(-10deg) scale(0); opacity: 0; white-space: nowrap;
}
.stage-stamp.show { animation: bigStamp 1.1s var(--pop) forwards; }
@keyframes bigStamp {
  0% { transform: translate(-50%, -50%) rotate(-24deg) scale(3); opacity: 0; }
  25% { transform: translate(-50%, -50%) rotate(-8deg) scale(.9); opacity: 1; }
  40% { transform: translate(-50%, -50%) rotate(-10deg) scale(1.05); }
  80% { transform: translate(-50%, -50%) rotate(-10deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -60%) rotate(-10deg) scale(1); opacity: 0; }
}

.dinfo { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px 30px 22px; overflow-y: auto; }
.dclose {
  position: absolute; top: 16px; right: 16px; z-index: 3; width: 46px; height: 46px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; font-size: 22px; padding: 0;
}
.dclose .i { stroke-width: 3; }
.d-series {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  background: var(--c); border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px 14px 3px 3px;
  font-weight: 800; font-size: 14px; box-shadow: 2px 2px 0 var(--ink);
}
.d-series.dark { color: #fff; }
.d-series img { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); object-fit: cover; }
.d-title-wrap { margin-right: 52px; }
.d-kicker { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--muted); }
.dinfo h2 { margin: 0; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: clamp(34px, 4vw, 54px); line-height: 1.02; word-break: break-word; text-wrap: balance; }
.d-meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.d-meta dt { color: var(--muted); font-weight: 600; }
.d-meta dd { margin: 0; font-weight: 700; }
.d-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.d-actions .seg { display: grid; width: 100%; box-shadow: 3px 3px 0 var(--ink); }
.d-actions .seg button { height: 42px; font-size: 15px; }
.d-scene-note {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px;
  border: 2.5px dashed var(--ink); font-size: 13.5px; font-weight: 700; background: #f4f6f5;
}
.btn-dl {
  position: relative; overflow: hidden; height: 66px; border-radius: 18px; background: var(--yellow);
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 28px; letter-spacing: 1px;
  box-shadow: 5px 5px 0 var(--ink);
}
.btn-dl .i { font-size: 28px; stroke-width: 3; }
.btn-dl small {
  font-family: var(--f-body); font-size: 13px; font-weight: 800; letter-spacing: 0;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 5px 8px;
}
.btn-dl::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: skewX(-18deg); animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -40%; } 100% { left: 130%; } }
.btn-dl.done, .btn-zip.done, .btn-orig.done { animation: donePulse .5s var(--pop); }
.qdl.done { animation: donePulse .5s var(--pop); }
@keyframes donePulse { 35% { transform: scale(1.05) rotate(-1deg); } 70% { transform: scale(.98); } }
.btn-dl.loading { pointer-events: none; }
.btn-dl.loading .i { animation: drop .6s ease-in-out infinite; }
@keyframes drop { 50% { transform: translateY(5px); } }
.d-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-2 {
  height: 50px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 15px;
}
.btn-2 .i { font-size: 20px; }
.btn-2.fav-big .i { fill: none; stroke: currentColor; stroke-width: 2.4; }
.btn-2.fav-big.on { background: var(--red); color: #fff; }
.btn-2.fav-big.on .i { fill: currentColor; }
.d-related { margin-top: auto; padding-top: 6px; }
.d-related p { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); display: flex; justify-content: space-between; }
.rel-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.rel-strip button {
  flex: none; width: 62px; height: 62px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; padding: 6px;
  display: grid; place-items: center; transition: transform .2s var(--pop);
}
.rel-strip button:hover { transform: translateY(-3px) rotate(-3deg); }
.rel-strip button.cur { background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }
.rel-strip img { max-height: 100%; object-fit: contain; }
.d-keys { margin: 0; font-size: 11.5px; color: #98a19c; font-weight: 600; }
.d-keys kbd { font: 700 10.5px/1 var(--f-num); border: 1.5px solid #c9cfcc; border-radius: 5px; padding: 2px 5px 1px; color: var(--muted); }

.nav-arrow {
  position: absolute; top: 50%; z-index: 4; width: 58px; height: 58px; margin-top: -29px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; font-size: 28px; padding: 0;
}
.nav-arrow .i { stroke-width: 3.2; }
.nav-arrow.prev { left: max(10px, calc(50% - 620px)); }
.nav-arrow.next { right: max(10px, calc(50% - 620px)); }
.d-counter {
  position: absolute; left: 50%; bottom: max(8px, calc(3vh - 30px)); transform: translateX(-50%); z-index: 4;
  font: 400 13px/1 var(--f-num); color: #fff; background: var(--ink); border: 2px solid #444; border-radius: 999px; padding: 7px 12px 6px;
}

.detail .backdrop { animation: fadeIn .3s both; }
.detail.enter .dcard { animation: cardEnter .6s var(--pop) both; }
.detail.enter .dinfo > * { animation: rise .55s var(--pop) backwards; animation-delay: calc(var(--k, 0) * 45ms + 140ms); }
.detail.enter .nav-arrow { animation: fadeIn .4s .2s backwards; }
.detail.leave .dcard { animation: cardLeave .22s ease-in both; }
.detail.leave .backdrop, .detail.leave .nav-arrow, .detail.leave .d-counter { animation: fadeOut .22s both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes cardEnter { from { opacity: 0; transform: translateY(50px) scale(.9) rotate(-2.5deg); } }
@keyframes cardLeave { to { opacity: 0; transform: translateY(24px) scale(.94) rotate(1.5deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.slide-l { animation: slideL .38s var(--out); }
.slide-r { animation: slideR .38s var(--out); }
@keyframes slideL { from { opacity: 0; transform: translateX(-70px) rotate(-4deg); } }
@keyframes slideR { from { opacity: 0; transform: translateX(70px) rotate(4deg); } }

/* ---------- 背包 ---------- */
.bag { position: fixed; inset: 0; z-index: 90; }
.bag .backdrop { background: rgba(6, 22, 16, .6); animation: fadeIn .25s both; }
.bag-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: #fff; border-left: 4px solid var(--ink); display: flex; flex-direction: column;
  animation: bagIn .5s var(--pop) both;
}
.bag.leave .bag-panel { animation: bagOut .25s ease-in both; }
.bag.leave .backdrop { animation: fadeOut .25s both; }
@keyframes bagIn { from { transform: translateX(105%); } }
@keyframes bagOut { to { transform: translateX(105%); } }
.bag-head {
  display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px;
  background: var(--yellow); border-bottom: 4px solid var(--ink);
  background-image: radial-gradient(rgba(20, 20, 20, .13) 1.3px, transparent 1.6px); background-size: 15px 15px;
}
.bag-head h2 { margin: 0; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 36px; line-height: 1; }
.bag-head h2 b { font: 400 16px/1 var(--f-num); background: var(--ink); color: var(--yellow); border-radius: 999px; padding: 6px 10px 5px; vertical-align: middle; margin-left: 4px; }
.bag-head .dclose { position: static; margin-left: auto; }
.bag-tools { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-bottom: 3px solid var(--ink); }
.bag-tools .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bag-tools .lbl { font-size: 13px; font-weight: 800; color: var(--muted); }
.btn-zip {
  height: 54px; border-radius: 16px; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 22px; letter-spacing: 1px;
}
.btn-zip .i { font-size: 24px; }
.btn-zip:disabled { background: #cfd5d2; color: #6f7773; cursor: not-allowed; box-shadow: 2px 2px 0 var(--ink); transform: none; }
.btn-zip .prog { font-family: var(--f-num); font-size: 14px; }
.bag-result {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 9px 12px; border-radius: 12px;
  background: var(--mint); border: 2px solid var(--ink); font-size: 13px; font-weight: 600; line-height: 1.5;
  animation: rise .35s var(--pop);
}
.bag-result.bad { background: #FFE3E5; }
.bag-result .i { font-size: 16px; }
.bag-result .btn-text { color: var(--ink); font-weight: 800; }
.btn-text { border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.bag-grid { flex: 1; overflow-y: auto; padding: 16px 20px 100px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: start; }
.bag-item {
  position: relative; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; padding: 0; text-align: left;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .25s var(--pop), box-shadow .25s;
  animation: cardIn .45s var(--pop) backwards; animation-delay: calc(var(--k, 0) * 30ms);
}
.bag-item:hover { transform: translateY(-3px) rotate(-1.5deg); box-shadow: 4px 6px 0 var(--ink); }
.bag-item .bp { aspect-ratio: 1; display: grid; place-items: center; padding: 10%; border-bottom: 2.5px solid var(--ink); }
.bag-item.scene .bp { padding: 0; overflow: hidden; border-radius: 11px 11px 0 0; }
.bag-item.scene .bp img { width: 100%; height: 100%; object-fit: cover; }
.bag-item .bp img { max-height: 100%; object-fit: contain; }
.bag-item .bt { display: block; padding: 5px 7px 6px; font-size: 11.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bag-item .rm {
  position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  background: #fff; border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 12px;
  transition: transform .2s var(--pop), background-color .2s;
}
.bag-item .rm:hover { background: var(--red); color: #fff; transform: rotate(90deg) scale(1.1); }
.bag-item.out { animation: bagItemOut .3s ease-in forwards; }
@keyframes bagItemOut { to { opacity: 0; transform: scale(.4) rotate(12deg); } }
.bag-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 30px 10px; }
.bag-empty img { width: 110px; animation: wobble 2.6s ease-in-out infinite; }
.bag-empty b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 24px; }
.bag-empty span { font-size: 13.5px; color: var(--muted); }

/* ---------- 扭蛋 ---------- */
.gacha { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; }
.gacha .sunburst { --c: var(--yellow); opacity: 0; transition: opacity .5s; }
.gacha.revealed .sunburst { opacity: .3; }
.capsule {
  --cc: var(--red);
  position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px;
}
.capsule i {
  position: absolute; left: 0; right: 0; height: 50%; border: 5px solid var(--ink);
}
.capsule .ct {
  top: 0; border-radius: 110px 110px 0 0; border-bottom-width: 3px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .55) 0 14%, transparent 15%), var(--cc);
}
.capsule .cb { bottom: 0; border-radius: 0 0 110px 110px; border-top-width: 3px; background: #fff; }
.capsule .cb::after {
  content: "任运"; position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 26px; color: var(--ink); letter-spacing: 2px;
}
.capsule.drop { animation: capDrop .7s cubic-bezier(.3, 1.4, .6, 1) both; }
.capsule.shake { animation: capShake .6s ease-in-out 2; }
.capsule.open .ct { animation: capTop .6s var(--out) forwards; }
.capsule.open .cb { animation: capBot .6s var(--out) forwards; }
@keyframes capDrop { from { transform: translateY(-80vh) rotate(-30deg); } }
@keyframes capShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg) translateX(-8px); } 50% { transform: rotate(14deg) translateX(8px); } 75% { transform: rotate(-8deg); } }
@keyframes capTop { to { transform: translate(-120px, -260px) rotate(-70deg); opacity: 0; } }
@keyframes capBot { to { transform: translate(120px, 260px) rotate(60deg); opacity: 0; } }
.flash { position: absolute; inset: 0; background: radial-gradient(circle, #fff 0, rgba(255, 255, 255, 0) 60%); opacity: 0; pointer-events: none; }
.flash.go { animation: flash .6s ease-out; }
@keyframes flash { 30% { opacity: 1; } }
.gacha-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; opacity: 0; pointer-events: none; }
.gacha.revealed .gacha-stage { opacity: 1; pointer-events: auto; }
.gacha-card {
  position: relative; width: 300px; background: #fff; border: 4px solid var(--ink); border-radius: 24px; box-shadow: 10px 10px 0 var(--ink);
}
.gacha.revealed .gacha-card { animation: gCard .9s var(--pop) both; }
@keyframes gCard { 0% { transform: scale(.2) rotateY(540deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.gacha-card .gp { aspect-ratio: 1; display: grid; place-items: center; padding: 12%; border-bottom: 4px solid var(--ink); background: var(--gc, var(--mint)); border-radius: 20px 20px 0 0; overflow: hidden; }
.gacha-card.scene .gp { padding: 0; }
.gacha-card.scene .gp img { width: 100%; height: 100%; object-fit: cover; }
.gacha-card .gp img { max-height: 100%; object-fit: contain; filter: drop-shadow(4px 5px 0 rgba(20, 20, 20, .22)); }
.gacha-card .gi { padding: 12px 16px 16px; text-align: center; }
.gacha-card .gi em { font: 400 13px/1 var(--f-num); font-style: normal; color: var(--muted); }
.gacha-card .gi b { display: block; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 30px; line-height: 1.1; margin-top: 4px; }
.gacha-card .gi span { font-size: 13px; font-weight: 700; color: var(--muted); }
.gacha-new {
  position: absolute; top: -18px; left: -16px; z-index: 2;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 20px; color: #fff;
  background: var(--red); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px 5px; box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-10deg);
}
.gacha-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.gacha-actions .btn-2 { padding: 0 18px; }
.gacha-actions .again { background: var(--yellow); }
.gacha-close { position: absolute; top: 20px; right: 20px; z-index: 2; }

/* ---------- 提示条 & 特效 ---------- */
.toasts { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink);
  font-size: 14px; font-weight: 700; animation: toastIn .45s var(--pop) both;
}
.toast > .i { font-size: 22px; flex: none; padding: 3px; border-radius: 8px; background: var(--mint); border: 2px solid var(--ink); box-sizing: content-box; }
.toast.warn > .i { background: var(--yellow); }
.toast.ach { background: var(--yellow); padding: 10px 18px 10px 12px; }
.toast.ach > .i { background: #fff; font-size: 26px; }
.toast.ach div { display: flex; flex-direction: column; line-height: 1.2; }
.toast.ach small { font: 400 10.5px/1.2 var(--f-num); letter-spacing: 1px; }
.toast.ach b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 22px; }
.toast.ach span { font-size: 12px; font-weight: 600; }
.toast.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-30px) scale(.8); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px) scale(.9); } }

.fx { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.cf { position: absolute; left: 0; top: 0; width: 18px; height: 18px; will-change: transform, opacity; }
.cf svg { width: 100%; height: 100%; }
.cf.sq { border: 2px solid var(--ink); border-radius: 3px; }
.fly { position: absolute; left: 0; top: 0; z-index: 2; will-change: transform; }
.fly-heart { width: 30px; height: 30px; color: var(--red); filter: drop-shadow(2px 2px 0 var(--ink)); }
.fly-img { position: fixed; z-index: 160; object-fit: contain; pointer-events: none; }

/* ---------- 开场 ---------- */
.boot { position: fixed; inset: 0; z-index: 300; background: var(--ink); overflow: hidden; display: grid; place-items: center; cursor: pointer; }
.boot-tiles { position: absolute; inset: 0; display: grid; perspective: 900px; }
.boot-tiles i { display: block; animation: tileIn .5s var(--pop) backwards; animation-delay: var(--d); }
.boot.out .boot-tiles i { animation: tileOut .45s ease-in forwards; animation-delay: var(--o); }
@keyframes tileIn { from { transform: rotateY(-90deg) scale(.6); opacity: 0; } }
@keyframes tileOut { to { transform: rotateY(90deg) scale(.4); opacity: 0; } }
.boot-center {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fff; border: 5px solid var(--ink); border-radius: 32px; padding: 28px 40px 24px; box-shadow: 12px 12px 0 var(--ink);
  animation: bootCard .7s .45s var(--pop) backwards;
}
.boot.out .boot-center { animation: bootCardOut .35s ease-in forwards; }
@keyframes bootCard { from { transform: scale(0) rotate(-14deg); } }
@keyframes bootCardOut { to { transform: scale(.4) rotate(10deg); opacity: 0; } }
.boot-logo { width: 150px; animation: logoDrop .8s .75s cubic-bezier(.3, 1.6, .5, 1) backwards; }
@keyframes logoDrop { from { transform: translateY(-260px) rotate(-30deg); opacity: 0; } }
.boot-title { margin: 0; display: flex; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: clamp(44px, 9vw, 76px); line-height: 1; letter-spacing: 2px; }
.boot-title span { display: inline-block; animation: slam .45s var(--pop) backwards; animation-delay: calc(1s + var(--k) * 90ms); }
.boot-title span:nth-child(2) { color: var(--green); }
@keyframes slam { from { transform: scale(3.2) rotate(-12deg); opacity: 0; } }
.boot-count { margin: 0; font-size: 15px; font-weight: 700; color: var(--muted); animation: fadeIn .4s 1.4s backwards; }
.boot-count b { font: 400 22px/1 var(--f-num); color: var(--ink); }
.boot-press { margin: 6px 0 0; font: 400 12px/1 var(--f-num); letter-spacing: 3px; color: var(--red); animation: blink 1s steps(2) infinite, fadeIn .3s 1.6s backwards; }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .hero-head { grid-template-columns: 1fr; }
  .fortune { width: 100%; height: 112px; transform: none; margin: 4px 0 0; perspective: 1400px; }
  .fortune:hover { transform: translateY(-3px); }
  .f-face { flex-direction: row; gap: 14px; padding: 0 16px; justify-content: flex-start; text-align: left; border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); }
  .f-back .f-medal { width: 72px; height: 72px; flex: none; }
  .f-back b { margin: 0; font-size: 20px; }
  .f-back small { margin: 0 0 0 auto; }
  .f-front { padding: 0; }
  .f-pic { width: 104px; height: 100%; flex: none; border-bottom: 0; border-right: 4px solid var(--ink); padding: 8px; }
  .f-txt { align-items: flex-start; padding: 8px 4px; }
  .f-txt b { font-size: 20px; }
  .dcard { grid-template-columns: 1fr; grid-template-rows: 46% 1fr; }
  .stage { border-right: 0; border-bottom: 4px solid var(--ink); }
  .nav-arrow { display: none; }
}
@media (max-width: 720px) {
  .hud { grid-template-columns: 1fr auto; grid-template-areas: "brand right" "search search"; row-gap: 10px; padding-top: 8px; padding-bottom: 10px; }
  .hud-brand { grid-area: brand; }
  .search { grid-area: search; height: 44px; }
  .hud-right { grid-area: right; }
  .meter-label, .search kbd { display: none; }
  .hud-name b { font-size: 20px; }
  .hero h1 em { -webkit-text-stroke-width: 3px; text-shadow: 4px 4px 0 var(--ink); }
  .roster { --tw: 112px; gap: 12px; padding-top: 50px; }
  .tile { border-radius: 18px; }
  .tile .face { bottom: 36px; }
  .tile .plate { height: 36px; border-radius: 0 0 14px 14px; padding: 0 8px 0 10px; }
  .tile .plate b { font-size: 15px; }
  .tile-all .all-mark { inset: 0 0 36px; font-size: 24px; }
  .tile-all .all-mark .i { font-size: 34px; }
  .toolbar { gap: 12px; scroll-margin-top: 132px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 6px; width: calc(100% + 2 * var(--gutter)); scrollbar-width: none; order: 3; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .tool-right { margin-left: auto; }
  .seg-label { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card { border-radius: 16px; box-shadow: 4px 4px 0 var(--ink); }
  .pic { border-radius: 13px 13px 0 0; }
  .meta { padding: 8px 10px 9px; }
  .meta .t { font-size: 14px; }
  .qdl { display: none; }
  .fav { width: 32px; height: 32px; font-size: 16px; }
  .host { left: 10px; }
  .host-face { width: 58px; height: 58px; }
  .host-face img { width: 70px; }
  .host-bubble { left: 0; bottom: 72px; font-size: 16px; transform-origin: 20px 100%; }
  .host-bubble::before { left: 18px; bottom: -11px; transform: rotate(-45deg); }
  .dock { left: auto; right: 12px; transform: none; padding: 5px 10px; }
  .dock-btn { width: 56px; }
  .gacha-btn { width: 72px; height: 72px; margin-top: -28px; }
  .detail { padding: 0; }
  .dcard { height: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .dinfo { padding: 18px 18px 190px; gap: 12px; }
  .dinfo h2 { font-size: 34px; }
  .d-actions {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; margin: 0;
    background: #fff; border-top: 3px solid var(--ink); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .btn-dl { height: 56px; font-size: 24px; }
  .d-row { display: none; }
  .d-mobile-row { display: grid !important; }
  .d-keys { display: none; }
  .d-counter { top: calc(46% - 40px); bottom: auto; left: auto; right: 14px; transform: none; }
  .dclose { top: 12px; right: 12px; position: fixed; }
  .stage-no { font-size: 17px; top: 12px; left: 12px; }
  .stage-new { top: 56px; left: 12px; right: auto; font-size: 16px; }
  .stage-stamp { font-size: 48px; }
  .bag-panel { top: auto; left: 0; width: 100%; height: 86dvh; border-left: 0; border-top: 4px solid var(--ink); border-radius: 26px 26px 0 0; overflow: hidden; }
  @keyframes bagIn { from { transform: translateY(105%); } }
  @keyframes bagOut { to { transform: translateY(105%); } }
  .gacha-card { width: min(300px, 80vw); }
  .boot-center { padding: 22px 26px 20px; margin: 0 16px; }
  .boot-logo { width: 110px; }
}
/* 输入时、往下滑时，底部导航和 NPC 让开，不挡结果和卡片上的按钮 */
.dock, .host { transition: transform .35s var(--out), opacity .25s; }
.dock-away .dock, body.typing .dock { transform: translateX(-50%) translateY(150%); opacity: 0; pointer-events: none; }
.dock-away .host, body.typing .host { transform: translateY(150%); opacity: 0; }
@media (max-width: 720px) {
  .dock-away .dock, body.typing .dock { transform: translateY(150%); }
  /* 搜索态：角色列缩成一排小圆头像，输入法弹出时第一屏仍能看到结果 */
  .searching .roster { --tw: 52px; gap: 10px; padding-top: 8px; padding-bottom: 12px; }
  .searching .tile { height: 52px; border-radius: 50%; overflow: hidden; box-shadow: 2px 2px 0 var(--ink); }
  .searching .tile .plate, .searching .tile .p1 { display: none; }
  .searching .tile .face { left: 0; bottom: 0; width: 100%; height: 100%; transform: none; object-fit: cover; object-position: 50% 20%; filter: none; }
  .searching .tile:hover .face, .searching .tile.on .face { transform: none; }
  .searching .tile-all .all-mark { inset: 0; font-size: 12px; gap: 0; }
  .searching .tile-all .all-mark .i { font-size: 18px; }
  .searching .tile.on { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--red), 2px 2px 0 var(--ink); }
}
.d-mobile-row { display: none; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-mobile-row .btn-2 { height: 44px; }
@media (max-width: 720px) {
  #dBgHint { display: none; }
  .btn-orig { padding: 2px 6px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   第三轮：游戏大厅布局 + 动效层
   ===================================================================== */
@property --sc { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
html { scrollbar-gutter: stable; }

/* ---------- 顶栏：等级 + 经验条 ---------- */
.meter { gap: 10px; padding: 0 14px 0 4px; height: 46px; }
.lv {
  position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: var(--yellow); color: var(--ink); line-height: 1;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}
.lv small { position: absolute; top: 6px; font: 400 7px/1 var(--f-num); letter-spacing: 1px; }
.lv b { font: 400 15px/1 var(--f-num); margin-top: 7px; color: var(--ink); }
.xp { display: flex; flex-direction: column; gap: 5px; min-width: 116px; }
.xp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 400 12px/1 var(--f-num); }
.xp-bar { height: 6px; border-radius: 999px; background: #333; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--yellow), #FFE6A0); border-radius: 999px; transition: width 1s var(--out); }
.meter.lvup .lv { animation: lvUp .9s var(--wobble); }
@keyframes lvUp { 30% { transform: scale(1.6) rotate(-14deg); } }

/* ---------- 首屏：纸张颗粒、跟随光、漂浮符号 ---------- */
.hero { isolation: isolate; padding-bottom: 0; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .28; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-fold, .roster { position: relative; z-index: 2; }
.floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.fl { position: absolute; width: var(--s); height: var(--s); will-change: transform; }
.fl svg { display: block; width: 100%; height: 100%; animation: flFloat var(--t, 7s) ease-in-out var(--dl, 0s) infinite alternate; filter: drop-shadow(2px 3px 0 rgba(20, 20, 20, .22)); }
@keyframes flFloat { from { transform: translateY(-12px) rotate(calc(var(--r, 10deg) * -1)); } to { transform: translateY(12px) rotate(var(--r, 10deg)); } }
.hero-light {
  position: absolute; z-index: 1; left: 0; top: 0; width: 820px; height: 820px; margin: -410px 0 0 -410px; border-radius: 50%;
  pointer-events: none; background: radial-gradient(circle, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 62%);
  mix-blend-mode: soft-light; will-change: transform;
}
.hero-off .fl svg, .lock .fl svg, .paused .fl svg, .hero-off .sc-rays, .lock .sc-rays, .hero-off .sc-art, .lock .sc-art { animation-play-state: paused; }

/* 标题逐字 */
.hero h1 { font-size: clamp(50px, 6.6vw, 104px); }
.hero h1 .ch { display: inline-block; transform-origin: 50% 90%; transition: transform .7s var(--wobble); }
.hero h1 .ch:hover { transform: translateY(-14px) rotate(-8deg) scale(1.1); transition-duration: .3s; }
.ready .hero h1 .ch { animation: chIn .9s var(--pop) backwards; animation-delay: calc(var(--i) * 55ms + 160ms); }
@keyframes chIn { from { opacity: 0; transform: translateY(70px) rotate(14deg) scale(.5); } }

/* ---------- 大厅：左资料卡 + 右展台 ---------- */
.lobby { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(360px, 1.12fr); gap: 20px 32px; align-items: stretch; }
.lobby-copy { display: flex; flex-direction: column; justify-content: center; padding: 4px 0 8px; }
.profile {
  --c: #FFBD45;
  position: relative; margin-top: 20px; max-width: 470px; display: grid; gap: 12px; padding: 14px 16px 16px;
  background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 7px 7px 0 var(--ink);
}
.profile::after {
  content: "PROFILE"; position: absolute; top: -12px; right: 18px; font: 400 10px/1 var(--f-num); letter-spacing: 2px;
  background: var(--ink); color: var(--yellow); padding: 5px 9px 4px; border-radius: 999px;
}
.pf-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-head img {
  width: 54px; height: 54px; flex: none; border-radius: 16px; border: 3px solid var(--ink); background: var(--c);
  object-fit: cover; object-position: 50% 12%; box-shadow: 2px 2px 0 var(--ink);
}
.pf-head span { display: flex; flex-direction: column; min-width: 0; }
.pf-head b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 30px; line-height: 1.05; }
.pf-head small { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-stats div { background: #F1F5F3; border: 2px solid var(--ink); border-radius: 14px; padding: 7px 10px 6px; }
.pf-stats dt { font-size: 11px; font-weight: 800; color: var(--muted); }
.pf-stats dd { margin: 2px 0 0; font: 400 24px/1 var(--f-num); }
.pf-stats dd.bump { animation: bump .5s var(--pop); }
.pf-bar { height: 12px; border-radius: 999px; background: #E3E9E6; border: 2px solid var(--ink); overflow: hidden; }
.pf-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: repeating-linear-gradient(-45deg, var(--green) 0 8px, #46C79A 8px 16px); transition: width 1s var(--out); animation: barRun 1.2s linear infinite; background-size: 22.6px 22.6px; }
@keyframes barRun { to { background-position: 22.6px 0; } }
.pf-actions { display: flex; gap: 10px; }
.btn-go {
  flex: 1; height: 52px; border-radius: 16px; background: var(--ink); color: var(--yellow);
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 21px; letter-spacing: 1px;
}
.btn-go .i { font-size: 22px; animation: nudgeDown 1.8s ease-in-out infinite; }
@keyframes nudgeDown { 50% { transform: translateY(4px); } }
.btn-ghost {
  height: 52px; padding: 0 16px; border-radius: 16px; background: #fff; border: 3px dashed var(--ink);
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px;
  transition: background-color .2s, transform .3s var(--pop);
}
.btn-ghost .i { font-size: 20px; transition: transform .5s var(--wobble); }
.btn-ghost:hover { background: var(--yellow); }
.btn-ghost:hover .i { transform: rotate(180deg); }
.btn-ghost:active { transform: scale(.94); }

.showcase { --sc: #ffffff; position: relative; min-height: 430px; transition: --sc .7s ease; }
.sc-rays {
  /* 光芒留在大厅内容后方，旋转时不扫亮标题和操作文字。 */
  z-index: -1;
  position: absolute; left: 50%; top: 50%; width: 860px; height: 860px; margin: -430px 0 0 -430px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--sc) 0 8deg, transparent 8deg 21deg);
  -webkit-mask: radial-gradient(circle, #000 14%, transparent 60%); mask: radial-gradient(circle, #000 14%, transparent 60%);
  opacity: .5; animation: spin 70s linear infinite;
}
.sc-name {
  position: absolute; left: 50%; top: 44%; translate: -50% -50%; rotate: -7deg; z-index: 0; pointer-events: none; white-space: nowrap;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: clamp(84px, 11vw, 176px); letter-spacing: 6px; line-height: 1;
  color: transparent; -webkit-text-stroke: 3px rgba(20, 20, 20, .17);
}
.sc-podium { position: absolute; left: 50%; bottom: 14px; width: min(84%, 460px); translate: -50% 0; z-index: 1; filter: drop-shadow(0 14px 18px rgba(80, 50, 0, .22)); }
.sc-podium svg { display: block; width: 100%; height: auto; overflow: visible; }
.sc-cast { position: absolute; inset: 0 0 58px; z-index: 2; pointer-events: none; }
.sc-art {
  position: absolute; bottom: 0; left: 50%; max-width: none; object-fit: contain; transform-origin: 50% 100%;
  filter: drop-shadow(5px 7px 0 rgba(20, 20, 20, .2));
  animation: artBob 6s ease-in-out infinite; animation-delay: var(--ad, 0s);
}
@keyframes artBob { 0%, 100% { translate: -50% 0; } 50% { translate: -50% -9px; } }

/* 运势卡缩成展台角落的小卡 */
.showcase .fortune { position: absolute; right: 2px; top: 4px; z-index: 4; width: 138px; height: 182px; margin: 0; transform: rotate(7deg); }
.showcase .fortune:hover { transform: rotate(2deg) translateY(-6px) scale(1.04); }
.showcase .fortune:not(.flipped) { animation: fWiggle 7s ease-in-out infinite; }
@keyframes fWiggle { 0%, 84%, 100% { rotate: 0deg; } 88% { rotate: -7deg; } 92% { rotate: 6deg; } 96% { rotate: -2deg; } }
.showcase .fortune:not(.flipped) .f-back { animation: fGlow 2.4s ease-in-out infinite; }
@keyframes fGlow { 50% { box-shadow: 6px 6px 0 var(--ink), 0 0 0 7px rgba(255, 255, 255, .55); } }
.showcase .f-face { border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); border-width: 3px; }
.showcase .f-back .f-medal { width: 76px; height: 76px; border-width: 3px; }
.showcase .f-back b { margin-top: 10px; font-size: 17px; padding: 6px 10px 5px; border-radius: 10px; letter-spacing: 1px; }
.showcase .f-back small { margin-top: 6px; font-size: 11px; padding: 4px 8px; }
.showcase .f-pic { height: 92px; padding: 8px; border-bottom-width: 3px; }
.showcase .f-txt { padding: 6px 8px; gap: 2px; }
.showcase .f-txt em { font-size: 10px; }
.showcase .f-txt b { font-size: 15px; }
.showcase .f-yj { font-size: 11px; gap: 4px; }
.showcase .f-yj i { width: 17px; height: 17px; font-size: 10px; border-radius: 5px; border-width: 1.5px; margin: 0; }
.f-streak {
  position: absolute; z-index: 6; left: -16px; top: -14px; rotate: -10deg; white-space: nowrap;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 14px; color: #fff;
  background: var(--red); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 10px 3px; box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- 选角栏：P1 光标、呼吸、收集进度 ---------- */
.roster { padding-bottom: 44px; }
.tile .p1 { display: none; }
.p1-marker {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  font: 400 14px/1 var(--f-num); color: #fff; background: var(--red); border: 3px solid var(--ink); border-radius: 10px;
  padding: 6px 8px 5px; box-shadow: 3px 3px 0 var(--ink); transition: transform .75s var(--wobble);
}
.p1-marker::after { content: ""; position: absolute; left: 9px; bottom: -11px; border: 6px solid transparent; border-top-color: var(--ink); }
.tile .face { animation: breathe 4.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.55s); }
@keyframes breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.hero-off .tile .face, .lock .tile .face { animation-play-state: paused; }
.tile .plate { padding-bottom: 4px; }
.tile .prog { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.tile .prog i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--yellow); border-radius: 2px; transition: width 1s var(--out); }
.tile .done-crown { position: absolute; left: -10px; top: -12px; z-index: 3; width: 30px; height: 30px; color: var(--yellow); transform: scale(0) rotate(-30deg); transition: transform .6s var(--wobble); filter: drop-shadow(2px 2px 0 var(--ink)); }
.tile.complete .done-crown { transform: scale(1) rotate(-14deg); }

/* ---------- 交叉滚动的标语胶带（压在棋盘边上） ---------- */
.checker-edge { position: relative; z-index: 4; }
.tapes { position: absolute; left: -8%; right: -8%; top: 50%; height: 0; pointer-events: none; }
.tape {
  position: absolute; left: 0; right: 0; height: 40px; margin-top: -20px; display: flex; align-items: center; overflow: hidden;
  border-block: 3px solid var(--ink); box-shadow: 0 7px 0 rgba(0, 0, 0, .18);
}
.tape-a { background: var(--ink); color: var(--yellow); transform: rotate(-2deg); z-index: 2; }
.tape-b { background: var(--green); color: #fff; transform: rotate(1.4deg) translateY(5px); z-index: 1; }
.tape .track { display: flex; flex: none; white-space: nowrap; animation: tapeRun 46s linear infinite; will-change: transform; }
.tape-b .track { animation-direction: reverse; animation-duration: 58s; }
.tape span { display: inline-flex; align-items: center; gap: 20px; padding: 0 20px; font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 19px; letter-spacing: 2px; }
.tape span i { font-style: normal; font-size: 14px; opacity: .8; }
@keyframes tapeRun { to { transform: translateX(-50%); } }
.checker-edge.paused .track, .lock .tape .track, .paused .tape .track { animation-play-state: paused; }
.board { padding-top: 56px; }

/* ---------- 图鉴面板 ---------- */
.dex-tab {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 60px; height: 60px; rotate: -6deg; line-height: 1; gap: 2px;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 3px 3px 0 #000;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 21px;
}
.dex-tab small { font: 400 9px/1 var(--f-num); letter-spacing: 1.5px; }
@media (min-width: 861px) {
  .toolbar {
    position: sticky; top: calc(var(--hud-h, 66px) + 10px); z-index: 20;
    background: rgba(9, 38, 28, .94); border: 2px solid rgba(255, 255, 255, .09); border-radius: 24px;
    padding: 12px 16px; box-shadow: 0 14px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .07);
  }
}

/* ---------- 卡片：异色闪光、浮现、角色徽章 ---------- */
.card .no { background: color-mix(in srgb, var(--c) 32%, #fff); border: 2px solid var(--ink); }
.card .pic img { opacity: 0; scale: .92; transition: opacity .5s var(--out), scale .8s var(--pop), transform .45s var(--pop); }
.card .pic img.loaded { opacity: 1; scale: 1; }
.card.in { animation: cardIn .85s var(--pop) backwards; animation-delay: var(--d, 0ms); }
@keyframes cardIn { from { opacity: 0; transform: perspective(900px) translateY(54px) rotateX(-26deg) scale(.9); } }
.card.tilting { transition: none; }
.meta .mini { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--c); object-fit: cover; object-position: 50% 12%; }
.sheen {
  mix-blend-mode: normal; opacity: 0; transition: opacity .4s var(--out);
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, 0) 34%),
    conic-gradient(from var(--ang, 0deg) at var(--mx, 50%) var(--my, 50%), rgba(255, 143, 184, .32), rgba(255, 211, 110, .32), rgba(184, 240, 214, .32), rgba(143, 211, 255, .32), rgba(201, 182, 255, .32), rgba(255, 143, 184, .32));
}
.card:hover .sheen, .card.tilting .sheen { opacity: 1; }

/* ---------- 图鉴卡：展品悬浮、跟随光、圆形揭开底色 ---------- */
.stage::before { clip-path: circle(150% at 50% 100%); transition: clip-path .75s var(--out); }
.stage[data-bg="white"]::before { clip-path: circle(0% at 50% 100%); }
.stage-img { z-index: 2; }
.stage-img img { animation: artFloat 5.6s ease-in-out infinite; will-change: transform; }
@keyframes artFloat { 0%, 100% { translate: 0 -7px; } 50% { translate: 0 7px; } }
.stage-shadow {
  position: absolute; left: 30%; right: 30%; bottom: 11%; height: 18px; z-index: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(20, 20, 20, .26), rgba(20, 20, 20, 0)); animation: shadowPulse 5.6s ease-in-out infinite;
}
@keyframes shadowPulse { 0%, 100% { transform: scale(.82); opacity: .65; } 50% { transform: scale(1.05); opacity: 1; } }
.stage-light {
  position: absolute; z-index: 1; left: 0; top: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 60%); mix-blend-mode: soft-light;
  opacity: 0; transition: opacity .5s; will-change: transform;
}
.stage:hover .stage-light { opacity: 1; }
.stage.zoom .stage-img img { animation: none; }
.dinfo { background: radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--c) 22%, #fff), #fff 60%); }
::view-transition-group(ry-art) { animation-duration: .62s; animation-timing-function: var(--pop); }
::view-transition-old(ry-art), ::view-transition-new(ry-art) { height: 100%; object-fit: contain; animation-duration: .38s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* ---------- 按钮手感 ---------- */
.btn-2, .chip, .af, .btn-orig, .rel-strip button, .seg button { position: relative; overflow: hidden; }
.ripple { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .22; transform: scale(0); animation: rip .65s var(--out) forwards; }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
.btn-dl:active { transform: translate(3px, 3px) scale(1.02, .93); }
.btn-dl.loading::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-45deg, rgba(20, 20, 20, .11) 0 12px, transparent 12px 24px); background-size: 34px 34px; animation: stripes .5s linear infinite;
}
@keyframes stripes { to { background-position: 34px 0; } }
.btn-dl.ok { background: var(--green); color: #fff; }
.btn-dl.ok small { background: #fff; color: var(--ink); }
.gacha-btn .gold-dot {
  position: absolute; top: -8px; right: -10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 15px; color: var(--ink);
  background: linear-gradient(135deg, #FFF1B8, #FFBD45 55%, #E8961A); border: 3px solid var(--ink); animation: goldPing 1.6s ease-in-out infinite;
}
@keyframes goldPing { 50% { transform: scale(1.15) rotate(-8deg); } }

/* ---------- 扭蛋：每日金蛋 ---------- */
.capsule.gold .ct { background: radial-gradient(circle at 30% 28%, #fff 0 11%, transparent 12%), linear-gradient(140deg, #FFF0B0, #FFBD45 45%, #E58E14); }
.capsule.gold { filter: drop-shadow(0 0 28px rgba(255, 200, 80, .85)); }
.gold-tag {
  position: absolute; top: -18px; right: -14px; z-index: 3; rotate: 10deg;
  font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 18px; color: var(--ink);
  background: linear-gradient(135deg, #FFF1B8, #FFBD45 55%, #E8961A); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 11px 5px; box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- 开场：落地压扁、扬尘、镜头推进 ---------- */
.boot-logo { animation: logoDrop 1.05s .7s linear backwards; }
@keyframes logoDrop {
  0% { transform: translateY(-320px) rotate(-30deg); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, 1, .6); }
  48% { transform: translateY(0) rotate(0); opacity: 1; animation-timing-function: ease-out; }
  58% { transform: translateY(10px) scale(1.2, .78); animation-timing-function: ease-out; }
  74% { transform: translateY(-14px) scale(.93, 1.08); animation-timing-function: ease-in-out; }
  88% { transform: translateY(2px) scale(1.03, .97); }
  100% { transform: none; }
}
.boot-center { animation: bootCard .7s .45s var(--pop) backwards, bootShake .4s 1.22s ease-out; }
@keyframes bootShake { 20% { translate: -7px 3px; } 40% { translate: 6px -4px; } 60% { translate: -3px 2px; } 80% { translate: 2px -1px; } }
.boot.out .boot-center { animation: bootZoom .5s ease-in forwards; }
@keyframes bootZoom { to { transform: scale(1.6); opacity: 0; } }
.dust { position: absolute; z-index: 3; width: 16px; height: 16px; border-radius: 50%; background: #EFE7D6; border: 2px solid var(--ink); pointer-events: none; }

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .lobby { display: flex; flex-direction: column; gap: 0; }
  .lobby-copy { display: contents; }
  .lobby .eyebrow { order: 1; align-self: flex-start; }
  .hero h1 { order: 2; }
  .hero-line { order: 3; margin-top: 10px; }
  .showcase { order: 4; min-height: 300px; margin-top: 4px; }
  .profile { order: 5; margin-top: 0; max-width: none; padding: 0; background: none; border: 0; box-shadow: none; }
  .profile::after, .pf-head, .pf-stats, .pf-bar { display: none; }
  .sc-name { font-size: 92px; top: 40%; }
  .sc-podium { width: 78%; bottom: 8px; }
  .sc-cast { bottom: 42px; }
  .showcase .fortune { width: 104px; height: 140px; right: -4px; top: 0; }
  .showcase .f-back .f-medal { width: 56px; height: 56px; }
  .showcase .f-back b { font-size: 13px; margin-top: 6px; padding: 4px 7px 3px; }
  .showcase .f-back small { display: none; }
  .showcase .f-pic { height: 66px; }
  .showcase .f-txt b { font-size: 12px; }
  .showcase .f-yj { display: none; }
  .f-streak { font-size: 11px; left: -10px; top: -12px; padding: 3px 8px 2px; }
}
@media (max-width: 720px) {
  .xp { min-width: 70px; }
  .xp .meter-label { display: none; }
  .tape { height: 32px; margin-top: -16px; }
  /* 窄屏仍交叉叠放；加大夹角，让绿带从两侧露出一部分。 */
  .tape-a { transform: rotate(-3deg); }
  .tape-b { transform: rotate(4deg) translateY(8px); }
  .tape span { font-size: 15px; gap: 14px; padding: 0 14px; }
  .board { padding-top: 46px; }
  .dex-tab { width: 50px; height: 50px; font-size: 17px; border-radius: 14px; }
  .roster { padding-bottom: 38px; }
  .btn-go { height: 48px; font-size: 18px; }
  .btn-ghost { height: 48px; }
  /* 把空间留给文字，避免“看全部 193 张”只剩末字另起一行。 */
  .pf-actions { gap: 8px; }
  .pf-actions .btn-go { min-width: 0; gap: 6px; padding-inline: 8px; letter-spacing: .5px; }
  .pf-actions .btn-go span { text-wrap: balance; }
  .pf-actions .btn-ghost { flex: none; gap: 5px; padding-inline: 8px; white-space: nowrap; }
  .searching .tile .prog, .searching .tile .done-crown, .searching .p1-marker { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .floaters, .hero-light, .sc-rays { display: none; }
}
.sc-art { translate: -50% 0; }
.detail.enter.vt .dcard { animation: none; }
/* 大厅收紧：选角栏要落在底部导航上方 */
.lobby-copy > .eyebrow { align-self: flex-start; }
.hero { padding-top: clamp(14px, 2.4vw, 28px); }
.hero h1 { font-size: clamp(48px, 6vw, 92px); }
.hero-line { margin-top: 12px; }
.profile { margin-top: 16px; gap: 10px; padding: 12px 14px 14px; }
.pf-stats div { padding: 6px 10px 5px; }
.pf-stats dd { font-size: 21px; }
.btn-go, .btn-ghost { height: 46px; }
.showcase { min-height: 380px; }
.roster { padding-top: 46px; }
.sc-name { -webkit-text-stroke: 3px rgba(20, 20, 20, .26); }
@media (max-width: 860px) {
  .showcase { min-height: 252px; }
  .sc-name { font-size: 76px; }
  .profile { margin-top: 2px; }
  .hero h1 { font-size: clamp(44px, 12vw, 64px); }
  .roster { padding-top: 40px; }
}
/* 运势小卡在窄屏也保持竖版（覆盖第一版的横条样式） */
@media (max-width: 860px) {
  .showcase .f-face { flex-direction: column; justify-content: center; text-align: center; gap: 0; padding: 0; }
  .showcase .f-front { justify-content: flex-start; }
  .showcase .f-pic { width: 100%; border-right: 0; border-bottom: 3px solid var(--ink); }
  .showcase .f-txt { align-items: center; padding: 4px 6px; }
  .showcase .f-back b { margin: 6px 0 0; }
}
/* 官方符号原图 */
.fl img { display: block; width: 100%; height: 100%; object-fit: contain; animation: flFloat var(--t, 7s) ease-in-out var(--dl, 0s) infinite alternate; filter: drop-shadow(2px 3px 0 rgba(20, 20, 20, .2)); }
.hero-off .fl img, .lock .fl img, .paused .fl img { animation-play-state: paused; }
.cf img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .done-crown { object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(20, 20, 20, .35)); }
.tile-all .all-mark img.i { width: 46px; height: 38px; object-fit: contain; }

/* =====================================================================
   第四轮：手机极致交互（检视台手势、试贴、收藏托盘、拿起拖放）
   ===================================================================== */

/* ---------- 底部导航：搜索 / 收藏托盘 / 回顶 ---------- */
.tray-btn {
  position: relative; display: flex; align-items: center; gap: 10px; height: 60px; margin: -18px 4px 0; padding: 0 16px 0 10px;
  border-radius: 22px; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink);
  font-weight: 900; transition: transform .25s var(--pop), box-shadow .2s, background-color .2s;
}
.tray-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.tray-stack { position: relative; width: 46px; height: 42px; flex: none; }
.tray-stack:empty { width: 30px; }
.tray-stack:empty::before { content: ""; position: absolute; inset: 6px 0; border: 2.5px dashed rgba(20, 20, 20, .45); border-radius: 10px; }
.tray-stack img {
  position: absolute; left: calc(var(--i) * 8px); top: calc(4px - var(--i) * 3px); width: 32px; height: 32px; object-fit: contain;
  background: #fff; border: 2px solid var(--ink); border-radius: 9px; padding: 2px; rotate: calc(var(--i) * 7deg - 7deg);
  box-shadow: 1px 2px 0 rgba(20, 20, 20, .35); transition: transform .3s var(--pop);
}
.tray-label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; white-space: nowrap; }
.tray-label .i { font-size: 18px; }
.tray-label .badge { position: static; margin-left: 2px; }
.tray-btn.tray-hot { transform: translateY(-10px) scale(1.12); background: #FFE08A; box-shadow: 0 10px 0 var(--ink), 0 0 0 8px rgba(255, 255, 255, .5); }
.tray-btn.tray-hot .tray-stack img { transform: translateY(-6px); }
@media (max-width: 380px) {
  .dock { gap: 4px; padding-inline: 8px; }
  .dock-btn { width: 44px; flex: none; }
  .tray-btn { gap: 6px; padding-inline: 8px; margin-inline: 0; }
}
.dragging .dock { transform: translateX(-50%) !important; opacity: 1 !important; pointer-events: auto !important; }
@media (max-width: 720px) { .dragging .dock { transform: none !important; } }

/* ---------- 随机排序开关 ---------- */
.shuffle-btn {
  height: 36px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .32); font-weight: 800; font-size: 13px;
  transition: background-color .2s, color .2s, transform .25s var(--pop);
}
.shuffle-btn .i { font-size: 16px; transition: transform .5s var(--wobble); }
.shuffle-btn.on { background: #fff; color: var(--ink); border-color: var(--ink); }
.shuffle-btn.on .i { transform: rotate(180deg); }
.shuffle-btn:active { transform: scale(.92); }

/* ---------- 卡片：触控拿起 ---------- */
.card { touch-action: pan-y pinch-zoom; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.card .pic img { pointer-events: none; -webkit-user-drag: none; }
.card.lifted { opacity: .35; transform: scale(.94) !important; transition: opacity .2s, transform .25s var(--pop); }
.drag-ghost {
  position: fixed; z-index: 210; object-fit: contain; pointer-events: none; background: #fff; border: 3px solid var(--ink); border-radius: 16px;
  padding: 8px; box-shadow: 10px 14px 0 rgba(20, 20, 20, .35); will-change: transform; transition: scale .2s;
}
.tilt-btn.on { border-color: var(--yellow); color: var(--yellow); }

/* ---------- 检视台：舞台 ---------- */
.stage { touch-action: none; background: transparent; }
.stage::before { clip-path: none !important; transition: none; opacity: calc(1 - var(--dp, 0) * 1.6); }
.stage[data-pv="white"]::before { background: #fff; }
.stage[data-pv="black"]::before { background: #141414; }
.stage[data-pv="yellow"]::before { background: #FFBD45; }
.stage[data-pv="green"]::before { background: #2AAC80; }
.stage[data-pv="chat"]::before { background: #EDEDED; }
.stage.pv-wipe::before { animation: pvWipe .42s var(--out); }
@keyframes pvWipe { from { clip-path: circle(0 at var(--wx, 50%) var(--wy, 90%)); } to { clip-path: circle(160% at var(--wx, 50%) var(--wy, 90%)); } }
.stage-img { will-change: transform; transition: none; }
.stage.zoomed .stage-img img, .stage.gesturing .stage-img img { animation: none; }
.stage.zoomed { cursor: grab; }
.stage.zoomed .stage-shadow { opacity: 0; }
.stage-peek { position: absolute; inset: 11% 9% 14%; z-index: 2; pointer-events: none; }
.stage-peek img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* 图像拖动交给现有 pointer 手势，不触发浏览器原生拖图。 */
.stage-img img, .stage-peek img { -webkit-user-drag: none; user-select: none; }
.stage[data-pv="chat"] .stage-img, .stage[data-pv="chat"] .stage-peek, .stage[data-pv="chat"] .stage-shadow,
.stage[data-pv="chat"] .stage-light, .stage[data-pv="chat"] .zoom-ctl { visibility: hidden; }
.detail { --dp: 0; }
.detail .backdrop { opacity: calc(1 - var(--dp)); }
.detail .dinfo, .detail .tryon, .detail .zoom-ctl, .detail .stage-no, .detail .fav-chip, .detail .d-counter, .detail .nav-arrow, .detail .dclose { opacity: calc(1 - var(--dp) * 2.4); }

/* 缩放按钮 */
.zoom-ctl {
  position: absolute; right: 12px; bottom: 76px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.zoom-ctl button {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: 20px;
  background: #fff; border: 2.5px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); transition: transform .2s var(--pop);
}
.zoom-ctl button:active { transform: scale(.88); }
.zoom-ctl #zReset { opacity: .45; }
.stage.zoomed .zoom-ctl #zReset { opacity: 1; background: var(--yellow); }
.zoom-ctl span { font: 400 11px/1 var(--f-num); background: var(--ink); color: #fff; padding: 4px 6px 3px; border-radius: 6px; opacity: 0; transition: opacity .2s; }
.stage.zoomed .zoom-ctl span { opacity: 1; }

/* 试贴底色 */
.tryon {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tryon button {
  width: 38px; height: 38px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: #fff;
  border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); transition: transform .25s var(--pop);
}
.tryon button .pv { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(20, 20, 20, .25); }
.tryon button .pv.chk { background: repeating-conic-gradient(#cfd5d2 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.tryon button.on { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 0 3px var(--yellow), 2px 3px 0 var(--ink); }
.tryon button:active { transform: scale(.88); }
.tryon .pv-chat { width: auto; padding: 0 12px; border-radius: 999px; font-weight: 900; font-size: 13px; }
.tryon small {
  flex-basis: 100%; font-size: 10.5px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, .85);
  align-self: flex-start; width: max-content; padding: 2px 7px; border-radius: 6px;
}
.stage[data-pv="black"] .tryon small, .stage[data-pv="green"] .tryon small { background: rgba(0, 0, 0, .45); color: #fff; }

/* 聊天示意（纯 CSS） */
.chat-demo { position: absolute; inset: 96px 12px 96px; z-index: 3; display: none; flex-direction: column; gap: 14px; padding: 0 6px; pointer-events: none; }
.stage[data-pv="chat"] .chat-demo { display: flex; }
.cd-bar { text-align: center; font-size: 13px; font-weight: 800; color: #333; padding: 0 0 8px; border-bottom: 1px solid #d6d6d6; margin: 0 -6px; }
.cd-msg { display: flex; align-items: flex-start; gap: 8px; }
.cd-msg.me { justify-content: flex-end; }
.cd-ava { width: 36px; height: 36px; border-radius: 6px; background: #fff; object-fit: cover; flex: none; }
.cd-bubble { background: #fff; padding: 9px 12px; border-radius: 6px; font-size: 15px; color: #111; }
.cd-sticker { width: auto; height: auto; max-width: 128px; max-height: 128px; object-fit: contain; }
.cd-note { margin: auto 0 0; align-self: center; font-size: 11px; font-weight: 700; color: #888; background: rgba(255, 255, 255, .8); padding: 3px 8px; border-radius: 6px; }

/* 收藏数（爱心飞向这里） */
.fav-chip {
  position: absolute; left: 14px; top: 58px; z-index: 4; display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 10px 4px 7px; box-shadow: 2px 2px 0 var(--ink);
  font: 400 13px/1 var(--f-num); color: var(--ink);
}
.fav-chip .i { font-size: 15px; color: var(--red); }
.fav-chip.bump { animation: bump .5s var(--pop); }

/* ---------- 收藏托盘：分页、下载记录 ---------- */
.bag-tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.bag-tabs button {
  flex: 1; height: 38px; border-radius: 12px 12px 0 0; border: 2.5px solid var(--ink); border-bottom: 0; background: #F1F5F3;
  font-weight: 800; font-size: 13.5px; transition: background-color .2s, transform .25s var(--pop);
}
.bag-tabs button.on { background: var(--yellow); transform: translateY(-3px); }
.bag-tabs + .bag-tools, .bag-tabs + .bag-tools + .bag-grid { border-top: 2.5px solid var(--ink); }
.dl-list { display: flex; flex-direction: column; gap: 10px; grid-column: 1 / -1; }
.dl-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; text-align: left; background: #fff;
  border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 2px 2px 0 var(--ink);
}
.dl-row img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.dl-row span { display: flex; flex-direction: column; min-width: 0; }
.dl-row b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-row small { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- 展台：横向拖动换角色 ---------- */
.showcase { touch-action: pan-y pinch-zoom; }

/* ---------- 手机：检视台布局 ---------- */
@media (max-width: 860px) {
  .dcard { grid-template-rows: 60% 1fr; background: rgb(255 255 255 / calc(1 - var(--dp, 0))); }
  .stage { border-bottom-color: rgb(20 20 20 / calc(1 - var(--dp, 0) * 2)); }
  .nav-arrow {
    display: grid; position: fixed; top: 30%; width: 40px; height: 40px; margin-top: -20px; font-size: 20px; z-index: 6;
    box-shadow: 2px 3px 0 var(--ink); background: rgba(255, 255, 255, .92);
  }
  .nav-arrow.prev { left: 8px; } .nav-arrow.next { right: 8px; }
  .d-counter { top: 16px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
  .stage-no { top: 12px; left: 12px; }
  .stage-img, .stage-peek { inset: 13% 6% 22%; }
}
@media (max-width: 720px) {
  .dinfo { padding-bottom: 200px; }
}
/* 倾斜手机时展品高光常亮（触屏没有 hover） */
.stage.tilt-light .stage-light { opacity: 1; }
/* 交叉胶带比屏幕宽：只裁左右，上下照常露出。否则手机会把布局宽度撑大，整页右侧被切掉 */
.checker-edge { overflow-x: clip; }
/* 手机：底栏铺满宽度；NPC 平时收起，只在收藏、下载、没搜到时从底栏上方冒出来做个表情 */
@media (max-width: 720px) {
  .dock { left: 12px; right: 12px; justify-content: space-between; }
  .host { bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateY(24px) scale(.5); opacity: 0; transform-origin: 30% 100%; }
  .host.live { transform: none; opacity: 1; transition: transform .45s var(--pop), opacity .2s; }
  body.typing .host.live { opacity: 0; }
}

/* ---------- 第一轮手机审查修正 ---------- */
/* B：下载列固定；按实际操作列和标题高度让出空间，仅在放不下时缩短舞台。
   JS 在 #detail 写入两项 border-box/内容实测值；量测前按原操作列及两行标题保守预留。 */
@media (max-width: 720px) {
  .detail {
    --detail-actions-h: calc(236px + env(safe-area-inset-bottom));
    --detail-heading-h: 180px;
    --detail-stage-h: clamp(0px, calc(100dvh - var(--detail-actions-h) - var(--detail-heading-h)), 60dvh);
  }
  .dcard { grid-template-rows: var(--detail-stage-h) minmax(0, 1fr); }
  .d-actions { position: fixed; z-index: 5; }
  .dinfo { min-height: 0; padding-bottom: calc(var(--detail-actions-h) + 18px); }
  .d-series, .d-title-wrap { flex-shrink: 0; }
  .nav-arrow { top: calc(var(--detail-stage-h) / 2); }
}
/* C：缩放按钮改成横排，放在试贴色板上方，和左右箭头上下错开 */
@media (max-width: 860px) {
  .zoom-ctl { flex-direction: row; right: 12px; bottom: 84px; gap: 8px; }
  .zoom-ctl #zOut { order: 1; } .zoom-ctl #zIn { order: 2; } .zoom-ctl #zReset { order: 3; } .zoom-ctl span { order: 0; }
  .stage-img, .stage-peek { inset: 13% 6% 28%; }
}
/* 舞台缩短后，仍给固定高度的缩放按钮留出空间，避免图片被按钮压住。 */
@media (max-width: 720px) {
  .stage-img, .stage-peek { top: max(13%, 52px); bottom: max(28%, 132px); }
}
/* 很短的屏幕把次操作并排放到下载旁，保留字级与足够的触控高度；
   底色已在上一行明确选中，省去下载按钮里重复的底色小徽章。 */
@media (max-width: 720px) and (max-height: 700px) {
  .d-actions { display: grid; grid-template-columns: minmax(0, 1fr) 52px 52px; gap: 10px 8px; }
  .d-actions .seg { grid-column: 1 / -1; }
  #dDownload { grid-column: 1; grid-row: 2; min-width: 0; padding: 0 10px; gap: 8px; }
  #dDownload span { white-space: nowrap; }
  #dDownload small { display: none; }
  .d-mobile-row { display: contents !important; }
  .d-mobile-row .btn-2 { height: 56px; min-width: 0; padding: 0; gap: 2px; flex-direction: column; }
  .d-mobile-row [data-act="fav"] { grid-column: 2; grid-row: 2; }
  .d-mobile-row [data-act="copy"] { grid-column: 3; grid-row: 2; }
  #dOrig { grid-column: 1 / -1; grid-row: 3; }
}
/* 放大后的展品不盖住编号牌 */
.stage-no { z-index: 4; }
