/* ═══════════════════════════════════════════════════════════════
   我呸呸呸 · 游戏 UI 视觉规范
   ── 主题:暗夜霓虹 · 解压发泄
   ── 主色:霓虹粉 #ff2e88 / 电光黄 #ffd166 / 电子青 #4de3ff / 暗夜紫 #0c0a1d
   ── 语言:玻璃拟态卡片 + 渐变霓虹 + 3D 按压缩放 + 漂浮背景
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg0: #0c0a1d;
  --bg1: #171133;
  --bg2: #241640;
  --pink: #ff2e88;
  --yellow: #ffd166;
  --cyan: #4de3ff;
  --purple: #8b5cf6;
  --green: #57e389;
  --red: #ff5d5d;
  --card: rgba(255, 255, 255, .06);
  --card-hi: rgba(255, 255, 255, .10);
  --border: rgba(255, 255, 255, .14);
  --text2: rgba(255, 255, 255, .62);
  --glow-y: 0 0 22px rgba(255, 209, 102, .55);
  --shadow-card: 0 12px 34px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: radial-gradient(120% 90% at 50% -10%, var(--bg1) 0%, var(--bg0) 55%);
  color: #fff;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
#app { max-width: 520px; margin: 0 auto; height: 100%; position: relative; }
.hidden { display: none !important; }
b { font-weight: 800; }

/* ───────────── 背景特效层(漂浮光斑 + 情绪 emoji) ───────────── */
.bg-fx { position: fixed; inset: 0; margin: 0 auto; max-width: 520px; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; will-change: transform; }
.blob-a {
  width: 420px; height: 420px; left: -140px; top: -120px;
  background: radial-gradient(circle at 35% 35%, rgba(255, 46, 136, .55), rgba(255, 46, 136, 0) 70%);
  animation: blobfloat 14s ease-in-out infinite alternate;
}
.blob-b {
  width: 460px; height: 460px; right: -170px; bottom: -150px;
  background: radial-gradient(circle at 65% 65%, rgba(77, 227, 255, .4), rgba(139, 92, 246, .25) 45%, rgba(139, 92, 246, 0) 70%);
  animation: blobfloat 17s ease-in-out infinite alternate-reverse;
}
.bg-emoji { position: absolute; font-size: 30px; opacity: .16; will-change: transform; }
.e1 { left: 8%;  top: 20%; animation: emojirise 9s linear infinite; }
.e2 { left: 82%; top: 32%; animation: emojirise 11s linear infinite 2s; }
.e3 { left: 14%; top: 66%; animation: emojirise 13s linear infinite 4s; }
.e4 { left: 76%; top: 70%; animation: emojirise 10s linear infinite 1s; }
.e5 { left: 46%; top: 12%; animation: emojirise 12s linear infinite 3s; }
@keyframes blobfloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(46px, 34px) scale(1.12); }
}
@keyframes emojirise {
  0%   { transform: translateY(0) rotate(-6deg); opacity: 0; }
  12%  { opacity: .16; }
  85%  { opacity: .12; }
  100% { transform: translateY(-130px) rotate(10deg); opacity: 0; }
}

/* ───────────── 屏幕容器 ───────────── */
.screen {
  position: fixed;
  top: 0; bottom: 0; left: 0; right: 0;
  margin: 0 auto;
  max-width: 520px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}
.screen.active { display: flex; }

/* ───────────── 通用控件 ───────────── */
.text-input {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 1.5px solid var(--border); background: rgba(255,255,255,.07);
  color: #fff; font-size: 15px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.text-input::placeholder { color: rgba(255,255,255,.32); }
.text-input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,209,102,.15); }

.btn-primary {
  margin: 10px 18px calc(12px + env(safe-area-inset-bottom));
  padding: 14px; border: none; border-radius: 16px;
  background: linear-gradient(100deg, #ff2e88, #ff6b3d 60%, #ffb347);
  color: #fff; font-size: 17px; font-weight: 900; letter-spacing: 3px;
  cursor: pointer;
  position: relative; overflow: hidden;
  box-shadow: 0 6px 0 #a3124e, 0 14px 30px rgba(255, 46, 136, .45);
  transition: transform .08s, box-shadow .08s;
}
.btn-primary::after { /* 光泽扫过 */
  content: ""; position: absolute; top: 0; bottom: 0; left: -80%;
  width: 50%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #a3124e, 0 8px 18px rgba(255,46,136,.35); }
.btn-primary.small { margin: 0; padding: 13px 20px; font-size: 15px; letter-spacing: 1px; border-radius: 14px; }
.btn-primary.small::after { display: none; }
@keyframes shine { 0%, 55% { left: -80%; } 100% { left: 130%; } }

.btn-ghost {
  margin: 0; padding: 13px 20px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--card);
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .08s, background .2s;
}
.btn-ghost:active { transform: scale(.96); background: var(--card-hi); }
.btn-ghost.small { padding: 13px 20px; font-size: 15px; }

.icon-btn {
  border: 1.5px solid var(--border); background: var(--card);
  color: #fff; width: 44px; height: 44px; border-radius: 14px;
  font-size: 20px; cursor: pointer; flex: none;
  transition: transform .08s;
}
.icon-btn:active { transform: scale(.92); }

/* 微信登录按钮 + 用户胶囊 */
.header-right { flex: none; }
.wechat-btn {
  border: none; cursor: pointer;
  background: linear-gradient(100deg, #09bb07, #3fce49);
  color: #fff; font-size: 13px; font-weight: 800;
  padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(9, 187, 7, .4);
  transition: transform .08s;
}
.wechat-btn:active { transform: scale(.94); }
.user-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 4px 12px 4px 5px;
  max-width: 150px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7); object-fit: cover; flex: none;
}
.user-name {
  font-size: 12px; font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ───────────── 版本切换(普通版/小孩版) ───────────── */
.mode-row { display: flex; gap: 10px; margin: 14px 0 4px; }
.mode-btn {
  flex: 1; padding: 10px 0; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--card);
  color: #fff; font-size: 14px; font-weight: 800; cursor: pointer;
  transition: all .12s;
}
.mode-btn:active { transform: scale(.96); }
.mode-btn.selected {
  background: linear-gradient(100deg, var(--pink), var(--purple));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(255, 46, 136, .4);
}
.mode-desc { font-size: 11px; color: var(--text2); margin: 6px 0 2px; text-align: center; }

/* ───────────── 设置屏 ───────────── */
.setup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 0;
}
.logo { font-size: 30px; font-weight: 900; letter-spacing: 1px; line-height: 1.1;
  background: linear-gradient(100deg, #fff 20%, #ffd166 55%, #ff2e88);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-pei { -webkit-text-fill-color: transparent;
  background: linear-gradient(100deg, #ff2e88, #ff6b3d, #ffd166);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 14px rgba(255, 46, 136, .55));
  display: inline-block;
  animation: peiwobble 2.4s ease-in-out infinite;
}
@keyframes peiwobble {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50%      { transform: rotate(2deg) scale(1.06); }
}
.sub {
  display: inline-block; margin-top: 4px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, rgba(255,46,136,.25), rgba(77,227,255,.25));
  border: 1px solid rgba(255,255,255,.2);
  padding: 3px 10px; border-radius: 999px; letter-spacing: 2px;
}
.setup-body { flex: 1; overflow-y: auto; padding: 2px 20px 8px; }
.setup-body > * { animation: fadeup .45s ease-out both; }
.setup-body > :nth-child(2) { animation-delay: .05s; }
.setup-body > :nth-child(3) { animation-delay: .1s; }
.setup-body > :nth-child(4) { animation-delay: .15s; }
.setup-body > :nth-child(5) { animation-delay: .2s; }
.setup-body > :nth-child(6) { animation-delay: .25s; }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.section-title {
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
  color: var(--yellow);
  margin: 11px 0 7px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 4px;
  background: linear-gradient(180deg, var(--yellow), var(--pink));
  box-shadow: 0 0 10px rgba(255,209,102,.6);
}

/* 头像:一行横向滑动(黑白卡通大叔) */
.avatar-grid {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.avatar-grid::-webkit-scrollbar { display: none; }
.avatar-tile {
  position: relative; flex: none;
  width: 92px; height: 102px;
  scroll-snap-align: center;
  border: 2px solid #4a4a5e; border-radius: 18px;
  background: #f4f1ea; color: #333;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; padding: 0;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.avatar-tile:active { transform: scale(.93); }
.avatar-face { width: 62px; height: 62px; object-fit: contain; }
.avatar-name {
  font-size: 11px; font-weight: 800; color: #333;
  background: rgba(0,0,0,.07); padding: 2px 10px; border-radius: 999px;
  max-width: 86%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.avatar-tile.selected {
  border-color: var(--yellow);
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(255,209,102,.4), 0 10px 22px rgba(255,209,102,.28);
}
.avatar-tile.selected::after {
  content: "✓"; position: absolute; top: 7px; right: 7px; z-index: 2;
  background: linear-gradient(135deg, var(--yellow), #ff9f43); color: #3a2400; font-weight: 900;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.upload-tile { background: rgba(255,255,255,.06) !important; border: 2px dashed rgba(255,255,255,.3); }
.upload-tile .avatar-emoji { font-size: 30px; color: #fff; }
.upload-thumb { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2.5px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.4); }

/* 外号:一行横向滑动 */
.chips {
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: center;
  border: 1.5px solid var(--border); background: var(--card);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: all .12s;
}
.chip:active { transform: scale(.93); }
.chip.selected {
  background: linear-gradient(100deg, var(--pink), var(--purple));
  border-color: transparent; color: #fff; font-weight: 800;
  box-shadow: 0 6px 16px rgba(255, 46, 136, .4);
}

/* 讨厌值档位 */
.tier-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tier-tile {
  border: 1.5px solid var(--border); background: var(--card);
  border-radius: 14px; padding: 8px 2px; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: all .12s;
  position: relative;
}
.tier-tile:active { transform: scale(.93); }
.tier-stars { font-size: 12px; color: var(--yellow); letter-spacing: 1px; text-shadow: 0 0 8px rgba(255,209,102,.6); }
.tier-label { font-size: 12px; font-weight: 800; }
.tier-meta { font-size: 10px; color: var(--text2); }
.tier-tile.selected {
  background: linear-gradient(165deg, rgba(255,46,136,.85), rgba(139,92,246,.85));
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(255, 46, 136, .45), var(--glow-y);
}
.tier-tile.selected .tier-meta { color: rgba(255,255,255,.85); }

/* 提示条 */
.hint {
  margin-top: 10px; padding: 9px 13px; border-radius: 13px;
  background: linear-gradient(100deg, rgba(255,209,102,.12), rgba(255,46,136,.1));
  border: 1px solid rgba(255,209,102,.35);
  font-size: 12px; line-height: 1.6; color: #ffe9b8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.hint b { color: var(--yellow); }
.hint.faint {
  background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.45); font-size: 11px;
  margin-top: 6px; padding: 6px 13px;
}

/* ───────────── 游戏屏 ───────────── */
.game-header {
  display: flex; align-items: center; gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 8px;
  z-index: 6;
}
.hud-box {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 9px 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hud-label { font-size: 15px; }
.hud-num { font-size: 18px; font-weight: 900; min-width: 36px; text-align: center; }
#hud-time  { color: var(--cyan); text-shadow: 0 0 12px rgba(77,227,255,.7); }
#hud-score { color: var(--yellow); text-shadow: 0 0 12px rgba(255,209,102,.7); }
#hud-combo { color: var(--pink); text-shadow: 0 0 12px rgba(255,46,136,.7); }
.hud-num.pop { animation: pop .25s; }
.quit-btn {
  border: 1.5px solid var(--border); background: var(--card);
  color: rgba(255,255,255,.75); width: 36px; height: 36px;
  border-radius: 12px; font-size: 15px; cursor: pointer; flex: none;
  transition: transform .08s;
}
.quit-btn:active { transform: scale(.9); }

#avatar-stage {
  position: relative;
  width: min(62vw, 270px);
  margin: 6px auto 0;
  display: flex; flex-direction: column; align-items: center;
  z-index: 1;
}
#avatar-stage.shake { animation: shake .4s; }
#avatar-stage.last10 { animation: last10pulse .6s; }
#avatar-canvas {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  /* 渐变描边 + 内层高光 */
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(160deg, rgba(255,46,136,.75), rgba(139,92,246,.75), rgba(77,227,255,.75));
  padding: 0;
  border: 4px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 34px rgba(255,46,136,.25);
}
#avatar-name {
  margin-top: 10px; font-size: 16px; font-weight: 800; letter-spacing: 1px;
  background: rgba(10,8,30,.65); border: 1px solid var(--border);
  padding: 5px 16px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  max-width: 90%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.hp-wrap {
  margin-top: 10px; width: 82%; height: 14px; border-radius: 999px;
  background: rgba(255,255,255,.1); overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.4);
  position: relative;
}
#hp-bar {
  height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #a5e87e);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px), linear-gradient(90deg, var(--green), #a5e87e);
  transition: width .3s, background .3s;
  box-shadow: 0 0 14px rgba(87,227,137,.5);
}
#hp-bar.mid {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px), linear-gradient(90deg, var(--yellow), #ffb347);
  box-shadow: 0 0 14px rgba(255,209,102,.5);
}
#hp-bar.low {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 6px, transparent 6px 12px), linear-gradient(90deg, var(--red), #ff2e88);
  box-shadow: 0 0 16px rgba(255,93,93,.6);
  animation: hplowpulse 1s ease-in-out infinite;
}
@keyframes hplowpulse { 0%,100% { opacity: 1; } 50% { opacity: .75; } }
#surrender-banner {
  position: absolute; top: 32%; left: 50%; transform: translateX(-50%);
  background: linear-gradient(100deg, var(--yellow), #ff9f43);
  color: #3a2400; font-weight: 900; font-size: 20px;
  padding: 12px 24px; border-radius: 999px;
  animation: surrenderbounce .8s infinite alternate;
  white-space: nowrap; z-index: 3;
  box-shadow: 0 10px 30px rgba(255,209,102,.5);
}

#words-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.word {
  position: absolute;
  pointer-events: auto;
  padding: 9px 16px; border-radius: 999px;
  color: #fff; font-weight: 900; letter-spacing: .5px;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.55);
  box-shadow: 0 5px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.35);
  will-change: transform;
}
.word.burst { animation: wordburst .38s forwards; pointer-events: none; }
/* 彩色泡泡 */
.w0 { background: linear-gradient(135deg, #ff5f6d, #ffc371); }
.w1 { background: linear-gradient(135deg, #7f00ff, #e100ff); }
.w2 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.w3 { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.w4 { background: linear-gradient(135deg, #f7971e, #ffd200); }
.w5 { background: linear-gradient(135deg, #e65c00, #f9d423); }
.word.special {
  background: linear-gradient(135deg, #ff2e2e, #ff8a00 60%, #ffd166);
  border: 2px solid #fff;
  color: #fff;
  font-size: 34px;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
  box-shadow: 0 0 24px rgba(255, 120, 40, .95), 0 6px 18px rgba(0,0,0,.45);
  animation: floaty 2.6s ease-in-out infinite alternate, specialpulse 1s ease-in-out infinite;
}
.word.special::after {
  content: "大招!"; position: absolute; top: -15px; right: -12px;
  background: linear-gradient(135deg, #ffd166, #ff2e88);
  color: #fff; font-size: 11px; font-weight: 900;
  padding: 3px 8px; border-radius: 999px; transform: rotate(8deg);
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}

.float-text {
  position: absolute; z-index: 6;
  font-size: 18px; font-weight: 900; color: var(--yellow);
  text-shadow: 0 2px 8px rgba(0,0,0,.7), 0 0 14px rgba(255,209,102,.5);
  pointer-events: none;
  animation: floattext .9s ease-out forwards;
  white-space: nowrap;
}

#fx-canvas { position: absolute; inset: 0; z-index: 5; pointer-events: none; }

#flash {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, rgba(255, 90, 90, .65), rgba(255, 90, 90, .18) 55%, transparent 78%);
  opacity: 0;
}
#flash.show { animation: flashanim .32s; }

#calib-overlay {
  position: absolute; inset: 0; z-index: 8;
  background: rgba(8,6,22,.78);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.calib-box {
  text-align: center; padding: 34px 28px; border-radius: 24px;
  background: var(--card); border: 1.5px solid var(--border);
  width: 84%;
  box-shadow: var(--shadow-card);
  animation: cardin .35s ease-out;
}
.calib-title { font-size: 32px; font-weight: 900;
  background: linear-gradient(100deg, var(--yellow), var(--pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.calib-sub { font-size: 14px; color: var(--text2); margin: 10px 0 18px; line-height: 1.6; }
.vol-bar {
  height: 18px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.4);
}
#calib-vol {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  transition: width .08s;
  box-shadow: 0 0 16px rgba(255,209,102,.5);
}

/* 声线玩法的实时音量表 */
#vol-meter-wrap {
  position: absolute; left: 16px; right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 6; text-align: center;
}
.vm-label { font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.vm-track {
  height: 12px; border-radius: 999px; background: rgba(255,255,255,.1);
  overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.4);
}
#vol-meter {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  transition: width .08s;
  box-shadow: 0 0 12px rgba(255,209,102,.5);
}

/* ───────────── 结算屏 ───────────── */
#screen-result { overflow-y: auto; }
.result-card {
  margin: auto;
  width: 100%; max-width: 440px;
  padding: calc(26px + env(safe-area-inset-top)) 24px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center;
  animation: cardin .45s ease-out;
}
.result-badge {
  font-size: 15px; font-weight: 900; letter-spacing: 1px;
  background: linear-gradient(100deg, var(--pink), var(--purple) 60%, var(--yellow));
  padding: 9px 24px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(255, 46, 136, .45);
  margin-bottom: 18px;
}
#result-avatar {
  width: 210px; height: 210px; border-radius: 50%;
  border: 5px solid transparent;
  background: linear-gradient(160deg, rgba(255,46,136,.8), rgba(77,227,255,.8)) border-box;
  box-shadow: 0 16px 44px rgba(0,0,0,.55), 0 0 30px rgba(255,46,136,.3);
}
.result-name { font-size: 21px; font-weight: 900; margin-top: 16px; letter-spacing: 1px; }
.result-score { font-size: 14px; color: var(--text2); margin-top: 4px; }
.result-score b {
  font-size: 40px; font-weight: 900;
  background: linear-gradient(100deg, var(--yellow), var(--pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin: 0 5px;
  filter: drop-shadow(0 0 16px rgba(255,209,102,.45));
}
.result-stats {
  display: flex; gap: 10px; margin-top: 14px; width: 100%;
}
.result-stats span {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 10px 4px;
}
.result-stats i { font-style: normal; font-size: 12px; color: var(--text2); }
.result-stats b { font-size: 20px; color: #fff; }
.result-copy {
  margin-top: 16px; padding: 15px 17px; width: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: 14px; font-size: 14px; line-height: 1.8; color: #ffe9b8;
  min-height: 62px;
}
.result-actions { display: flex; gap: 10px; margin-top: 18px; width: 100%; }
.result-actions .btn-primary, .result-actions .btn-ghost { flex: 1; }
.btn-share {
  margin-top: 12px; width: 100%; padding: 15px;
  border: 1.5px dashed rgba(255,209,102,.5); background: rgba(255,209,102,.07);
  color: var(--yellow); font-size: 15px; font-weight: 800; border-radius: 16px; cursor: pointer;
  transition: transform .08s, background .2s;
}
.btn-share:active { transform: scale(.97); background: rgba(255,209,102,.14); }
.share-img { margin-top: 16px; width: 100%; border-radius: 20px; box-shadow: 0 14px 40px rgba(0,0,0,.55); }

/* ───────────── 弹窗 & Toast ───────────── */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5,4,14,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  width: 100%; max-width: 400px;
  background: linear-gradient(170deg, #221c44, #171133);
  border: 1.5px solid var(--border);
  border-radius: 22px; padding: 24px;
  box-shadow: var(--shadow-card);
  animation: cardin .3s ease-out;
}
.modal-box h3 {
  margin: 0 0 6px; font-size: 18px;
  background: linear-gradient(100deg, var(--yellow), var(--pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.modal-box label { display: block; font-size: 12px; color: var(--text2); margin: 14px 0 5px; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn-ghost, .modal-actions .btn-primary { flex: 1; }
.llm-test-result { margin-top: 12px; font-size: 13px; line-height: 1.6; min-height: 18px; }
.llm-test-result.ok { color: var(--green); }
.llm-test-result.fail { color: #ff8a8a; }
.modal-tip { font-size: 12px; color: var(--text2); margin: 10px 0 0; line-height: 1.6; }
.modal-tip.faint { color: rgba(255,255,255,.38); }

#toast {
  position: fixed; left: 50%; bottom: calc(44px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(16,12,36,.92); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; z-index: 99;
  max-width: 86%; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ───────────── 动画 ───────────── */
@keyframes floaty {
  from { transform: translateY(-12px) rotate(-2deg); }
  to   { transform: translateY(12px) rotate(3deg); }
}
@keyframes wordburst {
  0%   { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.8) rotate(45deg); opacity: 0; }
}
@keyframes specialpulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255,120,40,.7); }
  50%      { box-shadow: 0 0 40px rgba(255,150,60,1); }
}
@keyframes floattext {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-48px) scale(1.15); opacity: 0; }
}
@keyframes flashanim {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-9px) rotate(-1.5deg); }
  40% { transform: translateX(9px) rotate(1.5deg); }
  60% { transform: translateX(-6px) rotate(-1deg); }
  80% { transform: translateX(6px) rotate(1deg); }
}
@keyframes last10pulse {
  0%, 100% { filter: none; }
  50% { filter: drop-shadow(0 0 28px rgba(255,60,60,1)); }
}
@keyframes surrenderbounce {
  from { transform: translateX(-50%) scale(1); }
  to   { transform: translateX(-50%) scale(1.12) rotate(-2deg); }
}
@keyframes pop {
  0% { transform: scale(1.5); }
  100% { transform: scale(1); }
}
@keyframes cardin {
  from { opacity: 0; transform: translateY(26px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
