/* ==========================================================================
   角色小屋 · 游戏中心首页
   --------------------------------------------------------------------------
   1. 主题变量  2. 基础  3. 背景层  4. 舞台（角色 / 小屋）
   5. 顶部 HUD  6. 底部 Dock  7. 面板 Sheet  8. 内景视图  9. 响应式
   ========================================================================== */

/* ---------- 1. 主题变量 ---------- */
:root {
  --gold-l: #fff8e4;
  --gold: #ffe6a8;
  --gold-m: #f7cf78;
  --gold-d: #c9922f;
  --ink: #6b4410;
  --ink-soft: #8a5e28;

  --dock-h: 126px;
  --dock-pad: 26px;

  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --shadow-deep: 0 18px 40px rgba(38, 10, 56, .38);
}

/* 森林 · 黄昏草地 */
body[data-theme="forest"] {
  --sky-1: #37155e;
  --sky-2: #7b2f9c;
  --sky-3: #cd5aa8;
  --sky-4: #ff9f78;
  --sky-5: #ffcf92;
  --glow: #ffd9a0;
  --cloud: #ffe6f4;
  --cloud-2: #ffffff;
  --mtn: #7d5aa8;
  --mtn-2: #5c3f86;
  --tree-1: #3d8b53;
  --tree-2: #276847;
  --tree-3: #1b4b34;
  --hill-far: #8ed050;
  --hill-mid: #6cb83a;
  --hill-near: #54a02c;
  --grass: #3d8626;
  --ray: rgba(255, 226, 170, .18);
  --hud-ink: #5d3a12;
  --ground-tuft: #86bf45;
  --badge-1: #9be07a;
  --badge-2: #4fae34;
}

/* 星空 · 深夜屋顶 */
body[data-theme="starry"] {
  --sky-1: #0a0824;
  --sky-2: #241a5e;
  --sky-3: #5b2d86;
  --sky-4: #a8519c;
  --sky-5: #d98cb8;
  --glow: #cdb8ff;
  --cloud: #b9a6ff;
  --cloud-2: #e5dbff;
  --mtn: #3b2a6d;
  --mtn-2: #261a4c;
  --tree-1: #23305e;
  --tree-2: #141c3c;
  --tree-3: #0b1026;
  --hill-far: #4f5fa8;
  --hill-mid: #3d4b90;
  --hill-near: #2c376f;
  --grass: #222b57;
  --ray: rgba(190, 170, 255, .22);
  --hud-ink: #4a2f66;
  --ground-tuft: #bda9e6;
  --badge-1: #b9a6ff;
  --badge-2: #7b5ce0;
}

/* 海洋 · 深海珊瑚 */
body[data-theme="ocean"] {
  --sky-1: #03304a;
  --sky-2: #0a6b85;
  --sky-3: #23a8b0;
  --sky-4: #62cfc4;
  --sky-5: #a8ecdd;
  --glow: #b6f4ff;
  --cloud: #cdf6ff;
  --cloud-2: #ffffff;
  --mtn: #0d5670;
  --mtn-2: #073c52;
  --tree-1: #11786f;
  --tree-2: #0a564f;
  --tree-3: #06403c;
  --hill-far: #46c2ab;
  --hill-mid: #2ea894;
  --hill-near: #1d8a7c;
  --grass: #12716a;
  --ray: rgba(190, 250, 255, .22);
  --hud-ink: #0f4d5c;
  --ground-tuft: #e6d2a6;
  --badge-1: #7fe0e8;
  --badge-2: #2a9db8;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #14082a;
}

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI",
    "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; }

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transition: background .6s ease;
}

/* ---------- 3. 背景层：主题背景图 ---------- */
.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b0418;
}

/* 两张图交叉淡化，切换主题 / 横竖屏时不闪白 */
.scene__bg {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  object-position: center 50%;
  opacity: 0;
  transition: opacity .7s ease;
  will-change: opacity;
  pointer-events: none;
  user-select: none;
}
.scene__bg.is-active { opacity: 1; }

/* 星光粒子：叠在背景图之上，让画面有呼吸感 */
.scene__sparks { position: absolute; inset: 0; pointer-events: none; }
.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 240, 190, .85) 38%, rgba(255, 220, 150, 0) 70%);
  animation: spark-float linear infinite;
  will-change: transform, opacity;
}
@keyframes spark-float {
  0% { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
  12% { opacity: .9; }
  70% { opacity: .7; }
  100% { transform: translate3d(14px, -30vh, 0) scale(1.1); opacity: 0; }
}

/* 海底气泡（仅海洋主题） */
.scene__bubbles { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; }
body[data-theme="ocean"] .scene__bubbles { opacity: 1; }
.bubble {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(210, 250, 255, .65);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .8), rgba(190, 245, 255, .12) 60%);
  animation: bubble-rise linear infinite;
}
@keyframes bubble-rise {
  0% { transform: translate3d(0, 10vh, 0) scale(.7); opacity: 0; }
  15% { opacity: .85; }
  100% { transform: translate3d(24px, -105vh, 0) scale(1.15); opacity: 0; }
}

/* 暗角：压暗四角，保证 HUD 与按钮在亮背景上依然清晰 */
.scene__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 48%, rgba(18, 6, 34, .32) 100%),
    linear-gradient(180deg,
      rgba(14, 4, 28, .34) 0%,
      transparent 16%,
      transparent 70%,
      rgba(8, 4, 16, .46) 100%);
  pointer-events: none;
}

/* ---------- 4. 舞台：角色 / 小屋 ---------- */
.stage {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* 小屋已并入背景图：这里只保留一块透明热区，点击即可进屋。
   热区位置按主题与屏幕方向分别贴合背景图中小屋的实际位置。 */
.house-hotspot {
  position: absolute;
  left: var(--hs-l, 55%);
  top: var(--hs-t, 25%);
  width: var(--hs-w, 44%);
  height: var(--hs-h, 62%);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
  transition: background .25s ease;
}
.house-hotspot:hover,
.house-hotspot:focus-visible {
  outline: none;
  background: radial-gradient(ellipse at 50% 64%, rgba(255, 244, 208, .18), transparent 72%);
}

/* 各主题小屋在背景图中的位置（横版） */
body[data-theme="forest"] .house-hotspot { --hs-l: 54%; --hs-t: 24%; --hs-w: 45%; --hs-h: 64%; }
body[data-theme="starry"] .house-hotspot { --hs-l: 54%; --hs-t: 19%; --hs-w: 45%; --hs-h: 67%; }
body[data-theme="ocean"]  .house-hotspot { --hs-l: 50%; --hs-t: 19%; --hs-w: 49%; --hs-h: 67%; }

/* 角色：站在画面左侧空地，与背景中的小屋形成前后关系 */
.hero {
  position: absolute;
  left: 33%;
  bottom: 4vh;
  height: min(76vh, 48vw);
  aspect-ratio: 1773 / 2364;
  transform: translateX(-50%);
  z-index: 3;
  animation: hero-bob 5.5s ease-in-out infinite;
  filter: drop-shadow(0 22px 26px rgba(28, 8, 44, .34));
  transition: left .5s var(--ease-pop, cubic-bezier(.2,.9,.25,1.2)),
              top .5s var(--ease-pop, cubic-bezier(.2,.9,.25,1.2)),
              height .5s var(--ease-pop, cubic-bezier(.2,.9,.25,1.2)),
              transform .5s var(--ease-pop, cubic-bezier(.2,.9,.25,1.2)),
              filter .4s ease;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
}
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 7.6%;
  width: 32%;
  height: 2%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 50%,
    rgba(0, 0, 0, .55) 0%,
    rgba(0, 0, 0, .28) 44%,
    rgba(0, 0, 0, .08) 70%,
    transparent 84%);
  filter: blur(2.5px);
  z-index: -1;
}

/* 脚前地面压痕：一层主题地面色的柔边，让脚"踩进"地面而不是浮在表面 */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6.6%;
  width: 38%;
  height: 2.6%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 14%,
    var(--ground-tuft) 0%,
    transparent 74%);
  filter: blur(3.5px);
  opacity: .52;
  z-index: 2;
  pointer-events: none;
}
/* 点角色说话：舞台整体不吃点击，但角色立绘自己要单独放开，否则点不到 */
.hero { cursor: pointer; pointer-events: auto; }
.hero img { pointer-events: auto; }
/* 头顶"和我聊聊"胶囊：奶白浅金玻璃底 + 暖金细描边柔光 + 底部小尾巴 + 下方天使光环 */
.hero__chat {
  position: absolute;
  left: 50%;
  top: 5.5%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 5;
}
.hero__chat-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px 5px 6px;
  border-radius: 99px;
  border: 1px solid rgba(240, 205, 122, .95);
  background:
    radial-gradient(circle at 78% 32%, rgba(201, 150, 60, .55) 0 1px, transparent 1.8px),
    radial-gradient(circle at 26% 68%, rgba(201, 150, 60, .4) 0 .8px, transparent 1.6px),
    linear-gradient(180deg, rgba(255, 252, 242, .93), rgba(255, 244, 214, .85));
  box-shadow: 0 3px 14px rgba(28, 10, 46, .4), 0 0 14px rgba(244, 214, 138, .42), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  white-space: nowrap;
}
/* 胶囊底部向下的小尾巴，和胶囊同色同描边 */
.hero__chat-pill::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: rgba(255, 248, 224, .92);
  border-right: 1px solid rgba(240, 205, 122, .95);
  border-bottom: 1px solid rgba(240, 205, 122, .95);
  border-radius: 0 0 2px 0;
  transform: translateX(-50%) rotate(45deg);
}
.hero__chat-ic {
  width: 19px;
  height: 19px;
  flex: none;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(90, 60, 20, .3));
}
.hero__chat-txt {
  color: #6b4a1f;
  font-size: clamp(10px, 1.05vw, 13px);
  font-weight: 900;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
}
/* 单圈横向金色天使光环：细边柔光，悬浮不接触头部 */
.hero__chat-ring {
  width: 92px;
  height: 15px;
  border: 1.5px solid #f4d68a;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(244, 214, 138, .72), inset 0 0 5px rgba(244, 214, 138, .4);
  transform: rotate(-5deg);
  opacity: .95;
  margin-top: 2px;
}
@keyframes hero-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-1.4%); }
}

/* 环境光覆盖：统一角色/小屋与背景的色温，消除"贴纸感" */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  mix-blend-mode: soft-light;
}
body[data-theme="forest"] .stage::after {
  background: linear-gradient(180deg,
    rgba(255, 176, 214, .22) 0%,
    rgba(255, 214, 156, .26) 42%,
    rgba(74, 132, 40, .3) 100%);
}
body[data-theme="starry"] .stage::after {
  background: linear-gradient(180deg,
    rgba(148, 126, 255, .3) 0%,
    rgba(96, 64, 168, .26) 58%,
    rgba(52, 34, 104, .3) 100%);
}
body[data-theme="ocean"] .stage::after {
  background: linear-gradient(180deg,
    rgba(160, 240, 255, .32) 0%,
    rgba(46, 158, 190, .3) 46%,
    rgba(12, 84, 106, .34) 100%);
}

/* 立绘轻度色调归一：向场景光照靠拢，但保留人物本身的肤色层次 */
.hero img { transition: filter .5s ease; }
body[data-theme="forest"] .hero img { filter: saturate(1.02) brightness(1.01) contrast(1.01); }
body[data-theme="starry"] .hero img { filter: saturate(1.04) brightness(.97) hue-rotate(-4deg); }
body[data-theme="ocean"] .hero img { filter: saturate(.92) brightness(.96) hue-rotate(-9deg) contrast(1.02); }


/* 换装切换动效 */
.stage.is-swapping .hero { animation: swap-pop .45s var(--ease-pop); }
@keyframes swap-pop {
  0% { opacity: .3; filter: brightness(1.8) blur(6px); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

/* 出场光晕 */
.hero__aura {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 130%;
  height: 60%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 90%, rgba(255, 246, 200, .5), transparent 62%);
  filter: blur(18px);
  z-index: -2;
  pointer-events: none;
}

/* ---------- 5. 顶部 HUD ---------- */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) clamp(18px, 2.4vw, 46px) 0;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

/* 去学习按钮：与信息卡同一套奶油白质感，位置在右上角 */
.learn-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 60px;
  padding: 0 22px 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(255, 242, 220, .92));
  color: var(--hud-ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .5px;
  white-space: nowrap;
  box-shadow:
    0 10px 26px rgba(50, 12, 70, .32),
    0 0 0 3px rgba(255, 236, 186, .2),
    inset 0 1.5px 0 #fff,
    inset 0 -2px 0 rgba(200, 160, 100, .25);
  backdrop-filter: blur(10px);
  transition: transform .2s var(--ease-pop), box-shadow .2s, filter .2s;
}
.learn-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 14px 30px rgba(50, 12, 70, .36),
    0 0 0 4px rgba(255, 232, 168, .26),
    inset 0 1.5px 0 #fff,
    inset 0 -2px 0 rgba(200, 160, 100, .25);
}
.learn-btn:active { transform: translateY(1px) scale(.97); }
.learn-btn__ic { width: 29px; height: 29px; flex: none; }

/* 顶部信息卡：小屋徽章 + 名称 + 等级 + 星星数量，合并为一个整体 */
.hud-card {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 243, 224, .9));
  color: var(--hud-ink);
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow:
    0 10px 26px rgba(50, 12, 70, .32),
    inset 0 1.5px 0 #fff,
    inset 0 -2px 0 rgba(200, 160, 100, .25);
  backdrop-filter: blur(10px);
}
.hud-card__badge {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--badge-1, #9be07a), var(--badge-2, #4fae34));
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 2px 6px rgba(30, 80, 20, .3);
}
.hud-card__name {
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}
.hud-card__lv {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #ff9a5c, #e2691f);
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: inset 0 -1px 0 rgba(160, 80, 0, .4);
  letter-spacing: .3px;
}
.hud-card__sep {
  flex: none;
  width: 2px;
  height: 30px;
  margin: 0 1px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent 8%, rgba(166, 124, 62, .55) 50%, transparent 92%);
}

/* 星星数量：内嵌在小卡片右侧的金色小块，点击进入商城 */
.coin {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 46px;
  padding: 0 15px 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 252, 236, .95);
  background: linear-gradient(180deg, #fff1bc, #ffd45e 52%, #eeb23c);
  box-shadow:
    inset 0 1.5px 0 #fffce8,
    inset 0 -2px 0 rgba(158, 98, 18, .38),
    0 2px 6px rgba(150, 90, 20, .26);
  transition: transform .18s var(--ease-pop), filter .18s;
}
.coin:hover { filter: brightness(1.05); }
.coin:active { transform: scale(.95); }
.coin__ic { width: 30px; height: 30px; }
.coin__num {
  color: #6d410c;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}
.coin.is-bump { animation: coin-bump .45s var(--ease-pop); }
@keyframes coin-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* 顶部提示条（小屋切换后短暂显示） */
.hint {
  position: absolute;
  top: calc(max(16px, env(safe-area-inset-top)) + 78px);
  left: 50%;
  transform: translate(-50%, -10px) scale(.94);
  padding: 10px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf4 0%, #ffefc9 56%, #f7d78d 100%);
  border: 1.5px solid rgba(255, 251, 236, .95);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #6b4410;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  box-shadow:
    0 12px 26px rgba(74, 32, 6, .3),
    0 0 0 4px rgba(255, 232, 168, .2),
    inset 0 2px 0 #fffdf6,
    inset 0 -3px 0 rgba(186, 132, 44, .3);
  opacity: 0;
  transition: opacity .3s, transform .34s var(--ease-pop);
  pointer-events: none;
  z-index: 40;
  white-space: nowrap;
}
.hint.is-show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- 6. 底部 Dock ---------- */
.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--dock-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(20px, 2.8vw, 52px) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(16, 6, 28, .28) 62%, rgba(12, 4, 22, .42));
}

.dock__tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  padding: 9px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 252, 246, .2), rgba(255, 248, 236, .07));
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow:
    0 12px 28px rgba(20, 6, 36, .2),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}

/* 图标直接浮在玻璃托盘上：没有独立底色，只有 squircle 形状用于高亮与点击区 */
.dock-btn {
  --s: 1;              /* 缩放由 JS 按鼠标距离写入，CSS hover 兜底 */
  --lift: 0px;
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  padding: 0;
  border-radius: 22.37%;       /* Big Sur 图标圆角比例 */
  background: transparent;
  transform-origin: 50% 100%;
  transform: translateY(calc(var(--lift) + (var(--s) - 1) * -30px)) scale(var(--s));
  transition: transform .18s cubic-bezier(.22, .9, .3, 1.35);
  will-change: transform;
}

.dock-btn img {
  width: 96%;
  height: 96%;
  object-fit: contain;
  color: transparent;          /* 加载失败时不显示 alt 文本 */
  filter: drop-shadow(0 6px 10px rgba(22, 8, 38, .38));
  transition: filter .2s ease;
}
.dock-btn:hover img { filter: drop-shadow(0 10px 16px rgba(22, 8, 38, .45)) brightness(1.04); }
.dock-btn:hover { --s: 1.24; }
.dock-btn:active { --s: .96; }
.dock-btn.is-active { --s: 1.08; --lift: -4px; }

/* 按钮标签：与金币胶囊 / 开始按钮同一套"奶油金"视觉，替代浏览器原生 tooltip */
.dock-btn::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 13px);
  transform: translate(-50%, 7px) scale(calc(.9 / var(--s, 1)));
  transform-origin: 50% 100%;
  padding: 8px 17px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1;
  white-space: nowrap;
  color: #6b4410;
  background: linear-gradient(180deg, #fffdf4 0%, #ffefc9 56%, #f7d78d 100%);
  border: 1.5px solid rgba(255, 251, 236, .95);
  box-shadow:
    0 8px 20px rgba(74, 32, 6, .3),
    0 0 0 3px rgba(255, 232, 168, .22),
    inset 0 1.5px 0 #fffdf6,
    inset 0 -2.5px 0 rgba(186, 132, 44, .32);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .26s var(--ease-pop);
  z-index: 6;
}
.dock-btn:hover::before,
.dock-btn:focus-visible::before,
.dock-btn.is-tip::before {
  opacity: 1;
  transform: translate(-50%, 0) scale(calc(1 / var(--s, 1)));
}

/* 按下时四枚按钮使用同一套回弹，不区分角色 */
.dock-btn.is-tap { animation: dock-tap .32s var(--ease-pop); }
@keyframes dock-tap {
  0% { scale: 1; }
  42% { scale: .9; }
  100% { scale: 1; }
}
.dock-btn.is-active { transform: translateY(-8px) scale(1.06); }
.dock-btn.is-active::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 30%;
  border: 3px solid rgba(255, 236, 168, .95);
  box-shadow: 0 0 22px rgba(255, 209, 106, .85), inset 0 0 14px rgba(255, 236, 168, .5);
  animation: ring-in .32s var(--ease-pop);
}
@keyframes ring-in {
  from { opacity: 0; transform: scale(.86); }
  to { opacity: 1; transform: scale(1); }
}

/* 开始游戏 */
.start-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 76px;
  padding: 0 46px;
  border-radius: 999px;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #7d4d0d;
  background: linear-gradient(180deg, #fffdf3 0%, #fff0c6 34%, #ffdd9a 68%, #f0bd63 100%);
  border: 2px solid #fffbee;
  box-shadow:
    0 14px 30px rgba(110, 56, 6, .4),
    0 0 0 5px rgba(255, 226, 158, .32),
    0 0 46px rgba(255, 200, 110, .5),
    inset 0 3px 0 #fffdf6,
    inset 0 -5px 0 rgba(186, 128, 40, .42);
  transition: transform .2s var(--ease-pop), box-shadow .2s, filter .2s;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
  animation: start-glow 3.4s ease-in-out infinite;
}
@keyframes start-glow {
  0%, 100% { box-shadow: 0 14px 30px rgba(110, 56, 6, .4), 0 0 0 5px rgba(255, 226, 158, .3), 0 0 40px rgba(255, 200, 110, .42), inset 0 3px 0 #fffdf6, inset 0 -5px 0 rgba(186, 128, 40, .42); }
  50% { box-shadow: 0 14px 34px rgba(110, 56, 6, .45), 0 0 0 8px rgba(255, 226, 158, .16), 0 0 62px rgba(255, 214, 130, .7), inset 0 3px 0 #fffdf6, inset 0 -5px 0 rgba(186, 128, 40, .42); }
}
.start-btn:hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.04); }
.start-btn:active { transform: translateY(1px) scale(.99); }
.start-btn__arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffc75e, #ed9a24);
  box-shadow: inset 0 -2px 0 rgba(150, 80, 0, .35);
  font-size: 16px;
  color: #fff9e6;
  letter-spacing: 0;
}

/* ---------- 7. 面板 Sheet ---------- */
/* ============================================================
   首次进入：角色资料引导
   ============================================================ */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.welcome.is-open { opacity: 1; pointer-events: auto; }
.welcome__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 110%, rgba(20, 8, 44, .52), rgba(6, 2, 16, .82));
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
.welcome__card {
  position: relative;
  width: min(880px, 96vw);
  max-height: min(96vh, 940px);
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 247, .97), rgba(255, 246, 232, .94));
  box-shadow:
    0 34px 80px rgba(6, 2, 20, .6),
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(255, 255, 255, .65);
  transform: translateY(20px) scale(.97);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}
.welcome.is-open .welcome__card { transform: none; }
/* 顶部金色描边，和小屋面板呼应 */
.welcome__card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #f7cf78, #ffe9b8, #e8b25a, #ffe9b8, #f7cf78);
}

.welcome__head { padding: 14px 24px 0; text-align: center; }
.welcome__kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #a9761f;
}
.welcome__head h2 {
  margin: 4px 0 3px;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: .6px;
  color: #4a2d0c;
}
.welcome__sub { margin: 0; font-size: 11.5px; font-weight: 600; color: #8a6b45; }

.welcome__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 22px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 110, 60, .45) transparent;
}
.welcome__body::-webkit-scrollbar { width: 6px; }
.welcome__body::-webkit-scrollbar-thumb { background: rgba(150, 110, 60, .42); border-radius: 3px; }
.welcome__body::-webkit-scrollbar { width: 6px; }
.welcome__body::-webkit-scrollbar-thumb { background: rgba(150, 110, 60, .42); border-radius: 3px; }
.welcome__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.welcome__note {
  margin-left: 8px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  color: #ab8b57;
}
.welcome__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 14px;
  border-top: 1px solid rgba(150, 110, 60, .16);
}
.welcome__coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: inset 0 0 0 1.5px rgba(190, 150, 80, .35), 0 3px 10px rgba(120, 80, 20, .16);
  font-size: 14px;
  font-weight: 900;
  color: #7a4a00;
}
.welcome__go { margin-left: auto; }
.welcome__tip {
  margin: 0 24px 2px;
  min-height: 16px;
  font-size: 11.5px;
  font-weight: 800;
  color: #c2552a;
  text-align: center;
}

/* 未解锁卡片：灰度 + 价格胶囊 */
.card.is-locked { opacity: .8; }
.card.is-locked .card__media img { filter: grayscale(.9) brightness(.97); }
.card.is-locked .card__name { color: #8a7350; }
.card.is-locked:hover { transform: translateY(-2px); }
.card__lock {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3d0, #ffd582);
  box-shadow: 0 3px 10px rgba(120, 70, 10, .34), inset 0 1px 0 #fff8e4;
  color: #6d410c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  white-space: nowrap;
  pointer-events: none;
}
.card__lock i { font-style: normal; font-size: 9.5px; }

/* 引导卡片里把卡片做紧凑一些，让 6 个角色 + 3 个小屋尽量一屏放下 */
.welcome .card { border-radius: 18px; }
.welcome .card--chara .card__media { height: 84px; }
.welcome .card--house .card__media { height: 76px; }
.welcome .card--house .card__media img { transform: translateY(-4%) scale(1.28); }
.welcome .card__name { padding: 5px 4px 7px; font-size: 12px; }
.welcome .grid { gap: 9px; }

.mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: radial-gradient(ellipse at 50% 120%, rgba(20, 6, 36, .1), rgba(10, 2, 20, .5));
  backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease, backdrop-filter .32s ease;
}
.mask.is-open { opacity: 1; pointer-events: auto; backdrop-filter: blur(6px); }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 45;
  width: min(1020px, 96vw);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  transform: translate(-50%, 104%);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
  border-radius: 34px 34px 0 0;
  /* 半透明磨砂玻璃：底色只留一半，靠 backdrop-filter 把背后的场景糊开 */
  background: linear-gradient(180deg, rgba(255, 253, 247, .74), rgba(255, 244, 228, .60));
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  box-shadow:
    0 -18px 60px rgba(40, 10, 60, .42),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 0 0 1px rgba(255, 255, 255, .45);
  color: #5d3a12;
  overflow: hidden;
}
.sheet.is-open { transform: translate(-50%, 0); }
/* 木纹顶部描边，呼应小屋质感 */
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #f7cf78, #ffe9b8, #e8b25a, #ffe9b8, #f7cf78);
  opacity: .85;
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 26px 12px;
}
.sheet__title {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #4b2d0a;
}
.sheet__sub {
  font-size: 13px;
  font-weight: 700;
  color: #a5824e;
  letter-spacing: .3px;
}
.sheet__close {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .55);
  color: #8a6a3d;
  font-size: 20px;
  font-weight: 900;
  transition: transform .2s, background .2s;
}
.sheet__close:hover { background: #e8d9bf; transform: rotate(90deg); }

.sheet__body {
  padding: 4px 26px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet__body::-webkit-scrollbar { width: 8px; }
.sheet__body::-webkit-scrollbar-thumb { background: #e0cdae; border-radius: 99px; }

.panel { display: none; }
.panel.is-active { display: block; animation: panel-in .34s ease both; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* 卡片网格 */
.grid {
  display: grid;
  gap: 14px;
}
.grid--house { grid-template-columns: repeat(3, 1fr); }
.grid--chara { grid-template-columns: repeat(3, 1fr); }
.grid--shop  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--outfit { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.card {
  position: relative;
  padding: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 6px 16px rgba(120, 80, 20, .14), inset 0 0 0 2px rgba(240, 227, 203, .9);
  overflow: hidden;
  text-align: center;
  transition: transform .22s var(--ease-pop), box-shadow .22s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 26px rgba(120, 80, 20, .2), inset 0 0 0 2px #e6d3b3; }
.card.is-on { box-shadow: 0 10px 24px rgba(200, 140, 40, .3), inset 0 0 0 3px #ffc85e; }
.card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #fdf6e7, #f2e6d0);
}
.card--house .card__media { height: 148px; }
.card--chara .card__media { height: 150px; }
.card--outfit .card__media { height: 132px; }
.card--outfit .card__media img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; object-position: center bottom; padding: 2px; }
.card--outfit.is-locked .card__media img { filter: grayscale(.45) opacity(.9); }
.card--outfit .card__name { padding: 8px 4px 10px; font-size: 12.5px; }
.card__media img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; padding: 8px;
}
.card--house .card__media img { transform: translateY(-7%) scale(1.46); }
.card--chara .card__media img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; object-position: center bottom; padding: 2px; }
.card__name {
  display: block;
  padding: 10px 6px 12px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;
  color: #5b3a12;
}
.card__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .5px;
  color: #fff;
  background: linear-gradient(180deg, #ffc65c, #ef8f22);
  box-shadow: 0 3px 8px rgba(160, 90, 10, .3);
}
.card__tag--ghost {
  color: #a06a1c;
  background: rgba(255, 255, 255, .92);
  box-shadow: inset 0 0 0 1.5px #f0d9ad, 0 2px 6px rgba(160, 90, 10, .12);
}
.card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: linear-gradient(180deg, #8fe06a, #45a92c);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(30, 90, 20, .35);
}
.card.is-on .card__check { display: grid; }

/* ---------- 角色面板：学生资料 + 选角 ---------- */
.panel.is-active[data-panel="chara"] {
  display: grid;
  grid-template-columns: minmax(240px, .92fr) minmax(280px, 1.08fr);
  gap: 20px;
  padding-bottom: 6px;
  align-items: start;
}
/* 橱窗放在「选择角色」下面，和角色卡同一列；资料栏纵向占两行 */
.panel.is-active[data-panel="chara"] .profile { grid-column: 1; grid-row: 1 / span 2; }
.panel.is-active[data-panel="chara"] .chara-pick:not(.outfit-pick) { grid-column: 2; grid-row: 1; }
.panel.is-active[data-panel="chara"] .outfit-pick { grid-column: 2; grid-row: 2; margin-top: 14px; min-width: 0; }

.profile { display: flex; flex-direction: column; gap: 11px; }
/* 只有两个选项的控件不必拉满整行 */
#genderSeg, #termSeg { max-width: 250px; }
#subjectSeg { max-width: 320px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #a5824e;
}
.field__input {
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 2px solid rgba(238, 223, 198, .9);
  background: rgba(255, 255, 255, .58);
  color: #4b2d0a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field__input::placeholder { color: #c6ae8b; font-weight: 600; }
.field__input:focus {
  border-color: #f0b44a;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 200, 94, .22);
}

/* 分段选择器 */
.seg {
  display: flex;
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 3px rgba(140, 100, 40, .1);
}
.seg__item {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 800;
  color: #8a6a3d;
  background: transparent;
  white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s, transform .15s;
}
.seg__item:hover { background: rgba(255, 255, 255, .72); }
.seg__item.is-on {
  color: #6b4410;
  background: linear-gradient(180deg, #fffaea, #ffe6a8 58%, #f8d083);
  box-shadow: 0 2px 6px rgba(160, 110, 30, .24), inset 0 1px 0 #fff;
}
.seg__item:active { transform: scale(.96); }
.seg--grade .seg__item { font-size: 13px; padding: 0 3px; }

.chara-pick__title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #a5824e;
}
/* 衣橱区与角色选择之间留白 */
.outfit-pick { margin-top: 18px; }

/* ---------- 换装入口：梦幻按钮图，点开精灵试衣间 ---------- */
.fitting-entry {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  border-radius: 24px;
  outline: none;
  transition: transform .22s ease, filter .22s ease;
  filter: drop-shadow(0 8px 14px rgba(140, 92, 20, .28));
}
.fitting-entry img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
}
.fitting-entry:hover, .fitting-entry:focus-visible {
  transform: translateY(-3px) scale(1.015);
  filter: drop-shadow(0 12px 22px rgba(180, 110, 20, .45)) brightness(1.04);
}
.fitting-entry:active { transform: translateY(0) scale(.985); }

.chara-pick__title span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #c0a882;
}

/* ---------- 橱窗：带窗框的衣服展示台（只陈列衣服图层） ---------- */
.wardrobe-case {
  position: relative;
  padding: 26px 36px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 251, 240, .96), rgba(246, 231, 205, .9));
  box-shadow:
    inset 0 0 0 3px #d9b87c,
    inset 0 0 0 7px rgba(255, 252, 244, .96),
    inset 0 -8px 16px rgba(180, 130, 60, .12),
    0 8px 20px rgba(140, 90, 30, .16);
}
/* 窗楣 + 窗台，做成一扇小橱窗的样子 */
.wardrobe-case::before {
  content: '';
  position: absolute; left: 12px; right: 12px; top: 7px; height: 13px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #ffe1a0, #e4b665 70%, #cf9d4c);
  box-shadow: 0 2px 5px rgba(150, 95, 25, .24);
}
.wardrobe-case::after {
  content: '';
  position: absolute; left: 10px; right: 10px; bottom: 7px; height: 9px;
  border-radius: 3px 3px 8px 8px;
  background: linear-gradient(180deg, #f6dca9, #d5ac6c);
  box-shadow: 0 3px 6px rgba(150, 95, 25, .2);
}
.wardrobe-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #d8b576 transparent;
  padding: 4px 2px 10px;
}
.wardrobe-strip::-webkit-scrollbar { height: 6px; }
.wardrobe-strip::-webkit-scrollbar-thumb { background: #d8b576; border-radius: 99px; }
.wardrobe-nav {
  position: absolute; top: 50%; z-index: 3;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(180deg, #fff6e2, #f0d29a);
  color: #916022; font-size: 22px; line-height: 1;
  box-shadow: 0 3px 8px rgba(150, 95, 25, .28), inset 0 0 0 2px #fff;
}
.wardrobe-nav:hover { filter: brightness(1.04); }
.wardrobe-nav--prev { left: 6px; }
.wardrobe-nav--next { right: 6px; }
.wardrobe-strip .card--outfit {
  flex: 0 0 132px;
  scroll-snap-align: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(255, 248, 234, .92));
}
.wardrobe-strip .card--outfit.is-selected {
  box-shadow: 0 10px 22px rgba(190, 130, 35, .3), inset 0 0 0 3px #ffc85e;
}
.card__hanger {
  position: absolute; top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 11px;
  border: 2px solid #d9b87c; border-bottom: 0;
  border-radius: 12px 12px 0 0;
  opacity: .8;
}
.card--outfit .card__media { height: 124px; background: radial-gradient(ellipse at 50% 40%, #fffdf6, #f5e9d3); }
.card--outfit .card__media img { object-fit: contain; object-position: center center; padding: 8px 6px; }
.card--outfit.is-locked .card__media img { filter: grayscale(.6) opacity(.72); }

.wardrobe-detail {
  margin-top: 12px;
  min-height: 54px;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .66);
  box-shadow: inset 0 0 0 1.5px #ecd8b4;
}
.wardrobe-detail__pic {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px; background: #f8eeda; overflow: hidden;
}
.wardrobe-detail__pic img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.wardrobe-detail__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wardrobe-detail__txt b { font-size: 13px; color: #5b3a12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-detail__txt small { font-size: 11px; color: #a5824e; }
.wardrobe-detail__price { margin-left: auto; font-size: 12px; font-weight: 800; color: #b87b1e; white-space: nowrap; }
.wardrobe-detail__btn {
  flex: none; height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 900; color: #6b4410;
  background: linear-gradient(180deg, #ffe9ae, #f5c15f);
  box-shadow: 0 3px 7px rgba(160, 100, 20, .24), inset 0 1px 0 #fff8e4;
}
.wardrobe-detail__btn:disabled { cursor: default; filter: grayscale(.4); opacity: .65; }
.wardrobe-detail__hint { margin: auto; font-size: 12px; color: #a5824e; }

/* 小屋面板底部动作条 */
.sheet__foot {
  display: flex;
  gap: 12px;
  padding: 16px 26px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid #efe0c8;
  background: linear-gradient(180deg, rgba(255, 251, 243, .6), rgba(255, 246, 233, .95));
}
.btn-soft, .btn-gold {
  height: 54px;
  padding: 0 30px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.5px;
  transition: transform .18s var(--ease-pop), filter .18s;
}
.btn-soft {
  color: #6b4a1e;
  background: #fff;
  box-shadow: inset 0 0 0 2px #ecdcc0, 0 4px 12px rgba(120, 80, 20, .12);
}
.btn-gold {
  margin-left: auto;
  color: #6d410c;
  background: linear-gradient(180deg, #fff6d8, #ffdf9a 55%, #f2bd60);
  box-shadow: 0 8px 20px rgba(150, 90, 10, .32), inset 0 2px 0 #fffbee, inset 0 -3px 0 rgba(186, 128, 40, .35);
}
.btn-soft:hover, .btn-gold:hover { transform: translateY(-2px); filter: brightness(1.03); }
.btn-soft:active, .btn-gold:active { transform: translateY(1px); }

/* 商城分类标签：小屋装饰 / 鱼缸装饰 */
.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  border-radius: 18px;
  background: #f5ebd8;
  box-shadow: inset 0 1px 3px rgba(140, 100, 40, .12);
}
.shop-tab {
  flex: 1;
  height: 44px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #8a6a3d;
  transition: background .22s, color .22s, box-shadow .22s, transform .15s;
}
.shop-tab:hover { background: rgba(255, 255, 255, .7); }
.shop-tab.is-on {
  color: #6b4410;
  background: linear-gradient(180deg, #fffaea, #ffe6a8 58%, #f8d083);
  box-shadow: 0 2px 8px rgba(160, 110, 30, .26), inset 0 1px 0 #fff;
}
.shop-tab:active { transform: scale(.98); }

/* 二级分类：玩偶/手办、背景/小鱼、各个小游戏 —— 横向滚动的小胶囊 */
.shop-subtabs {
  display: flex;
  gap: 7px;
  margin: -6px 0 10px;
  padding: 2px 1px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shop-subtabs::-webkit-scrollbar { display: none; }
/* 边缘淡出：提示右边还有分类可以滑 */
.shop-subtabs.is-scroll:not(.at-end) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent 100%);
}
.shop-subtabs.is-scroll:not(.at-start) {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px);
  mask-image: linear-gradient(90deg, transparent 0, #000 26px);
}
.shop-subtabs.is-scroll:not(.at-start):not(.at-end) {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
}
.shop-subtabs[hidden], .shop-kindtabs[hidden] { display: none; }
.shop-sub {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  color: #8a6a3d;
  white-space: nowrap;
  background: rgba(255, 255, 255, .82);
  box-shadow: inset 0 0 0 1.5px rgba(226, 209, 178, .95);
  transition: background .2s, color .2s, box-shadow .2s, transform .15s;
}
.shop-sub:hover { background: #fff; }
.shop-sub__ic { font-size: 14px; line-height: 1; }
.shop-sub__n {
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  color: #a98a58;
  background: rgba(245, 235, 216, .95);
}
.shop-sub.is-on {
  color: #6b4410;
  background: linear-gradient(180deg, #fffaea, #ffe6a8 60%, #f8d083);
  box-shadow: 0 3px 9px rgba(160, 110, 30, .22), inset 0 1px 0 #fff;
}
.shop-sub.is-on .shop-sub__n { color: #7a4d10; background: rgba(255, 255, 255, .7); }
.shop-sub:active { transform: scale(.97); }

/* 三级分类：只有小游戏有 —— 皮肤 / 道具 */
.shop-kindtabs {
  display: flex;
  gap: 6px;
  margin: -2px 0 14px;
  padding: 4px;
  border-radius: 16px;
  background: #f5ebd8;
  box-shadow: inset 0 1px 3px rgba(140, 100, 40, .1);
}
.shop-kind {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8a6a3d;
  transition: background .2s, color .2s, box-shadow .2s;
}
.shop-kind__ic { font-size: 13px; line-height: 1; }
.shop-kind__n {
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  color: #a98a58;
  background: rgba(255, 255, 255, .8);
}
.shop-kind:hover { background: rgba(255, 255, 255, .7); }
.shop-kind.is-on {
  color: #6b4410;
  background: linear-gradient(180deg, #fffdf4, #ffedc2 60%, #fbd98f);
  box-shadow: 0 2px 7px rgba(160, 110, 30, .2), inset 0 1px 0 #fff;
}
.shop-kind.is-on .shop-kind__n { color: #7a4d10; }

/* 商城道具 */
.shop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 6px 16px rgba(120, 80, 20, .12), inset 0 0 0 2px rgba(240, 227, 203, .9);
}
.shop-item__ic {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #fff9ea, #f6e8ce);
  box-shadow: inset 0 0 0 2px #f2e3c8;
}
.shop-item__ic svg { width: 40px; height: 40px; }
.shop-item__ic .art-img { width: 82%; height: 82%; }
.shop-item__meta { flex: 1; min-width: 0; }
.shop-item__name {
  flex: 1 1 auto;
  min-width: 42px;
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #4b2d0a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 商品品类小标签 */
.shop-item__top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.shop-item__kind {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .5px;
  color: #8a6a3d;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(190, 150, 100, .35);
}
.shop-item__kind.kind--figure { color: #4a6f9a; box-shadow: inset 0 0 0 1px rgba(110, 150, 200, .45); }
.shop-item__kind.kind--plush  { color: #a35a7a; box-shadow: inset 0 0 0 1px rgba(200, 130, 165, .45); }
.shop-item__kind.kind--tankbg { color: #2f7f8e; box-shadow: inset 0 0 0 1px rgba(90, 170, 185, .45); }
.shop-item__kind.kind--fish   { color: #a5762a; box-shadow: inset 0 0 0 1px rgba(200, 165, 90, .5); }
.shop-item__kind.kind--stage  { color: #8a5a1f; background: #fff2cf; box-shadow: inset 0 0 0 1px rgba(224, 162, 63, .55); }
.buy-btn.is-in-use {
  color: #2f7f6a;
  background: linear-gradient(180deg, #eafaf0, #cfeedd);
  box-shadow: inset 0 0 0 2px #bfe4d2;
  pointer-events: none;
}

.shop-item__desc {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #a5824e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buy-btn {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: #6d410c;
  background: linear-gradient(180deg, #fff3cf, #ffd88a);
  box-shadow: inset 0 -2px 0 rgba(186, 128, 40, .3), 0 3px 8px rgba(150, 90, 10, .2);
  transition: transform .16s var(--ease-pop), filter .16s;
}
.buy-btn:hover { transform: scale(1.05); filter: brightness(1.04); }
.buy-btn.is-owned {
  color: #7a8a6a;
  background: #eef1e8;
  box-shadow: inset 0 0 0 2px #e0e6d6;
  pointer-events: none;
}

/* 已拥有、还没穿上的皮肤：显示「换上」，必须能点 */
.buy-btn.is-swap {
  pointer-events: auto;
  cursor: pointer;
  color: #6d410c;
  background: linear-gradient(180deg, #fff3cf, #ffd88a);
  box-shadow: inset 0 -2px 0 rgba(186, 128, 40, .3), 0 3px 8px rgba(150, 90, 10, .2);
}
.buy-btn__coin { width: 16px; height: 16px; }

/* ---------- 8. 内景视图 ---------- */
.interior {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0c0616;
  opacity: 0;
  /* 摆放的道具带了 pointer-events:auto，同样要靠 visibility 兜底 */
  visibility: hidden;
  pointer-events: none;
  transition: opacity .45s ease;
  overflow: hidden;
}
.interior.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.interior:not(.is-on) {
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.interior__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 8s ease-out;
}
.interior.is-on .interior__bg { transform: scale(1); }

.interior__hero {
  position: absolute;
  z-index: 2;
  left: 48%;
  bottom: 5%;
  height: 44%;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 24px rgba(20, 6, 10, .45));
  animation: hero-bob 5.5s ease-in-out infinite;
}
.interior__hero img { height: 100%; width: auto; }

.interior__bar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 22px;
  right: 22px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px 0 16px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  color: #5b3a12;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 243, 224, .9));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), inset 0 1px 0 #fff;
  transition: transform .18s var(--ease-pop);
}
.back-btn:hover { transform: translateX(-3px); }

/* 可交互热点 */
.hot {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 2;
  animation: hot-float 3.4s ease-in-out infinite;
}
.hot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 246, 214, .95);
  background: radial-gradient(circle, rgba(255, 252, 232, .55) 0%, rgba(255, 220, 150, .2) 52%, transparent 72%);
  box-shadow: 0 0 24px rgba(255, 228, 160, .75), inset 0 0 16px rgba(255, 236, 180, .5);
  animation: hot-pulse 2.4s ease-out infinite;
}
.hot::after {
  content: "";
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fffbe8;
  box-shadow: 0 0 18px 5px rgba(255, 226, 150, .95);
}
@keyframes hot-pulse {
  0% { transform: scale(.62); opacity: .95; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes hot-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
.hot__label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(5px) scale(.92);
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf4 0%, #ffefc9 56%, #f7d78d 100%);
  border: 1.5px solid rgba(255, 251, 236, .95);
  color: #6b4410;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .8px;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  box-shadow:
    0 8px 18px rgba(74, 32, 6, .3),
    0 0 0 3px rgba(255, 232, 168, .18),
    inset 0 1.5px 0 #fffdf6,
    inset 0 -2px 0 rgba(186, 132, 44, .3);
  opacity: 0;
  transition: opacity .25s, transform .26s var(--ease-pop);
  pointer-events: none;
}
.hot:hover .hot__label,
.hot.is-hint .hot__label { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* 对话气泡 */
.bubbleline {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translate(-50%, 14px);
  max-width: min(560px, 84vw);
  padding: 16px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 253, 245, .97), rgba(255, 243, 224, .96));
  color: #5b3a12;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4), inset 0 2px 0 #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease-pop);
  z-index: 4;
}
.bubbleline::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  margin-left: -10px;
  border: 10px solid transparent;
  border-top-color: rgba(255, 243, 224, .96);
  border-bottom: 0;
}
.bubbleline.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 9. 提示 Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 34px);
  transform: translate(-50%, 14px) scale(.94);
  padding: 11px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf4 0%, #ffefc9 56%, #f7d78d 100%);
  border: 1.5px solid rgba(255, 251, 236, .95);
  color: #6b4410;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  box-shadow:
    0 14px 30px rgba(74, 32, 6, .32),
    0 0 0 4px rgba(255, 232, 168, .2),
    inset 0 2px 0 #fffdf6,
    inset 0 -3px 0 rgba(186, 132, 44, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s, transform .32s var(--ease-pop);
  z-index: 80;
  white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* 飘字（金币变化） */
.float-num {
  position: fixed;
  z-index: 90;
  font-size: 22px;
  font-weight: 900;
  color: #ffe9a8;
  text-shadow: 0 2px 10px rgba(120, 60, 0, .8);
  pointer-events: none;
  animation: float-up 1.1s ease-out forwards;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.8); }
  25% { opacity: 1; transform: translate(-50%, -14px) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -58px) scale(1); }
}

/* ---------- 10. 响应式：竖版 ---------- */
/* ---------- 8.5 鱼缸生态（场景内） ---------- */
.tanklife {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
/* 水色：用柔光混进画面，只改色调不改结构 */
.tanklife__tint {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 48%;
  filter: blur(3px);
  mix-blend-mode: soft-light;
  opacity: .9;
}
.tankfish {
  position: absolute;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  animation: fish-bob 6s ease-in-out infinite;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .22));
  will-change: transform;
}
.tankfish svg { width: 100%; height: auto; display: block; }
@keyframes fish-bob {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  35%      { transform: translate(calc(-50% + 8%), calc(-50% - 10%)) rotate(-4deg); }
  70%      { transform: translate(calc(-50% - 6%), calc(-50% + 6%)) rotate(4deg); }
}

/* ---------- 8.6 收藏柜 / 鱼缸 弹窗 ---------- */
.store {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 26px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease;
}
.store.is-on { opacity: 1; visibility: visible; pointer-events: auto; }
.store:not(.is-on) { transition: opacity .28s ease, visibility 0s linear .28s; }
.store__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(30, 14, 48, .44), rgba(10, 4, 20, .74));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.store__go {
  height: 38px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .6px;
  color: #5b3a12;
  background: linear-gradient(180deg, #fffcee, #ffe6a8 58%, #f8d083);
  box-shadow: 0 4px 12px rgba(160, 110, 30, .3), inset 0 1px 0 #fff;
  transition: transform .16s var(--ease-pop);
}
.store__go:active { transform: scale(.96); }

/* ---- 收藏柜：木质柜体 ---- */
.cabinet {
  position: relative;
  width: min(680px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  padding: 4px;
  background:
    linear-gradient(180deg, #c08a52 0%, #9a5f33 14%, #a86c3c 72%, #6e4020 100%);
  box-shadow:
    0 32px 70px rgba(18, 6, 26, .58),
    inset 0 0 0 3px rgba(255, 228, 190, .28),
    inset 0 2px 0 rgba(255, 240, 210, .6),
    inset 0 -6px 10px rgba(60, 28, 6, .45);
  transform: translateY(16px) scale(.97);
  transition: transform .38s var(--ease-pop);
  overflow: hidden;
}
.store.is-on .cabinet { transform: none; }

.cabinet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}
.cabinet__knob {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffe9b6, #d9a44e 58%, #9c6a26);
  box-shadow: inset 0 -2px 4px rgba(90, 50, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
}
.cabinet__titles { flex: 1; min-width: 0; }
.cabinet__title {
  display: block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff4de;
  text-shadow: 0 2px 6px rgba(60, 25, 0, .55);
}
.cabinet__sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255, 240, 215, .75);
}
.cabinet__close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  color: #fff2da;
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
  transition: transform .16s var(--ease-pop), background .2s;
}
.cabinet__close:hover { background: rgba(255, 255, 255, .28); }
.cabinet__close:active { transform: scale(.9); }

.cabinet__body { padding: 0 14px; overflow-y: auto; }
.cabinet__shelf {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 10px;
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255, 220, 175, .06), rgba(0, 0, 0, .18)),
    linear-gradient(180deg, #4c2b14, #381d0b);
  box-shadow:
    inset 0 12px 24px rgba(0, 0, 0, .6),
    inset 0 0 0 1.5px rgba(255, 214, 170, .12);
}
/* 一层 = 一排格子 + 一条木板 */
.cabinet__row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 9px;
}
.cabinet__row::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0;
  height: 7px;
  border-radius: 3px;
  background: linear-gradient(180deg, #c98f56, #9c6232 45%, #6f3f1e);
  box-shadow: 0 3px 7px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 226, 190, .45);
}
.cslot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 5px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 240, 215, .1), rgba(255, 240, 215, .02));
  box-shadow: inset 0 0 0 1px rgba(255, 226, 190, .1);
}
/* 收藏柜图标：统一方形画框，所有商品最大边一致 */
.cslot__art {
  width: 74%;
  max-width: 78px;
  aspect-ratio: 1;
  position: relative;
}
.cslot__art img, .cslot__art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cslot__name {
  max-width: 100%;
  font-size: 11px;
  font-weight: 800;
  color: #ffe9c9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cslot__kind { font-size: 9px; font-weight: 800; letter-spacing: .4px; color: rgba(255, 224, 190, .55); }
.cslot.is-empty { background: rgba(0, 0, 0, .16); box-shadow: inset 0 0 0 1px rgba(255, 226, 190, .08); }
.cslot.is-empty .cslot__plus {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 10px 0 8px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 900;
  color: rgba(255, 228, 195, .35);
  box-shadow: inset 0 0 0 1.5px rgba(255, 228, 195, .2);
}
.cslot.is-empty .cslot__name { color: rgba(255, 228, 195, .4); }

.cabinet__foot { display: flex; justify-content: center; padding: 12px 16px 14px; }

/* ---------- 收藏柜 · 星空主题（紫 + 金） ---------- */
body[data-theme="starry"] .cabinet {
  background: linear-gradient(180deg, #9a7ac9 0%, #6b4aa6 14%, #7757b0 72%, #3c2569 100%);
  box-shadow:
    0 32px 70px rgba(18, 6, 26, .6),
    inset 0 0 0 3px rgba(255, 226, 150, .38),
    inset 0 2px 0 rgba(255, 240, 200, .55),
    inset 0 -6px 10px rgba(30, 12, 60, .5);
}
body[data-theme="starry"] .cabinet__knob {
  background: radial-gradient(circle at 34% 28%, #fff4c8, #e8b84a 58%, #a8791f);
}
body[data-theme="starry"] .cabinet__title { color: #fff2d4; text-shadow: 0 2px 6px rgba(30, 10, 60, .6); }
body[data-theme="starry"] .cabinet__sub { color: rgba(240, 226, 255, .78); }
body[data-theme="starry"] .cabinet__shelf {
  background:
    linear-gradient(180deg, rgba(255, 232, 190, .07), rgba(0, 0, 0, .24)),
    linear-gradient(180deg, #2e1b55, #1c1038);
  box-shadow: inset 0 12px 24px rgba(0, 0, 0, .62), inset 0 0 0 1.5px rgba(255, 216, 140, .16);
}
body[data-theme="starry"] .cabinet__row::after {
  background: linear-gradient(180deg, #cfaae8, #9d72c8 45%, #6c4099);
  box-shadow: 0 3px 7px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 238, 198, .5);
}
body[data-theme="starry"] .cslot {
  background: linear-gradient(180deg, rgba(224, 208, 255, .12), rgba(224, 208, 255, .02));
  box-shadow: inset 0 0 0 1px rgba(232, 214, 255, .12);
}
body[data-theme="starry"] .cslot__name { color: #f2e6ff; }
body[data-theme="starry"] .cslot__kind { color: rgba(224, 208, 255, .6); }
body[data-theme="starry"] .cslot.is-empty { background: rgba(10, 4, 24, .22); box-shadow: inset 0 0 0 1px rgba(232, 214, 255, .1); }
body[data-theme="starry"] .cslot.is-empty .cslot__plus { color: rgba(224, 208, 255, .38); box-shadow: inset 0 0 0 1.5px rgba(224, 208, 255, .2); }
body[data-theme="starry"] .cslot.is-empty .cslot__name { color: rgba(224, 208, 255, .42); }

/* ---------- 收藏柜 · 海洋主题（海蓝 + 贝壳粉） ---------- */
body[data-theme="ocean"] .cabinet {
  background: linear-gradient(180deg, #7cc0e6 0%, #4688b8 14%, #5098cb 72%, #1f5c88 100%);
  box-shadow:
    0 32px 70px rgba(6, 24, 40, .6),
    inset 0 0 0 3px rgba(255, 234, 222, .42),
    inset 0 2px 0 rgba(255, 246, 238, .6),
    inset 0 -6px 10px rgba(10, 50, 80, .5);
}
body[data-theme="ocean"] .cabinet__knob {
  background: radial-gradient(circle at 34% 28%, #fff0e4, #f0a58e 58%, #b5684f);
}
body[data-theme="ocean"] .cabinet__title { color: #fff6ee; text-shadow: 0 2px 6px rgba(10, 40, 70, .6); }
body[data-theme="ocean"] .cabinet__sub { color: rgba(230, 246, 255, .8); }
body[data-theme="ocean"] .cabinet__shelf {
  background:
    linear-gradient(180deg, rgba(215, 244, 255, .08), rgba(0, 20, 40, .26)),
    linear-gradient(180deg, #16405e, #0b273c);
  box-shadow: inset 0 12px 24px rgba(0, 0, 0, .62), inset 0 0 0 1.5px rgba(255, 230, 216, .16);
}
body[data-theme="ocean"] .cabinet__row::after {
  background: linear-gradient(180deg, #b0e2f4, #72b6d8 45%, #3f82ab);
  box-shadow: 0 3px 7px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 246, 238, .55);
}
body[data-theme="ocean"] .cslot {
  background: linear-gradient(180deg, rgba(220, 244, 255, .12), rgba(220, 244, 255, .02));
  box-shadow: inset 0 0 0 1px rgba(228, 248, 255, .12);
}
body[data-theme="ocean"] .cslot__name { color: #eaf7ff; }
body[data-theme="ocean"] .cslot__kind { color: rgba(220, 244, 255, .6); }
body[data-theme="ocean"] .cslot.is-empty { background: rgba(0, 10, 20, .24); box-shadow: inset 0 0 0 1px rgba(228, 248, 255, .1); }
body[data-theme="ocean"] .cslot.is-empty .cslot__plus { color: rgba(220, 244, 255, .38); box-shadow: inset 0 0 0 1.5px rgba(220, 244, 255, .2); }
body[data-theme="ocean"] .cslot.is-empty .cslot__name { color: rgba(220, 244, 255, .42); }

/* ---- 鱼缸：玻璃水体 ---- */
.aquarium {
  position: relative;
  width: min(720px, 94vw);
  aspect-ratio: 1920 / 1394;
  max-height: 88vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(8, 30, 48, .55);
  transform: translateY(16px) scale(.97);
  transition: transform .38s var(--ease-pop);
}
.store.is-on .aquarium { transform: none; }

.aquarium__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.aquarium__close {
  position: absolute;
  top: 3.5%;
  right: 4%;
  z-index: 5;
  width: clamp(30px, 5vw, 36px);
  height: clamp(30px, 5vw, 36px);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  color: #fff6e2;
  background: rgba(60, 32, 10, .55);
  box-shadow: inset 0 0 0 1.5px rgba(255, 236, 200, .4), 0 3px 8px rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform .16s var(--ease-pop), background .2s;
}
.aquarium__close:hover { background: rgba(90, 50, 18, .7); }
.aquarium__close:active { transform: scale(.9); }

/* 玻璃水体：叠在边框图的玻璃开孔上，四角略收，贴合木框 */
.aquarium__glass {
  position: absolute;
  left: 8.5%;
  top: 12%;
  width: 83%;
  height: 33.5%;
  border-radius: 3%;
  overflow: hidden;
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, .5),
    inset 0 -8px 18px rgba(15, 60, 95, .3),
    inset 8px 0 16px rgba(15, 60, 95, .18),
    inset -8px 0 16px rgba(15, 60, 95, .18);
}
/* 三套边框图的玻璃开孔位置不同，按主题分别对齐（新星空/海洋图实测标定） */
body[data-theme="ocean"] .aquarium__glass {
  left: 6.5%; top: 18.5%; width: 87%; height: 33%; border-radius: 4%;
}
body[data-theme="starry"] .aquarium__glass {
  left: 19.5%; top: 20.5%; width: 63%; height: 37%; border-radius: 4.5%;
}
.aquarium__scene {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #bfe9fb, #8fd0ee 55%, #cdeefb);
  background-size: cover;
  background-position: center;
  transition: background-image .5s ease;
}
.aquarium__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, 0) 30%),
    linear-gradient(to top, rgba(120, 205, 240, .18) 0%, rgba(120, 205, 240, 0) 32%);
  pointer-events: none;
}
/* 进入海洋：叠在鱼缸玻璃顶部，点击跳到 magic-reef 的 tank 页面 */
.aquarium__enter {
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  z-index: 5;
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  color: #fff;
  background: rgba(8, 40, 72, .52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 2px 8px rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .16s;
}
.aquarium__enter:hover { background: rgba(20, 70, 118, .7); }
.aquarium__enter:active { transform: translateX(-50%) scale(.94); }

.aquarium__fish { position: absolute; inset: 0; }
.aquarium__fish .pfish {
  position: absolute;
  width: clamp(24px, 12%, 60px);
  aspect-ratio: 1;
  overflow: hidden;
  animation: fish-bob 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(0, 40, 60, .24));
}
.aquarium__fish .pfish svg,
.aquarium__fish .pfish img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.aquarium__bubble {
  position: absolute;
  bottom: 16%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  animation: bubble-rise 5.5s linear infinite;
}
@keyframes bubble-rise {
  0%   { transform: translateY(0) scale(.7); opacity: 0; }
  20%  { opacity: .85; }
  100% { transform: translateY(-110px) scale(1.1); opacity: 0; }
}

/* 下半部分：选项区（无背景，上下两行：背景横向画廊 + 小鱼环形轮播） */
.aquarium__panel {
  position: absolute;
  left: 8%;
  top: 53.5%;
  width: 84%;
  height: 42.5%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px 4px;
  box-sizing: border-box;
}
/* 三套边框图下方装饰区高度不同，选项区按主题下移/收窄（避开玻璃下沿的边框） */
body[data-theme="ocean"] .aquarium__panel { left: 8%; top: 61%; width: 84%; height: 33%; }
body[data-theme="starry"] .aquarium__panel { left: 17%; top: 64%; width: 66%; height: 29%; }
.aquarium__caption {
  flex: none;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .6px;
  color: #f7ead0;
  text-shadow: 0 1px 4px rgba(40, 18, 0, .8);
  margin-bottom: 1px;
}
.tank-sec {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tank-sec__head {
  flex: none;
  align-self: flex-start;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(56, 33, 12, .62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.tank-sec__head b {
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .6px;
  color: #ffe9c4;
  text-shadow: none;
}
.tank-sec__head span {
  font-size: 10.5px;
  font-weight: 700;
  color: #e9cd9a;
  text-shadow: none;
}
/* 鱼缸背景：单张展示 + 左右切换按钮 */
.bg-picker {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
  position: relative;
}
.pick-btn {
  flex: none;
  width: 30px;
  align-self: center;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: #ffe9c4;
  background: rgba(56, 33, 12, .58);
  border: none;
  border-radius: 10px;
  padding: 8px 0;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: background .2s, transform .16s;
}
.pick-btn:hover { background: rgba(90, 54, 20, .74); }
.pick-btn:active { transform: scale(.9); }

/* 横版：箭头也叠在卡片两侧边缘，把整栏宽度留给背景图 / 小鱼，
   同时避免左右两栏的箭头挤在中间分隔线旁 */
.bg-picker .pick-btn,
.fish-picker .pick-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 26px;
  height: 46px;
  padding: 0;
  font-size: 20px;
  border-radius: 10px;
  background: rgba(56, 33, 12, .52);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 240, 210, .22);
}
.bg-picker .pick-btn:hover,
.fish-picker .pick-btn:hover { background: rgba(90, 54, 20, .78); }
.bg-picker .pick-btn:first-of-type,
.fish-picker .pick-btn:first-of-type { left: 2px; }
.bg-picker .pick-btn:last-of-type,
.fish-picker .pick-btn:last-of-type { right: 2px; }
/* 叠边后按压缩放要保留位移，否则按钮会往上跳 */
.bg-picker .pick-btn:active,
.fish-picker .pick-btn:active { transform: translateY(-50%) scale(.9); }
.bg-picker__card {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 248, 232, .82);
  box-shadow: inset 0 0 0 1.5px rgba(150, 105, 50, .3), 0 4px 12px rgba(40, 20, 0, .18);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .2s, transform .16s;
}
.bg-picker__card:hover { box-shadow: inset 0 0 0 2px rgba(150, 105, 50, .5), 0 6px 16px rgba(40, 20, 0, .26); }
.bg-picker__card:active { transform: scale(.98); }
.bg-picker__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd76a, #f0a72e);
  color: #5b3608;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
  box-shadow: 0 2px 6px rgba(120, 70, 10, .38);
}
.bg-picker__badge[hidden] { display: none; }
.bg-picker__art {
  flex: 1;
  width: 100%;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .4);
}
.bg-picker__art img, .bg-picker__art svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.bg-picker__name {
  flex: none;
  max-width: 100%;
  font-size: 11px;
  font-weight: 800;
  color: #5b3a12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bg-picker__card.is-on {
  box-shadow: inset 0 0 0 2.5px #d8a044, 0 4px 14px rgba(160, 110, 30, .34);
}

/* ---------- 鱼缸弹窗 · 星空主题配色（紫色 + 金色） ---------- */
body[data-theme="starry"] .aquarium__close {
  background: rgba(52, 28, 88, .62);
  box-shadow: inset 0 0 0 1.5px rgba(255, 220, 140, .5), 0 3px 8px rgba(0, 0, 0, .3);
}
body[data-theme="starry"] .aquarium__close:hover { background: rgba(74, 44, 118, .8); }
body[data-theme="starry"] .tank-sec__head {
  background: rgba(48, 24, 84, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 216, 130, .3);
}
body[data-theme="starry"] .tank-sec__head b { color: #ffe6a6; }
body[data-theme="starry"] .tank-sec__head span { color: #d9c2f0; }
body[data-theme="starry"] .pick-btn {
  color: #ffe6a6;
  background: rgba(48, 24, 84, .66);
  box-shadow: inset 0 0 0 1px rgba(255, 216, 130, .26);
}
body[data-theme="starry"] .pick-btn:hover { background: rgba(74, 44, 118, .82); }
body[data-theme="starry"] .bg-picker__card {
  background: rgba(248, 242, 255, .9);
  box-shadow: inset 0 0 0 1.5px rgba(150, 110, 200, .4), 0 4px 12px rgba(30, 10, 60, .26);
}
body[data-theme="starry"] .bg-picker__card:hover {
  box-shadow: inset 0 0 0 2px rgba(170, 130, 220, .62), 0 6px 16px rgba(30, 10, 60, .32);
}
body[data-theme="starry"] .bg-picker__card.is-on {
  box-shadow: inset 0 0 0 2.5px #e8b84a, 0 4px 14px rgba(190, 140, 40, .42);
}
body[data-theme="starry"] .bg-picker__badge {
  background: linear-gradient(180deg, #ffe08a, #e8ab33);
  color: #4a2c06;
}
body[data-theme="starry"] .bg-picker__name { color: #3a2559; }
body[data-theme="starry"] .aquarium__cols::before {
  background: linear-gradient(to bottom, rgba(150, 110, 210, 0) 0%, rgba(150, 110, 210, .7) 5%, rgba(150, 110, 210, .7) 95%, rgba(150, 110, 210, 0) 100%);
  box-shadow: 1px 0 0 rgba(255, 230, 166, .4), -1px 0 0 rgba(255, 230, 166, .2);
}
body[data-theme="starry"] .aquarium__caption { color: #ffe6a6; }
body[data-theme="starry"] .fchip__name { color: #ffe6a6; text-shadow: 0 1px 4px rgba(30, 10, 60, .85); }
body[data-theme="starry"] .fchip.is-on .fchip__status {
  background: rgba(202, 152, 42, .95); color: #2e1c02; box-shadow: 0 2px 6px rgba(60, 30, 0, .36);
}
body[data-theme="starry"] .fchip:not(.is-on) .fchip__status {
  background: rgba(70, 45, 105, .55); color: #e8dcf8;
}

/* ---------- 鱼缸弹窗 · 海洋主题配色（深海蓝 + 贝壳粉） ---------- */
body[data-theme="ocean"] .aquarium__close {
  background: rgba(26, 70, 106, .6);
  box-shadow: inset 0 0 0 1.5px rgba(255, 236, 222, .48), 0 3px 8px rgba(0, 0, 0, .26);
}
body[data-theme="ocean"] .aquarium__close:hover { background: rgba(40, 96, 138, .78); }
body[data-theme="ocean"] .tank-sec__head {
  background: rgba(26, 70, 106, .68);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 202, .3);
}
body[data-theme="ocean"] .tank-sec__head b { color: #fff1e6; }
body[data-theme="ocean"] .tank-sec__head span { color: #cde5f3; }
body[data-theme="ocean"] .pick-btn {
  color: #fff1e6;
  background: rgba(26, 70, 106, .62);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 202, .26);
}
body[data-theme="ocean"] .pick-btn:hover { background: rgba(40, 96, 138, .78); }
body[data-theme="ocean"] .bg-picker__card {
  background: rgba(255, 251, 246, .92);
  box-shadow: inset 0 0 0 1.5px rgba(196, 146, 126, .36), 0 4px 12px rgba(20, 60, 90, .2);
}
body[data-theme="ocean"] .bg-picker__card:hover {
  box-shadow: inset 0 0 0 2px rgba(226, 160, 138, .62), 0 6px 16px rgba(20, 60, 90, .26);
}
body[data-theme="ocean"] .bg-picker__card.is-on {
  box-shadow: inset 0 0 0 2.5px #f0a58e, 0 4px 14px rgba(190, 110, 90, .32);
}
body[data-theme="ocean"] .bg-picker__badge {
  background: linear-gradient(180deg, #ffdccb, #f0a58e);
  color: #5a2318;
}
body[data-theme="ocean"] .bg-picker__name { color: #2c4a63; }
body[data-theme="ocean"] .aquarium__cols::before {
  background: linear-gradient(to bottom, rgba(122, 172, 204, 0) 0%, rgba(122, 172, 204, .68) 5%, rgba(122, 172, 204, .68) 95%, rgba(122, 172, 204, 0) 100%);
  box-shadow: 1px 0 0 rgba(255, 242, 232, .5), -1px 0 0 rgba(255, 242, 232, .24);
}
body[data-theme="ocean"] .aquarium__caption { color: #fff1e6; }
body[data-theme="ocean"] .fchip__name { color: #fff1e6; text-shadow: 0 1px 4px rgba(20, 50, 80, .78); }
body[data-theme="ocean"] .fchip.is-on .fchip__status {
  background: rgba(216, 132, 110, .95); color: #fff4ee; box-shadow: 0 2px 6px rgba(120, 50, 30, .34);
}
body[data-theme="ocean"] .fchip:not(.is-on) .fchip__status {
  background: rgba(78, 120, 150, .52); color: #e6f2fa;
}

/* 小鱼：横向滑动轮播 + 左右按钮 + 投放状态标签（透明卡片） */
.fish-picker {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
  position: relative;   /* 箭头用绝对定位叠边，必须有定位父级，否则会跑到整个面板左侧 */
}
.fish-picker__viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  display: flex;
}
.fish-picker__viewport::-webkit-scrollbar { display: none; }
.fish-picker__track {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  padding: 0;
}
/* 一张占满整个视口，内部内容垂直居中 —— 小鱼正好落在选择区正中 */
.fchip {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
}
.fchip__status {
  flex: none;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .4px;
  white-space: nowrap;
}
.fchip.is-on .fchip__status { background: rgba(46, 130, 74, .92); color: #eafff0; box-shadow: 0 2px 6px rgba(20, 60, 30, .35); }
.fchip:not(.is-on) .fchip__status { background: rgba(90, 66, 40, .42); color: #f3e6c8; }
/* 小鱼图标：方形画框，边长由 JS 按 fchip 可用空间精确设置，保证横长/竖长鱼最大边一致 */
.fchip__ic {
  flex: none;
  align-self: center;
  position: relative;
}
.fchip__ic img, .fchip__ic svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.fchip__ic img { filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .32)); }
.fchip__name {
  flex: none;
  max-width: 100%;
  font-size: 11px;
  font-weight: 800;
  color: #ffe9c4;
  text-shadow: 0 1px 4px rgba(30, 14, 0, .8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 左右分栏：鱼缸背景在左、小鱼在右，中间一条贯穿竖隔断 */
.aquarium__cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
  position: relative;
}
.aquarium__cols::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(96, 52, 14, 0) 0%, rgba(96, 52, 14, .72) 5%, rgba(96, 52, 14, .72) 95%, rgba(96, 52, 14, 0) 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .62), -1px 0 0 rgba(255, 255, 255, .30);
  pointer-events: none;
}
.aquarium__cols .tank-sec { min-width: 0; }

/* 竖版：整块等比缩小，格子更密 */
@media (orientation: portrait) {
  .cabinet__row { gap: 8px; }
  .cabinet__shelf { padding: 12px; }
  .cslot__art { width: 74%; }
  .cabinet__title { font-size: 16.5px; }
  .cabinet__sub { font-size: 10.5px; }

  .aquarium { width: 94vw; border-radius: 14px; }
  .aquarium__panel { top: 51%; height: 46%; padding: 0 2px 2px; }
  .aquarium__caption { display: none; }
  .fchip { flex: 0 0 100%; gap: 2px; padding: 2px 2px 3px; }
  .pick-btn { width: 24px; font-size: 18px; }
  /* 竖版面板窄：背景卡片两侧的箭头叠到卡片边缘，卡片缩小居中，避免占满整栏显得太大 */
  .bg-picker { position: relative; justify-content: center; }
  /* 小鱼区同理：箭头叠到视口边缘，把整栏宽度都留给小鱼，否则小鱼被挤得很小 */
  .fish-picker { position: relative; }
  .fish-picker .pick-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 18px;
    height: 32px;
    padding: 0;
    font-size: 15px;
    border-radius: 7px;
  }
  .fish-picker .pick-btn:first-of-type { left: 1px; }
  .fish-picker .pick-btn:last-of-type { right: 1px; }
  .fish-picker__viewport { padding: 0 2px; }
  /* 竖版高度紧：鱼名让位给鱼本体，名字只在不拥挤时才显示 */
  .fchip__name { display: none; }
  .bg-picker .pick-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 20px;
    height: 34px;
    padding: 0;
    font-size: 16px;
    border-radius: 8px;
  }
  .bg-picker .pick-btn:first-of-type { left: 3px; }
  .bg-picker .pick-btn:last-of-type { right: 3px; }
  .bg-picker__card {
    flex: 0 1 auto;
    width: 104px;
    max-width: calc(100% - 40px);
    max-height: 72px;
    align-self: center;
  }
  .bg-picker__badge {
    top: 4px;
    left: 4px;
    font-size: 9px;
    padding: 1px 7px;
  }
  .bg-picker__name { display: none; }
  .fchip__name { font-size: 9px; }
  .fchip__status { font-size: 8px; padding: 1px 7px; }
  .tank-sec { gap: 2px; }
  .tank-sec__head { padding: 1px 8px; gap: 5px; }
  .tank-sec__head b { font-size: 10px; }
  .tank-sec__head span { display: none; }
  /* 竖版弹窗更矮，海洋/星空选项区仍要避开玻璃下沿 */
  body[data-theme="ocean"] .aquarium__panel { top: 58%; height: 38%; }
  body[data-theme="starry"] .aquarium__panel { top: 61%; height: 35%; }
}

/* ---------- 8.7 3D 查看器 ---------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  place-items: center;
  padding: clamp(8px, 1.6vw, 24px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .32s ease;
}
.viewer.is-on { opacity: 1; visibility: visible; pointer-events: auto; }
.viewer:not(.is-on) { transition: opacity .32s ease, visibility 0s linear .32s; }

/* 影棚：中间一束顶光，四周压暗，物体像被放在展台上 */
.viewer__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 62% 54% at 50% 34%, rgba(120, 96, 150, .5) 0%, rgba(120, 96, 150, 0) 68%),
    radial-gradient(ellipse 90% 70% at 50% 42%, #2b2135 0%, #170f1e 54%, #08050d 100%);
}
.viewer__backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 46%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .55) 100%);
  pointer-events: none;
}

.viewer__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(.97);
  transition: transform .4s var(--ease-pop);
}
.viewer.is-on .viewer__panel { transform: none; }

.viewer__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 0 46px 2px;
  text-align: center;
}
.viewer__titles { min-width: 0; }
.viewer__kind {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .12em;
  color: #ffe6b0;
  background: rgba(255, 220, 160, .13);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 160, .32);
}
.viewer__name {
  margin: 8px 0 0;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
  letter-spacing: 1.4px;
  color: #fff8ec;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .55);
}
.viewer__desc {
  margin: 6px 0 0;
  font-size: clamp(11.5px, 1vw, 13.5px);
  font-weight: 700;
  letter-spacing: .4px;
  color: rgba(246, 232, 210, .66);
}
.viewer__close {
  position: absolute;
  top: 0;
  right: 0;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  color: rgba(255, 248, 235, .82);
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .16s var(--ease-pop), background .2s;
}
.viewer__close:hover { background: rgba(255, 255, 255, .2); }
.viewer__close:active { transform: scale(.9); }

/* 展台 */
.viewer__stage {
  position: relative;
  height: clamp(260px, 48vh, 440px);
  margin-top: 2px;
  perspective: 1500px;
  perspective-origin: 50% 46%;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.viewer__stage.is-drag { cursor: grabbing; }

.viewer__spot {
  position: absolute;
  left: 50%;
  top: -14%;
  width: 78%;
  height: 96%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 50% 42% at 50% 30%, rgba(255, 246, 224, .22) 0%, rgba(255, 246, 224, 0) 70%),
    conic-gradient(from 180deg at 50% -30%, rgba(255, 255, 255, 0) 44%, rgba(255, 248, 230, .09) 50%, rgba(255, 255, 255, 0) 56%);
  filter: blur(2px);
  pointer-events: none;
}

/* 展台圆环（地面） */
.viewer__ring {
  position: absolute;
  left: 50%;
  top: 76%;
  width: min(52%, 320px);
  height: 15%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 236, 200, .2) 0%, rgba(255, 236, 200, .06) 52%, rgba(255, 236, 200, 0) 74%);
  box-shadow: 0 0 0 1px rgba(255, 236, 200, .14), 0 0 44px rgba(255, 226, 178, .18) inset;
  pointer-events: none;
}

/* 接地阴影 */
.viewer__shadow {
  position: absolute;
  left: 50%;
  top: 76%;
  width: min(38%, 240px);
  height: 7%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(6px);
  transition: transform .12s linear, opacity .2s;
  pointer-events: none;
}

/* 物体：一叠切片沿 Z 轴挤出，转起来就有厚度 */
.viewer__rig {
  position: absolute;
  left: 50%;
  top: 44%;
  transform-style: preserve-3d;
  will-change: transform;
}
.viewer__obj {
  position: relative;
  width: clamp(180px, 34vh, 310px);
  height: clamp(180px, 34vh, 310px);
  transform-style: preserve-3d;
  will-change: transform;
}
/* 物体：正面 + 中间侧壁层 + 背面镜像，沿 Z 轴挤出厚度，转起来像实物 */
.vslice {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}
.vslice svg { width: 100%; height: 100%; display: block; }
.vslice--front {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .42));
}
.vslice-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.viewer__hint {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255, 244, 226, .4);
  white-space: nowrap;
  pointer-events: none;
}

/* 本地文件（file://）模式提示：浏览器禁止读取 glb，提醒用启动脚本打开 */
.viewer__filetip {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92%;
  margin: 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(20, 32, 52, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .14);
  color: #ffe9c4;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .2px;
  text-align: center;
  pointer-events: none;
  z-index: 4;
}
.viewer__filetip b { color: #ffd166; font-weight: 900; }
.viewer__filetip[hidden] { display: none; }

/* 小鱼：换成水下的光，展台弱一点，像悬在水里 */
.viewer--fish .viewer__backdrop {
  background:
    radial-gradient(ellipse 62% 54% at 50% 34%, rgba(72, 132, 180, .55) 0%, rgba(72, 132, 180, 0) 68%),
    radial-gradient(ellipse 90% 70% at 50% 42%, #1d3448 0%, #10202e 54%, #050a10 100%);
}
.viewer--fish .viewer__spot {
  background:
    radial-gradient(ellipse 46% 38% at 50% 26%, rgba(214, 248, 255, .22) 0%, rgba(214, 248, 255, 0) 72%),
    conic-gradient(from 180deg at 50% -30%, rgba(190, 240, 255, 0) 44%, rgba(190, 240, 255, .08) 50%, rgba(190, 240, 255, 0) 56%);
}
.viewer--fish .viewer__ring { opacity: .3; }
.viewer--fish .viewer__shadow { opacity: .22 !important; }
.viewer--fish .viewer__rig { top: 46%; }

/* 真实 3D 模型：canvas 铺满舞台，伪 3D 的展台元素全部让位 */
.viewer__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: none;
}
.viewer--model .viewer__canvas { display: block; }
.viewer--model .viewer__spot,
.viewer--model .viewer__ring,
.viewer--model .viewer__shadow,
.viewer--model .viewer__rig { display: none; }

.viewer__loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  color: rgba(255, 248, 236, .86);
  white-space: nowrap;
}
.viewer__loading[hidden] { display: none; }
.viewer__spin {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .22);
  border-top-color: #ffd98a;
  animation: vspin .8s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }

/* 图片型商品图标 */
.art-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.shop-item__ic .art-img { filter: drop-shadow(0 3px 6px rgba(60, 30, 0, .16)); }
.cslot__art .art-img { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }

/* 底部工具条 */
.viewer__tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2px clamp(6px, 1.4vw, 14px) 4px;
}
.vtool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .6px;
  color: rgba(255, 248, 236, .8);
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .16s var(--ease-pop), background .2s, color .2s, box-shadow .2s;
}
.vtool svg { width: 15px; height: 15px; }
.vtool:hover { background: rgba(255, 255, 255, .17); color: #fffaf1; }
.vtool:active { transform: scale(.94); }
.vtool.is-on {
  color: #3d2a10;
  background: linear-gradient(180deg, #ffeec4, #f0cd8c);
  box-shadow: 0 4px 14px rgba(200, 150, 60, .3), inset 0 1px 0 #fff8e4;
}
.viewer__zoom { display: flex; gap: 6px; }
.vtool--ic {
  width: 36px;
  padding: 0;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

/* 柜内手办 / 缸中小鱼：可点开 3D 查看 */
.cslot {
  width: 100%;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .16s var(--ease-pop), box-shadow .2s, background .2s;
}
.cslot:not(.is-empty):hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(255, 240, 215, .22), rgba(255, 240, 215, .06));
  box-shadow: inset 0 0 0 1px rgba(255, 226, 190, .22), 0 6px 14px rgba(0, 0, 0, .3);
}
.cslot.is-empty { cursor: default; }
.cslot::before {
  content: "3D";
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .5px;
  color: rgba(255, 232, 196, .0);
  transition: color .2s;
}
.cslot:not(.is-empty)::before { color: rgba(255, 232, 196, .32); }

.aquarium__fish { pointer-events: none; }
.pfish {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  transition: filter .2s ease;
}
.pfish:hover { filter: brightness(1.15) drop-shadow(0 0 10px rgba(120, 220, 255, .8)); }

/* 竖版 */
@media (orientation: portrait) {
  .viewer__stage { height: clamp(260px, 46vh, 420px); }
  .viewer__obj { width: clamp(180px, 56vw, 260px); height: clamp(180px, 56vw, 260px); }
  .viewer__name { font-size: 20px; letter-spacing: 1px; }
  .viewer__desc { font-size: 11.5px; }
  .viewer__hint { font-size: 10px; letter-spacing: .8px; }
  .vtool { height: 34px; padding: 0 12px; font-size: 11.5px; }
  .vtool--ic { width: 34px; }
  .viewer__ring { width: 66%; }
}

/* ---------- 9. 游戏大厅：3D 卡堆轮播 ---------- */
.arcade {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: clamp(8px, 1.6vw, 24px);
  opacity: 0;
  /* 卡片上有内联 pointer-events:auto，只在父级关 none 是挡不住的，
     必须用 visibility 把整棵子树从命中测试里摘掉 */
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease;
}
.arcade.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
/* 关闭方向：等 0.3s 淡出走完再隐藏；期间卡片一律不可命中 */
.arcade:not(.is-on) {
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.arcade:not(.is-on) .scard { pointer-events: none !important; }

.arcade__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(30, 14, 48, .32), rgba(10, 4, 20, .64));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* --cw 是卡宽，也是整个卡堆的尺寸基准：透视、位移、字号全部跟着它走 */
.arcade__panel {
  --cw: clamp(210px, min(50vh, 26vw), 400px);
  position: relative;
  width: min(max(560px, calc(var(--cw) * 2.34 + 46px)), 100%);
  max-height: 100%;
  padding: clamp(12px, 1.3vw, 18px) clamp(12px, 1.6vw, 22px) clamp(10px, 1.2vw, 16px);
  border-radius: clamp(22px, 2.4vw, 34px);
  background:
    radial-gradient(120% 70% at 50% -6%, rgba(255, 255, 255, .88) 0%, rgba(255, 253, 248, 0) 62%),
    linear-gradient(180deg, rgba(255, 253, 247, .8), rgba(255, 244, 228, .68));
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  box-shadow:
    0 44px 96px rgba(24, 6, 40, .5),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 0 0 1px rgba(255, 255, 255, .5);
  overflow: hidden;
  transform: translateY(16px) scale(.97);
  transition: transform .46s var(--ease-pop);
}
.arcade.is-on .arcade__panel { transform: none; }

/* 顶部：标题 + 毛玻璃箭头 + 关闭 */
.arcade__head {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: clamp(7px, .8vw, 10px);
}
.arcade__titles { flex: 1; min-width: 0; }
.arcade__kicker {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #5b3a12;
}
.arcade__sub {
  margin: 3px 0 0;
  font-size: clamp(10.5px, .92vw, 12.5px);
  font-weight: 700;
  letter-spacing: .4px;
  color: #a3845a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arcade__arrow {
  flex: none;
  width: clamp(34px, 3.1vw, 42px);
  height: clamp(34px, 3.1vw, 42px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #6b4410;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(196, 158, 108, .34);
  box-shadow: 0 6px 16px rgba(90, 50, 14, .13), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background .2s, box-shadow .2s;
}
.arcade__arrow:hover {
  transform: translateY(-2px) scale(1.08);
  background: #fff;
  box-shadow: 0 10px 22px rgba(90, 50, 14, .2), inset 0 1px 0 #fff;
}
.arcade__arrow:active { transform: scale(.94); }
.arcade__arrow svg { width: 54%; height: 54%; }

.arcade__close {
  flex: none;
  width: clamp(32px, 2.9vw, 38px);
  height: clamp(32px, 2.9vw, 38px);
  border-radius: 50%;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 900;
  color: #8a6a3d;
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 -2px 0 rgba(170, 130, 70, .18);
  transition: transform .16s var(--ease-pop), background .2s;
}
.arcade__close:hover { background: #eedcbc; }
.arcade__close:active { transform: scale(.9); }

/* 卡堆舞台：高度按卡高算，左右允许溢出（由面板裁切） */
.arcade__stage {
  position: relative;
  z-index: 1;
  height: calc(var(--cw) * 1.4 + 20px);
  margin-top: clamp(6px, .9vw, 12px);
}
.arcade__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--cw) * 1.45);
  height: calc(var(--cw) * 1.75);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(140, 190, 255, .55)) 0%, transparent 68%);
  filter: blur(calc(var(--cw) * .075));
  opacity: .55;
  pointer-events: none;
  transition: background .6s ease;
}
.arcade__deck {
  position: absolute;
  inset: 0;
  /* 透视随卡宽同步缩放，任何屏幕比例下卡堆都是同一副长相 */
  perspective: calc(var(--cw) * 3);
  perspective-origin: 50% 50%;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.arcade__deck.is-drag { cursor: grabbing; }

/* 单张卡 */
.scard {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  padding: 0;
  border: 0;
  border-radius: calc(var(--cw) * .078);
  overflow: hidden;
  background:
    radial-gradient(115% 85% at 16% -4%, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 52%),
    radial-gradient(75% 55% at 88% 104%, rgba(0, 0, 0, .26), rgba(0, 0, 0, 0) 70%),
    linear-gradient(158deg, var(--g1, #8fd6ff) 0%, var(--g2, #3f96e0) 100%);
  box-shadow:
    0 calc(var(--cw) * .026) calc(var(--cw) * .09) rgba(28, 10, 44, .3),
    inset 0 1px 0 rgba(255, 255, 255, .5);
  transform: translate(-50%, -50%) translate3d(0, 0, 0);
  transform-style: preserve-3d;
  will-change: transform, opacity;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .24);
  pointer-events: none;
}
/* 细网点底纹，让纯色卡片有纸感 */
.scard__tex {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.4px);
  background-size: calc(var(--cw) * .072) calc(var(--cw) * .072);
  opacity: .28;
  pointer-events: none;
}
.scard__art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
/* 有实拍/插画底图的卡：图片铺满整张卡，不再叠图标 */
/* 竖构图插画裁成 5:7 卡面时，放大一点取中景，主体不会被裁掉也不会太小 */
.scard__photo {
  position: absolute;
  inset: 0;
  background-size: 125%;
  background-position: 50% 36%;
  background-repeat: no-repeat;
  pointer-events: none;
}
/* 压暗只压到底部三分之一，保证白字可读又不糊住画面 */
.scard.has-photo .scard__shade {
  background: linear-gradient(to top,
    rgba(10, 4, 20, .9) 0%,
    rgba(10, 4, 20, .58) 18%,
    rgba(10, 4, 20, .12) 40%,
    rgba(10, 4, 20, 0) 58%);
}
.scard.has-photo .scard__no {
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.scard.has-photo .scard__name { text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }

/* 图标底下的玻璃圆盘 */
.scard__disk {
  position: absolute;
  width: 62%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, .26),
    inset 0 calc(var(--cw) * .03) calc(var(--cw) * .08) rgba(255, 255, 255, .16),
    0 calc(var(--cw) * .02) calc(var(--cw) * .06) rgba(10, 4, 20, .12);
}
.scard__art svg {
  position: relative;
  width: 42%;
  height: 42%;
  filter: drop-shadow(0 6px 14px rgba(18, 6, 34, .34));
}
/* 底部压暗，只有正中的卡才显字 */
.scard__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 5, 20, .74) 0%, rgba(12, 5, 20, .24) 30%, transparent 54%);
  opacity: 0;
  transition: opacity .38s ease;
  pointer-events: none;
}
.scard.is-active .scard__shade { opacity: 1; }

.scard__info {
  position: absolute;
  left: calc(var(--cw) * .085);
  right: calc(var(--cw) * .085);
  bottom: calc(var(--cw) * .082);
  display: flex;
  flex-direction: column;
  gap: calc(var(--cw) * .022);
  text-align: left;
  opacity: 0;
  transform: translateY(calc(var(--cw) * .03));
  transition: opacity .38s ease, transform .42s var(--ease-pop);
  pointer-events: none;
}
.scard.is-active .scard__info { opacity: 1; transform: none; }
.scard__name {
  font-size: clamp(18px, calc(var(--cw) * .088), 34px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .38);
}
.scard__no {
  position: absolute;
  top: calc(var(--cw) * .06);
  right: calc(var(--cw) * .075);
  font-size: clamp(9px, calc(var(--cw) * .034), 13px);
  font-weight: 900;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .62);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  pointer-events: none;
}

/* 底部：说明 + 圆点 + 开始按钮 */
.arcade__desc {
  margin: clamp(4px, .7vw, 8px) 0 0;
  text-align: center;
  font-size: clamp(11.5px, 1vw, 13.5px);
  font-weight: 700;
  letter-spacing: .4px;
  color: #86652f;
  min-height: 1.5em;
}
.arcade__foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: clamp(6px, .9vw, 12px);
}
.arcade__dots {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 7px;
}
.arcade__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 999px;
  background: #c9b291;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
  transition: width .32s var(--ease-pop), background .28s ease;
}
.arcade__dot.is-on { width: 24px; background: #c99a4e; }

.arcade__start {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: clamp(32px, 3.2vw, 40px);
  padding: 0 clamp(12px, 1.4vw, 18px) 0 clamp(14px, 1.6vw, 20px);
  border-radius: 999px;
  font-size: clamp(12.5px, 1.05vw, 14px);
  font-weight: 900;
  letter-spacing: .8px;
  color: #5b3a12;
  background: linear-gradient(180deg, #fffcee, #ffe6a8 58%, #f8d083);
  box-shadow: 0 4px 12px rgba(160, 110, 30, .28), inset 0 1px 0 #fff;
  transition: transform .18s var(--ease-pop), box-shadow .2s;
}
.arcade__start svg { width: 15px; height: 15px; }
.arcade__start:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(160, 110, 30, .32), inset 0 1px 0 #fff; }
.arcade__start:active { transform: scale(.96); }

@media (orientation: portrait) {
  :root {
    --dock-h: clamp(108px, 9vh, 132px);
  }

  .hud { padding-top: max(18px, env(safe-area-inset-top)); padding-left: 16px; padding-right: 16px; }
  .learn-btn { height: 46px; gap: 6px; padding: 0 14px 0 11px; font-size: 14px; letter-spacing: .5px; }
  .learn-btn__ic { width: 21px; height: 21px; }
  .hud-card { height: 52px; gap: 7px; padding: 0 7px; }
  .hud-card__badge { width: 32px; height: 32px; font-size: 13px; }
  .hud-card__name { font-size: 14px; }
  .hud-card__lv { font-size: 10px; padding: 3px 7px; }
  .hud-card__sep { height: 22px; margin: 0 1px; }
  .coin { height: 38px; padding: 0 11px 0 6px; gap: 5px; }
  .coin__ic { width: 24px; height: 24px; }
  .coin__num { font-size: 16px; }

  /* 小屋居中偏上，角色在其前方偏下 */
  .house-hotspot { --hs-l: 48%; --hs-t: 30%; --hs-w: 50%; --hs-h: 38%; }
  .hero {
    left: 38%;
    bottom: 9vh;
    height: min(37vh, 58vw);
    transform: translateX(-50%);
    z-index: 4;
  }
  /* 竖版背景构图差异大：森林小屋在右上、星空居中、海洋居中偏下 */
  body[data-theme="starry"] .hero { left: 70%; height: min(34vh, 54vw); }
  body[data-theme="ocean"] .hero { left: 31%; bottom: 17vh; height: min(34vh, 53vw); }

  /* 竖版各主题的底座落点不同：森林草坡较高，海洋沙地与星空云海更低 */
  body[data-theme="starry"] .house-hotspot { --hs-l: 24%; --hs-t: 40%; --hs-w: 52%; --hs-h: 36%; }
  body[data-theme="ocean"]  .house-hotspot { --hs-l: 27%; --hs-t: 32%; --hs-w: 46%; --hs-h: 42%; }

  .dock {
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding: 0 16px max(16px, env(safe-area-inset-bottom));
    height: auto;
    min-height: var(--dock-h);
  }
  .dock__tools {
    margin: 0 auto;          /* 左右都是 auto，竖版同样整体居中 */
    justify-content: center;
    gap: 10px;
    width: max-content;
    align-self: center;
    padding: 10px;
    border-radius: 24px;
  }
  .dock-btn { width: clamp(60px, 18vw, 84px); height: clamp(60px, 18vw, 84px); }
  .dock-btn.is-active::after { border-radius: 29px; inset: -6px; }
  .start-btn {
    width: 100%;
    height: 66px;
    justify-content: center;
    font-size: 23px;
    letter-spacing: 6px;
    padding: 0 20px;
  }

  .sheet {
    width: 100vw;
    max-height: 76vh;
    border-radius: 30px 30px 0 0;
  }
  .sheet__head { padding: 20px 18px 10px; }
  .sheet__title { font-size: 19px; }
  .sheet__sub { display: none; }
  .sheet__body { padding: 4px 18px 22px; }
  .sheet__foot { padding: 14px 18px max(16px, env(safe-area-inset-bottom)); }

  .grid--house { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card--house .card__media { height: 120px; }
  .card__name { font-size: 12px; padding: 8px 4px 10px; }

  .panel.is-active[data-panel="chara"] { grid-template-columns: 1fr; gap: 16px; }
  .panel.is-active[data-panel="chara"] .profile,
  .panel.is-active[data-panel="chara"] .chara-pick:not(.outfit-pick),
  .panel.is-active[data-panel="chara"] .outfit-pick { grid-column: 1; grid-row: auto; }
  .profile { gap: 12px; }
  .seg--grade { display: grid; grid-template-columns: repeat(3, 1fr); }
  .seg--grade .seg__item { height: 34px; font-size: 12px; }
  .field__input { height: 40px; font-size: 14px; }
  .grid--chara { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card--chara .card__media { height: 118px; }
  .outfit-pick { margin-top: 4px; }
  .fitting-entry { max-width: 100%; }

  .shop-tabs { margin-bottom: 12px; }
  .shop-tab { height: 40px; font-size: 14px; letter-spacing: 1px; }
  .shop-subtabs { margin: -4px 0 8px; }
  .shop-sub { height: 33px; padding: 0 11px; font-size: 12.5px; }
  .shop-kindtabs { margin-bottom: 12px; }
  .shop-kind { height: 32px; font-size: 12.5px; }
  .grid--shop { grid-template-columns: 1fr; gap: 10px; }
  .shop-item { padding: 10px; }

  /* 内景 */
  .interior__hero { left: 50%; bottom: 4%; height: 26%; }
  .bubbleline { bottom: 8%; font-size: 15px; padding: 14px 18px; }
  .hot { width: 48px; height: 48px; margin: -24px 0 0 -24px; }

  /* 竖版：收藏夹抽屉与道具 */
  .satchel { max-height: 56vh; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
  .satchel__title { font-size: 15px; }
  .satchel__tip { font-size: 11px; }
  .satchel__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .sat-item { padding: 9px 5px 7px; border-radius: 14px; }
  .sat-item__ic { width: 40px; height: 40px; }
  .sat-item__name { font-size: 11px; }
  .satchel-btn { height: 44px; padding: 0 13px 0 10px; font-size: 14px; gap: 6px; }
  .satchel-btn__ic { width: 21px; height: 21px; }
  .placed__item { width: clamp(46px, 15vw, 78px); }
  .placed__item.is-tank { width: clamp(26px, 8vw, 40px); }

  .toast { bottom: calc(var(--dock-h) + 26px); font-size: 14px; }

  /* 游戏大厅：竖版卡片按宽度铺满，卡堆只露左右各一张边 */
  .arcade { padding: 10px; }
  .arcade__panel {
    --cw: clamp(190px, 74vw, 315px);
    width: 100%;
    padding: 12px 12px 10px;
    border-radius: 26px;
  }
  .arcade__kicker { font-size: 16px; }
  .arcade__sub { font-size: 11px; }
  .arcade__stage { height: calc(var(--cw) * 1.4 + 14px); margin-top: 8px; }
  .arcade__desc { font-size: 12px; }
  .arcade__foot { margin-top: 8px; }
}

/* 矮屏（横版手机）压缩 */
@media (orientation: landscape) and (max-height: 560px) {
  .arcade__panel { --cw: clamp(150px, min(42vh, 19vw), 230px); padding: 8px 10px; }
  .arcade__sub { display: none; }
  .arcade__desc { display: none; }
  .arcade__stage { margin-top: 4px; height: calc(var(--cw) * 1.4 + 8px); }
  .arcade__foot { margin-top: 4px; }
  .arcade__start { height: 30px; font-size: 12px; }
  :root { --dock-h: 104px; }
  .dock-btn { width: 66px; height: 66px; border-radius: 20px; }
  .dock-btn img { border-radius: 20px; }
  .start-btn { height: 62px; font-size: 22px; padding: 0 34px; }
  .hud-card { height: 44px; }
  .learn-btn { height: 42px; padding: 0 12px 0 9px; font-size: 13px; gap: 5px; }
  .learn-btn__ic { width: 19px; height: 19px; }
  .coin { height: 32px; }
  .hero { height: min(74vh, 42vw); }
}

/* 大屏（桌面宽屏）适度放大 */
@media (orientation: landscape) and (min-width: 1500px) {
  :root { --dock-h: 152px; }
  .dock-btn { width: 96px; height: 96px; border-radius: 28px; }
  .dock-btn img { border-radius: 28px; }
  .start-btn { height: 84px; font-size: 30px; padding: 0 54px; }
}

/* 窄屏：信息卡与按钮挤在一行会溢出，按钮收成圆形图标 */
@media (max-width: 480px) {
  .satchel-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .satchel-btn__txt { display: none; }
  .satchel-btn__num { position: absolute; top: -5px; right: -4px; min-width: 19px; height: 19px; font-size: 11px; }
  .learn-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .learn-btn span { display: none; }
  .learn-btn__ic { width: 24px; height: 24px; }
  .hud-card { gap: 6px; padding: 0 6px; }
  .hud-card__name { font-size: 13px; }
}

/* ---------- 管理后台入口：低调的小齿轮，点进去要输密码 ---------- */
.admin-entry {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  /* 底部 Dock 是整条通栏（桌面约 126px 高），齿轮必须落在它上方 */
  bottom: calc(max(140px, env(safe-area-inset-bottom) + 128px));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 16px;
  line-height: 1;
  color: #8a6b45;
  text-decoration: none;
  background: rgba(255, 252, 242, .55);
  border: 1.5px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(90, 60, 20, .16), inset 0 1px 0 #fff;
  opacity: .62;
  transition: opacity .2s, transform .25s;
  -webkit-tap-highlight-color: transparent;
}
.admin-entry:hover { opacity: 1; transform: rotate(35deg); }
.admin-entry:active { transform: scale(.92); }

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

/* 商城按游戏分组时的小标题 */
.shop-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 2px 2px;
  padding-bottom: 5px;
  border-bottom: 2px solid rgba(224, 162, 63, .25);
}

.shop-group__t { font-size: 13px; font-weight: 800; color: #6b4a1c; }
.shop-group__n { font-size: 11px; color: #9a7f55; }
.shop-empty { grid-column: 1 / -1; padding: 18px; text-align: center; font-size: 12.5px; color: #9a7f55; }

/* 后台新加的商品如果没有图片，用 emoji 顶一下 */
.art-emoji {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 26px;
  line-height: 1;
}

/* 室内热点容器：display:contents 让热点按钮仍然相对 .interior 绝对定位 */
.interior__hot-layer { display: contents; }

/* 消消乐道具图标自带圆形徽章底（白底），裁成圆形和游戏内一致 */
.shop-item__ic img[src*="match3-item-"],
.shop-item-row__art img[src*="match3-item-"] {
  border-radius: 50%;
}

/* 商城里道具的持有数量 */
.shop-item__own {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: #2f7f6a;
  background: #eafaf0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px #cfeedd;
}

/* ---------------- 头像设置 ---------------- */
.avatar-set {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-set__pic {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 30%, #fff9ea, #f2e2c6);
  box-shadow: inset 0 0 0 2px #f0e0c2, 0 4px 10px rgba(150, 100, 30, .16);
  flex: none;
}

.avatar-set__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-set__ops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------- 头像裁剪弹窗 ---------------- */
.crop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(28, 18, 6, .55);
  backdrop-filter: blur(3px);
}

.crop[hidden] { display: none; }

.crop__box {
  width: min(94vw, 430px);
  padding: 18px;
  border-radius: 24px;
  background: #fffaf0;
  box-shadow: 0 24px 60px rgba(60, 30, 0, .35), inset 0 0 0 2px #f3e4c8;
}

.crop__title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  color: #6d410c;
}

.crop__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: #ece2d0;
  touch-action: none;
  cursor: grab;
}

.crop__stage:active { cursor: grabbing; }

.crop__stage img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

.crop__ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(24, 14, 0, .46), inset 0 0 0 3px rgba(255, 255, 255, .92);
}

.crop__zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 800;
  color: #8a6a3a;
}

.crop__zoom input { flex: 1; }

.crop__hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: #a5824e;
  font-weight: 600;
}

.crop__acts {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 头像按钮 / 裁剪按钮：与大厅的奶油色按钮统一 */
.avatar-set__ops button {
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: #6d410c;
  background: linear-gradient(180deg, #fff7e2, #ffe6ac);
  box-shadow: inset 0 -2px 0 rgba(186, 128, 40, .25);
}

.avatar-set__ops button:active { transform: translateY(1px); }

.crop__acts button {
  min-width: 96px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  color: #6d410c;
  background: linear-gradient(180deg, #fff7e2, #ffdf9c);
  box-shadow: inset 0 -2px 0 rgba(186, 128, 40, .28), 0 4px 10px rgba(160, 100, 20, .18);
}

.crop__acts button.btn--ghost {
  color: #8a6a3a;
  background: #fff;
  box-shadow: inset 0 0 0 2px #eadcc2;
}

.crop__acts button:active { transform: translateY(1px); }

/* ============ 角色对话：文字 + 语音 + 大模型 ============ */
.chatbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.chatbox.is-open { opacity: 1; pointer-events: auto; }
.chatbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 10, 38, .52);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.chatbox__panel {
  position: relative;
  width: min(560px, 94vw);
  height: min(74vh, 660px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(180deg, #fffdf7, #fff4e6);
  box-shadow: 0 24px 70px rgba(24, 4, 40, .5), inset 0 1px 0 #fff;
  color: #5d3a12;
  transform: translateY(18px) scale(.98);
  transition: transform .3s var(--ease-pop);
}
.chatbox.is-open .chatbox__panel { transform: none; }
.chatbox__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #f7cf78, #ffe9b8, #e8b25a);
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .5);
}
.chatbox__ava {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
}
.chatbox__ava img { width: 100%; height: 100%; object-fit: cover; }
.chatbox__titles { display: flex; flex-direction: column; min-width: 0; }
.chatbox__titles b { font-size: 16px; color: #5d3a12; }
.chatbox__titles em { font-size: 11px; font-style: normal; color: #94601b; }
.chatbox__tool, .chatbox__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  color: #7a531c;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.chatbox__close { margin-left: 0; font-size: 17px; }
.chatbox__log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chat-msg--me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg__ava {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff2d8;
  font-size: 15px;
}
.chat-msg__bubble {
  padding: 10px 13px;
  border: 1px solid #eadcc3;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(120, 80, 30, .08);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg--me .chat-msg__bubble {
  border-color: #e8b25a;
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, #ffe6a8, #f7cf78);
}
.chatbox__typing { padding: 0 16px 6px; font-size: 12px; color: #a5824e; }
.chatbox__typing[hidden] { display: none; }
.chatbox__foot { display: flex; gap: 8px; padding: 10px 14px 4px; border-top: 1px solid #eadcc3; }
.chatbox__foot input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid #e0cdae;
  border-radius: 12px;
  background: #fff;
  color: #5d3a12;
  font-size: 14px;
  outline: none;
}
.chatbox__foot input:focus { border-color: #e8b25a; }
.chatbox__mic, .chatbox__send {
  flex: none;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7cf78, #e8b25a);
  color: #5d3a12;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
.chatbox__mic.is-on { background: #e05a5a; color: #fff; animation: mic-pulse 1s infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 6px rgba(224, 90, 90, .22); } }
.chatbox__tip { margin: 0; padding: 6px 14px 12px; text-align: center; font-size: 11px; color: #a5824e; }
@media (orientation: portrait) {
  .chatbox__panel {
    width: 96vw;
    height: min(78vh, 640px);
    align-self: end;
    margin-bottom: 8px;
    border-radius: 22px 22px 18px 18px;
  }
}

/* ============ 角色对话：紫色星空玻璃气泡（贴人物，无遮罩） ============ */
.chatbubble {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  --bubble-solid: #2b1b4d;
  --bubble-bg: rgba(43, 27, 77, .74);
  --bubble-border: #f0cd7a;
  --bubble-ink: #fff6e2;
  --bubble-image: none;
  --chat-x: 50%;
  --chat-y: 20%;
  --chat-tail-y: 96px;
  --chat-tail-x: 50%;
  --gold: #f4d68a;
  --gold-deep: #c8963c;
}
/* 对话只从人物点击展开，悬浮球不再需要 */
.chatbubble__fab { display: none; }
.chatbubble__fab {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background: linear-gradient(135deg, #f7cf78, #e6a53f);
  box-shadow: 0 8px 22px rgba(36, 12, 48, .34), inset 0 2px 0 rgba(255, 255, 255, .6);
  color: #5d3a12;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .25s var(--ease-pop);
}
.chatbubble__fab:hover { transform: translateY(-2px) scale(1.04); }
.chatbubble.is-open .chatbubble__fab { transform: scale(.9); }
/* 面板由 JS 贴着人物摆放，菱形金扣始终朝向人物 */
.chatbubble__panel {
  position: absolute;
  left: var(--chat-x);
  top: var(--chat-y);
  width: var(--chat-w, min(390px, 92vw));
  height: var(--chat-h, min(60vh, 350px));
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--bubble-border);
  border-radius: 22px;
  background-color: var(--bubble-bg);
  /* 后台自定义背景图在上层；下层的紫靛星云材质始终透出，和参考图一致 */
  background-image:
    var(--bubble-image),
    /* 朦胧星轨：一道椭圆细弧，像星云从卡片里穿过 */
    radial-gradient(ellipse 74% 46% at 82% 34%, transparent 0 76%, rgba(255, 236, 186, .13) 77% 78%, transparent 79%),
    radial-gradient(circle at 83% 15%, rgba(255, 240, 196, .95) 0 1.6px, transparent 2.8px),
    radial-gradient(circle at 21% 71%, rgba(255, 226, 154, .85) 0 1.3px, transparent 2.4px),
    radial-gradient(circle at 63% 88%, rgba(255, 240, 196, .7) 0 1.2px, transparent 2.2px),
    radial-gradient(circle at 44% 34%, rgba(255, 236, 188, .6) 0 1px, transparent 2px),
    radial-gradient(ellipse at 78% 38%, rgba(255, 238, 200, .22) 0 12%, transparent 36%),
    radial-gradient(ellipse at 26% 14%, rgba(148, 98, 228, .36), transparent 62%),
    linear-gradient(158deg, rgba(58, 28, 112, .66), rgba(20, 32, 96, .6) 56%, rgba(40, 22, 88, .68));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  backdrop-filter: blur(2px) saturate(1.15);
  -webkit-backdrop-filter: blur(2px) saturate(1.15);
  color: var(--bubble-ink);
  box-shadow:
    0 0 0 1px rgba(255, 236, 178, .3) inset,
    0 0 0 4px rgba(244, 214, 138, .08),
    0 0 30px rgba(244, 214, 138, .32),
    0 22px 60px rgba(16, 4, 36, .62);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.96);
  transform-origin: left center;
  transition: opacity .24s ease, transform .28s var(--ease-pop), visibility .24s;
  pointer-events: none;
  overflow: visible;
}
/* 面板内朦胧弯月：配合真背景透出，模拟月牙藏在星云后，纯装饰不拦点击 */
.chatbubble__panel::after {
  content: "";
  position: absolute;
  right: 16%;
  top: 30%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: inset -10px -6px 0 0 rgba(255, 244, 212, .34), 0 0 26px rgba(255, 236, 186, .18);
  filter: blur(.6px);
  opacity: .72;
  pointer-events: none;
  z-index: 0;
}
.chatbubble[data-side="left"] .chatbubble__panel { transform-origin: right center; }
.chatbubble[data-side="above"] .chatbubble__panel { transform-origin: center bottom; }
.chatbubble.is-open .chatbubble__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
/* 菱形金扣：参考图里连接人物与对话框的钻石形装饰 */
.chatbubble__tail {
  position: absolute;
  width: 14px;
  height: 14px;
  background: rgba(43, 27, 77, .92);
  border: 1.5px solid var(--bubble-border);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(244, 214, 138, .62), inset 0 0 6px rgba(244, 214, 138, .28);
}
.chatbubble[data-side="right"] .chatbubble__panel,
.chatbubble[data-side="left"] .chatbubble__panel,
.chatbubble[data-side="above"] .chatbubble__panel { border-radius: 22px; }
.chatbubble[data-side="right"] .chatbubble__tail {
  left: -9px;
  top: var(--chat-tail-y);
  margin-top: -7px;
}
.chatbubble[data-side="left"] .chatbubble__tail {
  right: -9px;
  top: var(--chat-tail-y);
  margin-top: -7px;
}
.chatbubble[data-side="above"] .chatbubble__tail {
  bottom: -9px;
  left: var(--chat-tail-x);
  margin-left: -7px;
}
.chatbubble__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 22px 22px 0 0;
  border-bottom: 1px solid rgba(244, 214, 138, .3);
  background: linear-gradient(180deg, rgba(34, 20, 82, .68), rgba(28, 32, 92, .34));
  box-shadow: 0 6px 16px rgba(10, 2, 26, .18);
  position: relative;
  z-index: 1;
}
.chatbubble__ava {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--gold);
  background: #1a1030;
  box-shadow: 0 0 12px rgba(244, 214, 138, .48);
}
.chatbubble__ava img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.chatbubble__titles { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.chatbubble__titles b {
  font-size: 15px;
  font-weight: 900;
  color: #f4d68a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(16, 4, 36, .92), 0 0 10px rgba(244, 214, 138, .45);
}
.chatbubble__titles em { font-size: 10px; font-style: normal; color: #f0cd7a; opacity: .95; }
.chatbubble__lang {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 2px;
  border: 1px solid rgba(244, 214, 138, .6);
  border-radius: 99px;
  background: rgba(30, 20, 78, .62);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .32);
}
.chatbubble__lang button {
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 3px 8px;
  background: transparent;
  color: #f7e9c8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
  cursor: pointer;
}
/* EN 未选中态：金描边圆角按钮 */
.chatbubble__lang button:not(.is-on) { border-color: rgba(244, 214, 138, .68); }
.chatbubble__lang button.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #ffe4a0, #e7b558);
  color: #4a2c0c;
  box-shadow: 0 1px 6px rgba(244, 214, 138, .5);
}
.chatbubble__tool, .chatbubble__close {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 214, 138, .58);
  border-radius: 50%;
  background: rgba(30, 20, 78, .62);
  color: #ffe9bd;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .36);
}
.chatbubble__tool svg, .chatbubble__close svg { width: 15px; height: 15px; display: block; }
.chatbubble__close { font-size: 14px; }
.chatbubble__tool.is-muted { color: #a693c7; opacity: .72; }
.chatbubble__log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px 13px;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
  background: radial-gradient(120% 80% at 70% 18%, rgba(126, 78, 196, .12), transparent 70%);
}
.chatbubble .chat-msg { max-width: 92%; }
.chatbubble .chat-msg__ava {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--gold);
  background: #1a1030;
  color: #fff;
  overflow: hidden;
  font-size: 14px;
  box-shadow: 0 0 8px rgba(244, 214, 138, .3);
}
.chatbubble .chat-msg__ava img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.chatbubble .chat-msg__bubble {
  padding: 9px 12px;
  border: 1px solid rgba(244, 214, 138, .68);
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(135deg, rgba(38, 24, 88, .78), rgba(26, 34, 92, .68));
  color: #f7e6bd;
  box-shadow: 0 0 9px rgba(244, 214, 138, .24), 0 3px 12px rgba(10, 2, 26, .34), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-size: 12.5px;
}
.chatbubble .chat-msg--me .chat-msg__bubble {
  border-color: rgba(255, 228, 160, .85);
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, rgba(244, 214, 138, .94), rgba(205, 146, 54, .9));
  color: #3a2408;
}
.chatbubble__typing { padding: 0 14px 6px; font-size: 11px; color: #ffe4a0; opacity: .85; }
.chatbubble__typing[hidden] { display: none; }
.chatbubble__foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px 4px;
  border-top: 1px solid rgba(244, 214, 138, .26);
  background: linear-gradient(0deg, rgba(28, 18, 74, .42), transparent);
  position: relative;
  z-index: 1;
}
.chatbubble__foot input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(244, 214, 138, .5);
  border-radius: 12px;
  background: rgba(30, 20, 78, .62);
  color: #fff6e2;
  font-size: 12.5px;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3);
}
.chatbubble__foot input::placeholder { color: rgba(247, 230, 189, .72); }
.chatbubble__foot input:focus {
  border-color: #ffe4a0;
  box-shadow: 0 0 10px rgba(244, 214, 138, .3), inset 0 2px 5px rgba(0, 0, 0, .3);
}
.chatbubble__mic, .chatbubble__send {
  flex: none;
  height: 38px;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  background: rgba(16, 8, 36, .72);
  color: #ffe4a0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(244, 214, 138, .3);
}
/* 麦克风：参考图的暖金实心圆 + 深紫图标 */
.chatbubble__mic {
  width: 38px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border-color: #f6d488;
  background: radial-gradient(circle at 38% 30%, #ffe9b0, #e9b45c 78%);
  color: #5d3a12;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 10px rgba(244, 214, 138, .4);
}
.chatbubble__mic svg { width: 17px; height: 17px; display: block; }
.chatbubble__send {
  padding: 0 15px;
  border-color: #f0c46e;
  background: linear-gradient(135deg, #ffe6a8, #e8b25a);
  color: #4a2c0c;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.chatbubble__mic:disabled { opacity: .5; cursor: not-allowed; }
.chatbubble__mic.is-on { background: #8e2e5e; color: #fff; border-color: #ffb3d1; animation: mic-pulse 1s infinite; }
.chatbubble__tip { margin: 0; padding: 5px 12px 9px; text-align: center; font-size: 10px; color: rgba(247, 230, 189, .78); }
@media (orientation: portrait) {
  /* 竖屏人物靠下，气泡放到人物上方；高度由 JS 按 Dock 与人物位置动态计算 */
  .chatbubble__panel { width: min(88vw, 360px); }
}

/* ============================================================
   对话皮肤二：海洋珊瑚粉蓝（海洋小屋自动匹配）
   ============================================================ */
.chatbubble[data-style="ocean"] .chatbubble__panel {
  background-color: rgba(198, 238, 244, .72);
  background-image:
    var(--bubble-image),
    radial-gradient(circle at 22% 76%, rgba(255, 255, 255, .55) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 32%, rgba(255, 255, 255, .42) 0 2px, transparent 3.2px),
    radial-gradient(ellipse 88% 54% at 68% 82%, transparent 0 74%, rgba(255, 255, 255, .17) 75% 76%, transparent 77%),
    radial-gradient(ellipse at 28% 18%, rgba(186, 238, 246, .5), transparent 62%),
    linear-gradient(158deg, rgba(184, 232, 246, .82), rgba(132, 212, 214, .76) 55%, rgba(190, 234, 238, .8));
  border-color: #8fd6dc;
  box-shadow:
    0 0 0 1px rgba(255, 158, 172, .55),
    0 0 0 4px rgba(133, 210, 220, .12),
    0 0 30px rgba(126, 212, 222, .55),
    0 22px 60px rgba(8, 44, 66, .48);
}
/* 角落海星与透明小气泡，替代星空款的月牙 */
.chatbubble[data-style="ocean"] .chatbubble__panel::after {
  content: "✦  ◦";
  right: 15%;
  top: 28%;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: none;
  font-size: 15px;
  letter-spacing: 9px;
  color: rgba(255, 160, 178, .66);
  text-shadow: 0 0 10px rgba(255, 255, 255, .6);
  opacity: .8;
}
.chatbubble[data-style="ocean"] .chatbubble__tail {
  background: rgba(180, 232, 242, .94);
  border-color: #8fd6dc;
  box-shadow: 0 0 12px rgba(126, 212, 222, .62);
}
.chatbubble[data-style="ocean"] .chatbubble__head {
  border-bottom-color: rgba(255, 158, 172, .42);
  background: linear-gradient(180deg, rgba(255, 255, 255, .68), rgba(222, 246, 248, .26));
}
.chatbubble[data-style="ocean"] .chatbubble__ava {
  border-color: #ffa9b8;
  background: #eafaff;
  box-shadow: 0 0 12px rgba(255, 169, 184, .5);
}
.chatbubble[data-style="ocean"] .chatbubble__titles b {
  color: #146b8c;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .85);
}
.chatbubble[data-style="ocean"] .chatbubble__titles em { color: #3f9eb0; }
.chatbubble[data-style="ocean"] .chatbubble__lang {
  border-color: rgba(255, 158, 172, .72);
  background: rgba(255, 255, 255, .66);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, .7);
}
.chatbubble[data-style="ocean"] .chatbubble__lang button { color: #146b8c; }
.chatbubble[data-style="ocean"] .chatbubble__lang button:not(.is-on) {
  border-color: rgba(255, 158, 172, .75);
  background: rgba(255, 255, 255, .72);
}
.chatbubble[data-style="ocean"] .chatbubble__lang button.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #ffb3c1, #ff96ab);
  color: #fff;
  box-shadow: 0 1px 6px rgba(255, 150, 171, .5);
}
.chatbubble[data-style="ocean"] .chatbubble__tool,
.chatbubble[data-style="ocean"] .chatbubble__close {
  border-color: rgba(255, 158, 172, .62);
  background: rgba(255, 255, 255, .68);
  color: #146b8c;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, .7);
}
.chatbubble[data-style="ocean"] .chatbubble__log {
  background: radial-gradient(120% 80% at 70% 18%, rgba(160, 230, 240, .22), transparent 70%);
}
.chatbubble[data-style="ocean"] .chat-msg__ava {
  border-color: #ffa9b8;
  background: #eafaff;
}
.chatbubble[data-style="ocean"] .chat-msg__bubble {
  border-color: rgba(86, 170, 196, .62);
  background: linear-gradient(135deg, rgba(246, 253, 255, .92), rgba(222, 244, 250, .84));
  color: #124f6e;
  box-shadow: 0 0 9px rgba(120, 200, 220, .3), 0 3px 12px rgba(20, 80, 110, .14);
}
.chatbubble[data-style="ocean"] .chat-msg--me .chat-msg__bubble {
  border-color: #ffb3c1;
  background: linear-gradient(135deg, #ffc2ce, #ffa0b4);
  color: #fff;
}
.chatbubble[data-style="ocean"] .chatbubble__typing { color: #2b7f96; }
.chatbubble[data-style="ocean"] .chatbubble__foot {
  border-top-color: rgba(255, 158, 172, .35);
  background: linear-gradient(0deg, rgba(226, 248, 250, .5), transparent);
}
.chatbubble[data-style="ocean"] .chatbubble__foot input {
  border-color: rgba(120, 190, 210, .6);
  background: rgba(255, 255, 255, .62);
  color: #124f6e;
  box-shadow: inset 0 2px 5px rgba(60, 130, 160, .12);
}
.chatbubble[data-style="ocean"] .chatbubble__foot input::placeholder { color: rgba(70, 150, 180, .75); }
.chatbubble[data-style="ocean"] .chatbubble__foot input:focus {
  border-color: #7fd0d8;
  box-shadow: 0 0 10px rgba(127, 208, 216, .4), inset 0 2px 5px rgba(60, 130, 160, .12);
}
.chatbubble[data-style="ocean"] .chatbubble__mic {
  border-color: #ffc0cc;
  background: radial-gradient(circle at 38% 30%, #ffd0da, #ff96ab 78%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(180, 80, 110, .22), inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 10px rgba(255, 150, 171, .4);
}
.chatbubble[data-style="ocean"] .chatbubble__send {
  border-color: #ffb3c1;
  background: linear-gradient(135deg, #ffc2ce, #ff96ab);
  color: #fff;
}
.chatbubble[data-style="ocean"] .chatbubble__tip { color: rgba(63, 158, 176, .88); }

/* 海洋款头顶胶囊：浅蓝青玻璃 + 粉蓝描边 + 透明小气泡 + 珊瑚粉金光环 */
body[data-chat-style="ocean"] .hero__chat-pill {
  border-color: #8fd6dc;
  background:
    radial-gradient(circle at 24% 70%, rgba(255, 255, 255, .78) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 76% 34%, rgba(255, 255, 255, .6) 0 1.2px, transparent 2px),
    linear-gradient(180deg, rgba(230, 251, 253, .94), rgba(190, 232, 238, .87));
  box-shadow: 0 3px 14px rgba(20, 70, 90, .32), 0 0 14px rgba(255, 158, 172, .5), inset 0 1px 0 rgba(255, 255, 255, .92);
}
body[data-chat-style="ocean"] .hero__chat-pill::after {
  background: rgba(216, 246, 250, .95);
  border-color: rgba(143, 214, 220, .95);
}
body[data-chat-style="ocean"] .hero__chat-txt {
  color: #146b8c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}
body[data-chat-style="ocean"] .hero__chat-ic { filter: drop-shadow(0 1px 2px rgba(20, 107, 140, .35)); }
body[data-chat-style="ocean"] .hero__chat-ring {
  border-color: #ffc9a8;
  box-shadow: 0 0 12px rgba(255, 201, 168, .68), inset 0 0 5px rgba(255, 201, 168, .42);
}

/* ============================================================
   对话皮肤三：森林精灵奶白粉紫（森林小屋自动匹配）
   ============================================================ */
.chatbubble[data-style="sprite"] .chatbubble__panel {
  background-color: rgba(255, 248, 244, .76);
  background-image:
    var(--bubble-image),
    radial-gradient(circle at 82% 18%, rgba(212, 168, 96, .82) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 24% 66%, rgba(212, 168, 96, .62) 0 1.1px, transparent 2.1px),
    radial-gradient(ellipse at 70% 26%, rgba(255, 190, 220, .34), transparent 62%),
    radial-gradient(ellipse at 24% 84%, rgba(242, 200, 230, .3), transparent 64%),
    linear-gradient(158deg, rgba(255, 250, 246, .85), rgba(248, 232, 242, .79) 55%, rgba(252, 242, 250, .83));
  border-color: #f6b8c8;
  box-shadow:
    0 0 0 1px rgba(190, 230, 150, .5),
    0 0 26px rgba(246, 184, 200, .45),
    0 22px 60px rgba(60, 30, 50, .4);
}
.chatbubble[data-style="sprite"] .chatbubble__panel::after {
  content: "✦ · ✧";
  right: 15%;
  top: 28%;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: none;
  font-size: 15px;
  letter-spacing: 8px;
  color: rgba(212, 168, 96, .72);
  text-shadow: 0 0 10px rgba(255, 255, 255, .6);
  opacity: .8;
}
.chatbubble[data-style="sprite"] .chatbubble__tail {
  background: rgba(255, 246, 240, .94);
  border-color: #f6b8c8;
  box-shadow: 0 0 12px rgba(246, 184, 200, .6);
}
.chatbubble[data-style="sprite"] .chatbubble__head {
  border-bottom-color: rgba(246, 184, 200, .5);
  background: linear-gradient(180deg, rgba(255, 250, 246, .78), rgba(250, 232, 240, .3));
}
.chatbubble[data-style="sprite"] .chatbubble__ava {
  border-color: #f0b9a0;
  background: #fff8f2;
  box-shadow: 0 0 12px rgba(240, 185, 160, .5);
}
.chatbubble[data-style="sprite"] .chatbubble__titles b {
  color: #8a5a2b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .85);
}
.chatbubble[data-style="sprite"] .chatbubble__titles em { color: #c99a6b; }
.chatbubble[data-style="sprite"] .chatbubble__lang {
  border-color: rgba(240, 185, 160, .65);
  background: rgba(255, 250, 246, .72);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, .7);
}
.chatbubble[data-style="sprite"] .chatbubble__lang button { color: #8a5a2b; }
.chatbubble[data-style="sprite"] .chatbubble__lang button:not(.is-on) {
  border-color: rgba(240, 185, 160, .7);
  background: rgba(255, 250, 246, .75);
}
.chatbubble[data-style="sprite"] .chatbubble__lang button.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #ffe0a0, #e8b25a);
  color: #5d3a12;
  box-shadow: 0 1px 6px rgba(232, 178, 90, .5);
}
.chatbubble[data-style="sprite"] .chatbubble__tool,
.chatbubble[data-style="sprite"] .chatbubble__close {
  border-color: rgba(240, 185, 160, .6);
  background: rgba(255, 250, 246, .75);
  color: #8a5a2b;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, .7);
}
.chatbubble[data-style="sprite"] .chatbubble__log {
  background: radial-gradient(120% 80% at 70% 18%, rgba(255, 214, 232, .2), transparent 70%);
}
.chatbubble[data-style="sprite"] .chat-msg__ava {
  border-color: #f0b9a0;
  background: #fff8f2;
}
.chatbubble[data-style="sprite"] .chat-msg__bubble {
  border-color: rgba(246, 184, 200, .66);
  background: linear-gradient(135deg, rgba(255, 250, 252, .94), rgba(255, 236, 244, .86));
  color: #5d3a12;
  box-shadow: 0 0 9px rgba(246, 184, 200, .28), 0 3px 12px rgba(90, 50, 40, .12);
}
.chatbubble[data-style="sprite"] .chat-msg--me .chat-msg__bubble {
  border-color: #d8a06a;
  background: linear-gradient(135deg, #a87a52, #8a5a3c);
  color: #fff8f2;
}
.chatbubble[data-style="sprite"] .chatbubble__typing { color: #9a7048; }
.chatbubble[data-style="sprite"] .chatbubble__foot {
  border-top-color: rgba(240, 185, 160, .38);
  background: linear-gradient(0deg, rgba(255, 248, 244, .5), transparent);
}
.chatbubble[data-style="sprite"] .chatbubble__foot input {
  border-color: rgba(232, 178, 158, .62);
  background: rgba(255, 250, 246, .82);
  color: #5d3a12;
  box-shadow: inset 0 2px 5px rgba(140, 90, 70, .1);
}
.chatbubble[data-style="sprite"] .chatbubble__foot input::placeholder { color: rgba(150, 110, 80, .75); }
.chatbubble[data-style="sprite"] .chatbubble__foot input:focus {
  border-color: #f0b9a0;
  box-shadow: 0 0 10px rgba(240, 185, 160, .4), inset 0 2px 5px rgba(140, 90, 70, .1);
}
.chatbubble[data-style="sprite"] .chatbubble__mic {
  border-color: #ffd9c0;
  background: radial-gradient(circle at 38% 30%, #ffe6d0, #f6b8c8 78%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(150, 80, 90, .2), inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 10px rgba(246, 184, 200, .4);
}
.chatbubble[data-style="sprite"] .chatbubble__send {
  border-color: #8a5a3c;
  background: linear-gradient(135deg, #a87a52, #8a5a3c);
  color: #fff8f2;
}
.chatbubble[data-style="sprite"] .chatbubble__tip { color: rgba(150, 110, 80, .88); }

/* 精灵款头顶胶囊：奶白浅粉玻璃 + 暖粉嫩绿描边 + 淡金光环 */
body[data-chat-style="sprite"] .hero__chat-pill {
  border-color: #f6b8c8;
  background:
    radial-gradient(circle at 78% 32%, rgba(212, 168, 96, .5) 0 1px, transparent 1.8px),
    radial-gradient(circle at 26% 68%, rgba(212, 168, 96, .38) 0 .8px, transparent 1.6px),
    linear-gradient(180deg, rgba(255, 250, 246, .94), rgba(255, 232, 240, .88));
  box-shadow: 0 3px 14px rgba(60, 30, 50, .3), 0 0 0 1px rgba(190, 230, 150, .42), 0 0 14px rgba(246, 184, 200, .5), inset 0 1px 0 rgba(255, 255, 255, .92);
}
body[data-chat-style="sprite"] .hero__chat-pill::after {
  background: rgba(255, 244, 240, .95);
  border-color: rgba(246, 184, 200, .95);
}
body[data-chat-style="sprite"] .hero__chat-txt {
  color: #8a5a2b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
}
body[data-chat-style="sprite"] .hero__chat-ic { filter: drop-shadow(0 1px 2px rgba(138, 90, 43, .32)); }
body[data-chat-style="sprite"] .hero__chat-ring {
  border-color: #f2d99a;
  box-shadow: 0 0 12px rgba(242, 217, 154, .7), inset 0 0 5px rgba(242, 217, 154, .42);
}

/* ================================================================
   声波虹彩 RW 舞台：对话时人物缩小进入环中央，六态随对话流转
   环在人物下层（z:2 < hero z:3），状态标签浮于环上方
   ================================================================ */
.orb-stage {
  position: fixed;
  left: 50%; top: 50%;
  width: 240px; height: 240px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateZ(0) scale(.82);
  transition: opacity .38s ease, transform .46s var(--ease-pop, cubic-bezier(.2,.9,.25,1.2)), visibility 0s linear .38s;
}
.orb-stage.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateZ(0) scale(1);
  transition: opacity .38s ease, transform .46s var(--ease-pop, cubic-bezier(.2,.9,.25,1.2)), visibility 0s;
}
/* 圆形柔边遮罩：边缘淡出融入场景；虹彩波按亮度输出透明度，不留黑色圆底 */
.orb-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, rgba(0,0,0,.82) 66%, transparent 86%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, rgba(0,0,0,.82) 66%, transparent 86%);
}
/* screen 混合兜底：波带以外的暗部直接透出原场景，不产生黑块 */
.orb-stage .orb-rw__gl { z-index: 1; mix-blend-mode: screen; }
.orb-stage .orb-rw__ring { z-index: 2; background: transparent !important; }
/* 对话态：人物缩到环内并与环心同源定位；停用 bob 动画保证居中稳定 */
body.is-orbiting .hero {
  animation: none !important;
  left: var(--orb-cx, 30%);
  top: var(--orb-cy, 46%);
  bottom: auto;
  height: var(--orb-hero-h, 180px);
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 22px rgba(4, 14, 34, .35)) drop-shadow(0 0 16px rgba(60, 200, 255, .45));
  z-index: 3;
}
body.is-orbiting .hero__chat { opacity: 0; transition: opacity .2s ease; }
body.is-orbiting .hero__aura { opacity: .35; }
/* 小屋内对话：声波环被搬进内景层（背景之下、人物之上），内景人物同样缩到环心 */
.interior.is-on .orb-stage { z-index: 1; }
body.is-inroom.is-orbiting .interior__hero {
  animation: none !important;
  left: var(--orb-cx, 50%);
  top: var(--orb-cy, 50%);
  bottom: auto;
  height: var(--orb-hero-h, 180px);
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 22px rgba(8, 20, 34, .4)) drop-shadow(0 0 16px rgba(60, 200, 255, .45));
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .orb-stage { transition: opacity .2s ease; transform: none !important; }
  body.is-orbiting .hero { transition: none; }
}
