/* ============================================================
   PlayScreen 深色霓虹设计系统（照 ~/work/game/ 原型复刻）
   公式：底色 #0a0e27 + 对角渐变 + 大模糊光斑 + 玻璃面板 + 紫粉渐变强调
   ============================================================ */
* { box-sizing: border-box; }

:root {
  --bg: #0a0e27;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --purple-500: #a855f7;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;
  --cyan-400: #22d3ee;
  --amber-400: #fbbf24;
  --yellow-300: #fde047;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --red-400: #f87171;
  --grad-brand: linear-gradient(135deg, #7c3aed, #ec4899);
  --grad-cta: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
  --grad-text: linear-gradient(90deg, #a78bfa, #f472b6, #fbbf24);
  --glass: rgba(255, 255, 255, .05);
  --glass-strong: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .1);
  --line-soft: rgba(255, 255, 255, .05);
  --text: rgba(255, 255, 255, .92);
  --text-70: rgba(255, 255, 255, .7);
  --text-50: rgba(255, 255, 255, .5);
  --text-40: rgba(255, 255, 255, .4);
  --text-30: rgba(255, 255, 255, .3);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, .02);
  --font: -apple-system, 'PingFang SC', 'HarmonyOS Sans', 'MiSans',
          'Microsoft YaHei', sans-serif;
}

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
  min-height: 100vh;
}
[x-cloak] { display: none !important; }
button { font-family: inherit; }
a { color: inherit; }

/* ---------- 页面背景：渐变 + 光斑 ---------- */
.page-bg { position: relative; min-height: 100vh; overflow-x: hidden; }
.bg-home   { background: linear-gradient(135deg, #0a0e27 0%, #121035 55%, #1a1040 100%); }
.bg-gen    { background: linear-gradient(135deg, #0a0e27 0%, #1a1040 55%, #2a1550 100%); }
.bg-game   { background: linear-gradient(135deg, #0a0e27 0%, #1a1040 60%, #121035 100%); }
.bg-my     { background: linear-gradient(135deg, #0a0e27 0%, #121035 55%, #1a1040 100%); }
.glow {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(120px);
}
.glow-violet { background: rgba(124, 58, 237, .22); width: 600px; height: 600px; }
.glow-pink   { background: rgba(236, 72, 153, .16); width: 500px; height: 500px; }
.glow-sm { filter: blur(100px); width: 400px; height: 400px; }
.rel { position: relative; z-index: 10; }

/* ---------- 通用组件 ----------
   兼容基线 Chromium 83（小时光 Android 11 出厂 WebView）：
   flexbox 不用 gap（84+），间距一律 * + * margin；grid 的 gap（66+）可用；
   不用 inset 简写（87+）与 aspect-ratio（88+）。 */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.btn-grad {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-brand); color: #fff; border: none; cursor: pointer;
  border-radius: 14px; font-size: 17px; font-weight: 600;
  padding: 12px 24px; transition: transform .15s, box-shadow .2s;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(139, 92, 246, .35);
}
.btn-grad > * + * { margin-left: 10px; }
.btn-grad:hover { transform: scale(1.04); box-shadow: 0 6px 26px rgba(139, 92, 246, .5); }
.btn-grad:active { transform: scale(.97); }
.btn-grad:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-glass {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-strong); color: var(--text); border: none; cursor: pointer;
  border-radius: 14px; font-size: 17px; font-weight: 600; padding: 12px 24px;
  transition: background .15s, transform .15s; text-decoration: none;
}
.btn-glass > * + * { margin-left: 10px; }
.btn-glass:hover { background: rgba(255, 255, 255, .14); }
.btn-glass:active { transform: scale(.97); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--glass-strong); color: var(--text); font-size: 20px;
  transition: background .15s, transform .15s; text-decoration: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; }

.chip {
  display: inline-flex; align-items: center;
  padding: 10px 20px; border-radius: 999px; font-size: 16px; font-weight: 500;
  background: var(--glass-strong); color: var(--text-70); cursor: pointer;
  border: 1px solid var(--line); transition: all .18s; white-space: nowrap;
}
.chip > * + * { margin-left: 8px; }
.chip:hover { color: var(--text); background: rgba(255, 255, 255, .12); }
.chip.active {
  background: var(--grad-brand); color: #fff; border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 4px 18px rgba(139, 92, 246, .4);
}
.field {
  width: 100%; background: var(--glass); border: 1px solid var(--line);
  border-radius: 14px; color: var(--text); font-size: 16px; padding: 14px 18px;
  outline: none; font-family: inherit; transition: border-color .15s;
}
.field::placeholder { color: var(--text-40); }
.field:focus { border-color: rgba(167, 139, 250, .6); }

/* ---------- 首页 ---------- */
.topbar { display: flex; align-items: center; padding: 20px 32px; }
.topbar > * + * { margin-left: 28px; }
.logo {
  display: flex; align-items: center; text-decoration: none;
  cursor: pointer; flex-shrink: 0;
}
.logo > * + * { margin-left: 12px; }
.logo-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #22d3ee, #8b5cf6, #ec4899);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, .4);
}
.logo-text {
  font-size: 24px; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(90deg, #fff, #ddd6fe, #fbcfe8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 搜索降权：次要功能，笔设备软键盘逐键点选极难用——缩小不占满，
   主操作让给分类 chips；后续如接语音搜索再提权重 */
.search-wrap { flex: 0 1 300px; max-width: 300px; position: relative; }
.search-wrap .search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-40); pointer-events: none; display: flex;
}
.search-wrap input {
  width: 100%; height: 44px; border-radius: 999px; padding: 0 16px 0 42px;
  background: var(--glass); border: 1px solid var(--line); outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.search-wrap input::placeholder { color: var(--text-40); }
.search-wrap input:focus { border-color: rgba(167, 139, 250, .6); }
.cats { display: flex; flex-shrink: 0; }
.cats > * + * { margin-left: 10px; }
.topbar-spacer { flex: 1; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--glass-strong); display: flex; align-items: center;
  justify-content: center; font-size: 22px; cursor: pointer; flex-shrink: 0;
  transition: border-color .15s; color: var(--text-70);
}
.avatar:hover { border-color: rgba(167, 139, 250, .6); }

.home-main { padding: 8px 32px 150px; }
.home-title { font-size: 30px; font-weight: 700; margin: 12px 0 4px; }
.home-sub { color: var(--text-50); font-size: 16px; margin: 0 0 20px; }
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 24px;   /* grid 的 gap 基线 Chromium 66 起支持 */
}
/* 1080p 单屏适配：目标大屏 1920×1080（视口高 ≤1150 都收紧），三行卡片不出滚动条 */
@media (max-height: 1150px) and (min-width: 821px) {
  .home-main { padding-bottom: 96px; }
  .home-title { font-size: 26px; margin-top: 4px; }
  .home-sub { margin-bottom: 14px; }
  .card-grid { gap: 18px; }
  .card-cover { height: 128px; font-size: 54px; }
}
.game-card {
  position: relative; border-radius: 16px; overflow: hidden; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .2s, box-shadow .25s, border-color .25s;
  animation: card-in .4s cubic-bezier(.16, 1, .3, 1) both;
  text-decoration: none; display: block;
}
.game-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(139, 92, 246, .5);
  border-color: rgba(192, 132, 252, .5);
}
.card-cover {
  position: relative; height: 150px; display: flex;
  align-items: center; justify-content: center; font-size: 64px;
}
.card-cover::after {
  content: ''; position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10, 14, 39, .55));
}
.cover-0 { background: linear-gradient(135deg, #312e81, #7c3aed); }
.cover-1 { background: linear-gradient(135deg, #581c87, #db2777); }
.cover-2 { background: linear-gradient(135deg, #134e4a, #0891b2); }
.cover-3 { background: linear-gradient(135deg, #7c2d12, #d97706); }
.card-cover-img {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center;
  background: rgba(16, 185, 129, .9); color: #fff; font-size: 13px;
  font-weight: 600; padding: 4px 12px; border-radius: 999px;
}
.card-badge > * + * { margin-left: 6px; }
.card-ai-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--grad-brand); color: #fff; font-size: 12px;
  font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.card-del {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0, 0, 0, .5); color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.card-del:hover { background: rgba(239, 68, 68, .85); }
.card-body { padding: 14px 16px 16px; }
.card-name { font-size: 19px; font-weight: 700; margin: 0 0 6px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; justify-content: space-between; }
.card-saved { font-size: 12px; color: var(--text-50); margin-top: 6px; }
.stars { display: inline-flex; font-size: 14px; }
.stars > * + * { margin-left: 2px; }
.stars .on { color: var(--yellow-300); }
.stars .off { color: var(--text-30); }
.home-empty { text-align: center; padding: 80px 0; color: var(--text-50); }
.home-empty h3 { font-size: 22px; color: var(--text-70); margin: 0 0 8px; }

.big-cta {
  position: fixed; bottom: 32px; left: 32px; z-index: 20;
}
.big-cta .cta-inner {
  position: relative; display: flex; align-items: center;
  padding: 20px 40px; border-radius: 28px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
  color: #fff; font-size: 23px; font-weight: 700;
  transition: transform .18s; text-decoration: none;
}
.big-cta .cta-inner > * + * { margin-left: 16px; }
.big-cta:hover .cta-inner { transform: scale(1.05); }
.big-cta .cta-glow {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
  filter: blur(24px); opacity: .55; z-index: -1;
}
.cta-ico {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255, 255, 255, .2); display: flex;
  align-items: center; justify-content: center; font-size: 24px;
}
.idle-hint {
  position: fixed; bottom: 14px; right: 20px; z-index: 5;
  color: var(--text-30); font-size: 13px; pointer-events: none;
  white-space: nowrap;   /* 窄视口别截成竖排 */
}
/* 小视口（平板竖屏/小窗口）：缩小悬浮 CTA，别盖住卡片与 idle-hint */
@media (max-width: 920px), (max-height: 620px) {
  .big-cta .cta-inner { padding: 12px 22px; font-size: 17px; border-radius: 20px; }
  .big-cta .cta-inner > * + * { margin-left: 10px; }
  .cta-ico { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
  .idle-hint { display: none; }
}

/* ---------- 生成输入页 ---------- */
.gen-wrap { display: flex; align-items: center;
            padding: 0 32px; height: calc(100vh - 120px); }
.gen-wrap > * + * { margin-left: 32px; }
.gen-left { flex: 1; max-width: 70%; }
.gen-title { font-size: 46px; font-weight: 700; margin: 0 0 28px; }
.input-shell {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 28px; padding: 16px; display: flex;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.input-shell > * + * { margin-left: 16px; }
.input-shell textarea {
  flex: 1; height: 180px; background: transparent; border: none; outline: none;
  resize: none; color: var(--text); font-size: 22px; font-family: inherit;
  line-height: 1.6; padding: 8px;
}
.input-shell textarea::placeholder { color: var(--text-40); }
.input-side { display: flex; flex-direction: column;
              justify-content: flex-end; align-items: center; }
.input-side > * + * { margin-top: 14px; }
.enter-hint { font-size: 13px; color: var(--text-30); text-align: center; }
.mic-btn {
  position: relative; width: 112px; height: 112px; border-radius: 50%;
  border: none; cursor: pointer; background: var(--grad-brand);
  color: #fff; font-size: 44px; display: flex; align-items: center;
  justify-content: center; transition: transform .18s; flex-shrink: 0;
}
.mic-btn:hover { transform: scale(1.06); }
.mic-btn:disabled { opacity: .5; }
.mic-btn.rec { transform: scale(1.1); animation: mic-pulse 1.6s infinite; }
.mic-btn.rec::after {
  content: ''; position: absolute; top: -14px; right: -14px;
  bottom: -14px; left: -14px; border-radius: 50%;
  border: 3px solid rgba(236, 72, 153, .6);
  animation: mic-ring 1.4s infinite;
}
.send-btn {
  height: 52px; padding: 0 32px; border-radius: 999px; border: none;
  cursor: pointer; background: var(--glass-strong); color: var(--text);
  font-size: 18px; font-weight: 600; display: inline-flex;
  align-items: center; transition: background .15s;
}
.send-btn > * + * { margin-left: 8px; }
.send-btn:hover { background: rgba(255, 255, 255, .16); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }
.insp-title { font-size: 19px; color: var(--text-70); margin: 28px 0 14px; }
/* wrap 场景的 flex gap 用"子元素 margin + 容器负 margin"模拟（83 兼容） */
.insp-tags { display: flex; flex-wrap: wrap; margin-left: -12px; }
.insp-tags > * { margin: 0 0 12px 12px; }
.insp-tags .chip { padding: 12px 24px; font-size: 17px; }
.insp-tags .chip:hover {
  background: var(--grad-brand); color: #fff; transform: scale(1.05);
}
.example-card { width: 320px; flex-shrink: 0; border-radius: 24px;
                overflow: hidden; }
/* aspect-ratio 是 Chromium 88+，用 padding-top 75% 实现 4:3 */
.example-scene {
  position: relative; height: 0; padding-top: 75%;
  background: linear-gradient(135deg, #312e81, #7c3aed);
}
.example-emoji {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); font-size: 72px;
}
.example-scene::after {
  content: ''; position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 8, 22, .7));
}
.example-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center;
  background: var(--grad-brand); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; font-weight: 600;
}
.example-name { position: absolute; bottom: 10px; left: 14px; z-index: 2;
                font-size: 19px; font-weight: 700; }
.example-desc { padding: 16px; font-size: 15px; color: var(--text-70);
                line-height: 1.6; margin: 0; }
.back-btn { position: absolute; top: 24px; left: 32px; z-index: 20; }

/* ---------- 生成加载页 ---------- */
.load-center {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 0 32px;
}
.load-center > * + * { margin-top: 20px; }
.orbit {
  position: relative; width: 300px; height: 300px;
  display: flex; align-items: center; justify-content: center;
}
.orbit-core {
  position: relative; width: 84px; height: 84px; border-radius: 24px;
  background: var(--grad-brand); display: flex; align-items: center;
  justify-content: center; font-size: 38px;
  box-shadow: 0 0 60px rgba(139, 92, 246, .6);
  animation: bounce-soft 1.5s ease-in-out infinite;
}
.orbit-item {
  position: absolute; width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: var(--glass-strong); color: var(--text-50);
  transition: all .35s;
}
.orbit-item.on {
  background: var(--grad-brand); color: #fff; transform: scale(1.25);
  box-shadow: 0 0 24px rgba(139, 92, 246, .6);
}
.orbit-ring { position: absolute; top: 30px; right: 30px; bottom: 30px;
              left: 30px; border-radius: 50%;
              border: 2px dashed rgba(167, 139, 250, .3);
              animation: spin 8s linear infinite; }
.orbit-ring.r2 { top: 10px; right: 10px; bottom: 10px; left: 10px;
                 border-color: rgba(244, 114, 182, .2);
                 animation: spin-r 12s linear infinite; }
.load-title { font-size: 30px; font-weight: 700; margin: 6px 0 0; }
.load-pct {
  font-size: 48px; font-weight: 900; font-variant-numeric: tabular-nums;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.load-bar { width: 320px; height: 8px; border-radius: 999px;
            background: var(--glass-strong); overflow: hidden; }
.load-bar-inner { height: 100%; border-radius: 999px; background: var(--grad-brand);
                  transition: width .3s; }
.load-eta { color: var(--text-50); font-size: 16px; }
.load-game { color: var(--text-30); font-size: 15px; }
.load-notice { color: var(--text-50); font-size: 14px; min-height: 20px; }
.load-error { color: var(--red-400); font-size: 16px; text-align: center;
              max-width: 560px; }

/* ---------- 游玩页 ---------- */
.game-top { display: flex; align-items: center;
            padding: 18px 32px 10px; }
.game-top > * + * { margin-left: 16px; }
.game-top-title { flex: 1; font-size: 20px; font-weight: 700; margin: 0;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-top-time {
  display: inline-flex; align-items: center;
  background: var(--glass-strong); border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 999px; font-size: 16px;
  color: var(--text-70); font-variant-numeric: tabular-nums;
}
.game-top-time > * + * { margin-left: 8px; }
.game-body { display: flex; padding: 0 32px 24px;
             height: calc(100vh - 76px); }
.game-body > * + * { margin-left: 24px; }
.game-stage-col { flex: 1; display: flex; flex-direction: column;
                  min-width: 0; transition: margin-right .35s; }
.game-stage {
  position: relative; flex: 1; border-radius: 24px; overflow: hidden;
  border: 4px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
  background: #000;
}
.game-stage iframe { width: 100%; height: 100%; border: none; display: block; }
.stage-ctl {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  display: flex;
}
.stage-ctl > * + * { margin-left: 10px; }
.stage-ctl .icon-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0, 0, 0, .4); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); font-size: 20px;
}
.pause-mask {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 8;
  cursor: pointer;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; animation: fade-in .2s;
}
.pause-mask > * + * { margin-top: 14px; }
.pause-mask .pm-ico { font-size: 56px; }
.pause-mask h3 { margin: 0; font-size: 30px; font-weight: 700; }
.pause-mask p { margin: 0; color: var(--text-70); font-size: 16px; }
.game-side { width: 288px; flex-shrink: 0; display: flex;
             flex-direction: column; }
.game-side > * + * { margin-top: 16px; }
.side-card { border-radius: 20px; padding: 18px; }
.side-label { color: var(--text-50); font-size: 15px; margin: 0 0 6px; }
.score-num {
  font-size: 54px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #fde047, #fbbf24, #d97706);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.side-best { display: flex; align-items: center; margin-top: 10px;
             color: var(--text-70); font-size: 15px; }
.side-best > * + * { margin-left: 8px; }
.info-row { display: flex; justify-content: space-between; font-size: 15px;
            padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-50); }
.info-row .v { color: var(--text); font-weight: 500; }
.side-hint { color: var(--text-50); font-size: 14px; line-height: 1.7; margin: 0; }
.side-btn { width: 100%; height: 56px; border-radius: 16px; font-size: 17px; }

/* 结算弹窗 */
.over-mask {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 10;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .25s;
}
.over-card {
  width: 400px; max-width: 92%; border-radius: 24px; padding: 32px;
  background: linear-gradient(160deg, rgba(15, 23, 42, .97), rgba(88, 28, 135, .97));
  border: 1px solid var(--line); text-align: center;
  max-height: calc(100% - 24px); overflow-y: auto;
  animation: scale-in .3s cubic-bezier(.16, 1, .3, 1);
}
.over-trophy { font-size: 56px; }
.over-card h3 { font-size: 28px; font-weight: 800; margin: 8px 0 2px; }
.over-game { color: var(--text-50); font-size: 16px; margin: 0 0 18px; }
.over-score-box { background: var(--glass); border-radius: 16px;
                  padding: 16px; margin-bottom: 16px; }
.over-score-box .n { font-size: 44px; font-weight: 900; color: var(--amber-400); }
.over-score-box .l { color: var(--text-50); font-size: 14px; }
.over-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
              margin-bottom: 20px; }
.over-stat { background: var(--glass); border-radius: 14px; padding: 12px; }
.over-stat .v { font-size: 22px; font-weight: 800; color: var(--violet-400); }
.over-stat .l { font-size: 13px; color: var(--text-50); margin-top: 2px; }
.over-btns { display: flex; flex-direction: column; }
.over-btns > * + * { margin-top: 10px; }

/* ---------- AI 修改面板 ---------- */
.modify-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: 35%; min-width: 500px;
  background: linear-gradient(160deg, rgba(15, 23, 42, .98), rgba(59, 7, 100, .98));
  border-left: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  animation: slide-in-right .35s cubic-bezier(.16, 1, .3, 1);
}
.mp-head { display: flex; align-items: center;
           padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.mp-head > * + * { margin-left: 12px; }
.mp-ico { width: 44px; height: 44px; border-radius: 14px;
          background: var(--grad-brand); display: flex; align-items: center;
          justify-content: center; font-size: 22px; flex-shrink: 0; }
.mp-title { font-size: 18px; font-weight: 700; }
.mp-sub { font-size: 13px; color: var(--text-50); margin-top: 2px; }
.mp-close { margin-left: auto; }
.mp-msgs { flex: 1; overflow-y: auto; padding: 18px 20px;
           display: flex; flex-direction: column; }
.mp-msgs > * + * { margin-top: 12px; }
.mp-msg { max-width: 85%; border-radius: 16px; padding: 11px 15px;
          font-size: 15px; line-height: 1.6; white-space: pre-wrap;
          word-break: break-word; animation: msg-in .25s; }
.mp-msg.user {
  align-self: flex-end; background: var(--grad-brand); color: #fff;
  border-bottom-right-radius: 5px;
}
.mp-msg.ai {
  align-self: flex-start; background: var(--glass-strong);
  border: 1px solid var(--line); border-bottom-left-radius: 5px;
}
.mp-typing { display: inline-flex; padding: 14px 16px; }
.mp-typing > * + * { margin-left: 5px; }
.mp-typing i { width: 8px; height: 8px; border-radius: 50%;
               background: var(--violet-400); animation: bounce-dot 1s infinite; }
.mp-typing i:nth-child(2) { background: var(--pink-400); animation-delay: .15s; }
.mp-typing i:nth-child(3) { background: var(--violet-400); animation-delay: .3s; }
.mp-chips { display: flex; overflow-x: auto; padding: 12px 20px;
            border-top: 1px solid var(--line-soft); flex-shrink: 0; }
.mp-chips > * + * { margin-left: 10px; }
.mp-chips .chip { padding: 8px 16px; font-size: 14px; flex-shrink: 0; }
.mp-input { display: flex; padding: 14px 20px 18px; flex-shrink: 0; }
.mp-input > * + * { margin-left: 12px; }
/* 修改面板的语音按钮（与生成页 mic 同源，小一号） */
.mp-mic {
  width: 56px; height: 56px; border-radius: 16px; border: none;
  cursor: pointer; background: var(--glass-strong); color: var(--text);
  font-size: 22px; flex-shrink: 0; transition: transform .15s;
}
.mp-mic:hover { background: rgba(255, 255, 255, .16); }
.mp-mic.rec { background: var(--grad-brand); color: #fff;
              transform: scale(1.06); }
.mp-input textarea {
  flex: 1; height: 56px; border-radius: 16px; background: var(--glass);
  border: 1px solid var(--line); color: var(--text); font-size: 16px;
  padding: 14px 18px; outline: none; resize: none; font-family: inherit;
}
.mp-input textarea::placeholder { color: var(--text-40); }
.mp-send {
  width: 56px; height: 56px; border-radius: 16px; border: none;
  background: var(--grad-brand); color: #fff; font-size: 22px;
  cursor: pointer; flex-shrink: 0; transition: transform .15s;
}
.mp-send:disabled { opacity: .4; }
.mp-send:not(:disabled):hover { transform: scale(1.06); }

/* ---------- 弹窗（登录/分享）---------- */
.modal-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .2s;
}
.modal-card {
  position: relative; border-radius: 24px; padding: 32px;
  background: linear-gradient(160deg, rgba(15, 23, 42, .97), rgba(88, 28, 135, .97));
  border: 1px solid var(--line);
  animation: scale-in .3s cubic-bezier(.16, 1, .3, 1);
  max-height: 90vh; overflow-y: auto;
}
.modal-x {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--glass-strong); color: var(--text-70); font-size: 18px;
}
.modal-x:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.modal-title { font-size: 24px; font-weight: 800; margin: 0 0 20px;
               text-align: center; }
.tabbar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
         background: var(--glass); border-radius: 14px; padding: 4px;
         margin-bottom: 22px; }
.tabbar button {
  height: 44px; border: none; border-radius: 11px; cursor: pointer;
  background: transparent; color: var(--text-50); font-size: 16px;
  font-weight: 600; transition: all .18s;
}
.tabbar button.on { background: var(--grad-brand); color: #fff; }
.qr-box {
  width: 224px; height: 224px; margin: 0 auto; border-radius: 16px;
  background: #fff; padding: 14px; display: flex; align-items: center;
  justify-content: center;
}
.qr-grid { display: grid; grid-template-columns: repeat(21, 1fr);
           grid-template-rows: repeat(21, 1fr); width: 100%; height: 100%; gap: 0; }
.qr-grid i { background: transparent; }
.qr-grid i.f { background: #0f172a; }
.qr-note { text-align: center; color: var(--text-70); font-size: 15px;
           margin: 16px 0 4px; }
.qr-refresh { display: block; margin: 0 auto; background: none; border: none;
              color: var(--violet-400); font-size: 14px; cursor: pointer; }
.guest-btn {
  width: 100%; margin-top: 20px; height: 52px; border-radius: 14px;
  border: 1px dashed var(--line); background: transparent;
  color: var(--text-70); font-size: 16px; cursor: pointer;
}
.guest-btn:hover { color: var(--text); border-color: rgba(167, 139, 250, .5); }
.soon-tip { text-align: center; color: var(--text-50); font-size: 14px;
            padding: 26px 0 10px; line-height: 1.8; }

/* 微信扫码登录：官方 wxLogin.js 渲染的 iframe（300×400）居中 */
#wx-login-box { text-align: center; }
#wx-login-box iframe { max-width: 100%; }

/* 分享弹窗 */
.share-card { width: 640px; max-width: 94vw; }
.share-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
              margin-bottom: 22px; }
.share-opt {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 10px; border-radius: 16px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--line);
  color: var(--text-70); font-size: 15px; transition: all .18s;
}
.share-opt > * + * { margin-top: 10px; }
.share-opt:hover { color: var(--text); }
.share-opt.on {
  background: linear-gradient(135deg, rgba(124, 58, 237, .3), rgba(236, 72, 153, .3));
  border-color: rgba(167, 139, 250, .5); color: #fff;
}
.share-opt .si { width: 52px; height: 52px; border-radius: 50%;
                  display: flex; align-items: center; justify-content: center;
                  font-size: 24px; color: #fff; }
.share-preview { display: flex; justify-content: center; padding: 8px 0 4px; }
.share-poster {
  width: 280px; background: #fff; border-radius: 14px; padding: 20px 16px;
  color: #1f2937; text-align: center;
}
.share-poster .t { font-size: 15px; font-weight: 700; line-height: 1.6;
                   margin: 0 0 12px; }
.share-poster .score-block {
  background: var(--grad-brand); border-radius: 12px; padding: 14px;
  color: #fff; margin-bottom: 12px;
}
.share-poster .score-block .n { font-size: 32px; font-weight: 900; }
.share-poster .score-block .g { font-size: 13px; opacity: .9; }
.share-poster .qr { width: 88px; height: 88px; margin: 0 auto;
                    background:
                      repeating-conic-gradient(#1f2937 0 25%, #fff 0 50%)
                      0 0 / 14px 14px; border-radius: 6px;
                    border: 4px solid #1f2937; }
.share-poster .scan { font-size: 12px; color: #6b7280; margin-top: 8px; }
.share-tip {
  display: flex; align-items: center; margin-top: 18px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(251, 191, 36, .1); color: var(--amber-400);
  font-size: 14px;
}
.share-tip > * + * { margin-left: 10px; }
.share-actions { display: flex; justify-content: center; margin-top: 14px; }
.share-actions .btn-grad { height: 46px; padding: 0 28px; font-size: 15px; }
.share-js-tip { text-align: center; color: var(--text-40); font-size: 13px;
                margin: 10px 0 0; }
.poster-img {
  width: 280px; border-radius: 14px; cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
}
.qr-share-box {
  width: 264px; height: 264px; margin: 0 auto; background: #fff;
  border-radius: 18px; padding: 16px;
  display: flex; align-items: center; justify-content: center;
}
.qr-share-box img { width: 100%; height: 100%; }
.share-reward-btn {
  margin-left: auto; height: 36px; padding: 0 16px; border: none;
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff;
  flex-shrink: 0;
}
.share-reward-btn:disabled { opacity: .6; }
.quota-hint { color: var(--text-40); font-size: 14px; margin: 18px 2px 0; }

/* ---------- 手机 H5 落地页：竖屏引导 + 横屏游玩适配 ---------- */
.rotate-mask { display: none; }
@media (orientation: portrait) and (max-width: 820px) {
  .rotate-mask {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 300;
    display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 40%, #1a1040, #0a0e27);
    animation: fade-in .3s;
  }
  .rotate-mask > * + * { margin-top: 14px; }
  .rotate-mask .rm-ico { font-size: 72px; animation: rotate-hint 2s ease-in-out infinite; }
  .rotate-mask h3 { margin: 0; font-size: 26px; font-weight: 800; }
  .rotate-mask p { margin: 0; color: var(--text-50); font-size: 16px; }
  /* 一键全屏横屏（Android 微信/浏览器）/ 竖屏继续（iPhone 微信等不支持全屏的场景） */
  .rotate-mask .rm-btn { height: 54px; padding: 0 34px; margin-top: 18px; }
  .rotate-mask .rm-tip {
    margin: 14px 0 0; max-width: 340px; text-align: center;
    color: var(--text-50); font-size: 13px; line-height: 1.8;
  }
  .rotate-mask .rm-skip {
    margin-top: 2px; background: none; border: none; cursor: pointer;
    color: var(--text-50); font-size: 14px; text-decoration: underline;
  }
}
@keyframes rotate-hint {
  0%, 100% { transform: rotate(0); }
  60% { transform: rotate(90deg); }
  80% { transform: rotate(90deg); }
}
@media (max-width: 820px) and (orientation: landscape) {
  .game-top { padding: 8px 12px 6px; }
  .game-body { padding: 0 10px 10px; height: calc(100vh - 52px); }
  .game-body > * + * { margin-left: 10px; }
  .game-side { display: none; }              /* 手机横屏隐藏侧栏，舞台全宽 */
  .game-stage-col { margin-right: 0 !important; }
  .game-stage { border-width: 2px; border-radius: 12px; }
  .stage-ctl .icon-btn { width: 38px; height: 38px; font-size: 16px; }
  .modify-panel { width: 100%; min-width: 0; }
  /* 结算卡紧凑化：横屏视口高度只有 ~350px，竖排按钮会被裁掉 */
  .over-card { width: 320px; max-width: 90%; padding: 12px 18px 14px;
               max-height: calc(100% - 16px); }
  .over-trophy { display: none; }               /* 横屏太矮，奖杯让位给按钮 */
  .over-card h3 { font-size: 20px; margin: 0; }
  .over-game { font-size: 13px; margin-bottom: 10px; }
  .over-score-box { padding: 8px 10px; margin-bottom: 10px; }
  .over-score-box .n { font-size: 30px; }
  .over-score-box .l { font-size: 12px; }
  .over-stats { gap: 8px; margin-bottom: 12px; }
  .over-stat { padding: 6px 8px; }
  .over-stat .v { font-size: 17px; }
  .over-stat .l { font-size: 11px; }
  .over-btns { flex-direction: row; }          /* 两按钮并排省一截高度 */
  .over-btns > * + * { margin-top: 0; margin-left: 8px; }
  .over-btns .btn-grad, .over-btns .btn-glass { flex: 1; height: 44px; padding: 0 10px; }
  .share-card { width: 94vw; padding: 20px; }
  .share-opts { gap: 8px; }
  .share-opt { padding: 10px 6px; font-size: 13px; }
  .share-opt .si { width: 40px; height: 40px; font-size: 19px; }
  .share-actions { margin-top: 10px; }
  .share-actions .btn-grad { height: 42px; }
  .share-tip { font-size: 12px; padding: 8px 12px; }
  .share-js-tip { font-size: 11px; }
  .poster-img { width: 170px; }
  .qr-share-box { width: 170px; height: 170px; padding: 10px; }
  /* 首页/生成页在手机上也可用（分享回流入口） */
  .topbar { flex-wrap: wrap; padding: 12px 14px; }
  .topbar > * + * { margin-left: 10px; }
  .cats { order: 3; width: 100%; overflow-x: auto; }
  .home-main { padding: 8px 14px 120px; }
  .big-cta { bottom: 16px; left: 16px; }
  .big-cta .cta-inner { padding: 14px 24px; font-size: 18px; }
  .gen-wrap { flex-direction: column; padding: 0 14px; height: auto;
              padding-top: 64px; }
  .gen-wrap > * + * { margin-left: 0; margin-top: 18px; }
  .gen-left { max-width: 100%; }
  .gen-title { font-size: 28px; margin-bottom: 16px; }
  .input-shell textarea { height: 110px; font-size: 18px; }
  .example-card { display: none; }
  .my-body { flex-direction: column; padding: 8px 14px 24px; }
  .my-body > * + * { margin-left: 0; margin-top: 24px; }
  .my-menu { width: 100%; flex-direction: row; }
  .my-menu > * + * { margin-top: 0; margin-left: 8px; }
  .my-menu button { flex: 1; justify-content: center; }
}

/* ---------- 我的游戏 ---------- */
.my-body { display: flex; padding: 12px 32px 32px; }
.my-body > * + * { margin-left: 24px; }
.my-menu { width: 224px; flex-shrink: 0; border-radius: 20px;
           padding: 14px; display: flex; flex-direction: column;
           align-self: flex-start; }
.my-menu > * + * { margin-top: 8px; }
.my-menu button {
  display: flex; align-items: center; height: 52px;
  padding: 0 18px; border-radius: 14px; border: none; cursor: pointer;
  background: transparent; color: var(--text-70); font-size: 17px;
  font-weight: 600; transition: all .18s; text-align: left;
}
.my-menu button > * + * { margin-left: 12px; }
.my-menu button.on {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6); color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, .3);
}
.my-main { flex: 1; min-width: 0; }
.my-count { color: var(--text-50); font-size: 15px; margin: 6px 2px 14px; }
.my-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
           gap: 20px; }
.my-empty { text-align: center; padding: 70px 0; color: var(--text-50); }
.my-empty h3 { font-size: 20px; color: var(--text-70); margin: 0 0 8px; }

/* ---------- 设置页 ---------- */
.settings-card { max-width: 640px; margin: 12px auto 40px; border-radius: 24px;
                 overflow: hidden; }
.set-row { display: flex; align-items: center;
           padding: 18px 24px; border-bottom: 1px solid var(--line-soft); }
.set-row > * + * { margin-left: 16px; }
.set-row:last-child { border-bottom: none; }
.set-ico { width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
           display: flex; align-items: center; justify-content: center;
           font-size: 22px; background: rgba(139, 92, 246, .2); }
.set-name { font-size: 17px; font-weight: 600; flex: 1; }
.set-val { color: var(--text-50); font-size: 15px; }
.seg { display: inline-flex; background: var(--glass);
       border-radius: 12px; padding: 4px; }
.seg > * + * { margin-left: 4px; }
.seg button { height: 40px; padding: 0 20px; border: none; border-radius: 9px;
              cursor: pointer; background: transparent; color: var(--text-50);
              font-size: 15px; font-weight: 600; }
.seg button.on { background: var(--grad-brand); color: #fff; }
.set-volume { display: flex; align-items: center; flex: 1;
              max-width: 320px; }
.set-volume > * + * { margin-left: 14px; }
.set-volume input[type=range] { flex: 1; accent-color: var(--violet-500); }
.set-volume .num { width: 36px; text-align: right;
                   font-variant-numeric: tabular-nums; color: var(--text-70); }
.logout-btn {
  display: flex; align-items: center; width: 100%;
  max-width: 640px; margin: 0 auto 40px; height: 64px; padding: 0 24px;
  border-radius: 18px; cursor: pointer; font-size: 17px; font-weight: 600;
  background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .3);
  color: var(--red-400);
}
.logout-btn > * + * { margin-left: 14px; }
.logout-btn:hover { background: rgba(239, 68, 68, .18); }

/* ---------- 404 ---------- */
.nf-wrap { min-height: 100vh; display: flex; flex-direction: column;
           align-items: center; justify-content: center; }
.nf-wrap > * + * { margin-top: 10px; }
.nf-wrap h1 { font-size: 60px; font-weight: 800; margin: 0; }
.nf-wrap p { color: var(--text-50); margin: 0 0 14px; }
.nf-wrap a { color: var(--violet-400); }

/* ---------- toast ---------- */
.toast-host { position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
              z-index: 100; display: flex; flex-direction: column;
              align-items: center; pointer-events: none; }
.toast-host > * + * { margin-top: 10px; }
.toast {
  padding: 12px 24px; border-radius: 14px; font-size: 16px;
  background: rgba(15, 23, 42, .95); border: 1px solid var(--line);
  color: var(--text); box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: toast-in .25s; max-width: 80vw;
}
.toast.success { border-color: rgba(52, 211, 153, .4);
                 color: #6ee7b7; }
.toast.error { border-color: rgba(248, 113, 113, .4); color: #fca5a5; }

/* ---------- 屏保 ---------- */
.screensaver {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 200;
  cursor: pointer;
  background: radial-gradient(ellipse at 50% 40%, #1a1040 0%, #0a0e27 70%);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; animation: fade-in .6s;
}
.screensaver > * + * { margin-top: 18px; }
.ss-logo { display: flex; align-items: center; }
.ss-logo > * + * { margin-left: 18px; }
.ss-logo .logo-mark { width: 88px; height: 88px; border-radius: 26px;
                       font-size: 44px; }
.ss-logo .logo-text { font-size: 44px; }
.ss-slogan { color: var(--text-50); font-size: 22px; letter-spacing: 2px; }
.ss-float { position: absolute; font-size: 44px; opacity: .5;
            animation: float-y 4s ease-in-out infinite; }
.ss-wake { position: absolute; bottom: 60px; color: var(--text-30);
           font-size: 16px; }

/* ---------- 动画 ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-r { to { transform: rotate(-360deg); } }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, .5); }
  50% { box-shadow: 0 0 0 22px rgba(236, 72, 153, 0); }
}
@keyframes mic-ring {
  0% { transform: scale(.9); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-7px); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}
@keyframes score-pop {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-46px) scale(1.25); }
}
@keyframes twinkle {
  0%, 100% { opacity: .25; } 50% { opacity: 1; }
}

/* AI 修改面板：打字动画旁的生成进度字数 */
.mp-typing span { margin-left: 6px; font-size: 13px; color: var(--text-50); align-self: center; }
