/* ============================================================
   [ui] Richy Verse · 山海御兽录 — v2 「山海玩具工坊」 (Pocket 范式, 去赛博)
   浅壳 (#F4F6FB) 暗台 (#141A2E) · 主色青金 · 辅色朱砂/金 · 圆角 8/12/16/24 · 胶囊按钮
   三端: phone <760 底栏 | tablet 760–1099 左窄栏 | desktop ≥1100 左宽栏
   ============================================================ */
:root {
  --bg: #F4F6FB; --panel: #FFFFFF; --line: #E3E7F0; --tx: #1F2540; --tx2: #6B7390; --tx3: #9AA2BA;
  --teal: #2BB8D6; --teal-d: #1E93AD; --teal-l: #E4F6FA; --cinn: #E4573D; --gold: #F2B135; --gold-d: #C98A12;
  --shadow: 0 6px 20px rgba(30,40,80,.08); --shadow-l: 0 14px 40px rgba(30,40,80,.14);
  --nav-h: 64px; --top-h: 54px; --rail: 84px; --side: 232px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --c-common: 156,163,175; --c-rare: 56,189,248; --c-epic: 168,85,247; --c-legend: 245,158,11; --c-mythic: 239,68,68;
  --e-wood: 34,197,94; --e-water: 59,130,246; --e-wind: 20,184,166; --e-fire: 249,115,22; --e-light: 234,179,8; --e-dark: 139,92,246;
  --stage: #141A2E; --stage2: #0B0F1E;
  --card-w: clamp(240px, min(80vw, 60vh * 5 / 7), 440px);
  --r8: 8px; --r12: 12px; --r16: 16px; --r24: 24px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--tx); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overflow: hidden; font-size: 15px; line-height: 1.5; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }
.bg-pattern { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260' fill='none' stroke='%23C9D1E3' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 200 C60 150 90 120 140 160 S220 90 280 150 S360 120 420 170'/%3E%3Cpath d='M20 90 c20 -14 40 -14 60 0 c20 14 40 14 60 0'/%3E%3Cpath d='M300 50 c16 -12 32 -12 48 0 c16 12 32 12 48 0'/%3E%3C/svg%3E");
  background-size: 420px 260px; }

/* ---------- 图标 ---------- */
.ni { display: inline-block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ni-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l9 8h-2.5v9h-5v-6h-3v6h-5v-9H3z'/%3E%3C/svg%3E"); }
.ni-pack { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M8 2h8a3 3 0 013 3v14a3 3 0 01-3 3H8a3 3 0 01-3-3V5a3 3 0 013-3zm-1 5.5v2h10v-2H7zm2 5v2h6v-2H9z'/%3E%3C/svg%3E"); }
.ni-dex { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M4 3h13a3 3 0 013 3v13a2 2 0 01-2 2H4a1 1 0 01-1-1V4a1 1 0 011-1zm3 4v2h9V7H7zm0 4v2h9v-2H7zm0 4v2h6v-2H7z'/%3E%3C/svg%3E"); }
.ni-quiz { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 110 20 10 10 0 010-20zm0 4.2c-2.3 0-4 1.5-4 3.6h2.2c0-1 .7-1.7 1.8-1.7 1 0 1.7.6 1.7 1.5 0 1.6-2.7 1.7-2.7 4.1h2.2c0-1.6 2.8-1.9 2.8-4.2 0-2-1.7-3.3-4-3.3zM12 15.5a1.4 1.4 0 100 2.8 1.4 1.4 0 000-2.8z'/%3E%3C/svg%3E"); }
.ni-me { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3.5 21a8.5 8.5 0 0117 0z'/%3E%3C/svg%3E"); }
.ni-hour { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h12v5l-4.5 5L18 17v5H6v-5l4.5-5L6 7z'/%3E%3C/svg%3E"); }
.ni-slip { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='2' width='4.5' height='20' rx='1.5'/%3E%3Crect x='9.75' y='2' width='4.5' height='20' rx='1.5'/%3E%3Crect x='15.5' y='2' width='4.5' height='20' rx='1.5'/%3E%3C/svg%3E"); }
.ni-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 7' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ---------- 品牌印 ---------- */
.nb-mark { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.15rem; color: #fff; letter-spacing: 0;
  background: linear-gradient(160deg, #3FCBE3, #1E93AD); box-shadow: 0 4px 12px rgba(43,184,214,.35), inset 0 1px 0 rgba(255,255,255,.4); font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; }

/* ---------- HUD (浮在场景上, 四角) ---------- */
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: calc(var(--top-h) + var(--sat)); padding: calc(var(--sat) + 8px) 12px 0; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-avatar { position: relative; width: 62px; height: 62px; border-radius: 50%; background: none center / 100% 100% no-repeat; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
.hud-avatar .av-ring { position: absolute; inset: 8px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(30,20,10,.5); background: url('/static/ui/icon-192.png') center / cover; }
.hud-avatar .av-lv { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: .68rem; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-weight: 900; color: #F7E7B8; background: linear-gradient(180deg, #5a4630, #2e2318); border: 1px solid #c9a35c; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.hud-res { display: flex; gap: 8px; align-items: flex-start; }
/* 资源牌: 素材 ui/kit/res_tab.webp (皮革+铜边+铜钉); 数字代码层 */
.res { display: inline-flex; align-items: center; gap: 6px; width: 96px; height: 41px; padding: 3px 18px 5px 16px; font-size: 1rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #F7E7B8; position: relative;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; background: none center / 100% 100% no-repeat; filter: drop-shadow(0 3px 5px rgba(0,0,0,.45)); text-shadow: 0 1px 0 rgba(0,0,0,.7); }
.res .ni { width: 17px; height: 17px; color: #F2B135; filter: drop-shadow(0 1px 0 rgba(0,0,0,.5)); }
.res b { flex: 1; text-align: right; }
.res .plus { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(180deg, #4fd0e6, #1a8ea6); color: #fff; font-size: .85rem; line-height: 18px; text-align: center; font-weight: 900; font-family: system-ui, sans-serif; box-shadow: 0 1px 3px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4); }
body:not(.in-scene) #hud { background: rgba(244,246,251,.92); backdrop-filter: blur(10px); }

/* ---------- 底栏: 三块浅色石板钮 (素材 ui/kit/slab.webp / slab_on.webp; 文字代码层) ---------- */
#nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--sab)); padding: 4px 12px calc(var(--sab) + 6px); display: flex; gap: 10px; align-items: stretch; justify-content: center; pointer-events: none; }
.nav-item { pointer-events: auto; flex: 1; max-width: 190px; display: flex; align-items: center; justify-content: center; position: relative; font-size: 1.15rem; font-weight: 900; letter-spacing: .16em; color: #3a3129; padding-bottom: 6px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif; background: none center / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45));
  text-shadow: 0 1px 0 rgba(255,255,255,.6), 0 -1px 0 rgba(0,0,0,.2); transition: transform .1s, filter .1s; -webkit-tap-highlight-color: transparent; }
.nav-item:active { transform: translateY(3px); filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.nav-item.active { color: #135e70; background-image: none; transform: translateY(-2px) scale(1.04); filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)) drop-shadow(0 0 10px rgba(43,184,214,.35)); text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 0 8px rgba(120,235,255,.45); }
.nav-item .badge { position: absolute; top: -4px; right: 2px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--cinn); color: #fff; font-size: .64rem; line-height: 19px; text-align: center; padding: 0 5px; font-family: system-ui, sans-serif; letter-spacing: 0; box-shadow: 0 2px 6px rgba(228,87,61,.5), inset 0 0 0 1px rgba(255,255,255,.5); }
body:not(.in-scene) #nav { background: linear-gradient(180deg, rgba(244,246,251,0), rgba(244,246,251,.96) 40%); }

#views { position: fixed; left: 0; right: 0; top: 0; bottom: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; z-index: 1; }
.view { display: none; min-height: 100%; padding: calc(var(--top-h) + var(--sat) + 8px) 16px calc(var(--nav-h) + var(--sab) + 20px); }
.view.active { display: block; }
#view-home { padding: 0; height: 100%; }
@media (min-width: 760px) { .view { padding-left: 24px; padding-right: 24px; max-width: 1180px; margin: 0 auto; } #view-home { max-width: none; } .nav-item { max-width: 220px; } }

/* ---------- 山海界场景 ---------- */
.scene { position: relative; width: 100%; height: 100%; overflow: hidden; background: #6b7f93; }
/* 图与所有后加层共用 .scene-box 坐标系: 由 JS 按 cover 算出 box 尺寸/偏移 */
.scene-box { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.scene-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.scene-box > * { position: absolute; }
/* 热区 (透明; 点击闪一下) */
#zones { inset: 0; }
.zone { position: absolute; background: transparent; border-radius: 18px; transition: filter .25s; -webkit-tap-highlight-color: transparent; }
.zone.tap { filter: brightness(1.25) drop-shadow(0 0 18px rgba(255,220,140,.7)); animation: zone-pop .4s cubic-bezier(.2,1.4,.3,1); }
@keyframes zone-pop { 40% { transform: scale(1.03); } }
.zone .zdot { position: absolute; right: 14%; top: 8%; width: 14px; height: 14px; border-radius: 50%; background: var(--cinn); box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 2px 8px rgba(228,87,61,.6); animation: dot-pulse 1.6s ease-in-out infinite; }
@keyframes dot-pulse { 50% { transform: scale(1.25); } }
/* 石碑名牌: 生成素材 ui/kit/stele_*.webp (深石板+金线+铜钉), 文字后加 (代码层) */
.stele { position: absolute; transform: translate(-50%, -50%); z-index: 7; display: flex; align-items: center; justify-content: center; background: none center / 100% 100% no-repeat; color: #EFE1BF;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif; font-size: .95rem; font-weight: 900; letter-spacing: .14em; white-space: nowrap; text-shadow: 0 1px 0 rgba(0,0,0,.8), 0 0 8px rgba(255,220,150,.3);
  width: 118px; height: 58px; padding: 10px 14px 6px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); transition: transform .15s, filter .15s; }
.stele.v { writing-mode: vertical-rl; background-image: none; width: 40px; height: 96px; padding: 16px 0 10px; letter-spacing: .2em; font-size: .92rem; }
.stele.v.locked { background-image: none; height: 110px; padding-bottom: 28px; }
.stele.v.long { height: 124px; } .stele.v.long.locked { height: 138px; }
.stele:active { transform: translate(-50%, -50%) scale(.94); filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)) brightness(1.12); }
.stele.locked { color: #b9bcc2; text-shadow: 0 1px 0 rgba(0,0,0,.8); }
.stele .lock { display: none; }
body.scene-wide .stele { font-size: .8rem; }
body.scene-wide .stele.v { width: 34px; height: 82px; } body.scene-wide .stele.v.locked { height: 94px; } body.scene-wide .stele.v.long { height: 106px; } body.scene-wide .stele.v.long.locked { height: 118px; }
/* 归墟井: 井口即开包入口 (不放卡包实物); 漩涡 + 气泡 */
.well-btn { transform: translate(-50%, -50%); width: 22%; aspect-ratio: 1.7; border-radius: 50%; background: transparent; z-index: 6; -webkit-tap-highlight-color: transparent; }
.well-btn::before { content: ''; position: absolute; inset: 8% 14%; border-radius: 50%; mix-blend-mode: screen; opacity: .85; filter: blur(1px);
  background: conic-gradient(from 0deg, rgba(43,184,214,0) 0%, rgba(120,235,255,.9) 18%, rgba(43,184,214,0) 32%, rgba(120,235,255,.7) 55%, rgba(43,184,214,0) 68%, rgba(120,235,255,.9) 88%, rgba(43,184,214,0) 100%);
  -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, #000 70%, transparent 80%); mask: radial-gradient(circle, transparent 18%, #000 30%, #000 70%, transparent 80%); animation: vortex 6s linear infinite; }
.well-btn::after { content: ''; position: absolute; inset: 30% 36%; border-radius: 50%; background: radial-gradient(circle, rgba(10,30,50,.9), rgba(20,90,120,.4) 60%, transparent 75%); }
.well-btn.ready::before { animation-duration: 2.6s; opacity: 1; }
@keyframes vortex { to { transform: rotate(360deg) scaleY(1); } }
@keyframes bubble-float { 50% { transform: translate(-50%, calc(-100% - 6px)); } }
/* 兽 (广场闲逛) */
.beasts { inset: 0; pointer-events: none; }
.beast { position: absolute; width: 15%; transform: translate(-50%, -100%) scale(var(--s, 1)); background: none; pointer-events: auto; transition: left 3.8s ease-in-out, top 3.8s ease-in-out; z-index: 5; }
.beast img { width: 100%; display: block; animation: breathe 2.8s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0,0,0,.25)); }
.beast.flip img, .beast.flip .sil { transform: scaleX(-1); }
.beast .shadow { position: absolute; left: 50%; bottom: -3%; width: 70%; height: 10%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.4), transparent 70%); }
.beast.noimg { width: 7%; }
.beast .sil { display: flex; width: 100%; aspect-ratio: .8; border-radius: 40% 40% 45% 45%; background: linear-gradient(180deg, rgba(60,70,95,.85), rgba(25,30,50,.9)); color: rgba(243,230,200,.9); font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-size: clamp(.8rem, 2.6vw, 1.2rem); font-weight: 900; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(201,163,92,.5), 0 3px 6px rgba(0,0,0,.4); }
.beast.hop img, .beast.hop .sil { animation: hop .5s cubic-bezier(.3,1.5,.5,1); }
@keyframes breathe { 50% { transform: translateY(-2%) scaleY(1.02); } }
@keyframes hop { 40% { transform: translateY(-14%); } }
/* 特效层 */
.fx-well { width: 26%; aspect-ratio: 1.6; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 2; --rc: 43,184,214;
  background: radial-gradient(ellipse at center, rgba(var(--rc), .75) 0%, rgba(var(--rc), .35) 30%, transparent 62%); filter: blur(6px); opacity: .55; animation: well-pulse 4s ease-in-out infinite; mix-blend-mode: screen; }
.fx-well.ready { opacity: .95; animation-duration: 2.2s; }
@keyframes well-pulse { 50% { opacity: .85; transform: translate(-50%, -50%) scale(1.08); } }
.fx-beam { width: 9%; height: 22%; transform: translate(-50%, -100%); pointer-events: none; z-index: 3; mix-blend-mode: screen; opacity: .55;
  background: linear-gradient(180deg, rgba(180,240,255,0) 0%, rgba(160,235,255,.35) 60%, rgba(160,235,255,.7) 100%); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); filter: blur(2px); animation: beam-flicker 3s ease-in-out infinite; }
@keyframes beam-flicker { 50% { opacity: .8; } }
.fx-runes { inset: 0; pointer-events: none; z-index: 3; }
.fx-runes i { position: absolute; width: 3%; height: 6%; transform: translate(-50%, -100%); border-radius: 30%; background: rgba(120,230,220,0); box-shadow: 0 0 0 rgba(120,230,220,0); transition: all .6s; mix-blend-mode: screen; }
.fx-runes i.on { background: rgba(120,230,220,.55); box-shadow: 0 0 14px 6px rgba(120,230,220,.55); animation: rune-glow 2.4s ease-in-out infinite; }
@keyframes rune-glow { 50% { box-shadow: 0 0 22px 10px rgba(120,230,220,.7); } }
.fx-lanterns { inset: 0; pointer-events: none; z-index: 3; }
.fx-lanterns i { position: absolute; width: 9%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,190,90,.75), rgba(255,150,50,.25) 45%, transparent 70%); mix-blend-mode: screen; opacity: 0; filter: blur(3px); transition: opacity 1s; }
.fx-lanterns i.lit { opacity: .8; animation: flicker 2.6s ease-in-out infinite; }
.fx-lanterns i:nth-child(2n).lit { animation-delay: -1.1s; }
@keyframes flicker { 0%,100% { opacity: .75; } 50% { opacity: .95; } 72% { opacity: .7; } }
.fx-smoke { width: 4%; height: 12%; transform: translate(-50%, -100%); pointer-events: none; z-index: 4; }
.fx-smoke i { position: absolute; left: 50%; bottom: 0; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(3px); animation: smoke 3.6s ease-out infinite; }
.fx-smoke i:nth-child(2) { animation-delay: 1.2s; } .fx-smoke i:nth-child(3) { animation-delay: 2.4s; }
@keyframes smoke { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 15% { opacity: .7; } 100% { transform: translate(calc(-50% + 14px), -90px) scale(2.2); opacity: 0; } }
.fx-sparks { inset: 0; pointer-events: none; z-index: 4; }
.fx-sparks i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #FFF3C4; box-shadow: 0 0 8px 3px rgba(255,230,160,.7); opacity: 0; animation: spark 9s ease-in-out infinite; }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: .9; } 50% { transform: translate(14px, -40px); } 80% { opacity: .6; } 100% { opacity: 0; transform: translate(-8px, -80px); } }
.fx-mist { left: -10%; width: 120%; height: 18%; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at center, rgba(255,255,255,.35), transparent 70%); filter: blur(14px); mix-blend-mode: screen; }
.fx-mist-a { top: 30%; animation: mist 60s linear infinite alternate; }
.fx-mist-b { top: 50%; height: 12%; opacity: .7; animation: mist 90s linear infinite alternate-reverse; }
@keyframes mist { to { transform: translateX(6%); } }
/* 宽屏 (pad 横 / PC): 卡包按高度收小, 场景可拖拽 */
body.scene-wide .scene { cursor: grab; } body.scene-wide .scene:active { cursor: grabbing; }
body.scene-wide .beast { width: 10%; }
body.fx-lvl-2 .fx-sparks, body.fx-lvl-3 .fx-sparks, body.fx-lvl-3 .fx-mist { display: none; }

/* ---------- 通用 ---------- */
.card-panel { background: var(--panel); border-radius: var(--r24); padding: 16px; box-shadow: var(--shadow); }
.card-panel > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.card-panel h3 { font-size: 1rem; font-weight: 800; }
.sub { font-size: .76rem; color: var(--tx2); }
.hint { font-size: .74rem; color: var(--tx2); line-height: 1.6; }
.page-h { font-size: 1.3rem; font-weight: 900; margin: 6px 0 12px; }
.link { color: var(--teal-d); font-size: .82rem; font-weight: 700; }
.btn-primary { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 54px; padding: 0 34px; border-radius: 999px; color: #fff; font-weight: 900; font-size: 1.05rem; letter-spacing: .2em; text-indent: .2em;
  background: linear-gradient(180deg, #3FCBE3 0%, #2BB8D6 55%, #1E93AD 100%); box-shadow: 0 6px 0 #17758A, 0 10px 24px rgba(43,184,214,.35), inset 0 1.5px 0 rgba(255,255,255,.55); transition: transform .08s, box-shadow .08s; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #17758A, 0 6px 14px rgba(43,184,214,.3), inset 0 1.5px 0 rgba(255,255,255,.55); }
.btn-primary:disabled { filter: saturate(.3) brightness(1.1); box-shadow: 0 6px 0 #B7C0CE; cursor: default; }
.btn-primary.xl { height: 64px; padding: 0 60px; font-size: 1.3rem; min-width: 260px; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--line); color: var(--tx2); font-weight: 800; font-size: .9rem; background: #fff; transition: all .15s; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-d); }
.btn-ghost.light { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); font-weight: 900; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-size: .86rem; font-weight: 800; color: var(--tx); font-variant-numeric: tabular-nums; }
.chip .ni { width: 15px; height: 15px; color: var(--gold); }
.chip.ready { background: linear-gradient(90deg, #FFF4D6, #FFE9B0); color: #7A5A1E; }
.tog { border-radius: 999px; padding: 6px 16px; font-size: .8rem; font-weight: 800; color: var(--tx2); background: var(--bg); }
.tog.on { color: #fff; background: var(--teal); }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.set-row:last-child { border-bottom: 0; }
.set-row.danger .tog { color: var(--cinn); }
.about { font-size: .84rem; line-height: 1.7; } .about.dim { color: var(--tx2); margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { text-align: center; padding: 12px 6px; border-radius: var(--r16); background: var(--bg); }
.stat b { display: block; font-size: 1.4rem; font-weight: 900; color: var(--tx); font-variant-numeric: tabular-nums; }
.stat span { font-size: .68rem; color: var(--tx2); }
.stat.t-common b { color: rgb(var(--c-common)); } .stat.t-rare b { color: rgb(var(--c-rare)); } .stat.t-epic b { color: rgb(var(--c-epic)); } .stat.t-legend b { color: rgb(var(--c-legend)); }
.empty { padding: 18px; text-align: center; color: var(--tx2); font-size: .82rem; line-height: 1.7; }

/* ---------- 兽卡缩略 (兽录/近期/结算 通用) ---------- */
.mc { position: relative; aspect-ratio: 5 / 7; border-radius: 12px; overflow: hidden; background: #E9EDF5; border: 2px solid rgba(var(--tc), .9); box-shadow: 0 4px 12px rgba(30,40,80,.1); text-align: left; flex-shrink: 0; transition: transform .18s, box-shadow .18s; }
.mc:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(30,40,80,.16); }
.mc .mc-img { position: absolute; inset: 0; background: center / cover no-repeat; }
.mc .mc-sil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 900; color: rgba(31,37,64,.12); background: radial-gradient(circle at 50% 42%, rgba(var(--tc), .18), transparent 62%); }
.mc.owned .mc-sil { color: rgba(31,37,64,.55); background: radial-gradient(circle at 50% 42%, rgba(var(--tc), .35), rgba(var(--tc), .06) 70%); }
.mc .mc-no { position: absolute; left: 5px; top: 4px; font-size: .58rem; font-weight: 800; color: rgba(31,37,64,.5); font-variant-numeric: tabular-nums; }
.mc .mc-tier { position: absolute; right: 4px; top: 4px; font-size: .56rem; font-weight: 900; padding: 1px 6px; border-radius: 6px; background: rgb(var(--tc)); color: #fff; }
.mc .mc-el { position: absolute; left: 4px; bottom: 4px; width: 17px; height: 17px; border-radius: 50%; font-size: .58rem; font-weight: 900; color: #fff; display: flex; align-items: center; justify-content: center; background: rgb(var(--ec)); }
.mc .mc-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 6px 5px; text-align: center; font-size: .74rem; font-weight: 800; color: #fff; background: linear-gradient(180deg, transparent, rgba(20,26,46,.8)); }
.mc:not(.owned) .mc-name { color: rgba(31,37,64,.45); background: none; }
.mc .mc-cnt { position: absolute; right: 4px; bottom: 24px; font-size: .58rem; font-weight: 900; color: #fff; background: rgba(20,26,46,.6); padding: 1px 5px; border-radius: 6px; }
.mc .mc-new { position: absolute; left: -22px; top: 8px; transform: rotate(-35deg); background: var(--cinn); color: #fff; font-size: .56rem; font-weight: 900; padding: 2px 24px; letter-spacing: .1em; }
.recent-row .mc { width: 74px; }

/* ---------- 卡包页 ---------- */
.pack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
@media (min-width: 560px) { .pack-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .pack-grid { grid-template-columns: repeat(5, 1fr); } }
.pkc { background: #fff; border-radius: var(--r24); padding: 14px 10px 12px; box-shadow: var(--shadow); text-align: center; transition: transform .18s; }
.pkc:hover { transform: translateY(-3px); }
.pkc.sel { box-shadow: var(--shadow), 0 0 0 2px var(--teal); }
.pkc img { width: 64%; aspect-ratio: 1115/1683; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(20,30,60,.22)); }
.pkc .pk-n { font-weight: 900; margin-top: 6px; } .pkc .pk-s { font-size: .7rem; color: var(--tx2); }
.pkc .pk-bar { height: 5px; border-radius: 3px; background: var(--bg); margin: 8px 8px 0; overflow: hidden; } .pkc .pk-bar i { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.slip-table { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sl { font-size: .76rem; font-weight: 900; padding: 5px 12px; border-radius: 999px; color: #fff; }
.sl-c { background: rgb(var(--c-common)); } .sl-r { background: rgb(var(--c-rare)); } .sl-e { background: rgb(var(--c-epic)); } .sl-l { background: rgb(var(--c-legend)); }

/* ---------- 兽录 ---------- */
.dex-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.seg button { padding: 6px 14px; font-size: .78rem; font-weight: 800; color: var(--tx2); border-radius: 999px; }
.seg button.on { color: #fff; background: var(--teal); }
.chk { font-size: .78rem; color: var(--tx2); display: inline-flex; align-items: center; gap: 5px; } .chk input { accent-color: var(--teal); width: 16px; height: 16px; }
.dex-prog { margin-left: auto; font-size: .8rem; color: var(--teal-d); font-weight: 900; font-variant-numeric: tabular-nums; }
.dex-jump { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; } .dex-jump::-webkit-scrollbar { display: none; }
.dex-jump button { flex: 0 0 auto; font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--tx2); box-shadow: var(--shadow); white-space: nowrap; }
.dex-group { margin-bottom: 18px; }
.dex-group h3 { font-size: .92rem; font-weight: 900; margin: 6px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.dex-group h3 small { font-size: .7rem; color: var(--tx2); font-weight: 700; }
.dex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .dex-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 760px) { .dex-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1100px) { .dex-grid { grid-template-columns: repeat(8, 1fr); } }

/* ---------- 问道 ---------- */
.quiz-layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .quiz-layout { grid-template-columns: 290px 1fr; align-items: start; } }
.subj-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
@media (min-width: 760px) { .subj-grid { grid-template-columns: repeat(4, 1fr); } }
.sb { border-radius: var(--r16); padding: 10px 6px; text-align: center; background: var(--bg); transition: all .18s; border: 2px solid transparent; }
.sb .sb-el { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 5px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; background: rgb(var(--ec)); font-family: "Songti SC","Noto Serif CJK SC",serif; box-shadow: 0 3px 8px rgba(var(--ec), .4); }
.sb .sb-n { font-weight: 900; font-size: .88rem; } .sb .sb-s { font-size: .64rem; color: var(--tx2); }
.sb.on { border-color: rgb(var(--ec)); background: #fff; }
.quiz-stat { display: flex; gap: 10px; font-size: .72rem; color: var(--tx2); flex-wrap: wrap; margin-top: 8px; } .quiz-stat b { color: var(--tx); }
.quiz-main { min-height: 320px; }
.quiz-empty { display: flex; align-items: center; justify-content: center; min-height: 280px; color: var(--tx2); font-weight: 700; }
.qc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.qc-subj { font-size: .72rem; font-weight: 900; padding: 4px 12px; border-radius: 999px; color: #fff; background: rgb(var(--ec)); }
.qc-streak { font-size: .74rem; color: var(--gold-d); font-weight: 800; }
.qc-q { font-size: 1.05rem; line-height: 1.8; font-weight: 700; margin-bottom: 14px; }
.qc-opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 760px) { .qc-opts { grid-template-columns: 1fr 1fr; } }
.qo { text-align: left; padding: 13px 14px; border-radius: var(--r16); background: var(--bg); border: 2px solid transparent; font-size: .92rem; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; transition: all .15s; }
.qo i { font-style: normal; flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px; background: #fff; font-size: .72rem; font-weight: 900; display: flex; align-items: center; justify-content: center; color: var(--tx2); }
.qo:hover { border-color: var(--teal); }
.qo.right { border-color: #22C55E; background: #ECFDF3; } .qo.right i { background: #22C55E; color: #fff; }
.qo.wrong { border-color: var(--cinn); background: #FEF1EE; } .qo.wrong i { background: var(--cinn); color: #fff; }
.qo:disabled { cursor: default; }
.qc-why { margin-top: 12px; padding: 12px 14px; border-radius: var(--r16); background: #FFF8E8; font-size: .84rem; line-height: 1.7; }
.qc-why .link { margin-left: 6px; }
#qc-next { margin: 14px auto 0; display: flex; }

/* ---------- 我的 ---------- */
.me-layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .me-layout { grid-template-columns: 1fr 1fr; } .me-layout .card-panel:first-child { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .me-layout { grid-template-columns: 1.4fr 1fr 1fr; } .me-layout .card-panel:first-child { grid-column: auto; } }
.me-layout .stat-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 479px) { .me-layout .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 开包舞台 ---------- */
#stage { position: fixed; inset: 0; z-index: 100; background: radial-gradient(ellipse 90% 60% at 50% 20%, #232C4C 0%, var(--stage) 45%, var(--stage2) 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
#stage::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(1px 1px at 15% 20%, rgba(255,230,160,.7), transparent 60%), radial-gradient(1.4px 1.4px at 70% 30%, rgba(255,255,255,.5), transparent 60%), radial-gradient(1px 1px at 40% 75%, rgba(255,230,160,.6), transparent 60%), radial-gradient(1.2px 1.2px at 85% 80%, rgba(255,255,255,.45), transparent 60%), radial-gradient(1px 1px at 25% 55%, rgba(255,255,255,.4), transparent 60%);
  background-size: 520px 520px; animation: drift 90s linear infinite; }
@keyframes drift { to { background-position: 520px 260px; } }
body.fx-lvl-2 #stage::before, body.fx-lvl-3 #stage::before { display: none; }
.stage-skip { position: absolute; right: 16px; top: calc(var(--sat) + 14px); z-index: 5; font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.7); padding: 7px 14px; border: 1.5px solid rgba(255,255,255,.25); border-radius: 999px; }
.stage-hint { position: absolute; top: calc(var(--sat) + 22px); left: 0; right: 0; text-align: center; font-size: .9rem; letter-spacing: .2em; color: rgba(255,255,255,.75); font-weight: 700; }
.stage-hint.sub { position: static; margin-top: 14px; font-size: .78rem; letter-spacing: .1em; color: rgba(255,255,255,.55); }
.st { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
/* 划封 */
.tear-wrap { position: relative; width: min(66vw, 300px); aspect-ratio: 1115 / 1683; transform: perspective(1000px) rotateX(4deg); filter: drop-shadow(0 30px 40px rgba(0,0,0,.5)); touch-action: none; }
.tear-pack { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tear-strip { position: absolute; left: 6%; right: 6%; top: 9.3%; height: 3px; pointer-events: none; }
.tear-strip i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #FFF3C4 0 10px, transparent 10px 18px); border-radius: 2px; box-shadow: 0 0 8px #FFE08A, 0 0 18px rgba(255,210,100,.7); animation: seam 1.4s ease-in-out infinite; }
@keyframes seam { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.tear-progress { position: absolute; left: 6%; top: 8.4%; height: calc(3px + 1.8%); width: 0%; pointer-events: none; background: linear-gradient(90deg, rgba(255,240,180,.0), #FFF7DC); box-shadow: 0 0 20px 6px rgba(255,220,120,.75); border-radius: 4px; mix-blend-mode: screen; }
.tear-hand { position: absolute; left: 8%; top: 4%; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.9); background: rgba(255,255,255,.15); opacity: 0; pointer-events: none; }
.tear-hand.show { animation: hand-swipe 1.8s ease-in-out infinite; }
@keyframes hand-swipe { 0% { opacity: 0; transform: translateX(0); } 15% { opacity: 1; } 75% { opacity: 1; transform: translateX(calc(min(66vw,300px) * .75)); } 100% { opacity: 0; transform: translateX(calc(min(66vw,300px) * .8)); } }
.tear-glow { position: absolute; inset: -20%; border-radius: 50%; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(var(--rc, 255,220,120), .55), transparent 60%); filter: blur(20px); transition: opacity .6s; z-index: -1; }
.tear-wrap.torn .tear-strip { display: none; }
.tear-wrap.torn .tear-pack { animation: pack-open .7s cubic-bezier(.3,1.4,.4,1) forwards; }
@keyframes pack-open { 0% { transform: scale(1); } 40% { transform: scale(1.06) translateY(6px); } 100% { transform: scale(.94) translateY(30px); opacity: 0; } }
.tear-cap { position: absolute; left: 0; right: 0; top: 0; height: 11%; overflow: hidden; pointer-events: none; }
.tear-cap img { position: absolute; left: 0; top: 0; width: 100%; object-fit: contain; aspect-ratio: 1115 / 1683; }
.tear-wrap.torn .tear-cap { animation: cap-fly .8s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes cap-fly { to { transform: translate(60%, -140%) rotate(28deg); opacity: 0; } }
/* 逐张翻卡 */
.deck { position: relative; width: var(--card-w); aspect-ratio: 5 / 7; touch-action: none; }
.dk { position: absolute; inset: 0; border-radius: 4.5% / 3.2%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.8,.2,1), opacity .5s; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.dk .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: inherit; overflow: hidden; }
.dk .face.back { background: url('/static/ui/cardback.webp') center / cover no-repeat; }
.dk .face.front { transform: rotateY(180deg); background: #0f1424; }
.dk .face.front .hc { width: 100%; height: 100%; }
.dk.flipped { transform: rotateY(180deg); }
.dk.flipped.done { transform: rotateY(180deg) translateY(-140%) scale(.85); opacity: 0; pointer-events: none; z-index: 0 !important; }
/* 翻转完成后落平 (.flat): 嵌套双 rotateY(180) + 引擎自身 3D 倾斜 + backface-visibility 会被 Chromium 剔除成空白, 翻完立即改为平面态 */
.dk.flipped.flat { transform: none; transform-style: flat; transition: none; }
.dk.flipped.flat .face.back { display: none; }
.dk.flipped.flat .face.front { transform: none; backface-visibility: visible; }
.dk.flipped.flat.done { transform: translateY(-140%) scale(.85); transition: transform .55s cubic-bezier(.2,.8,.2,1), opacity .5s; }
.dk.under { transform: translateY(6px) scale(.985); } .dk.under2 { transform: translateY(12px) scale(.97); } .dk.under3 { transform: translateY(18px) scale(.955); } .dk.under4 { transform: translateY(24px) scale(.94); }
.dk.dragging { transition: none; }
.dk .glow { position: absolute; inset: -14%; border-radius: 50%; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(var(--rc), .7), transparent 62%); filter: blur(22px); transition: opacity .5s; z-index: -1; }
.dk.flipped .glow { opacity: 1; }
.deck.hot { animation: deck-shake .4s ease-in-out 2; }
@keyframes deck-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px) rotate(-1deg); } 75% { transform: translateX(5px) rotate(1deg); } }
.orig-box { max-width: 560px; width: min(92vw, 560px); margin-top: 16px; padding: 16px 18px; border-radius: var(--r16); background: rgba(255,255,255,.06); border: 1px solid rgba(255,230,160,.25); text-align: left; }
.orig-src { font-size: .72rem; letter-spacing: .24em; color: #F2C66B; margin-bottom: 8px; }
.orig-text { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-size: clamp(1rem, 2.4vw, 1.25rem); line-height: 1.9; letter-spacing: .08em; color: #F7F1E1; }
.orig-text .hchar { display: inline-block; opacity: 0; animation: hchar-in .45s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes hchar-in { 0% { opacity: 0; transform: translateY(10px); filter: blur(4px); } 100% { opacity: 1; transform: none; filter: none; } }
.orig-name { margin-top: 10px; font-size: 1.15rem; font-weight: 900; letter-spacing: .4em; text-indent: .4em; text-align: center; color: #fff; opacity: 0; transition: opacity .6s; }
.orig-name.show { opacity: 1; }
#flash-white { position: absolute; inset: 0; z-index: 50; background: #fff; opacity: 0; pointer-events: none; transition: opacity .5s ease-out; }
/* 结算 */
.res-h { font-size: 1.2rem; font-weight: 900; letter-spacing: .4em; text-indent: .4em; margin-bottom: 18px; color: #FFF3D6; }
.res-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; max-width: 640px; }
.res-row .mc { width: min(17vw, 100px); border-width: 2.5px; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 24px rgba(var(--tc), .35); }
.res-row .mc .mc-name { font-size: .7rem; }
.res-gain { margin: 18px 0 20px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.res-gain .chip { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; }
.res-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.res-in { animation: res-pop .5s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes res-pop { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
/* 宽屏: 案上开包 (Pad 横 / PC) — 包留左, 卡居中, 案上牌在右 */
.st-open .st-col { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.desk-pack-name { display: none; }
.st-col-side { display: none; }
@media (min-width: 760px) {
  .tear-wrap { width: min(34vh * 1115 / 1683, 340px); }
  .st-open.desk { flex-direction: row; align-items: stretch; justify-content: center; gap: 0; padding: 60px 24px 24px; }
  .st-open.desk .st-col-pack { flex: 0 0 26%; justify-content: flex-end; padding-bottom: 6vh; }
  .st-open.desk .tear-wrap { width: min(22vh * 1115 / 1683, 200px); transform: perspective(900px) rotateX(10deg) rotateZ(-8deg) translateY(10px); filter: drop-shadow(0 22px 26px rgba(0,0,0,.55)) brightness(.85); transition: transform .6s, width .6s, filter .6s; }
  .st-open.desk .tear-glow { display: none; }
  .st-open.desk .desk-pack-name { display: block; margin-top: 16px; font-size: .78rem; letter-spacing: .3em; color: rgba(255,255,255,.5); }
  .st-open.desk .st-col-cards { flex: 0 0 44%; }
  .st-open.desk .st-col-cards .orig-box { display: none; }   /* 原文改到右侧案上牌 */
  .st-open.desk .st-col-side { display: flex; flex: 0 0 30%; align-items: stretch; justify-content: flex-start; padding: 2vh 8px 2vh 28px; border-left: 1px solid rgba(255,230,160,.14); text-align: left; }
  .side-h { font-size: .74rem; letter-spacing: .5em; color: #F2C66B; margin-bottom: 14px; }
  .side-strip { display: flex; gap: 8px; flex-wrap: wrap; min-height: 96px; margin-bottom: 18px; }
  .side-strip .mc { width: 64px; border-width: 2px; box-shadow: 0 8px 20px rgba(0,0,0,.5), 0 0 16px rgba(var(--tc), .3); }
  .side-strip .mc .mc-name { font-size: .62rem; }
  .side-orig { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-size: clamp(1rem, 1.5vw, 1.3rem); line-height: 2; letter-spacing: .08em; color: #F7F1E1; margin: 8px 0 12px; }
  .side-orig rt { color: rgba(255,230,160,.7); }
  .side-plain { font-size: .86rem; line-height: 1.8; color: rgba(255,255,255,.62); }
}
@media (min-width: 760px) {
  /* 案上: 撕开的包不消失, 留在案上 (顶部封口被裁掉) */
  .st-open.desk .tear-wrap.torn .tear-pack { animation: none; opacity: 1; clip-path: inset(10.5% 0 0 0); }
  .st-open.desk .tear-wrap.torn .tear-progress { display: none; }
}
@media (min-width: 1100px) {
  .st-open.desk { padding: 60px 8vw 32px; }
  .st-open.desk .tear-wrap { width: min(26vh * 1115 / 1683, 240px); }
  .st-open.desk .st-col-cards { --card-w: clamp(300px, min(34vw, 66vh * 5 / 7), 460px); }
  .side-strip .mc { width: 76px; }
}

/* ---------- 卡详情 L2 (暗台) ---------- */
#card-overlay { position: fixed; inset: 0; z-index: 90; background: radial-gradient(ellipse 90% 60% at 50% 20%, #232C4C 0%, var(--stage) 45%, var(--stage2) 100%); display: flex; flex-direction: column; color: #fff; }
.co-top { height: calc(var(--top-h) + var(--sat)); padding: var(--sat) 12px 0; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.co-top .icon-btn { background: rgba(255,255,255,.1); box-shadow: none; color: #fff; font-size: .8rem; }
#co-back { font-size: 1.4rem; }
#co-title { flex: 1; text-align: center; font-weight: 900; letter-spacing: .08em; display: flex; align-items: center; justify-content: center; gap: 8px; }
#co-title .tbg { font-size: .62rem; font-weight: 900; padding: 2px 9px; border-radius: 999px; background: rgb(var(--tc)); color: #fff; }
#co-title small { color: rgba(255,255,255,.5); font-size: .7rem; font-weight: 600; }
.co-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: 8px 14px; gap: 14px; }
.co-stage { width: var(--card-w); flex-shrink: 0; position: relative; }
.co-tip { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: .74rem; white-space: nowrap; backdrop-filter: blur(6px); animation: tip-in .4s ease both; }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.co-info { width: 100%; max-width: 520px; font-size: .86rem; line-height: 1.7; background: rgba(255,255,255,.06); color: #EEF0F6; box-shadow: none; }
.co-info h4 { font-size: .72rem; letter-spacing: .2em; color: #F2C66B; margin: 10px 0 4px; } .co-info h4:first-child { margin-top: 0; }
.co-info .orig { font-family: "Songti SC","Noto Serif CJK SC",serif; color: #F7F1E1; border-left: 2px solid rgba(242,198,107,.6); padding-left: 10px; }
.co-info .plain { color: #C7CCE0; }
.co-info .chips { display: flex; gap: 6px; flex-wrap: wrap; } .co-info .chip { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; font-size: .72rem; padding: 4px 10px; }
.co-info .locked { text-align: center; color: rgba(255,255,255,.5); padding: 10px; }
.co-info .mv b { color: #fff; } .co-info .mv .x { color: #FFB27A; margin: 0 6px; } .co-info .mv span { color: #C7CCE0; }
@media (min-width: 760px) { .co-body { flex-direction: row; justify-content: center; align-items: flex-start; padding: 16px 24px; gap: 28px; } .co-stage { --card-w: clamp(300px, min(42vw, 72vh * 5 / 7), 480px); } .co-info { max-width: 420px; } }
.co-actions { flex-shrink: 0; display: flex; gap: 10px; justify-content: center; padding: 10px 12px calc(12px + var(--sab)); }
.co-actions .btn-ghost { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
/* 无真图占位卡 */
.ph-card { width: 100%; aspect-ratio: 5 / 7; border-radius: 4.5% / 3.2%; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff;
  background: url('/static/ui/cardback.webp') center / cover no-repeat; box-shadow: inset 0 0 0 3px rgba(var(--tc), .55), 0 12px 30px rgba(0,0,0,.35); }
.ph-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(10,16,30,.72); }
.ph-card > * { position: relative; }
.ph-card .ph-name { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 900; letter-spacing: .1em; }
.ph-card .ph-name.long { font-size: clamp(1rem, 4.2vw, 1.5rem); letter-spacing: .04em; max-width: 82%; text-align: center; line-height: 1.35; }
.ph-card .ph-sub { font-size: .74rem; letter-spacing: .25em; color: rgba(255,255,255,.7); }
.ph-card .ph-note { margin-top: 14px; font-size: .7rem; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); color: rgba(255,255,255,.75); }

/* ---------- 弹层 / toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-end; justify-content: center; }
.sheet-mask { position: absolute; inset: 0; background: rgba(20,26,46,.5); }
.sheet-box { position: relative; width: 100%; max-width: 520px; background: #fff; border-radius: 24px 24px 0 0; padding: 22px 20px calc(20px + var(--sab)); display: flex; flex-direction: column; gap: 12px; animation: sheet-up .3s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-box { border-radius: 24px; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-box h3 { font-size: 1.05rem; font-weight: 900; }
.odds { width: 100%; border-collapse: collapse; font-size: .84rem; text-align: center; }
.odds th, .odds td { padding: 8px 4px; border-bottom: 1px solid var(--line); } .odds th { color: var(--tx2); font-weight: 800; } .odds td:first-child { text-align: left; font-weight: 700; }
.odds th:nth-child(2) { color: rgb(var(--c-common)); } .odds th:nth-child(3) { color: rgb(var(--c-rare)); } .odds th:nth-child(4) { color: rgb(var(--c-epic)); } .odds th:nth-child(5) { color: rgb(var(--c-legend)); }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--sab) + 16px); transform: translateX(-50%) translateY(20px); z-index: 200; padding: 10px 18px; border-radius: 999px; background: var(--tx); color: #fff; font-size: .82rem; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s; white-space: nowrap; box-shadow: var(--shadow-l); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 760px) { #toast { bottom: 28px; } }
/* 注音 */
ruby rt { font-size: .55em; color: var(--tx2); }
.orig-text ruby rt, .co-info ruby rt { color: #F2C66B; }
body.no-pinyin rt { display: none; }
.hc { --kf: .4; }

/* ---------- 二级页 页头 (结构; 皮肤见 pocket.css) ---------- */
.l2-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 4px; position: relative; min-height: 56px; }
.l2-title { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-weight: 900; font-size: 1.15rem; letter-spacing: .12em; }
.l2-title small { font-size: .62rem; letter-spacing: .1em; font-weight: 700; }
.l2-back { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; }
.l2-back:active { transform: translateY(-50%) scale(.92); }
body.in-l2 .view.active { animation: l2-in .28s ease-out both; }
@keyframes l2-in { from { opacity: 0; transform: translateY(6px); } }
body.in-l2 .page-h { display: none; }
body.in-l2 .set-row > span { flex: 1; }
body.in-l2 .card-panel > header .sub { max-width: 55%; text-align: right; }

/* ===================== 卡包轮播 (井上飘, 参照用户示意图) ===================== */
.pack-carousel { transform: translate(-50%, -100%); width: 78%; height: 0; z-index: 6; pointer-events: none; }
.pack-ring { position: absolute; left: 50%; bottom: 0; width: 0; height: 0; pointer-events: auto; }
.pack-ring .pc { position: absolute; left: 0; bottom: 0; width: calc(var(--scene-w, 390px) * .21); aspect-ratio: 1115 / 1683; object-fit: contain; cursor: pointer; -webkit-tap-highlight-color: transparent;
  --ak: calc(var(--k) * var(--k)); /* |k| 近似 */
  transform: translateX(calc(-50% + var(--k) * 58%)) translateY(calc(min(var(--ak), 4) * 5%)) scale(calc(1 - min(var(--ak), 4) * .16)); z-index: calc(10 - var(--ak));
  filter: brightness(calc(1 - min(var(--ak), 2) * .2)) saturate(calc(1 - min(var(--ak), 2) * .25)) drop-shadow(0 18px 18px rgba(0,0,0,.45)); transition: transform .38s cubic-bezier(.2,.9,.3,1), filter .38s; animation: pack-float 3.4s ease-in-out infinite; }
.pack-ring .pc.on { animation: pack-float-on 3.4s ease-in-out infinite; }
@keyframes pack-float { 50% { margin-bottom: 6px; } }
@keyframes pack-float-on { 50% { margin-bottom: 12px; } }
.pack-carousel.ready .pc.on { filter: drop-shadow(0 18px 18px rgba(0,0,0,.45)) drop-shadow(0 0 16px rgba(120,235,255,.75)); }
.pack-carousel .pack-arrow { pointer-events: auto; position: absolute; bottom: calc(var(--scene-w, 390px) * .21 * 1683 / 1115 * .35); width: 34px; height: 34px; border-radius: 50%; color: #F3E6C8; font-size: 1.4rem; font-weight: 900; line-height: 30px; text-align: center; background: none center / 100% 100% no-repeat; color: #3a3129; filter: drop-shadow(0 3px 5px rgba(0,0,0,.45)); z-index: 12; }
.pack-carousel .pack-arrow.left { left: -14%; } .pack-carousel .pack-arrow.right { right: -14%; }
.pack-carousel .bubble { position: absolute; left: 50%; bottom: calc(var(--scene-w, 390px) * .21 * 1683 / 1115 + 10px); transform: translateX(-50%); width: 112px; height: 56px; padding: 8px 14px 18px; display: flex; align-items: center; justify-content: center; background: none center / 100% 100% no-repeat; color: #2a3a3a; font-size: .8rem; font-weight: 900; white-space: nowrap; letter-spacing: .04em; text-shadow: 0 1px 0 rgba(255,255,255,.6); filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); animation: bubble-float2 2.6s ease-in-out infinite; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; z-index: 13; }
.pack-carousel.ready .bubble { color: #7a4a00; text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 0 8px rgba(255,200,90,.6); }
@keyframes bubble-float2 { 50% { transform: translateX(-50%) translateY(-6px); } }
body.scene-wide .pack-ring .pc { width: calc(var(--scene-w, 390px) * .11); } body.scene-wide .pack-carousel .bubble { bottom: calc(var(--scene-w, 390px) * .11 * 1683 / 1115 + 10px); } body.scene-wide .pack-carousel .pack-arrow { bottom: calc(var(--scene-w, 390px) * .11 * 1683 / 1115 * .35); }

/* ===================== RITE v7 舞台特效 ===================== */
/* 阶段 2 漏光: 撕口一线光 → 档位越高越强; SSR 透出剪影 */
.tear-leak { position: absolute; left: 4%; right: 4%; top: 7.5%; height: 6%; border-radius: 50%; pointer-events: none; opacity: 0; filter: blur(5px); mix-blend-mode: screen; background: radial-gradient(ellipse, #fff 0%, rgba(var(--rc), 1) 18%, rgba(var(--rc), .5) 50%, transparent 75%); z-index: 5; }
.tear-leak.g-common { animation: leak-r .45s ease-out both; }
.tear-leak.g-rare { animation: leak-sr .7s ease-out both; }
.tear-leak.g-epic { animation: leak-ssr 1.4s ease-out both; }
.tear-leak.g-legend { --rc: 255,205,90; animation: leak-ur 1.2s ease-out both; }
@keyframes leak-r { 0% { opacity: 0; transform: scaleX(.3); } 40% { opacity: .7; transform: scaleX(1); } 100% { opacity: 0; } }
@keyframes leak-sr { 0% { opacity: 0; transform: scaleX(.3); } 30% { opacity: 1; transform: scaleX(1.1) scaleY(1.6); } 100% { opacity: .2; transform: scaleX(1) scaleY(1); } }
@keyframes leak-ssr { 0% { opacity: 0; transform: scaleX(.3); } 20% { opacity: 1; transform: scaleX(1.2) scaleY(2); } 60% { opacity: 1; transform: scaleX(1.4) scaleY(3); } 100% { opacity: .3; } }
@keyframes leak-ur { 0% { opacity: 0; transform: scaleX(.3); } 15% { opacity: 1; transform: scaleX(1.3) scaleY(2.5); } 100% { opacity: 1; transform: scaleX(1.6) scaleY(5); } }
/* SSR: 光从内部打透包体, 显出兽的剪影 */
.tear-wrap.swell::before { content: ''; position: absolute; left: 50%; top: 20%; width: 80%; aspect-ratio: 1; transform: translateX(-50%); background: var(--sil) center / contain no-repeat; filter: brightness(0) invert(1) blur(2px) drop-shadow(0 0 16px rgba(var(--rc), 1)); opacity: 0; mix-blend-mode: screen; animation: sil-in 1.4s ease-out both; z-index: 6; pointer-events: none; }
@keyframes sil-in { 0%, 25% { opacity: 0; transform: translateX(-50%) scale(.85); } 65% { opacity: .9; transform: translateX(-50%) scale(1.02); } 100% { opacity: .75; transform: translateX(-50%) scale(1); } }
/* 包体: SR 一鼓 / SSR 膨胀 / UR 膨胀+裂纹+抖动+消失 */
.tear-wrap.puff { animation: puff .3s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes puff { 0%,100% { transform: perspective(1000px) rotateX(4deg) scale(1); } 50% { transform: perspective(1000px) rotateX(4deg) scale(1.05); } }
.tear-wrap.swell { animation: swell .8s cubic-bezier(.2,1.2,.4,1) forwards; }
@keyframes swell { 0% { transform: perspective(1000px) rotateX(4deg) scale(1); } 40% { transform: perspective(1000px) rotateX(4deg) scale(1.1) translateY(-1.5%); filter: drop-shadow(0 30px 40px rgba(0,0,0,.5)) brightness(1.12); } 70% { transform: perspective(1000px) rotateX(4deg) scale(1.07) translateY(-1%); } 100% { transform: perspective(1000px) rotateX(4deg) scale(1.13) translateY(-1.5%); filter: drop-shadow(0 30px 40px rgba(0,0,0,.5)) brightness(1.25); } }
.tear-wrap.crack::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 6; mix-blend-mode: screen; opacity: 0; animation: crack 1.2s ease-out .3s forwards;
  background: linear-gradient(112deg, transparent 46%, #fff3c4 48.5%, transparent 51%), linear-gradient(64deg, transparent 30%, #ffd77a 32%, transparent 34.5%), linear-gradient(148deg, transparent 60%, #ffd77a 62%, transparent 64.5%), linear-gradient(98deg, transparent 70%, #fff3c4 71.5%, transparent 73%), linear-gradient(80deg, transparent 18%, #ffd77a 19.5%, transparent 21%); -webkit-mask: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); mask: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); filter: drop-shadow(0 0 10px rgba(255,200,90,1)) drop-shadow(0 0 22px rgba(255,180,60,.8)); }
@keyframes crack { 0% { opacity: 0; -webkit-mask-size: 100% 0%; mask-size: 100% 0%; } 100% { opacity: 1; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; } }
.tear-wrap.crack::after { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.tear-wrap.shake { animation: shake .5s linear both; --sw: 1.13; }
@keyframes shake { 0%,100% { transform: perspective(1000px) rotateX(4deg) scale(1.13) translate(0,-1.5%); } 10% { transform: perspective(1000px) rotateX(4deg) scale(1.14) translate(-4px, calc(-1.5% + 2px)); } 20% { transform: perspective(1000px) rotateX(4deg) scale(1.13) translate(5px, calc(-1.5% - 2px)); } 30% { transform: perspective(1000px) rotateX(4deg) scale(1.15) translate(-6px, -1.5%); } 40% { transform: perspective(1000px) rotateX(4deg) scale(1.14) translate(6px, calc(-1.5% + 3px)); } 50% { transform: perspective(1000px) rotateX(4deg) scale(1.16) translate(-5px, calc(-1.5% - 3px)); } 60% { transform: perspective(1000px) rotateX(4deg) scale(1.15) translate(5px, -1.5%); } 70% { transform: perspective(1000px) rotateX(4deg) scale(1.17) translate(-4px, -1.5%); } 80% { transform: perspective(1000px) rotateX(4deg) scale(1.16) translate(3px, -1.5%); } 90% { transform: perspective(1000px) rotateX(4deg) scale(1.18) translate(-2px, -1.5%); } }
.tear-leak.fade { animation: none !important; opacity: 0 !important; transition: opacity .6s; }
.tear-wrap.gone .tear-pack, .tear-wrap.gone .tear-cap, .tear-wrap.gone .tear-strip, .tear-wrap.gone .tear-progress, .tear-wrap.gone::after { opacity: 0 !important; animation: none !important; }
.tear-shards { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.tear-shards i { position: absolute; inset: 0; background: center / 100% 100% no-repeat; animation: shard .9s cubic-bezier(.2,.8,.4,1) forwards; filter: drop-shadow(0 0 10px rgba(255,200,90,.9)); }
@keyframes shard { 0% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rz)) scale(1.15); } }
/* 舞台档位环境: SSR 压暗 / UR 黑场 */
#stage.g-epic::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.4); pointer-events: none; z-index: 1; animation: fade-in .6s both; }
#stage.blackout::after { content: ''; position: absolute; inset: 0; background: #000; z-index: 60; pointer-events: none; }
@keyframes fade-in { from { opacity: 0; } }
/* 七属性全屏粒子 */
.fx-elem { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .3s; mix-blend-mode: screen; }
#stage > .st, #stage > .stage-skip, #stage > .stage-hint, #stage > #st-result { position: relative; z-index: 2; }
#stage > .st { position: absolute; }
.fx-elem.on { opacity: 1; }
/* 兽跃出 */
.leap { position: fixed; left: var(--x); top: var(--y); width: 0; height: 0; z-index: 55; pointer-events: none; }
.leap img { position: absolute; left: 0; top: 0; width: min(84vw, 62vh); transform: translate(-50%, -60%) scale(.3); opacity: 0; filter: drop-shadow(0 0 30px rgba(var(--rc), .9)) drop-shadow(0 20px 30px rgba(0,0,0,.6)); animation: leap-up 1.2s cubic-bezier(.2,1.3,.3,1) forwards; }
.leap.g-legend img { width: min(90vw, 70vh); animation-duration: 1.6s; }
.leap.back img { animation: leap-back .4s ease-in forwards; }
@keyframes leap-up { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.3); } 30% { opacity: 1; transform: translate(-50%, -78%) scale(1.08); } 45% { transform: translate(-50%, -72%) scale(1); } 100% { opacity: 1; transform: translate(-50%, -75%) scale(1.02); } }
@keyframes leap-back { to { opacity: 0; transform: translate(-50%, -45%) scale(.25); } }
.leap::before { content: ''; position: absolute; left: 0; top: 0; width: min(90vw, 70vh); aspect-ratio: 1; transform: translate(-50%, -75%); border-radius: 50%; background: radial-gradient(circle, rgba(var(--rc), .55), transparent 60%); filter: blur(10px); mix-blend-mode: screen; animation: fade-in .4s both; }
/* R / SR 翻面后的情绪 */
/* R / SR 情绪价值: 光环放在 .dk 层 (face 有 overflow:hidden 会裁掉), 星屑在正面内 */
.dk .pop-ring { position: absolute; inset: -5%; border-radius: 6% / 4.5%; pointer-events: none; z-index: 12; opacity: 0; border: 2px solid rgba(var(--ec, 255,240,200), .95); box-shadow: 0 0 22px rgba(var(--ec, 255,240,200), .8), 0 0 60px rgba(var(--ec, 255,240,200), .35), inset 0 0 22px rgba(var(--ec, 255,240,200), .4); }
.dk.pop-r .pop-ring { animation: pop-ring .8s ease-out both; }
.dk.pop-sr .pop-ring { animation: pop-ring 1.1s ease-out both; border-width: 3px; }
.dk.pop-sr .pop-ring::after { content: ''; position: absolute; inset: -14%; border-radius: inherit; border: 1.5px solid rgba(var(--ec), .6); animation: pop-ring2 1.1s ease-out both; }
@keyframes pop-ring { 0% { opacity: 0; transform: scale(.92); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.12); } }
@keyframes pop-ring2 { 0% { opacity: 0; transform: scale(.9); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(1.25); } }
.dk.pop-sr .glow { animation: glow-pulse 1.1s ease-out both; background: radial-gradient(circle, rgba(var(--ec), .85), transparent 62%); }
@keyframes glow-pulse { 0% { opacity: .2; transform: scale(.9); } 35% { opacity: 1; transform: scale(1.15); } 100% { opacity: .7; transform: scale(1); } }
.dk.pop-r .face.front::before, .dk.pop-sr .face.front::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 9; opacity: 0; animation: pop-stars .9s ease-out both;
  background: radial-gradient(circle at 20% 30%, #fff 0 2px, transparent 3px), radial-gradient(circle at 80% 20%, #fff 0 2px, transparent 3px), radial-gradient(circle at 70% 80%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 30% 75%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 50% 10%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 12% 55%, rgba(var(--ec),1) 0 1.5px, transparent 2.5px), radial-gradient(circle at 88% 60%, rgba(var(--ec),1) 0 1.5px, transparent 2.5px); }
.dk.pop-sr .face.front::before { background-size: 100% 100%; filter: drop-shadow(0 0 4px rgba(var(--ec), .9)); }
@keyframes pop-stars { 0% { opacity: 0; transform: scale(.9); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.06) translateY(-4%); } }

/* ===== 经济 v1: 市集 6 格 / 选择弹层 / 香点燃态 ===== */
.ni-pack { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14a1 1 0 0 1 1 1v3H4V4a1 1 0 0 1 1-1zm-1 6h16v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9zm5 3v2h6v-2H9z'/%3E%3C/svg%3E"); }
.ni-jade { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Crect x='9.5' y='5' width='5' height='2' fill='%23000' opacity='.35'/%3E%3Crect x='9.5' y='9' width='5' height='2' fill='%23000' opacity='.35'/%3E%3Crect x='9.5' y='13' width='5' height='2' fill='%23000' opacity='.35'/%3E%3C/svg%3E"); }
.ni-star { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.6 7.1.7-5.4 4.8 1.6 7L12 17.4 5.8 21l1.6-7L2 9.3l7.1-.7z'/%3E%3C/svg%3E"); }
.ni-lure { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10l-1 4H8zM6 7h12v13a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2zm4 3v7h4v-7z'/%3E%3C/svg%3E"); }
.ni-seal { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M7 7h10v10H7z' fill='%23000' opacity='.35'/%3E%3Cpath d='M9 9h6v2H9zm0 4h6v2H9z' fill='%23fff'/%3E%3C/svg%3E"); }
.res.lit .ni { color: #FF9A3C; filter: drop-shadow(0 0 5px rgba(255,154,60,.9)); animation: incense-glow 1.6s ease-in-out infinite; }
@keyframes incense-glow { 50% { filter: drop-shadow(0 0 10px rgba(255,190,80,1)); } }
.shop-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.shop-bag { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-bag .chip { padding: 5px 11px; font-size: .74rem; }
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
.shop-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 46px 16px 18px; border-radius: 14px; background: none center / cover; box-shadow: var(--shadow); text-align: center; transition: transform .18s; min-height: 168px; }
.shop-item::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; border: 20px solid transparent; border-image: none 105 / 20px round; pointer-events: none; z-index: 0; }
.shop-item > * { position: relative; z-index: 1; }
.shop-item:hover { transform: translateY(-3px); }
.shop-item.off { filter: saturate(.4); opacity: .78; }
.shop-item .si-ic { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; color: var(--gold); filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.shop-item .si-n { font-size: 1.02rem; font-weight: 900; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; letter-spacing: .08em; }
.shop-item .si-s { font-size: .68rem; color: var(--tx2); line-height: 1.35; min-height: 2.7em; }
.shop-item .si-cost { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 5px 14px; border-radius: 999px; background: linear-gradient(90deg, #FFF4D6, #FFE9B0); color: #7A5A1E; font-weight: 900; font-size: .9rem; font-variant-numeric: tabular-nums; }
.shop-item .si-cost .ni { width: 13px; height: 13px; color: #B8860B; }
.shop-item .si-lim { position: absolute; top: 10px; right: 12px; font-size: .62rem; color: var(--tx2); background: rgba(255,255,255,.7); padding: 2px 7px; border-radius: 999px; }
.hint.center { text-align: center; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; margin: 12px 0 14px; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r16); background: var(--bg); text-align: left; font-size: .82rem; font-weight: 700; }
.pick:hover { background: #EEF6F8; }
.pick img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.pick .pick-dot { width: 14px; height: 14px; border-radius: 50%; background: rgb(var(--ec)); flex: 0 0 14px; }
.chip.ok { background: #E6F7EC; color: #1F7A45; } .chip.no { background: #FBEAEA; color: #A33; }
.btn-ghost.sm { height: 34px; padding: 0 14px; font-size: .82rem; }
.quiz-stat .lit { color: #C25A11; font-weight: 800; }
@media (min-width: 760px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== 底栏中钮双面: 山海界 ⇄ 征途 (翻牌) ===== */
.nav-mid { perspective: 400px; }
.nav-mid > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 6px; backface-visibility: hidden; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s; }
.nav-mid .f-home { transform: rotateX(0); } .nav-mid .f-journey { transform: rotateX(180deg); color: #8B2E1E; }
.nav-mid.to-journey .f-home { transform: rotateX(-180deg); } .nav-mid.to-journey .f-journey { transform: rotateX(0); }
.nav-mid.to-journey.active { text-shadow: 0 1px 0 rgba(255,255,255,.75), 0 0 8px rgba(255,140,90,.45); }
.home-stone { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 10px; padding: 6px 14px 6px 10px; border-radius: 999px; background: none center / 100% 100% no-repeat; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-weight: 900; letter-spacing: .12em; color: #3a3129; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.home-stone .ni { width: 16px; height: 16px; color: #1b8aa3; }
.ni-well { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 20h18v2H3zM5 18h14v-2H5zm1-4h12v-2H6zm6-12l7 7H5z'/%3E%3C/svg%3E"); }
.journey-teaser .hint { line-height: 1.7; margin: 6px 0 12px; }

/* ===== 排兵页 (擂台战前): 3 上场 + 2 替补, 点两张交换, 兽录候选换人 ===== */
.sheet-box.lineup { gap: 8px; max-height: 88vh; overflow-y: auto; background: #F7F1E4; }
.sheet-box.lineup h3 { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; letter-spacing: .12em; }
.line-side { display: flex; align-items: center; gap: 8px; }
.line-lab { writing-mode: vertical-rl; font-size: .7rem; font-weight: 900; letter-spacing: .2em; color: var(--tx2); flex: 0 0 auto; }
.line-row { display: flex; gap: 6px; flex: 1; }
.ls { position: relative; flex: 1; aspect-ratio: 5/7; border-radius: 10px; overflow: hidden; border: 2px solid rgba(var(--tc), .9); background: #1a1d26; box-shadow: 0 3px 8px rgba(0,0,0,.18); transition: transform .15s, box-shadow .15s; }
.ls.bench { flex: .78; opacity: .85; align-self: flex-end; }
.ls.sel { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0,0,0,.25); }
.ls-img { position: absolute; inset: 0; background: center / cover; }
.ls-el { position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(var(--ec), .95); color: #fff; font-size: .6rem; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.ls-nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 3px; font-size: .62rem; font-weight: 800; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-pw { position: absolute; right: 4px; top: 4px; font-size: .58rem; font-weight: 900; color: #FFE9B0; text-shadow: 0 1px 0 #000; font-family: system-ui; }
.ls-tag { position: absolute; left: 50%; top: 32%; translate: -50% 0; font-size: .58rem; font-weight: 900; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,.55); color: #ddd; }
.ls-tag.on { background: var(--cinn); color: #fff; }
.ls.mini { flex: 0 0 56px; }
.line-vs { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 900; color: var(--tx2); font-family: system-ui; }
.line-vs b:first-child { color: #1e8f86; } .line-vs b:last-child { color: var(--cinn); }
.line-vs i { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #3fc9b8 0 var(--p, 50%), #E4573D var(--p, 50%)); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.line-pool { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.line-btns { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.line-btns .chip.ready { padding: 10px 26px; font-size: .95rem; }

/* ===== 征途: 行粮 HUD + 卷 tab + 山径卷轴 ===== */
.jn-hud { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.jn-hud .chip { padding: 6px 12px; font-size: .8rem; }
.jn-food small { margin-left: 6px; font-size: .66rem; color: #9a7a3a; font-weight: 700; }
.jn-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.jn-tab { flex: 0 0 auto; padding: 8px 14px; border-radius: 10px; background: none center / 100% 100% no-repeat; color: #2b2118; font-size: .78rem; font-weight: 900; letter-spacing: .06em; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); opacity: .8; }
.jn-tab.on { background-image: none; opacity: 1; color: #EFE1BF; }
.jn-tab.lock { opacity: .45; }
.jn-scroll { position: relative; padding: 10px 8px 30px; }
.jn-scroll::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; translate: -50% 0; background: repeating-linear-gradient(180deg, rgba(239,225,191,.55) 0 10px, transparent 10px 18px); border-radius: 2px; }
.jn-node { position: relative; display: flex; align-items: center; gap: 12px; margin: 0 0 18px; width: 58%; }
.jn-node:nth-child(odd) { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.jn-node::before { content: ''; position: absolute; top: 50%; width: 22px; height: 3px; background: rgba(239,225,191,.55); }
.jn-node:nth-child(even)::before { right: -22px; } .jn-node:nth-child(odd)::before { left: -22px; }
.jn-stele { flex: 0 0 auto; width: 74px; height: 92px; padding-bottom: 14px; background: none center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-weight: 900; font-size: .92rem; letter-spacing: .12em; color: #EFE1BF; text-shadow: 0 1px 0 #000; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); position: relative; }
.jn-node.lock .jn-stele { background-image: none; color: rgba(239,225,191,.45); }
.jn-node.god .jn-stele { width: 92px; height: 116px; font-size: 1.05rem; color: #FFD166; }
.jn-node.cur .jn-stele { animation: jnPulse 1.4s ease-in-out infinite alternate; }
@keyframes jnPulse { to { filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)) drop-shadow(0 0 14px rgba(255,220,140,.9)); } }
.jn-stars { position: absolute; bottom: 6px; left: 50%; translate: -50% 0; writing-mode: horizontal-tb; display: flex; gap: 1px; font-size: .6rem; letter-spacing: 0; line-height: 1; }
.jn-stars i { color: rgba(0,0,0,.4); font-style: normal; } .jn-stars i.on { color: #FFD166; text-shadow: 0 0 4px rgba(255,200,80,.8); }
.jn-info { min-width: 0; }
.jn-info b { display: block; font-size: .8rem; color: #EFE1BF; text-shadow: 0 1px 0 #000; }
.jn-info .hint { color: rgba(239,225,191,.7); font-size: .68rem; line-height: 1.4; }
.jn-beasts { display: flex; gap: 3px; margin-top: 4px; }
.jn-node:nth-child(odd) .jn-beasts { justify-content: flex-end; }
.jn-beasts i { width: 22px; height: 30px; border-radius: 3px; background: center / cover; box-shadow: 0 1px 3px rgba(0,0,0,.5); display: block; }
.jn-beasts i.unk { background: rgba(20,16,12,.7); box-shadow: inset 0 0 0 1px rgba(239,225,191,.35), 0 1px 3px rgba(0,0,0,.5); position: relative; }
.jn-beasts i.unk::after { content: '?'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(239,225,191,.7); font-size: .7rem; font-weight: 900; font-style: normal; }
/* 山 sheet */
.sheet-box.mount { background: #F7F1E4; gap: 10px; }
.sheet-box.mount h3 { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; letter-spacing: .14em; font-size: 1.2rem; }
.mt-orig { font-family: "Songti SC","STSong",serif; font-size: .8rem; line-height: 1.7; color: #4a3a2a; margin: 0; max-height: 96px; overflow-y: auto; }
.mt-beasts { display: flex; gap: 8px; }
.mt-beasts .ls { flex: 0 0 64px; }
.mt-beasts .ls.unk .ls-img { filter: grayscale(1) brightness(.4); }
.mt-waves { display: flex; gap: 8px; }
.mt-wave { flex: 1; padding: 8px 6px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); text-align: center; font-size: .72rem; font-weight: 800; color: var(--tx2); }
.mt-wave.done { background: #ECFDF3; color: #15803d; } .mt-wave.god { color: #C98A12; }
.mt-wave b { display: block; font-size: 1rem; color: var(--tx); }

/* ===== kit2 · nano 生成 3D 图标 (UIKIT_SPEC_v1 §2.4) — 覆盖 .ni 的单色 mask, 改为全彩图 ===== */
.ni.ni-hour, .ni.ni-slip, .ni.ni-jade, .ni.ni-star, .ni.ni-seal, .ni.ni-pack, .ni.ni-well, .ni.ni-food, .ni.ni-mask, .ni.ni-axes, .ni.ni-cave, .ni.ni-banner, .ni.ni-loom, .ni.ni-bell, .ni.ni-ring, .ni.ni-stardust, .ni.ni-lure { background: var(--i) center / contain no-repeat; -webkit-mask: none; mask: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.ni-hour  { --i: url(/static/ui/kit2/icon_incense.webp); }
.ni-slip  { --i: url(/static/ui/kit2/icon_slip.webp); }
.ni-jade  { --i: url(/static/ui/kit2/icon_jade.webp); }
.ni-star  { --i: url(/static/ui/kit2/icon_star.webp); }
.ni-stardust { --i: url(/static/ui/kit2/icon_stardust.webp); }
.ni-seal  { --i: url(/static/ui/kit2/icon_seal.webp); }
.ni-pack  { --i: url(/static/ui/kit2/icon_pack.webp); }
.ni-food  { --i: url(/static/ui/kit2/icon_food.webp); }
.ni-mask  { --i: url(/static/ui/kit2/icon_godmask.webp); }
.ni-axes  { --i: url(/static/ui/kit2/icon_axes.webp); }
.ni-cave  { --i: url(/static/ui/kit2/icon_cave.webp); }
.ni-banner{ --i: url(/static/ui/kit2/icon_banner.webp); }
.ni-loom  { --i: url(/static/ui/kit2/icon_loom.webp); }
.ni-bell  { --i: url(/static/ui/kit2/icon_bell.webp); }
.ni-ring  { --i: url(/static/ui/kit2/icon_ring.webp); }
.ni-well  { --i: url(/static/ui/kit2/icon_cave.webp); }
.ni-lure  { --i: url(/static/ui/kit2/icon_ring.webp); }  /* 引兽符暂用玉戒, 待重生成 (首批符纸出字被弃) */
.res .ni { color: transparent; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); width: 20px; height: 20px; }
.chip .ni { width: 18px; height: 18px; }

/* ---------- 结构残留 (皮肤见 pocket.css) ---------- */
#mt-incense { align-self: flex-start; }

/* 征途节点 / 山 sheet 残留 */
.jn-mile { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; font-size: .68rem; color: #5a7a7a; letter-spacing: .08em; margin-bottom: 2px; }
.jn-node.done .jn-stele { filter: saturate(.7) brightness(.92); }
.jn-beasts i.godm, .ls-img.godm { background: url(/static/ui/kit2/icon_godmask.webp) center / 78% no-repeat !important; }
.jn-tabs { overflow-x: auto; scrollbar-width: none; } .jn-tabs::-webkit-scrollbar { display: none; }
.ls.god .ls-img { background-color: rgba(var(--ec), .25); }
#mt-cost b.ok { color: #1F7A45; } #mt-cost b.low { color: #D9553C; }
.line-bond { display: flex; flex-wrap: wrap; gap: 6px; } .line-bond .bond { font-size: .72rem; padding: 4px 12px 6px; font-weight: 700; } .line-bond .bond b { font-family: "Songti SC","STSong","Noto Serif CJK SC",serif; letter-spacing: .08em; margin-right: 6px; }
