:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --text: #fff8ec;
  --muted: #d6cab9;
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(12, 12, 16, 0.74);
  --panel-strong: rgba(16, 16, 22, 0.92);
  --gold: #f4c98f;
  --gold-deep: #bb7b3d;
  --warm: #ffdec1;
  --mint: #a7f0db;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { background: #050507; color: var(--text); overflow: hidden; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }

.shell, .stage-view {
  width: 100vw;
  height: 100svh;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  background: #050507;
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 8;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
  pointer-events: none;
}

.entry-button, .overlay-close {
  pointer-events: auto;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.34);
  color: #ffefd1;
  backdrop-filter: blur(12px);
}

/* ════ ICP 备案 + 协议链接（Option B：首页隐藏，仅浮层显示）═══
   合规策略：监管要求"可访问"而非"显眼可见"。首页保留沉浸体验，
   用户进入换装/翻牌/收藏任意浮层时，footer 在浮层底部出现。
═══════════════════════════════════════════════════════ */
.legal-footer {
  display: none; /* 默认隐藏 */
  text-align: center;
  /* v1.2.x-14: 回收上次提亮（用户反馈过于显眼），字号 10→9，灰度 0.55→0.38 */
  font-size: 9px;
  line-height: 1.3;
  color: rgba(255,255,255,0.38);
  pointer-events: auto;
  letter-spacing: 0.02em;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.35) 100%);
}
/* v1.2.x-41: 收藏卡详情页 legal-footer 整体隐藏（小程序版不再展示）
   理由：PC landing 页已有独立 ICP/隐私/协议入口完成合规，小程序内不再重复展示。
   DOM 元素保留在 index.html，未来如需开放再启用此规则即可。 */
/*
body:has(#collectionDetail:not(.hidden)) .legal-footer {
  display: block;
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 70;
}
*/
.legal-footer a {
  /* v1.2.x-14: 0.68→0.5 链接也降亮 */
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 2px 4px;
}
.legal-footer a:active { color: rgba(255,255,255,0.8); }
.legal-dot { color: rgba(255,255,255,0.22); margin: 0 2px; }

/* ════ 会员徽章 ════════════════════════════════════════
   两种形态：
   - .is-compact（首页 topbar）：纯圆点图标，极简不抢戏
   - .membership-chip（换装/翻牌等浮层）：图标 + 文字 chip
   两者共享状态 class：is-guest / is-member / is-near-expiry / is-expired
═══════════════════════════════════════════════════════ */

/* ── 紧凑圆点（首页用）─────────────────────────────── */
.membership-badge.is-compact {
  pointer-events: auto;
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.28);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.membership-badge.is-compact:active { transform: scale(0.92); }
.membership-badge.is-compact .vip-icon {
  font-size: 16px;
  line-height: 1;
  color: rgba(255,255,255,0.55);  /* 默认极浅，跟背景几乎融为一体 */
}
.membership-badge.is-compact .vip-text { display: none; } /* 紧凑形态不显示文字 */

/* 紧凑·非会员：极淡，几乎隐形 */
.membership-badge.is-compact.is-guest .vip-icon { color: rgba(255,255,255,0.55); }

/* 紧凑·会员：浅紫，温和不刺眼 */
.membership-badge.is-compact.is-member {
  background: rgba(139,92,246,0.18);
  border-color: rgba(196,163,255,0.30);
}
.membership-badge.is-compact.is-member .vip-icon { color: #d4bfff; }

/* 紧凑·临期：浅紫 + 右下角橙色小点 */
.membership-badge.is-compact.is-near-expiry .vip-dot-warn {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffa05a;
  border: 1.5px solid rgba(20,15,28,0.95);
  box-shadow: 0 0 6px rgba(255,160,90,0.6);
}

/* 紧凑·过期：红色 ring */
.membership-badge.is-compact.is-expired {
  border-color: rgba(255,120,120,0.55);
  background: rgba(255,120,120,0.10);
}
.membership-badge.is-compact.is-expired .vip-icon { color: #ff9b9b; }
.membership-badge.is-compact.is-expired .vip-dot-warn {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6464;
  border: 1.5px solid rgba(20,15,28,0.95);
}

/* v1.2.x-8 关键：覆盖 display:inline-flex 让 [hidden] 属性生效
   Android WeChat WebKit 不会自动让 hidden 覆盖 display:inline-flex，必须显式 !important
   MVP 模式下 HTML 默认 hidden，下面规则确保从头到尾不出现，杜绝 FOUC */
.membership-badge[hidden],
.membership-chip[hidden] {
  display: none !important;
}

/* 默认（非 compact）形态：兼容旧调用 —— 完整 chip */
.membership-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.46);
  color: #cdcdcd;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1.2;
}

/* ── 浮层 chip（换装页等）—— 完整形态 ─────────────── */
.membership-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid rgba(196,163,255,0.40);
  background: rgba(196,163,255,0.10);
  color: #d4c6ff;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
  font-family: inherit;
  line-height: 1.2;
}
.membership-chip:active { transform: scale(0.96); }
.membership-chip .vip-icon { font-size: 14px; color: #c4a3ff; line-height: 1; }
.membership-chip .vip-text { line-height: 1; }

/* chip·非会员：紫色描边 + "开通" CTA */
.membership-chip.is-guest {
  color: #d4c6ff;
  border-color: rgba(196,163,255,0.45);
  background: rgba(196,163,255,0.08);
}

/* chip·会员：紫色实心 */
.membership-chip.is-member {
  background: linear-gradient(135deg, #c4a3ff 0%, #8b5cf6 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(139,92,246,0.35);
}
.membership-chip.is-member .vip-icon { color: #fff; }

/* chip·临期：橙色警示 */
.membership-chip.is-near-expiry {
  background: linear-gradient(135deg, #ffd089 0%, #ffaa5a 100%);
  color: #2a1a08;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(255,170,90,0.40);
}
.membership-chip.is-near-expiry .vip-icon { color: #2a1a08; }

/* chip·过期：红色 */
.membership-chip.is-expired {
  background: rgba(255,140,140,0.14);
  color: #ffb3b3;
  border-color: rgba(255,140,140,0.50);
}
.membership-chip.is-expired .vip-icon { color: #ffb3b3; }



.entry-button, .overlay-close { padding: 0 12px; }


.hero-zone, .media-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-zone.is-long-pressing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(244,201,143,0.22), transparent 62%);
  animation: longPressPulse 850ms linear forwards;
}
@keyframes longPressPulse {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 0.9; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.04); }
}

.idle-image, .action-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── v1.1.x：抖音风格主题切换滑动动画 ── */
/* 上滑切下一主题：old 向上滑出（-100%），new 从底部滑入（100%→0） */
/* 下滑切上一主题：old 向下滑出（100%），new 从顶部滑入（-100%→0） */
@keyframes themeSlideOutUp   { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@keyframes themeSlideOutDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes themeSlideInUp    { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes themeSlideInDown  { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.theme-slide-out-up   { animation: themeSlideOutUp   360ms cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
.theme-slide-out-down { animation: themeSlideOutDown 360ms cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
.theme-slide-in-up    { animation: themeSlideInUp    360ms cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
.theme-slide-in-down  { animation: themeSlideInDown  360ms cubic-bezier(0.25,0.46,0.45,0.94) forwards; }

.action-video {
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 2;
}
.action-video.playing { opacity: 1; }

/* ── 点击即时反馈：idle 图轻弹，让用户知道已响应 ── */
@keyframes respondPulse {
  0%   { transform: scale(1);     opacity: 1; }
  35%  { transform: scale(1.018); opacity: 0.75; }
  100% { transform: scale(1);     opacity: 1; }
}
.idle-image.is-responding {
  animation: respondPulse 320ms cubic-bezier(.22,.68,0,1.2) forwards;
}

/* ── 视频缓冲中：media-frame 右下角小转圈，感知加载不卡 ── */
@keyframes spinLoader { to { transform: rotate(360deg); } }
.media-frame.is-buffering::before {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 48%;
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.75);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  animation: spinLoader 0.65s linear infinite;
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.28), transparent 22%),
    linear-gradient(0deg, rgba(0,0,0,0.8), transparent 36%);
}

.motion-label {
  position: absolute;
  top: max(82px, calc(env(safe-area-inset-top) + 68px));
  right: 14px;
  z-index: 6;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.34);
  color: #fff1d7;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
  backdrop-filter: blur(10px);
}
.motion-label.show { opacity: 1; transform: translateY(0); }

.hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(128px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 56px);
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(0,0,0,0.34);
  color: #fff1d7;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.emotion-ring-wrap {
  display: none !important; /* 隐藏情绪能量环 */
  position: absolute;
  z-index: 6;
  left: 22px;
  right: auto;
  top: max(36px, calc(env(safe-area-inset-top) + 28px));
  bottom: auto;
  transform: none;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.emotion-ring {
  width: 52px;
  height: 52px;
  position: relative;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.22));
}
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.16);
  stroke-width: 7;
}
.ring-fg {
  fill: none;
  stroke: #f3c48d;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 260ms ease, stroke 220ms ease, filter 220ms ease;
}
.emotion-ring.near .ring-fg {
  stroke: #ffb88b;
  filter: drop-shadow(0 0 10px rgba(255, 184, 139, 0.5));
}
.emotion-ring.ultra-near .ring-fg {
  stroke: #ff9a6c;
  filter: drop-shadow(0 0 16px rgba(255, 154, 108, 0.75));
  animation: ringUltraNearPulse 600ms ease-in-out infinite alternate;
}
.emotion-ring.release .ring-fg {
  stroke: #a7f0db;
  filter: drop-shadow(0 0 14px rgba(167, 240, 219, 0.55));
}
.emotion-ring.milestone {
  animation: ringMilestone 320ms cubic-bezier(0.22, 1.4, 0.36, 1);
}
@keyframes ringMilestone {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes ringUltraNearPulse {
  0%   { filter: drop-shadow(0 0 12px rgba(255, 154, 108, 0.6)); }
  100% { filter: drop-shadow(0 0 22px rgba(255, 120, 80, 0.9)); }
}
.ring-core {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}
.ring-title {
  display: none;
}
.ring-core strong {
  font-size: 10px;
  color: #fff1d7;
  letter-spacing: 0.02em;
}
.ring-copy {
  display: none;
}

.control-dock {
  position: absolute;
  z-index: 7;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 18px));
  width: 60px;
  display: grid;
  justify-items: center;
}
.combo-note {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.action-button {
  width: 60px;
  height: 60px;
  min-height: 60px;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  background-color: transparent;
  background-image: url("./icon/action-default.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  appearance: none;
  -webkit-appearance: none;
}
.action-button.active {
  transform: translateY(1px) scale(0.985);
  background-color: transparent;
  background-image: url("./icon/action-pressed.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: #ffffff;
}
.action-button:disabled { opacity: 0.96; }

.message-bubble {
  position: absolute;
  z-index: 8;
  left: 16px;
  /* 顶部距离加大：原 24px → 56px */
  top: max(48px, calc(env(safe-area-inset-top) + 36px));
  bottom: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  width: min(72vw, 270px);
  max-width: min(72vw, 270px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.message-bubble.show {
  opacity: 1;
  transform: translateY(0);
}
.message-panel {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.message-panel p {
  margin: 0;
  color: rgba(255, 222, 193, 0.98);
  font-size: 17px;
  line-height: 1.6;
  text-align: left;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.01em;
  transform: skewX(-8deg);
  text-shadow: 0 2px 10px rgba(0,0,0,0.38);
  white-space: pre-line;     /* 保留 \n 换行 */
}
.message-panel p.typing::after {
  content: "|";
  display: inline-block;
  margin-left: 3px;
  color: rgba(255, 239, 209, 0.96);
  animation: typingCursorBreath 2.4s ease-in-out infinite;
}
@keyframes typingCursorBreath {
  0%, 100% { opacity: 0.28; transform: translateY(0) scaleY(0.94); }
  50% { opacity: 1; transform: translateY(0) scaleY(1.06); }
}

.quick-entry {
  position: absolute;
  z-index: 7;
  left: 0;
  top: max(108px, calc(env(safe-area-inset-top) + 94px));
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.entry-button {
  font-size: 12px;
}
.entry-text-button {
  min-height: 48px;
  min-width: 0;
  width: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 0 14px 14px 0;
  background: rgba(14, 14, 18, 0.42);
  border: 1px solid rgba(255,255,255,0.12);
  border-left: 0;
  box-shadow: 0 8px 18px rgba(0,0,0,0.16);
}
.entry-label {
  color: #ffefd1;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: normal;
  line-height: 1.16;
  text-align: center;
  word-break: break-all;
}
.entry-badge-wrap {
  position: relative;
  display: inline-flex;
}
.entry-float-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 214, 153, 0.96);
  color: #3a240f;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}
.entry-float-badge.bump {
  animation: badgeBump 760ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes badgeBump {
  0% { transform: scale(0.72); box-shadow: 0 0 0 rgba(255, 214, 153, 0); }
  36% { transform: scale(1.28); box-shadow: 0 0 0 8px rgba(255, 214, 153, 0.18); }
  100% { transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.18); }
}
.chance-toast {
  min-width: 88px;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(180deg, rgba(255, 243, 224, 0.98), rgba(255, 224, 182, 0.96));
  color: #442710;
  box-shadow: 0 10px 26px rgba(0,0,0,0.22);
  opacity: 0;
  transform: translateY(10px) scale(0.88);
  transition: opacity 220ms ease, transform 220ms ease;
}
.chance-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.chance-toast-plus {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  animation: plusPulse 780ms cubic-bezier(0.22, 1, 0.36, 1) 1;
}
.chance-toast-text {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
@keyframes plusPulse {
  0% { transform: scale(0.72); opacity: 0.4; }
  30% { transform: scale(1.34); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.overlay-view {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom));
  background: rgba(2,2,4,0.78);
}
.overlay-panel {
  width: min(100%, 460px);
  max-height: 90svh;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}
#gachaView .overlay-panel {
  border: 0;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.82), rgba(7, 8, 12, 0.94));
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ── 抽卡页专属 header ─────────────────────── */
.gacha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  gap: 10px;
}
.gacha-back-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 6px 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.gacha-back-btn:active { background: rgba(255,255,255,0.12); }

.gacha-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gacha-chance-badge,
.gacha-points-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.gacha-chance-badge strong {
  font-size: 18px;
  font-weight: 800;
  color: #ffd8a8;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.gacha-points-badge strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.gacha-topup-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(244, 201, 143, 0.15);
  border: 1px solid rgba(244, 201, 143, 0.28);
  border-radius: 12px;
  padding: 3px 9px;
  margin-left: 2px;
  cursor: pointer;
}
.gacha-topup-btn:active { background: rgba(244, 201, 143, 0.26); }

/* v1.1.x：彻底撑满全屏，不留任何边距/底部空白 */
#themeView {
  padding: 0;
  display: block;
  background: transparent;
}
#themeView .overlay-panel {
  /* absolute 定位 + inset:0 强制覆盖整个 overlay-view（已 position:absolute inset:0），
     比 height:100svh 更稳，规避 Android WebView 上工具栏伸缩留白的问题 */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(8,9,14,0.96) 0%, rgba(14,8,18,0.99) 100%);
}
/* v1.1.x：收藏页跟换装页一样全屏占满，去掉 460px 宽度限制 */
#collectionView {
  padding: 0;
  display: block;
  background: transparent;
}
#collectionView .overlay-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(8,9,14,0.96) 0%, rgba(14,8,18,0.99) 100%);
}
.theme-overlay-panel {
  position: relative;
}
.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.theme-overlay-head {
  align-items: center;
  padding: 8px 14px 6px; /* v1.1.x：紧凑顶栏，给卡片让空间 */
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.theme-overlay-head h2 {
  font-size: 16px;       /* 原 .overlay-head h2 是 20px，这里 #themeView 内压到 16 */
  line-height: 1.2;
  margin: 0;
}
/* v1.2.x-25: 标题字号 20→16，更克制 */
.overlay-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
/* 收藏页：返回在左、标题紧跟，不需要 space-between */
.collection-head {
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.collection-head h2 {
  flex: 1;
  min-width: 0;
}
/* 左侧：返回按钮 + 标题 */
.theme-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
/* 右侧积分 + 充值区 */
.theme-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.theme-pts-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.overlay-sub { color: var(--muted); }
.overlay-close-fixed {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  right: 18px;
  margin-left: 0;
  display: inline-flex;
  z-index: 999;
}
.overlay-close-pill {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(18, 18, 22, 0.32);
  color: rgba(255, 239, 209, 0.92);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(0,0,0,0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.theme-overlay-head h2 {
  margin: 0;
  /* v1.2.x-25: 20→16，与其它 overlay-head 一致 */
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.reveal-box {
  position: relative;
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  row-gap: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(10, 11, 16, 0.9), rgba(10, 11, 16, 0.96));
  padding: 24px 18px 24px;
  overflow: hidden;
}
.reveal-box.revealing {
  animation: revealPulse 0.8s ease;
}
@keyframes revealPulse {
  0% { opacity: 0.82; transform: scale(0.992); }
  100% { opacity: 1; transform: scale(1); }
}
.reveal-result {
  width: 100%;
  display: grid;
  gap: 12px;
  text-align: center;
  position: relative;
  z-index: 3;
}
.reveal-result strong { font-size: 24px; }
.polaroid-reveal {
  /* 与 reveal-placeholder 共享 grid row 1 */
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  display: grid;
  place-items: center;
  perspective: 2200px;
}
.polaroid-card {
  width: min(82vw, 318px);
  aspect-ratio: 0.66;
  opacity: 0;
  transform: translateY(22px) scale(0.9);
}
.polaroid-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}
.polaroid-card.is-tilted {
  /* v1.1.x：去掉 -3deg 倾斜，避免卡上的标题/副标语跟着倾斜，影响阅读 */
  transform: translateY(0) scale(1);
}
.polaroid-card.is-flipping .polaroid-card-inner,
.polaroid-card.is-revealed .polaroid-card-inner {
  transform: rotateY(180deg);
}
.polaroid-card.is-collected {
  animation: polaroidCollect 880ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes polaroidCollect {
  0%   { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotate(-1deg); }
  30%  { opacity: 1; transform: translate3d(calc(var(--fly-x, 118px) * 0.12), calc(var(--fly-y, -168px) * 0.08), 0) scale(0.96) rotate(2deg); }
  100% { opacity: 0; transform: translate3d(var(--fly-x, 118px), var(--fly-y, -168px), 0) scale(0.32) rotate(9deg); }
}
.polaroid-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--flip-duration, 640ms) cubic-bezier(0.22, 1, 0.36, 1);
}

/* anticipation glow on rare/hidden card back, before flip starts */
.polaroid-card[data-rarity="rare"] .polaroid-back {
  animation: anticipationGold 1.4s ease-in-out infinite;
}
.polaroid-card[data-rarity="hidden"] .polaroid-back {
  animation: anticipationPurple 1.4s ease-in-out infinite;
}
.polaroid-card.is-flipping .polaroid-back,
.polaroid-card.is-revealed .polaroid-back {
  animation: none;
}
@keyframes anticipationGold {
  0%, 100% { box-shadow: 0 22px 44px rgba(0,0,0,0.34), 0 0 0 1px rgba(244, 201, 143, 0), 0 0 18px rgba(244, 201, 143, 0); }
  50%      { box-shadow: 0 22px 44px rgba(0,0,0,0.34), 0 0 0 1.5px rgba(244, 201, 143, 0.5), 0 0 38px rgba(244, 201, 143, 0.55); }
}
@keyframes anticipationPurple {
  0%, 100% { box-shadow: 0 22px 44px rgba(0,0,0,0.34), 0 0 0 1px rgba(216, 169, 255, 0), 0 0 22px rgba(216, 169, 255, 0); }
  50%      { box-shadow: 0 22px 44px rgba(0,0,0,0.34), 0 0 0 1.5px rgba(216, 169, 255, 0.55), 0 0 44px rgba(216, 169, 255, 0.62); }
}
.polaroid-face {
  position: absolute;
  inset: 0;
  /* v1.2.x-15: 圆角 24→14 更克制 */
  border-radius: 14px;
  backface-visibility: hidden;
}
.polaroid-back {
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(160, 110, 255, 0.5);
  background:
    radial-gradient(ellipse at 50% 38%, rgba(110, 60, 220, 0.72) 0%, rgba(80, 30, 180, 0.28) 40%, transparent 68%),
    radial-gradient(ellipse at 15% 12%, rgba(90, 50, 200, 0.3) 0%, transparent 45%),
    linear-gradient(148deg, rgba(30, 14, 58, 1) 0%, rgba(14, 8, 32, 1) 100%);
  box-shadow: 0 22px 44px rgba(0,0,0,0.5), 0 0 0 1px rgba(140, 90, 255, 0.15), inset 0 1px 0 rgba(200, 160, 255, 0.12);
}
.polaroid-back::before {
  content: "";
  position: absolute;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(160, 110, 255, 0.35);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
  box-shadow: 0 0 18px rgba(130, 80, 255, 0.18) inset;
}
.polaroid-back::after {
  content: "";
  position: absolute;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(180, 140, 255, 0.28);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
}
.polaroid-back-mark {
  position: relative;
  z-index: 1;
  color: rgba(220, 195, 255, 0.95);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-shadow: 0 0 24px rgba(160, 100, 255, 0.85), 0 0 8px rgba(140, 80, 255, 0.6), 0 2px 6px rgba(0,0,0,0.6);
  transform: translateY(16%);
}
.polaroid-front {
  padding: 0;
  /* v1.2.x-28: 去深色 fallback bg — 之前 photo 圆角 24 / 卡片圆角 14 不匹配，
     深色 bg 在四角缝隙里露出，看起来像额外一圈外框。photo 圆角统一 inherit 后也用不上 bg */
  background: transparent;
  box-shadow: 0 24px 48px rgba(0,0,0,0.34);
  transform: rotateY(180deg);
  overflow: hidden;
}
.polaroid-front::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;  /* v1.2.x-15: 与 polaroid-face 同步 */
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255,255,255,0.06), transparent 28%, transparent 72%, rgba(255,255,255,0.04));
}
.polaroid-photo {
  position: relative;
  width: 100%;
  height: 100%;
  /* v1.2.x-28: 圆角 24→inherit (= polaroid-face 的 14px)，消除四角缝隙 */
  border-radius: inherit;
  background-color: #120d0b;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.polaroid-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 10, 0.18), rgba(12, 10, 10, 0.36) 100%);
  opacity: 1;
  transition: opacity 760ms ease;
}
.polaroid-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(16, 12, 11, 0.18);
  opacity: 1;
  transition: opacity 1100ms ease, backdrop-filter 1100ms ease, -webkit-backdrop-filter 1100ms ease;
}
.polaroid-photo.is-developed {
  animation: photoDevelop var(--develop-duration, 1100ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.polaroid-photo[data-rarity="surprise"].is-developed {
  animation: photoDevelopSurprise var(--develop-duration, 1100ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.polaroid-photo[data-rarity="rare"].is-developed {
  animation: photoDevelopRare var(--develop-duration, 1500ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.polaroid-photo[data-rarity="hidden"].is-developed {
  animation: photoDevelopHidden var(--develop-duration, 1700ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.polaroid-photo.is-developed::before {
  opacity: 0.08;
}
.polaroid-photo.is-developed::after {
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}
@keyframes photoDevelop {
  0%   { filter: blur(14px) brightness(0.84) saturate(0.7); transform: scale(1.05); }
  55%  { filter: blur(5px) brightness(0.97) saturate(0.92); transform: scale(1.02); }
  100% { filter: blur(0) brightness(1) saturate(1.04); transform: scale(1); }
}
@keyframes photoDevelopSurprise {
  0%   { filter: blur(14px) brightness(0.82) saturate(0.65) hue-rotate(20deg); transform: scale(1.05); }
  50%  { filter: blur(5px) brightness(0.97) saturate(1.0) hue-rotate(8deg) drop-shadow(0 0 14px rgba(180, 160, 255, 0.38)); transform: scale(1.02); }
  100% { filter: blur(0) brightness(1.01) saturate(1.06) hue-rotate(0deg) drop-shadow(0 0 8px rgba(180, 160, 255, 0.14)); transform: scale(1); }
}
@keyframes photoDevelopRare {
  0%   { filter: blur(18px) brightness(0.78) saturate(0.6); transform: scale(1.07); }
  45%  { filter: blur(8px) brightness(0.96) saturate(0.92) drop-shadow(0 0 22px rgba(244, 201, 143, 0.5)); transform: scale(1.03); }
  100% { filter: blur(0) brightness(1.02) saturate(1.08) drop-shadow(0 0 14px rgba(244, 201, 143, 0.22)); transform: scale(1); }
}
@keyframes photoDevelopHidden {
  0%   { filter: blur(20px) brightness(0.74) saturate(0.55); transform: scale(1.08); }
  45%  { filter: blur(10px) brightness(0.97) saturate(0.9) drop-shadow(0 0 28px rgba(216, 169, 255, 0.55)); transform: scale(1.04); }
  100% { filter: blur(0) brightness(1.04) saturate(1.1) drop-shadow(0 0 18px rgba(216, 169, 255, 0.26)); transform: scale(1); }
}
.polaroid-meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 12px 14px 11px;
  display: grid;
  gap: 6px;
  text-align: center;
  border-radius: 12px;
  /* v1.2.x-15: 毛玻璃透明度大幅下调
     0.04→0 顶端完全透明，0.74→0.32 底端淡很多 */
  background: linear-gradient(180deg, rgba(18,13,11,0), rgba(18,13,11,0.32));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 稀有度标签基础样式（复用于右上角角标和收藏详情） */
.polaroid-rarity {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(97, 69, 40, 0.78), rgba(58, 39, 24, 0.9));
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.22);
  color: #ffe8c5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* 右上角角标定位（抽卡结果卡片专用） */
.polaroid-rarity-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}
.polaroid-rarity[data-rarity="common"] {
  background: linear-gradient(180deg, rgba(96, 72, 58, 0.82), rgba(55, 39, 31, 0.92));
  color: #f5dec3;
}
.polaroid-rarity[data-rarity="surprise"] {
  background: linear-gradient(180deg, rgba(163, 76, 106, 0.86), rgba(95, 36, 56, 0.94));
  color: #ffe4ef;
}
.polaroid-rarity[data-rarity="rare"] {
  background: linear-gradient(180deg, rgba(242, 195, 116, 0.92), rgba(158, 101, 34, 0.98));
  color: #fff5da;
  box-shadow: 0 0 0 1px rgba(255, 225, 166, 0.28), 0 12px 28px rgba(223, 168, 86, 0.28), inset 0 1px 0 rgba(255,255,255,0.34);
}
.polaroid-rarity[data-rarity="hidden"] {
  background: linear-gradient(180deg, rgba(155, 105, 174, 0.9), rgba(76, 42, 108, 0.98));
  color: #f7e8ff;
  box-shadow: 0 0 0 1px rgba(221, 183, 255, 0.28), 0 12px 30px rgba(160, 98, 214, 0.3), inset 0 1px 0 rgba(255,255,255,0.3);
}
.reveal-placeholder {
  /* 与 polaroid-reveal 共享 grid row 1，两者重叠 */
  grid-row: 1;
  grid-column: 1;
  width: min(82vw, 318px);
  aspect-ratio: 0.66;
  border-radius: 20px;
  opacity: 1;
  transition: opacity 300ms ease;
  box-shadow:
    0 8px 48px rgba(80, 30, 200, 0.30),
    0 24px 56px rgba(0, 0, 0, 0.36);
}
.reveal-placeholder-photo {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(160, 95, 255, 0.55) 0%, rgba(100, 45, 215, 0.18) 38%, transparent 58%),
    radial-gradient(ellipse at 20% 12%, rgba(110, 65, 230, 0.28) 0%, transparent 38%),
    radial-gradient(ellipse at 80% 82%, rgba(80, 28, 190, 0.22) 0%, transparent 35%),
    linear-gradient(158deg, rgba(20, 9, 46, 1) 0%, rgba(7, 4, 18, 1) 100%);
  border: 1.5px solid rgba(170, 115, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(220, 180, 255, 0.16),
    inset 0 -1px 0 rgba(100, 45, 220, 0.10);
  animation: placeholderPulse 6s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* 微点阵纹理，增加质感 */
.reveal-placeholder-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(circle, rgba(180, 130, 255, 0.09) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  pointer-events: none;
}
/* 卡片顶部高光条 */
.reveal-placeholder-photo::after {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220, 185, 255, 0.5) 30%, rgba(220, 185, 255, 0.5) 70%, transparent);
  border-radius: 0;
  pointer-events: none;
}
.reveal-placeholder-photo .placeholder-gem {
  position: relative;
  z-index: 1;
  font-size: 86px;
  line-height: 1;
  color: rgba(210, 170, 255, 0.48);
  text-shadow:
    0 0 24px rgba(180, 120, 255, 0.85),
    0 0 56px rgba(150, 85, 255, 0.45),
    0 0 100px rgba(130, 65, 255, 0.22);
  animation: gemFloat 4.5s ease-in-out infinite;
}
@keyframes gemFloat {
  0%, 100% { transform: translateY(0px) scale(1); opacity: 0.48; }
  50%       { transform: translateY(-9px) scale(1.04); opacity: 0.62; }
}
.reveal-placeholder-photo .placeholder-label {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: rgba(185, 145, 255, 0.38);
  letter-spacing: 0.30em;
  text-transform: uppercase;
}
@keyframes placeholderPulse {
  0%, 100% {
    border-color: rgba(170, 115, 255, 0.48);
    box-shadow: inset 0 1px 0 rgba(220, 180, 255, 0.14), inset 0 -1px 0 rgba(100, 45, 220, 0.08), 0 0 32px rgba(130, 70, 255, 0.14);
  }
  50% {
    border-color: rgba(200, 155, 255, 0.80);
    box-shadow: inset 0 1px 0 rgba(230, 195, 255, 0.22), inset 0 -1px 0 rgba(120, 60, 240, 0.14), 0 0 64px rgba(160, 95, 255, 0.30);
  }
}
.reveal-box.revealing .reveal-placeholder,
.reveal-box.has-result .reveal-placeholder {
  opacity: 0;
}
.gacha-head-count {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 238, 221, 0.92);
}
.gacha-head-count strong {
  color: #ffd8a8;
  font-size: 22px;
}
.polaroid-meta strong {
  font-size: 22px;
  color: #fff4e6;
  text-shadow: 0 2px 10px rgba(0,0,0,0.28);
}
.polaroid-meta p {
  margin: 0;
  color: rgba(255, 230, 208, 0.9);
  font-size: 13px;
  line-height: 1.55;
}
/* v1.2.x-31: 移除 rare-glow / hidden-glow ::after 错位边框
   原设计：reveal-box 内 inset:16 + border-radius:20 1px 矩形 + 大范围光晕
   问题：reveal-box 比卡片大很多，::after 不跟卡片对齐 → 出现"额外一圈错位边框"
   替代：稀有度差异由 chip + polaroid-back 翻面前的 anticipation 光晕承担，足够 */
.reveal-box.rare-glow,
.reveal-box.hidden-glow {
  /* 保留 class 给将来扩展，目前无样式 */
}

.lucky-burst {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: luckyBurstFade 1800ms ease forwards;
}
.lucky-burst-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(244, 201, 143, 0.32), rgba(244, 201, 143, 0.0) 60%);
  animation: luckyBurstGlow 1800ms ease forwards;
}
.lucky-burst-card {
  position: relative;
  z-index: 2;
  padding: 18px 28px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(38, 26, 14, 0.96), rgba(20, 14, 8, 0.98));
  border: 1px solid rgba(244, 201, 143, 0.6);
  box-shadow: 0 0 0 1px rgba(244, 201, 143, 0.32), 0 18px 48px rgba(244, 201, 143, 0.28), 0 30px 80px rgba(0,0,0,0.5);
  text-align: center;
  display: grid;
  gap: 4px;
  min-width: 220px;
  transform: scale(0.7);
  opacity: 0;
  animation: luckyBurstPop 1800ms cubic-bezier(0.22, 1.4, 0.36, 1) forwards;
}
.lucky-burst-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #ffd9a8;
  text-transform: uppercase;
}
.lucky-burst-title {
  font-size: 26px;
  font-weight: 900;
  color: #fff5e3;
  letter-spacing: 0.02em;
}
.lucky-burst-desc {
  font-size: 12px;
  color: rgba(255, 230, 208, 0.78);
}
@keyframes luckyBurstPop {
  0%   { opacity: 0; transform: scale(0.7); }
  18%  { opacity: 1; transform: scale(1.08); }
  35%  { transform: scale(1); }
  78%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.96); }
}
@keyframes luckyBurstGlow {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes luckyBurstFade {
  0%, 95% { visibility: visible; }
  100% { visibility: visible; }
}

/* ── 补充机会区（reveal-box grid 末行，跟随卡片整体） ── */
.gacha-cta-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 0;
}
.gacha-buy-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 215, 100, 0.46);
  letter-spacing: 0.14em;
}
.gacha-buy-options {
  width: 100%;
  display: flex;
  gap: 10px;
}
.gacha-buy-btn {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 16px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 190, 60, 0.22);
  background: rgba(255, 180, 45, 0.06);
  transition: background 160ms ease, border-color 160ms ease;
}
.gacha-buy-btn:active {
  background: rgba(255, 185, 50, 0.16);
  border-color: rgba(255, 200, 80, 0.50);
}
.gacha-buy-count {
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 228, 138, 0.90);
  line-height: 1;
}
.gacha-buy-pts {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 205, 90, 0.46);
  line-height: 1;
}
/* 3次：更亮、边框更明显 */
.gacha-buy-btn-best {
  border-color: rgba(255, 200, 70, 0.40);
  background: rgba(255, 185, 50, 0.10);
}
.gacha-buy-btn-best .gacha-buy-count {
  color: rgba(255, 238, 158, 1);
}
.gacha-buy-btn-best .gacha-buy-pts {
  color: rgba(255, 215, 100, 0.60);
}
/* 划算标签 */
.gacha-buy-badge {
  position: absolute;
  top: 7px; right: 9px;
  font-size: 9px;
  font-weight: 800;
  color: rgba(22, 14, 2, 0.95);
  background: linear-gradient(135deg, #f7d989 0%, #e9a030 100%);
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.05em;
}
.gacha-result-actions {
  width: 100%;
  display: grid;
  gap: 10px;
  align-items: stretch;
}
.gacha-result-row {
  width: min(84%, 280px);
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 0 auto;
}
.gacha-result-row-top {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gacha-result-row-bottom {
  grid-template-columns: 1fr;
}
.gacha-bottom-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 4px 0 env(safe-area-inset-bottom);
}
/* 结果出现后隐藏底部 CTA 区域 */
.reveal-box.has-result .gacha-bottom-cta {
  display: none;
}
.gacha-main-button {
  width: min(72%, 260px);
  min-height: 52px;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}
.gacha-result-row-top .gacha-main-button {
  min-width: 0;
}
.gacha-again-button {
  width: 100%;
}
.theme-list {
  display: block;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}
.theme-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}
.theme-item.active-theme {
  border-color: rgba(244, 201, 143, 0.42);
}
.theme-item.locked {
  opacity: 0.74;
}
.theme-item button { margin-top: 8px; }

.collection-list {
  /* v1.1.x：图鉴模式下 .collection-list 不再是 2 列 grid，而是 block 容器
     ── 否则会把 .collection-atlas 挤成半屏宽 */
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}
.collection-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #1a1410;
  border: 1px solid rgba(255,255,255,0.10);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
/* padding-bottom 撑开卡片高度：匹配素材原始比例 1536×2752 ≈ 1.79 */
.collection-card::before {
  content: "";
  display: block;
  padding-bottom: 179%;
}
.collection-card:active {
  transform: scale(0.97);
}
.collection-card[data-rarity="rare"] {
  border-color: rgba(244, 201, 143, 0.46);
  box-shadow: 0 0 0 1px rgba(244, 201, 143, 0.18), 0 10px 24px rgba(244, 201, 143, 0.14);
}
.collection-card[data-rarity="hidden"] {
  border-color: rgba(216, 169, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(216, 169, 255, 0.22), 0 10px 26px rgba(216, 169, 255, 0.18);
}
.collection-card-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: top center;   /* 从顶部对齐，确保头部可见 */
  background-color: #120d0b;
}
.collection-card-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(0,0,0,0.7) 100%);
}
.collection-card-meta {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  z-index: 2;
  display: grid;
  gap: 4px;
}
.collection-card-rarity {
  align-self: flex-start;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.45);
  color: #ffe6c8;
  border: 1px solid rgba(255,255,255,0.12);
}
.collection-card-rarity[data-rarity="surprise"] {
  background: rgba(163, 76, 106, 0.78);
  color: #ffe4ef;
}
.collection-card-rarity[data-rarity="rare"] {
  background: linear-gradient(180deg, rgba(242, 195, 116, 0.86), rgba(158, 101, 34, 0.94));
  color: #fff5da;
}
.collection-card-rarity[data-rarity="hidden"] {
  background: linear-gradient(180deg, rgba(155, 105, 174, 0.88), rgba(76, 42, 108, 0.96));
  color: #f7e8ff;
}
.collection-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff5e3;
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
  line-height: 1.25;
}
.collection-card-time {
  font-size: 10px;
  color: rgba(255, 230, 208, 0.62);
}

.collection-empty {
  grid-column: span 2;
  margin: 6px auto 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: 16px;
  display: grid;
  gap: 10px;
  width: 100%;
}
.collection-empty-icon {
  font-size: 32px;
  opacity: 0.62;
}
.collection-empty-hint {
  color: var(--muted);
  font-size: 13px;
}
.collection-empty-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f4c98f, #e0a060);
  color: #1a0e00;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.collection-toolbar {
  padding: 8px 16px 0;
  flex-shrink: 0;
  overflow: hidden;
}
.collection-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.collection-filter-row::-webkit-scrollbar { display: none; }
.collection-filter-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 42px;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #f7e8d0;
  cursor: pointer;
  flex-shrink: 0;
}
.chip-gems {
  font-size: 10px;
  line-height: 1;
  letter-spacing: -0.5px;
}
.chip-text {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.collection-filter-chip.is-active {
  background: rgba(244, 201, 143, 0.22);
  border-color: rgba(244, 201, 143, 0.48);
  color: #fff2d8;
}
.collection-sort-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.34);
  color: #ffefd1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.collection-head-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(244, 201, 143, 0.22);
  color: #ffe2b6;
  font-size: 13px;
  font-weight: 800;
  margin-left: 8px;
  vertical-align: middle;
}

.collection-detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  /* v1.2.x-3: 加底部 safe-area 防止"返回"按钮被微信小程序壳 home indicator 遮挡 */
  padding: 12px 12px calc(28px + env(safe-area-inset-bottom));
}
.collection-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
/* v1.2.x-3: 去掉外层"卡片框" — 直接透明容器，photo 自身就是主视觉，
   不再用嵌套 background + border 显得拥挤、套娃 */
.collection-detail-card {
  position: relative;
  z-index: 2;
  width: min(94vw, 460px);
  max-height: 100%;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.collection-detail-photo {
  /* v1.2.x-27: 底部按钮组全删，aspect-ratio 0.6 → 0.58 再加大 */
  position: relative;
  width: 100%;
  aspect-ratio: 0.58;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  background-color: #120d0b;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  overflow: hidden;
}
/* v1.2.x-38: 右上角毛玻璃 × 关闭按钮 — 兜底关闭入口
   位置 = 卡片右上角浮在 photo 之上；z-index 4 高于 chip/title (3) */
.collection-detail-close-x {
  position: absolute;
  top: max(8px, calc(env(safe-area-inset-top) - 8px));
  right: 8px;
  z-index: 4;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  color: rgba(255, 240, 220, 0.92);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, background 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}
.collection-detail-close-x:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.6);
}

/* v1.2.x-33: HD 高清 png 渐显层 — 叠在低清 webp 之上，加载完 fade-in
   chip/title z-index 3 仍在最上层不受影响 */
.collection-detail-photo-hd {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 1;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.collection-detail-photo-hd.is-loaded { opacity: 1; }

/* v1.2.x-26: title 右下（保留），chip 移到左上角 */
.collection-detail-title-on-photo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;  /* 现在 chip 不在底部了，title 可以横到底 */
  z-index: 3;
  text-align: right;
  font-size: 17px;
  font-weight: 700;
  color: rgba(255, 245, 230, 0.98);
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
  letter-spacing: 0.04em;
  pointer-events: none;
}
/* v1.2.x-26: rarity chip — 左上角 */
.collection-detail-rarity-on-photo {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.55);
  color: #ffe6c8;
}
/* v1.2.x-23: 底部一行 — 副标语 · 收藏于日期，inline 排列由小圆点分隔 */
.collection-detail-foot {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 230, 208, 0.7);
  letter-spacing: 0.04em;
  line-height: 1.5;
  padding: 0 12px;
}
.collection-detail-subtitle {
  color: rgba(255, 240, 220, 0.88);
}
/* · 分隔符（用 pseudo + 间距控制，subtitle 为空时不显示分隔点）*/
.collection-detail-subtitle:not(:empty) + .collection-detail-time::before {
  content: " · ";
  margin: 0 6px;
  color: rgba(255, 230, 208, 0.45);
}
.collection-detail-time {
  font-size: 11px;
  color: rgba(255, 230, 208, 0.55);
  letter-spacing: 0.06em;
}
/* v1.2.x-3: 分享/删除 hidden 后只剩"返回"，简化为单列 */
.collection-detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.collection-detail-actions .primary-button {
  min-height: 46px;
  font-size: 15px;
}
.collection-detail-actions .secondary-button {
  min-height: 38px;
  font-size: 13px;
}
/* hidden button 完全不占位（HTML hidden + 这里兜底）*/
.collection-detail-actions button[hidden] {
  display: none !important;
}
.secondary-button.is-danger {
  border-color: rgba(255, 130, 130, 0.34);
  color: #ffd2cf;
  background: rgba(255, 90, 90, 0.12);
}
.secondary-button.is-danger:hover {
  background: rgba(255, 90, 90, 0.18);
}

/* v1.1.x：sticky 筛选条，滑动卡片时不被划走（compact 版）*/
.theme-filter-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px 12px 18px;  /* 上下加大，与卡片留出明显间距 */
  background: linear-gradient(180deg, rgba(8,9,14,0.98) 70%, rgba(8,9,14,0.85) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.theme-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.theme-filter-row::-webkit-scrollbar { display: none; }
.theme-filter-chip {
  flex: 0 0 auto;
  min-height: 36px;       /* 28 → 36，chip 本身更高 */
  padding: 0 16px;        /* 加宽 */
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #f7e8d0;
  font-size: 13px;        /* 12 → 13 */
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms, border-color 150ms;
}
.theme-filter-chip.is-active {
  background: rgba(244, 201, 143, 0.22);
  border-color: rgba(244, 201, 143, 0.55);
  color: #fff5e3;
}

.theme-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  /* 顶部贴近 sticky 筛选条；底部仅保留 safe-area-inset（防止刘海/Home Bar 遮挡最后一行）*/
  padding: 8px 8px env(safe-area-inset-bottom);
}
.theme-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  touch-action: manipulation; /* 去掉 iOS 300ms tap 延迟，touchend 立即响应 */
  -webkit-tap-highlight-color: rgba(255,255,255,0.08);
}
.theme-card.is-current {
  border-color: rgba(244, 201, 143, 0.52);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.theme-card.is-locked {
  cursor: pointer; /* 保持可点击——iOS WebKit 需要 cursor:pointer 才能触发 tap */
}
.theme-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 0;
  background: rgba(255,255,255,0.06);
}
.theme-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.12) 46%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}
.theme-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.theme-card-title {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  z-index: 2;
  width: calc(100% - 24px);
  text-align: center;
  color: #f4c98f;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0,0,0,0.42);
}
.theme-card-status-pill {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 2;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.theme-card-status-pill.is-current {
  background: rgba(167, 240, 219, 0.92);
  color: #173129;
}
.theme-card-status-pill.is-unlock {
  background: rgba(244, 201, 143, 0.94);
  color: #3d250f;
}
.theme-card-status-pill.is-soon {
  background: rgba(255,255,255,0.88);
  color: #3b3632;
}
.theme-card-status-pill.is-coming-soon {
  background: rgba(255,255,255,0.55);
  color: #5a5560;
}
.theme-card-status-pill.is-locked {
  /* 默认锁定（无类型） — 金色按钮 */
  background: rgba(244, 201, 143, 0.94);
  color: #3d250f;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}
/* 观看广告解锁 — 金色，同 is-unlock，有 ▶ 图标暗示 CTA */
.theme-card-status-pill.is-locked.is-locked-ad {
  background: rgba(244, 201, 143, 0.94);
  color: #3d250f;
}
/* 会员专属 — 紫色渐变，明显区分付费 */
.theme-card-status-pill.is-locked.is-locked-member {
  background: linear-gradient(135deg, #c4a3ff 0%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* coming_soon 卡片整体灰化（但仍可点击 → 弹订阅解锁提醒）*/
.theme-card.is-coming-soon {
  opacity: 0.6;
  cursor: pointer;
}
/* locked 卡片轻微遮罩 */
.theme-card.is-locked .theme-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.35);
  border-radius: inherit;
  pointer-events: none;
}
/* just-unlocked：解锁成功后短暂高亮闪光效果 */
.theme-card.just-unlocked {
  animation: unlock-flash 1.8s ease-out forwards;
}
@keyframes unlock-flash {
  0%   { box-shadow: 0 0 0 0 rgba(244, 201, 143, 0); }
  20%  { box-shadow: 0 0 0 6px rgba(244, 201, 143, 0.6); }
  60%  { box-shadow: 0 0 0 10px rgba(244, 201, 143, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(244, 201, 143, 0); }
}

.theme-loading-banner {
  text-align: center;
  padding: 12px 16px;
  font-size: 13px;
  color: rgba(255, 220, 180, 0.5);
  letter-spacing: 0.04em;
  animation: pulse-opacity 1.2s ease-in-out infinite;
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

.theme-empty {
  padding: 18px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.16);
  color: var(--muted);
  text-align: center;
}

.primary-button, .secondary-button {
  min-height: 46px;
  border-radius: 12px;
  font-weight: 800;
}
.primary-button[disabled], .secondary-button[disabled] {
  opacity: 0.46;
}
.primary-button {
  border: 0;
  background: linear-gradient(180deg, #f7d989, var(--gold-deep));
  color: #17120b;
}
.secondary-button {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

.hidden { display: none !important; }

.achievement-toast {
  position: fixed;
  z-index: 80;
  top: max(16px, calc(env(safe-area-inset-top) + 8px));
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(40, 28, 18, 0.96), rgba(20, 14, 10, 0.98));
  border: 1px solid rgba(244, 201, 143, 0.34);
  box-shadow: 0 14px 32px rgba(0,0,0,0.32);
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: none;
  max-width: min(86vw, 320px);
}
.achievement-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.achievement-toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7d989, var(--gold-deep));
  color: #17120b;
  font-size: 16px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.achievement-toast-label {
  font-size: 10px;
  color: rgba(255, 226, 182, 0.7);
  letter-spacing: 0.14em;
  font-weight: 800;
  text-transform: uppercase;
}
.achievement-toast-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff5e3;
  line-height: 1.2;
  margin-top: 2px;
}
.achievement-toast-desc {
  font-size: 11px;
  color: rgba(255, 230, 208, 0.7);
  line-height: 1.3;
  margin-top: 1px;
}

.onboarding-hint {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 240ms ease;
}
.onboarding-hint-card {
  width: min(86vw, 320px);
  display: grid;
  gap: 14px;
  padding: 22px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 22, 18, 0.98), rgba(14, 11, 9, 0.99));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.onboarding-hint-title {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: rgba(255, 226, 182, 0.7);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}
.onboarding-hint-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #fff5e3;
  line-height: 1.4;
}
.onboarding-hint-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f7d989, var(--gold-deep));
  color: #17120b;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}
.onboarding-hint-dismiss {
  margin-top: 6px;
  min-height: 42px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(180deg, #f7d989, var(--gold-deep));
  color: #17120b;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .polaroid-card-inner,
  .polaroid-card.is-flipping .polaroid-card-inner,
  .polaroid-card.is-revealed .polaroid-card-inner {
    transition-duration: 0.01ms !important;
  }
  .polaroid-card[data-rarity="rare"] .polaroid-back,
  .polaroid-card[data-rarity="hidden"] .polaroid-back,
  .polaroid-photo.is-developed,
  .polaroid-card.is-collected,
  .reveal-box.revealing,
  .hero-zone.is-long-pressing::after,
  .entry-float-badge.bump,
  .chance-toast,
  .chance-toast-plus,
  .message-panel p.typing::after,
  .emotion-ring.milestone,
  .emotion-ring.ultra-near .ring-fg {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}
.payment-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.payment-modal-card {
  position: relative;
  z-index: 2;
  width: min(86vw, 340px);
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 22, 18, 0.98), rgba(14, 11, 9, 0.99));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  text-align: center;
}
.payment-modal-stripe {
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(244, 201, 143, 0.16);
  color: #ffe2b6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  width: fit-content;
}
.payment-modal-card h3 {
  margin: 0;
  font-size: 18px;
  color: #fff4e6;
}
.payment-modal-desc {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 230, 208, 0.78);
  line-height: 1.55;
}
.payment-modal-amount {
  font-size: 32px;
  font-weight: 900;
  color: #ffd9a8;
  letter-spacing: 0.02em;
}
.payment-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.payment-modal-actions .primary-button,
.payment-modal-actions .secondary-button {
  min-height: 42px;
  font-size: 14px;
}

@media (max-width: 420px) {
  .theme-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ============================================================
   积分系统 UI（v0.9）
   ============================================================ */

/* 积分行：出现在抽卡页和主题页 header 下方 */
.points-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.points-row-label {
  font-size: 13px;
  color: var(--muted);
}
.points-row-label strong {
  color: var(--gold);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.topup-entry-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  background: rgba(244, 201, 143, 0.12);
  border: 1px solid rgba(244, 201, 143, 0.3);
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.topup-entry-btn:active { background: rgba(244, 201, 143, 0.22); }

/* ——— 充值抽屉 ——— */
.topup-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.topup-drawer.hidden { display: none; }

.topup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.topup-sheet {
  position: relative;
  background: #13131a;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.topup-drawer:not(.hidden) .topup-sheet {
  transform: translateY(0);
}

.topup-sheet-header {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}
.topup-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.topup-current {
  font-size: 12px;
  color: var(--muted);
  margin-right: 12px;
}
.topup-current strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.topup-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}

/* 4档充值卡片：2×2 网格 */
.topup-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.topup-tier {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(255,255,255,0.03);
}
.topup-tier:active { background: rgba(255,255,255,0.07); }
.topup-tier.is-selected {
  border-color: var(--gold);
  background: rgba(244, 201, 143, 0.08);
}
.topup-tier-points {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.topup-tier-unit {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.topup-tier-price {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.topup-tier.is-selected .topup-tier-price { color: var(--gold); }

/* 推荐角标 */
.topup-tier-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--gold);
  color: #1a1004;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 0 10px 0 8px;
}

.topup-confirm-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
}

/* ——— 积分不足弹层（底部大卡，需手动关闭） ——— */
.points-toast {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.points-toast.hidden { display: none; }

.points-toast-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}
.points-toast-sheet {
  position: relative;
  background: linear-gradient(180deg, #1c1628 0%, #130e1e 100%);
  border: 1px solid rgba(160, 100, 255, 0.2);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  padding: 32px 24px max(32px, env(safe-area-inset-bottom));
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -8px 40px rgba(130, 60, 255, 0.18);
}
.points-toast:not(.hidden) .points-toast-sheet {
  transform: translateY(0);
}

/* ── 积分金币 icon（纯 CSS，全平台兼容，em 单位随字号自动缩放） ── */
.pts-coin {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%,
    #fff9c0 0%,
    #f5c832 28%,
    #d49000 68%,
    #a86000 100%
  );
  border: 1px solid rgba(140, 78, 0, 0.38);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 190, 0.70),
    inset 0 -1px 2px rgba(0, 0, 0, 0.24);
  vertical-align: -0.12em;
  flex-shrink: 0;
  line-height: 1;
}
.points-toast-gem {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(220, 160, 20, 0.65));
  margin-bottom: 4px;
}
.points-toast-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.points-toast-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}
.points-toast-balance {
  font-size: 13px;
  color: var(--muted);
  padding: 9px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  width: 100%;
}
.points-toast-balance strong {
  color: var(--gold);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.points-toast-action {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 800;
  margin-top: 4px;
  background: linear-gradient(135deg, #b06aff 0%, #7c3aed 100%);
  box-shadow: 0 6px 24px rgba(130, 60, 255, 0.45);
  border: none;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
}
.points-toast-action:active {
  filter: brightness(0.9);
}
.points-toast-close {
  color: rgba(255,255,255,0.38);
  font-size: 14px;
  padding: 6px 16px;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: -4px;
}
.points-toast-close:active { color: rgba(255,255,255,0.6); }

/* ——— 解锁主题确认卡（底部滑入） ——— */
/* ── 解锁选项弹层（替代旧 unlock-confirm）── */
.unlock-options {
  position: fixed;
  inset: 0;
  z-index: 9000;   /* 远高于 overlay-view(20) 和其他层，确保在最上层 */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.unlock-options.hidden { display: none; }

.unlock-options-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.unlock-options-sheet {
  position: relative;
  background: #16141f;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px max(28px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.unlock-options:not(.hidden) .unlock-options-sheet {
  transform: translateY(0);
}
.unlock-options-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
/* 各解锁按钮 */
.unlock-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: opacity 0.15s;
}
.unlock-option-btn:active { opacity: 0.75; }
.unlock-option-ad {
  background: rgba(167, 240, 219, 0.12);
  color: #a7f0db;
  border: 1px solid rgba(167, 240, 219, 0.25);
}
.unlock-option-purchase {
  background: rgba(244, 201, 143, 0.12);
  color: #f4c98f;
  border: 1px solid rgba(244, 201, 143, 0.25);
}
.unlock-option-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.unlock-option-text {
  flex: 1;
}
.unlock-option-tag {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
/* 会员提示行（非按钮） */
.unlock-option-membership {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  font-size: 14px;
  color: var(--muted);
}
.unlock-options-empty {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}
.unlock-options-cancel {
  margin-top: 4px;
}

/* 积分数字滚动动画 */
@keyframes pointsRollup {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.points-rollup-anim {
  animation: pointsRollup 0.4s ease-out;
}

@media (max-width: 360px) {
  .emotion-ring-wrap {
    display: none !important; /* 小屏同样隐藏 */
    left: 14px;
    right: auto;
    top: max(16px, calc(env(safe-area-inset-top) + 12px));
    bottom: auto;
    transform: none;
  }
  .control-dock { width: 80px; }
  .action-button { width: 80px; }
  .theme-card-body h3 {
    font-size: 15px;
  }
  .theme-card-meta,
  .theme-card-desc {
    font-size: 11px;
  }
}

/* ── Zone Overlay 热区 ──────────────────────────────────── */
.zone-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* 透明大触摸区 — 实际响应点击，比视觉 pill 大 */
.zone-hit {
  position: absolute;
  transform: translate(-50%, -50%);
  /* v1.1.x: 从 80×80 方形改为 110×70 长方形，更贴合 pill 形状，触摸更舒服。
     最小相邻 zone 距离（dx 116px 或 dy 80px）下不会重叠（已数学验证）。*/
  width: 110px;
  height: 70px;
  background: transparent;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.zone-hit:disabled {
  pointer-events: none;
}
.zone-hit:disabled .zone-pill {
  opacity: 0.38;
}

/* 视觉 pill — 只负责显示，不响应事件 */
.zone-pill {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
  box-shadow: 0 2px 12px rgba(0,0,0,0.22);
  pointer-events: none;
  transition: background 120ms ease, transform 120ms ease;
  user-select: none;
}
.zone-hit:active .zone-pill,
.zone-hit.active .zone-pill {
  background: rgba(255,255,255,0.22);
  transform: scale(0.92);
}

/* ── Corner Dock 右下角快捷区 ──────────────────────────── */
.corner-dock {
  position: absolute;
  z-index: 7;
  right: max(14px, env(safe-area-inset-right));
  /* v1.1.x：换装 fab 已并入 dock，dock 整体下移到更接近拇指自然伸触位 */
  bottom: max(60px, calc(env(safe-area-inset-bottom) + 50px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 换装 FAB — 底部居中，比默认抬高 */
.fab-bottom-center {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: max(56px, calc(env(safe-area-inset-bottom) + 48px));
  transform: translateX(-50%);
  /* —— 胶囊形状 —— */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 28px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  /* —— Frosted glass —— */
  background: rgba(255, 255, 255, 0.12);
  border: 0.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: background 200ms ease, transform 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .fab-bottom-center:hover {
    background: rgba(255, 255, 255, 0.18);
  }
}
.fab-bottom-center:active {
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-50%) scale(0.98);
}
.fab-swap-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.92;
}

.corner-fab-label {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ── 右侧 dock 精致按钮 ─────────────────────────────────── */
.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  /* v1.1.x：尺寸放大 44 → 52px，提升触摸命中率（特别是三四线用户大手指）*/
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 15, 20, 0.45);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  color: rgba(255, 255, 255, 0.80);
  cursor: pointer;
  padding: 0;
  transition: background 180ms ease, transform 150ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.dock-icon {
  width: 18px !important;     /* v1.1.x：图标也对应放大 16 → 18 */
  height: 18px !important;
}
.dock-label {
  font-size: 13px !important; /* 2026-05-29 加大字号 10→13，提高首页入口的可读性 */
  font-weight: 600;
  letter-spacing: 0.05em;
}
/* v1.1.x bug fix: 三星/华为 Android webview（微信内置）tap 后 :hover 状态
   不会自动清除，导致 BGM 切换后按钮变灰底。用 hover:hover media query 限定
   :hover 只在真正支持 hover 的设备（鼠标）生效，跳过触摸设备。*/
@media (hover: hover) {
  .dock-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }
}
.dock-btn:active {
  transform: scale(0.91);
  background: rgba(255, 255, 255, 0.18);
}
/* 确保 :focus 状态不残留灰色（同样的 webview tap → focus 不清除问题）*/
.dock-btn:focus { outline: none; }
.dock-btn:focus-visible { outline: 2px solid rgba(244, 201, 143, 0.6); outline-offset: 2px; }
.dock-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}
.dock-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: inherit;
  line-height: 1;
}

/* 兼容旧选择器（badge 定位等依赖） */
.corner-secondary-btn { display: none; }
.corner-secondary-label { display: none; }

/* BGM 播放中动态效果 — 向外扩散光圈 */
@keyframes bgmRipple {
  0%   { box-shadow: 0 0 0 0px rgba(255,255,255,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0px rgba(255,255,255,0); }
}
#bgm-toggle.is-playing {
  animation: bgmRipple 1.6s ease-out infinite;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.30);
}

/* ▼ P0-1 扫码关注卡 ▼ */
.leadgen-card{position:relative;text-align:center;padding:24px 20px max(24px,env(safe-area-inset-bottom))}
.leadgen-close{position:absolute;right:10px;top:10px;background:transparent;border:0;color:#aaa;font-size:20px;width:32px;height:32px;cursor:pointer}
.leadgen-head{margin-bottom:14px}
.leadgen-title{margin:0 0 6px;font-size:18px;color:#fff}
.leadgen-sub{margin:0;font-size:13px;color:#bbb;line-height:1.5}
.leadgen-qr-wrap{position:relative;width:200px;height:200px;margin:0 auto 14px;background:#fff;border-radius:14px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.leadgen-qr{width:184px;height:184px;display:block}
.leadgen-qr[src=""]{visibility:hidden}
.leadgen-qr-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#888;font-size:13px}
.leadgen-qr-loading.hidden{display:none}
.leadgen-meta{margin-bottom:16px;font-size:13px;color:#aaa}
.leadgen-amount-hidden{display:none}
.leadgen-meta-text{display:block}
.leadgen-actions{display:flex;flex-direction:column;gap:8px}
.leadgen-actions .primary-button,.leadgen-actions .secondary-button{width:100%}
.leadgen-status{margin-top:12px;font-size:13px;padding:8px 12px;border-radius:10px}
.leadgen-status.hidden{display:none}
.leadgen-status.is-waiting{background:#2a2a35;color:#bbb}
.leadgen-status.is-success{background:#1f3a1f;color:#7fe07f}
.leadgen-status.is-error{background:#3a1f1f;color:#ff8888}
/* ▲ P0-1 ▲ */

/* ▼ P0-3 微信提示横条 ▼ */
.wx-hint{position:fixed;top:0;left:0;right:0;z-index:1500;background:linear-gradient(90deg,#ffd54a,#ffb74a);color:#1a1a22;padding:10px 44px 10px 14px;font-size:13px;display:flex;align-items:center;line-height:1.4;padding-top:max(10px,env(safe-area-inset-top))}
.wx-hint.hidden{display:none}
.wx-hint-text{flex:1}
.wx-hint-close{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:transparent;border:0;color:#1a1a22;font-size:18px;width:32px;height:32px;cursor:pointer}
/* ▲ P0-3 ▲ */

/* ▼ 抽卡机会获得弹窗 ▼ */
/* 用 JS 动态设置 right / bottom，让气泡贴在抽卡按钮正上方 */
.chance-popup {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.88);
  transition: opacity 260ms cubic-bezier(0.22,1,0.36,1),
              transform 260ms cubic-bezier(0.22,1,0.36,1);
}
.chance-popup.hidden { display: none; }
.chance-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 气泡主体 */
.chance-popup-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2e1f4a 0%, #1a1030 100%);
  border: 1.5px solid rgba(200,160,255,0.30);
  border-radius: 14px;
  padding: 10px 16px 10px 12px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.50),
              0 0 0 1px rgba(255,255,255,0.05) inset;
  white-space: nowrap;
}
/* 光晕层 */
.chance-popup-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 20% 0%, rgba(190,130,255,0.20) 0%, transparent 65%);
  pointer-events: none;
}
/* 向下的小三角 —— 指向抽卡按钮 */
.chance-popup-inner::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 18px;           /* 与按钮中心对齐，JS 会微调整体位置 */
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #2e1f4a;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
}

.chance-popup-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  animation: chanceIconBounce 480ms cubic-bezier(0.22,1,0.36,1) 1;
}
.chance-popup-body {
  display: flex;
  flex-direction: column;
  gap: 0px;
}
.chance-popup-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(210,185,255,0.70);
  letter-spacing: 0.4px;
  line-height: 1.2;
}
.chance-popup-value {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-shadow: 0 0 16px rgba(200,150,255,0.75);
  animation: chanceValuePop 500ms cubic-bezier(0.22,1,0.36,1) 60ms both;
}
/* 右侧 → 箭头替换为角标次数总计（可选，暂隐藏） */
.chance-popup-arrow { display: none; }

@keyframes chanceIconBounce {
  0%   { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.22) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes chanceValuePop {
  0%   { transform: scale(0.5) translateY(6px); opacity: 0; }
  65%  { transform: scale(1.14) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}
/* ▲ 抽卡机会获得弹窗 ▲ */

/* ════════════════════════════════════════════════════════ */
/* v1.1 收藏页图鉴模式 + 概率公示弹窗 */
/* ════════════════════════════════════════════════════════ */

.collection-atlas {
  padding: 12px 14px 24px;
  display: grid;
  gap: 14px;
}

.atlas-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
}
.atlas-summary-text {
  font-size: 13px;
  color: rgba(255, 230, 208, 0.78);
}
.atlas-summary-text strong {
  color: #ffe6c8;
  font-size: 16px;
  font-weight: 800;
}
.atlas-summary-text span {
  color: rgba(255, 230, 208, 0.5);
}
.atlas-prob-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 217, 160, 0.92);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}
@media (hover: hover) {
  .atlas-prob-btn:hover {
    background: rgba(255, 255, 255, 0.10);
  }
}

.atlas-theme {
  background: rgba(255, 255, 255, 0.025);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.atlas-theme-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: #ffe6c8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.atlas-fold-icon {
  display: inline-block;
  transition: transform 200ms ease;
  font-size: 10px;
  color: rgba(255, 230, 208, 0.55);
}
.atlas-theme.is-collapsed .atlas-fold-icon {
  transform: rotate(-90deg);
}
.atlas-theme.is-collapsed .atlas-theme-body {
  display: none;
}
.atlas-theme-name {
  flex: 0 0 auto;
}
.atlas-theme-progress {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 230, 208, 0.55);
  font-weight: 600;
}

.atlas-theme-body {
  padding: 0 14px 14px;
}

.atlas-series {
  padding: 12px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.atlas-series:first-child {
  border-top: none;
  padding-top: 4px;
}
.atlas-series-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 230, 208, 0.65);
  padding: 0 2px 8px;
}
.atlas-series.is-complete .atlas-series-header {
  color: #f4c98f;
  font-weight: 700;
}
.atlas-series-name {
  letter-spacing: 0.04em;
}
.atlas-series-progress {
  font-weight: 600;
}

.atlas-card-grid {
  display: grid;
  /* v1.1.x：5 列 → 2 列，卡片面积约 4 倍（线性宽 2.4x，面积 ~5.8x，实际看着 4x 感觉）*/
  grid-template-columns: repeat(2, 1fr);
  /* v1.2.x-16: 缝隙 12 → 6，卡片更紧凑 */
  gap: 6px;
}
.atlas-card {
  position: relative;
  aspect-ratio: 1 / 1.55;
  border-radius: 7px;
  overflow: hidden;
  background: #120d0b;
  border: 1px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.atlas-card:active {
  transform: scale(0.94);
}
.atlas-card[data-rarity="surprise"] {
  border-color: rgba(255, 168, 200, 0.42);
}
.atlas-card[data-rarity="rare"] {
  border-color: rgba(244, 201, 143, 0.55);
  box-shadow: 0 0 0 1px rgba(244, 201, 143, 0.16);
}
.atlas-card[data-rarity="hidden"] {
  border-color: rgba(216, 169, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(216, 169, 255, 0.22);
}
.atlas-card-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: top center;
  background-color: #120d0b;
}
/* v1.2.x-16: blur 5→10, brightness 0.62→0.42 重新加强模糊（用户反馈过清） */
.atlas-card-photo.is-blurred {
  filter: blur(10px) brightness(0.42);
}
/* v1.2.x-16: chip 与 title 位置对调 — chip → 左下、title → 右上 */
.atlas-card-rarity-pill {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffe6c8;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
/* v1.2.x-29: 重复张数 ×N 角标 — 右下角 */
.atlas-card-dup-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(244, 201, 143, 0.92);
  color: #2a1808;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
/* v1.2.x-16: 卡片名称 → 右上角 */
.atlas-card-title {
  position: absolute;
  right: 6px;
  top: 6px;
  left: 6px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 240, 220, 0.95);
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
  letter-spacing: 0.04em;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atlas-card-rarity-pill[data-rarity="surprise"] {
  background: rgba(163, 76, 106, 0.85);
  color: #ffe4ef;
}
.atlas-card-rarity-pill[data-rarity="rare"] {
  background: linear-gradient(180deg, rgba(242, 195, 116, 0.92), rgba(158, 101, 34, 0.96));
  color: #fff5da;
}
.atlas-card-rarity-pill[data-rarity="hidden"] {
  background: linear-gradient(180deg, rgba(155, 105, 174, 0.9), rgba(76, 42, 108, 0.96));
  color: #f7e8ff;
}
/* v1.2.x-13: 未收集卡 cover 改为顶部淡渐变 + 底部小标 #号
   去掉满屏大问号（反复堆叠让用户不适），改用轻量层级 */
.atlas-card-cover {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.15) 50%,
    rgba(0,0,0,0.40) 100%
  );
}
/* 顶部居中小锁图标，比满屏 ? 克制许多 */
.atlas-card-q {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1;
}
.atlas-card-no {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.10em;
  font-weight: 500;
}

/* ── 概率公示弹窗 ────────────────────────────────────── */
.prob-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: probFadeIn 220ms ease;
}
@keyframes probFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.prob-modal {
  background: linear-gradient(180deg, #1f1611, #170f0c);
  border: 1px solid rgba(244, 201, 143, 0.28);
  border-radius: 16px;
  padding: 24px 22px 20px;
  max-width: 340px;
  width: 100%;
  color: #ffe6c8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.prob-modal h3 {
  margin: 0 0 14px;
  font-size: 17px;
  color: #f4c98f;
  text-align: center;
  font-weight: 800;
}
.prob-modal-table {
  width: 100%;
  margin: 0 0 12px;
  font-size: 13px;
  border-collapse: collapse;
}
.prob-modal-table td {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.prob-modal-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: #ffd9a0;
}
.prob-modal p {
  margin: 8px 0;
  font-size: 12px;
  color: rgba(255, 230, 208, 0.72);
  line-height: 1.65;
}
.prob-modal-close {
  display: block;
  margin: 16px auto 0;
  padding: 9px 28px;
  background: linear-gradient(180deg, #f4c98f, #c48a4a);
  border: none;
  border-radius: 999px;
  color: #20140c;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.05em;
}
.prob-modal-close:active {
  transform: scale(0.96);
}


/* ════════════════════════════════════════════════════════ */
/* v1.1.x 抽卡页布局重做：把卡片做大，让"卡片"成为页面唯一主角 */
/* 设计原则：                                                   */
/*   - 返回按钮 + 次机会胶囊：吸顶（半透明渐变背景，不抢卡片视觉）│
/*   - 惊喜抽卡 / 再抽一次 / 加入收藏：吸底                       */
/*   - 卡片：占满中央，限制三重 min(92vw, 380px, 65vh*0.66)       │
/*   - 周围 vignette + 中心 radial-glow → "聚光灯"突出卡片        │
/* ════════════════════════════════════════════════════════ */

/* v1.1.x-w23：抽卡页完全遮罩首页 —— 干掉父级 padding + 半透明，做全屏接管 */
#gachaView {
  padding: 0 !important;            /* 干掉 .overlay-view 默认 padding，避免周边露首页 */
  background: rgb(8, 9, 14) !important;  /* 不透明黑底兜底（防 backdrop-filter 不支持） */
}

/* overlay-panel 改成 relative full-height 容器 */
#gachaView .overlay-panel {
  position: relative;
  width: 100%;
  height: 100svh;
  max-height: none;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, rgba(244, 201, 143, 0.09) 0%, transparent 65%),
    linear-gradient(180deg, rgb(8,9,14) 0%, rgb(14,8,18) 100%);  /* 改成不透明，杜绝渗透 */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── 顶部吸边：返回 + 次机会胶囊 ── */
#gachaView .gacha-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 14px 8px;
  margin: 0;
  background: linear-gradient(180deg, rgba(8,9,14,0.66) 0%, rgba(8,9,14,0.22) 65%, transparent 100%);
  pointer-events: none; /* 中间空白不拦点击 */
}
#gachaView .gacha-header > * {
  pointer-events: auto;
}
#gachaView .gacha-back-btn {
  padding: 6px 13px;
  font-size: 12px;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#gachaView .gacha-chance-badge {
  padding: 5px 13px;
  font-size: 11px;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(244, 201, 143, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#gachaView .gacha-chance-badge strong {
  font-size: 16px;
}

/* ── 中部"放映厅" ──
   v1.2.x bugfix: 不再 inset:0 全屏，改为「头部下方 → 按钮上方」中间留白区，
   避免卡片高 76vh 在某些屏比下压住 .gacha-bottom-cta；同时消除顶部多余留白
   预留尺寸：top 64px+safe-area 给 header；bottom 120px+safe-area 给 cta（38px 按钮 + 36px 间距 + 36px 按钮高 + 余量）
*/
#gachaView .reveal-box {
  position: absolute;
  /* v1.2.x-27: cta 回归 bottom:16，footer 已搬到 detail；reserve = 16 + 50 + 20 = 86 */
  top:    calc(70px + env(safe-area-inset-top));
  bottom: calc(86px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  /* v1.2.x-6 关键修复：用 grid place-items:center 让 placeholder + polaroid-reveal 重叠居中
     上次改成 flex 导致两者并排（placeholder opacity:0 占左，polaroid 占右），出现半截卡片 bug */
  display: grid;
  grid-template-areas: "stack";
  place-items: center;
  overflow: visible;
}
#gachaView .reveal-box > .reveal-placeholder,
#gachaView .reveal-box > .polaroid-reveal,
#gachaView .reveal-box > .reveal-result {
  grid-area: stack;  /* 全部塞到同一个 cell，CSS 控制谁可见 */
}
/* 四角晕影 → 视线聚焦中央 */
#gachaView .reveal-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* v1.1.x：占位卡 = 横向胶囊（更宽更矮 + 暖色调 + ♡ 装饰）*/
/*           polaroid 翻卡 = 保持竖向 portrait（卡片图本身是 2:3）*/
#gachaView .reveal-placeholder {
  /* v1.2.x-7: 同 polaroid-card，用 viewport 数学严格约束高度，min-height: 0 解 grid 陷阱 */
  --vv-header: calc(70px + env(safe-area-inset-top));
  --vv-footer: calc(86px + env(safe-area-inset-bottom));
  --vv-avail-h: calc(100svh - var(--vv-header) - var(--vv-footer) - 16px);
  height: min(var(--vv-avail-h), 720px);
  width: 94%;
  max-width: 420px;
  min-height: 0;
  min-width: 0;
  aspect-ratio: auto !important;
  position: relative;
  z-index: 2;
}
/* 抽完后的真卡 v1.2.x-7
   关键问题：grid 里 aspect-ratio + width 会算出超出 grid cell 的 height（min-height:auto 陷阱），
   导致卡片 overflow 到底部按钮区。
   解法：用 viewport 数学算"可用高度"，从 height 反推 width，强约束 min-height: 0 解 grid 陷阱
   可用高度 = 100svh - top reserve(70+safe) - bottom reserve(112+safe) - 12 内边距
*/
#gachaView .polaroid-card {
  --vv-header: calc(70px + env(safe-area-inset-top));
  --vv-footer: calc(86px + env(safe-area-inset-bottom));
  --vv-avail-h: calc(100svh - var(--vv-header) - var(--vv-footer) - 16px);
  height: min(var(--vv-avail-h), 660px);
  width: auto;                /* 由 aspect-ratio + height 反推 */
  max-width: 94vw;            /* 窄屏兜底 */
  min-height: 0;              /* 关键：解 grid item 默认 min-height:auto */
  min-width: 0;
  aspect-ratio: 0.66;
  position: relative;
  z-index: 2;
}
#gachaView .polaroid-reveal {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

/* 占位卡：薄薄一片暖色毛玻璃 + 暖光晕 + ♡ 装饰 */
/* ⚠️ 不要在这里加 width/height —— 这个 class 与 .reveal-placeholder 共用同一 div，
       尺寸由 .reveal-placeholder 唯一控制，避免 100% 撑满整屏的 bug */
#gachaView .reveal-placeholder-photo {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 200, 200, 0.22);
  border-radius: 18px;
  box-shadow:
    0 14px 32px rgba(60, 20, 40, 0.42),
    0 0 0 1px rgba(255, 180, 200, 0.10),
    inset 0 1px 0 rgba(255, 220, 230, 0.18);
  overflow: hidden;
  position: relative;
}
/* 底图：毛玻璃透明度更高（亮度 0.75，blur 减小到 12px），更"隐约能看见"
   v1.2.x-12: background-position 从默认 center → 50% 32%（图像下移）
   原因：人物头部在源图上部，center/cover 让头贴卡顶，呼吸/光晕动效时
   头部"越界"出边框造成不适。32% 位置让头部安稳在卡内 30% 处
   inset 从 -16 → -8 减小溢出范围 */
#gachaView .reveal-placeholder-photo::before {
  content: "";
  position: absolute;
  inset: -8px;
  background:
    url('https://cdn.xdrama.tv/assets/suit_bs_chair_kneel_lookback.webp') 50% 32% / cover;
  filter: blur(12px) brightness(0.75) saturate(1.05);
  opacity: 0.85;
  z-index: 0;
}
/* 暖色光晕（粉/金调）+ 底部柔渐变 */
#gachaView .reveal-placeholder-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 180, 200, 0.20) 0%, transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.04) 0%, transparent 40%, rgba(40, 15, 30, 0.36) 100%);
  z-index: 1;
  pointer-events: none;
}
/* 标签文字：浮在卡中部，手写感 + 粉色 glow */
#gachaView .placeholder-label {
  /* 文案绝对定位到卡片中下方（约 65% 高度处），不再随 flex 居中 */
  position: absolute;
  bottom: 22%;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  /* 手写感字体（系统楷书优先；iOS 用 STKaiti，鸿蒙系优先用 HYQiHei 或 LXGW WenKai 等）*/
  font-family: "LXGW WenKai", "Ma Shan Zheng", "STKaiti", "FZShuTi", "KaiTi", "楷体", -apple-system, BlinkMacSystemFont, serif;
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(255, 240, 230, 0.96);
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(255, 180, 200, 0.4);
  text-align: center;
  padding: 0 14px;
  /* 若隐若现：独立于卡片呼吸的 fade，慢于呼吸节奏（7s 一个周期）*/
  animation: gachaLabelFade 7s ease-in-out infinite;
}
@keyframes gachaLabelFade {
  0%        { opacity: 0; }
  18%       { opacity: 1; }   /* fade in: 0 → 1.26s */
  55%       { opacity: 1; }   /* hold visible: 1.26s → 3.85s */
  78%       { opacity: 0; }   /* fade out: 3.85s → 5.46s */
  100%      { opacity: 0; }   /* hold invisible: 5.46s → 7s */
}

/* ♡ 装饰：右上角小心形（轻微脉动）*/
#gachaView .reveal-placeholder::before {
  content: "♡";
  position: absolute;
  top: 6px;
  right: 10px;
  z-index: 3;
  font-size: 14px;
  color: rgba(255, 170, 190, 0.9);
  text-shadow: 0 0 8px rgba(255, 100, 140, 0.6);
  animation: heartPulse 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1; }
}

/* 🎀 蝴蝶结：卡顶部居中（露出一半在卡上方）*/
#gachaView .reveal-placeholder::after {
  content: "🎀";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 32px;
  filter: drop-shadow(0 3px 7px rgba(120, 30, 60, 0.55));
  pointer-events: none;
}

/* 闪粉粒子：用 box-shadow 复制小光点，散布在卡片左/右上 */
#gachaView .placeholder-sparkles {
  position: absolute;
  top: 26%;
  left: 18%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 230, 235, 0.95);
  box-shadow:
    /* 各位置散布，px 相对自身位置；alpha 不同模拟远近 */
     58px  -6px 0 0.5px rgba(255, 220, 230, 0.78),
    128px   3px 0 0.5px rgba(255, 210, 220, 0.62),
    178px -10px 0 0.5px rgba(255, 230, 240, 0.85),
    232px   8px 0 0.5px rgba(255, 200, 215, 0.55),
    -8px   12px 0 0.5px rgba(255, 220, 230, 0.70),
     90px  18px 0 0.5px rgba(255, 225, 235, 0.50);
  z-index: 2;
  animation: sparkleBreath 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sparkleBreath {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ── 底部吸边：CTA 按钮 ── */
/* v1.2.x-27: legal-footer 搬到 collection-detail 后，gacha 页底部回归 bottom:16
   不再需要给 ICP 文字让位（gacha 页底部纯按钮区，干净） */
#gachaView .gacha-bottom-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  width: auto;
}
/* v1.1.x: 主按钮 = 惊喜抽卡（金色，召唤付费）；次按钮 = 我的收藏（玻璃质感，回顾入口）*/
#gachaView .gacha-bottom-cta #gachaDrawButton {
  flex: 1;
  max-width: 220px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: 0 10px 32px rgba(244, 201, 143, 0.36);
}
#gachaView .gacha-bottom-cta #gachaCollectionFromIdleButton {
  flex: 1;
  max-width: 140px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 230, 208, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}
#gachaView .gacha-bottom-cta #gachaCollectionFromIdleButton:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.96);
}

/* 揭晓后双行按钮（我的收藏 / 加入收藏 / 再抽一次）也吸底 */
#gachaView .reveal-result {
  /* v1.2.x-27: 同 cta，回归 bottom:16 */
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 26;
  padding: 0 18px;
  width: auto;
  text-align: center;
}
#gachaView .gacha-result-actions {
  max-width: 380px;
  margin: 0 auto;
}
/* v1.1.x：揭晓后唯一一行 = 我的收藏 + 再来一次 */
#gachaView .gacha-result-row-single {
  display: flex;
  gap: 12px;
  justify-content: center;
}
#gachaView .gacha-result-row-single .gacha-main-button {
  flex: 1;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  min-width: 0;
  /* 主按钮（再来一次）继承现有 primary-button 金色样式；
     我的收藏 弱化为次级，避免双主按钮抢戏 */
}
/* 我的收藏 改成次级灰色（金色按钮只留给"再来一次"召唤再消费） */
#gachaView #gachaCollectionButton {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 230, 208, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}
#gachaView #gachaCollectionButton:active {
  background: rgba(255, 255, 255, 0.18);
}

/* has-result 或 revealing(动画进行中) 都隐藏 idle CTA — 防卡片被按钮叠住 */
#gachaView .reveal-box.has-result .gacha-bottom-cta,
#gachaView .reveal-box.revealing .gacha-bottom-cta {
  display: none;
}

/* 揭晓后卡片底部的元数据（rarity tag + title）保持原样 */
/* polaroid-meta 已有样式，不动 */

/* ─────────────────────────────────────────────────
   v1.1 一期：「今日翻完了」+「想要看更多？」按钮
   §2.3 隐性付费意愿验证点
   位置：和 gacha-bottom-cta 同位（无翻牌次数时显示，互斥）
───────────────────────────────────────────────── */
/* v1.2.x-32: 提示文字上移到卡片下沿外 — bottom 88→124
   防止文字"今日翻完了..."压在卡片边框上（reveal-box bottom 86 + 8 边距 + 30 文字高 ≈ 124）*/
#gachaView .gacha-today-done {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(124px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  pointer-events: none;
}
#gachaView .today-done-hint {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 230, 208, 0.78);
  letter-spacing: 0.08em;
  font-weight: 500;
}
/* 邀请裂变入口①「带朋友来」按钮 */
#gachaView .invite-entry-btn {
  display: block;
  margin: 14px auto 0;
  padding: 11px 26px;
  background: linear-gradient(135deg, #c084fc, #818cf8);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 22px;
  letter-spacing: 0.05em;
  cursor: pointer;
  /* BUG-010-CSS：父容器 .gacha-today-done 设了 pointer-events:none（防遮挡背景交互），
     子按钮必须显式 auto 覆盖，否则继承 none → 点击穿透 → JS 事件委托永远收不到 click。 */
  pointer-events: auto;
}
@media (max-height: 700px) {
  #gachaView .gacha-today-done {
    bottom: calc(24px + env(safe-area-inset-bottom));
    gap: 10px;
  }
}

/* 小屏适配：iPhone SE 等 < 700px 高的设备 */
@media (max-height: 700px) {
  /* 小屏：占位适度变矮，仍保留视觉存在感 */
  #gachaView .reveal-placeholder {
    width: 90%;
    max-width: 320px;
    height: 160px;
    max-height: 24vh;
  }
  #gachaView .placeholder-label { font-size: 14px; }
  #gachaView .reveal-placeholder::after { font-size: 20px; top: -10px; }
  #gachaView .polaroid-card {
    /* 小屏：真卡 88vw / 340px / 视口剩余高度安全范围 */
    width: min(88vw, 340px, calc((100vh - 150px) * 0.66));
    max-width: 340px;
  }
  #gachaView .gacha-bottom-cta {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  #gachaView .reveal-result {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  #gachaView .gacha-bottom-cta .gacha-main-button {
    padding: 12px 30px;
    font-size: 14px;
  }
}

/* ═══════════════════════════════════════════════════════
   二期 v1.1.0 · Acknowledge — 新增组件样式
   ═══════════════════════════════════════════════════════ */

/* ── F3 昵称引导（message-bubble 内联 input 模式）──── */

/* mode=text 时隐藏 prompt，mode=nickname-prompt 时显示 */
#messageBubble[data-mode="text"]             .nickname-prompt { display: none; }
#messageBubble[data-mode="text"]             #messageText     { display: block; }
#messageBubble[data-mode="nickname-prompt"]  .nickname-prompt { display: block; }
#messageBubble[data-mode="nickname-prompt"]  #messageText     { display: none; }
#messageBubble[data-mode="nickname-confirm"] .nickname-prompt { display: none; }
#messageBubble[data-mode="nickname-confirm"] #messageText     { display: block; }

.nickname-prompt {
  padding: 2px 0;
}
.nickname-prompt-q {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  color: inherit;
  white-space: pre-wrap;
}
.nickname-prompt-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  color: #fff;
  outline: none;
  margin-bottom: 10px;
  font-family: inherit;
  caret-color: #fff;
}
.nickname-prompt-input::placeholder { color: rgba(255,255,255,0.45); }
.nickname-prompt-input:focus { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.18); }
.nickname-prompt-input.shake {
  animation: nickname-shake 0.3s ease;
}
@keyframes nickname-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}
.nickname-prompt-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.nickname-btn-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  padding: 6px 8px;
  cursor: pointer;
  font-family: inherit;
}
.nickname-btn-skip:active { opacity: 0.6; }
.nickname-btn-submit {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  color: #fff;
  font-size: 13px;
  padding: 6px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.nickname-btn-submit:active { background: rgba(255,255,255,0.32); }

/* ── F5 连签第 7 天奖励弹窗 ──────────────────────── */

.streak-reward-modal {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.streak-reward-modal.hidden { display: none; }

.streak-reward-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.82);
}
.streak-reward-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #1a1030 0%, #0d0820 100%);
  border: 1px solid rgba(180,140,255,0.25);
  border-radius: 20px;
  padding: 40px 32px 32px;
  width: min(320px, 86vw);
  text-align: center;
  box-shadow: 0 0 60px rgba(140,80,255,0.2);
  animation: streak-card-in 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes streak-card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.streak-reward-glow {
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160,100,255,0.35) 0%, transparent 70%);
  pointer-events: none;
}
.streak-reward-label {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(200,180,255,0.7);
  letter-spacing: 0.04em;
}
.streak-reward-main {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  color: #e8d8ff;
  letter-spacing: 0.02em;
}
.streak-reward-sub {
  margin: 0 0 28px;
  font-size: 13px;
  color: rgba(200,180,255,0.55);
}
.streak-reward-go {
  width: 100%;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #7c4dff, #9c6dff);
  border: none;
  border-radius: 24px;
  padding: 14px;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}
.streak-reward-go:active { opacity: 0.8; }
.streak-reward-dismiss {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: rgba(200,180,255,0.45);
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
}
.streak-reward-dismiss:active { opacity: 0.6; }

/* ── C3 E4：首翻订阅召回底部弹窗 ─────────────────────────── */
.recall-sheet {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.recall-sheet.hidden { display: none; }
.recall-sheet.show {
  opacity: 1;
  pointer-events: auto;
}
.recall-sheet-inner {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(160deg, #1e1330 0%, #0e0a1a 100%);
  border-top: 1.5px solid rgba(200,160,255,0.25);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 350ms cubic-bezier(0.22,1,0.36,1);
}
.recall-sheet.show .recall-sheet-inner {
  transform: translateY(0);
}
.recall-sheet-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}
.recall-sheet-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8d5ff;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.recall-sheet-desc {
  font-size: 0.875rem;
  color: rgba(200,180,230,0.75);
  line-height: 1.6;
  margin-bottom: 22px;
}
.recall-sheet-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #9b5de5, #7b3fc4);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  font-family: inherit;
  transition: opacity 150ms;
}
.recall-sheet-btn:active { opacity: 0.8; }
.recall-sheet-skip {
  background: none;
  border: none;
  color: rgba(200,180,230,0.45);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  padding: 4px;
}
.recall-sheet-skip:active { opacity: 0.6; }
