/* =========================================================
   遇见 · 博主内容与剧情私聊
   深色沉浸：参考 HeroUI 深色令牌（background / surface / border / muted），强调色玫瑰红。
   ========================================================= */
:root {
  --bg: #0b0b0e;
  --surface: #16161b;
  --surface-2: #1e1e25;
  --surface-3: #282830;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f6f6f8;
  --muted: #a3a3ad;
  --muted-2: #6f6f7a;
  --accent: #ff4d79;
  --accent-2: #ff7a59;
  --accent-soft: rgba(255, 77, 121, 0.14);
  --gold: #f5c56b;
  --text-2: rgba(255, 255, 255, 0.84);
  --text-3: rgba(255, 255, 255, 0.58);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', 'Helvetica Neue', 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  --spring: cubic-bezier(.2, .8, .25, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; }
svg { display: block; }
img { -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { transition: background .15s ease, transform .15s ease, border-color .15s ease, opacity .15s; }
button:not(:disabled):active { transform: scale(.97); }

/* ---------- 舞台 ---------- */
.stage { position: fixed; inset: 0; display: flex; justify-content: center; }
.app { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; isolation: isolate; }

/* ---------- 视频流 ---------- */
.feed { position: absolute; inset: 0; overflow: hidden; transition: opacity .16s; }
.feed.jump { opacity: 0; }
.v-track { position: absolute; inset: 0; will-change: transform; }
.v-slide { position: absolute; left: 0; right: 0; top: calc(var(--v) * 100%); height: 100%; overflow: hidden; }
.h-track { position: absolute; inset: 0; will-change: transform; }
.panel { position: absolute; top: 0; bottom: 0; left: calc(var(--h) * 100%); width: 100%; overflow: hidden; background: #0c0c10; }
.media { position: absolute; inset: 0; }
.backdrop { position: absolute; inset: -40px; background: #121218 center / cover no-repeat; filter: blur(32px) brightness(.5) saturate(1.2); transform: scale(1.1); }
.vid, .pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .25s; }
.panel.ready .vid, .panel.ready .pic { opacity: 1; }
.shade { position: absolute; left: 0; right: 0; pointer-events: none; }
.shade-t { top: 0; height: 20%; background: linear-gradient(rgba(0, 0, 0, .5), transparent); }
.shade-b { bottom: 0; height: 55%; background: linear-gradient(transparent, rgba(8, 8, 12, .55) 45%, rgba(8, 8, 12, .92)); }
.play-ind { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; color: rgba(255, 255, 255, .88); opacity: 0; transform: scale(1.3); transition: .2s; pointer-events: none; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .4)); }
.panel.paused .play-ind { opacity: 1; transform: scale(1); }
.panel.is-image .play-ind { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.err-ind { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: 13px; color: var(--text-2); display: none; white-space: nowrap; }
.panel.error .err-ind { display: block; }
.loading-bar { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 2px); height: 2px; opacity: 0; overflow: hidden; }
.panel.buffering:not(.error) .loading-bar { opacity: 1; }
.loading-bar::after { content: ''; position: absolute; left: 50%; width: 0; height: 100%; background: rgba(255, 255, 255, .8); animation: buf 1s ease-in-out infinite; }
@keyframes buf { 0% { left: 50%; width: 0; opacity: 1; } 100% { left: 0; width: 100%; opacity: 0; } }
.story { position: absolute; left: 12px; right: 12px; top: calc(var(--safe-t) + 6px); display: flex; gap: 4px; z-index: 11; pointer-events: none; }
.story i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.story b { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
.story:has(i:only-child) { display: none; }
.peek-hint { position: absolute; right: 0; top: 50%; transform: translate(100%, -50%); display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 14px; border-radius: 999px 0 0 999px; background: var(--accent); font-size: 13px; font-weight: 600; transition: transform .4s var(--spring); pointer-events: none; z-index: 4; }
.peek-hint svg { width: 14px; height: 14px; }
.v-slide.peeking .peek-hint { transform: translate(0, -50%); }

/* 顶栏 */
.topbar { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 16px) 12px 0; display: flex; align-items: center; justify-content: space-between; z-index: 10; pointer-events: none; }
.top-actions { display: flex; gap: 8px; }
.top-icon { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; pointer-events: auto; background: rgba(0, 0, 0, .22); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18); }
.top-icon svg { width: 21px; height: 21px; }
.top-inbox:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); animation: badge .5s var(--pop); }
@keyframes badge { from { transform: scale(0); } }
.top-title { text-align: center; }
.top-title b { font-size: 16px; font-weight: 700; letter-spacing: .5px; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.top-title b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 77, 121, .3); vertical-align: 2px; }
.demo-mode-badge { display: block; margin-top: 3px; font-size: 9px; font-weight: 500; color: var(--gold); letter-spacing: 1px; }
.app.dragging .topbar, .app.dragging .side, .app.dragging .caption { opacity: .6; transition: opacity .2s; }

/* 右侧操作栏 */
.side { position: absolute; right: 10px; bottom: calc(var(--safe-b) + 150px); display: flex; flex-direction: column; align-items: center; gap: 16px; z-index: 3; }
.av { display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--surface-3); flex: none; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av b { color: #fff; font-weight: 700; }
.sb-avatar { position: relative; margin-bottom: 6px; }
.sb-avatar .av { width: 50px; height: 50px; box-shadow: 0 0 0 2px #fff, 0 6px 18px rgba(0, 0, 0, .35); }
.sb-avatar .av b { font-size: 20px; }
.sb-plus { position: absolute; left: 50%; bottom: -8px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); box-shadow: 0 0 0 2px #fff; color: #fff; }
.sb-plus svg { width: 11px; height: 11px; }
.sb-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; }
.sb-ic { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .24); transition: background .2s; }
.sb-ic svg { width: 25px; height: 25px; }
.sb-num, .sb-label { font-size: 11.5px; font-weight: 600; line-height: 1.1; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.sb-num:empty { display: none; }
.sb-like.on .sb-ic { background: var(--accent); box-shadow: 0 6px 20px rgba(255, 77, 121, .45); }
.sb-like.pop .sb-ic { animation: pop .45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.25); } }
.sb-chat .sb-ic { width: 54px; height: 54px; background: var(--accent); box-shadow: 0 10px 26px rgba(255, 77, 121, .45); }
.sb-chat .sb-ic svg { width: 28px; height: 28px; }
.sb-chat .sb-ic svg path:last-child { stroke: var(--accent); }
.sb-chat .sb-label { font-weight: 700; }
.sb-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--accent); font-size: 11.5px; font-style: normal; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); animation: badge .5s var(--pop); }
.sb-chat:has(.sb-badge) .sb-ic::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(255, 77, 121, .7); animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.4); opacity: 0; } }

/* 左下：名字、文案、聊天入口 */
.caption { position: absolute; left: 14px; right: 80px; bottom: calc(var(--safe-b) + 20px); z-index: 3; }
.cap-name { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; cursor: pointer; text-shadow: 0 1px 10px rgba(0, 0, 0, .4); }
.cap-name > b { font-size: 21px; font-weight: 750; }
.cap-tag { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 11px; font-weight: 600; text-shadow: none; }
.cap-tag svg { width: 12px; height: 12px; }
.cap-sub { display: inline-block; margin-bottom: 8px; font-size: 13px; color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .4); cursor: pointer; }
.cap-text { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.panel.expanded .cap-text { -webkit-line-clamp: 12; }
.cap-title { color: #fff; margin-right: 6px; }
.cap-cta { display: flex; align-items: center; gap: 11px; width: 100%; max-width: 320px; padding: 8px 8px 8px 8px; border-radius: 999px; background: rgba(20, 20, 26, .55); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2); text-align: left; }
.cta-pair { position: relative; width: 36px; height: 36px; flex: none; }
.cta-pair .av { width: 36px; height: 36px; }
.cta-pair .av b { font-size: 15px; }
.cta-pair::after { content: ''; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 2px #1a1a20; display: none; }
.cta-txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cta-txt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-txt small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-go { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); flex: none; }
.cta-go svg { width: 15px; height: 15px; }

/* 双击心动 / 提示 / 启动 */
.heart-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.burst { position: absolute; width: 96px; height: 96px; margin: -60px 0 0 -48px; color: var(--accent); transform: rotate(var(--rot)); animation: burst .95s ease-out forwards; filter: drop-shadow(0 6px 18px rgba(255, 77, 121, .5)); }
@keyframes burst { 0% { transform: rotate(var(--rot)) scale(.2); opacity: 0; } 18% { transform: rotate(var(--rot)) scale(1.15); opacity: 1; } 32% { transform: rotate(var(--rot)) scale(.95); } 70% { opacity: 1; } 100% { transform: rotate(var(--rot)) translateY(-90px) scale(1.4); opacity: 0; } }
.toast { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.92); max-width: 80%; padding: 11px 16px; border-radius: var(--r-md); background: rgba(22, 22, 27, .9); box-shadow: inset 0 0 0 1px var(--border-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14px; line-height: 1.45; text-align: center; opacity: 0; pointer-events: none; transition: .22s; z-index: 90; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.boot { position: absolute; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(500px 380px at 50% 40%, #2a1220, var(--bg) 70%); transition: opacity .45s; }
.boot.hide { opacity: 0; pointer-events: none; }
.boot-mark { width: 60px; height: 60px; color: var(--accent); animation: beat 1.6s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(255, 77, 121, .55)); }
@keyframes beat { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(1.1); } 86% { transform: scale(.97); } 92% { transform: scale(1.05); } }
.boot-line { width: 120px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.boot-line i { display: block; width: 40%; height: 100%; background: var(--accent); animation: bootl 1.1s ease-in-out infinite; }
@keyframes bootl { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.boot-msg { margin: 0; padding: 0 30px; font-size: 14px; color: var(--text-2); text-align: center; line-height: 1.6; }
.boot.error .boot-line { display: none; }
.boot-msg button { margin-top: 14px; padding: 9px 20px; border-radius: 999px; background: var(--accent); font-weight: 600; }

/* ---------- 主动搭讪弹窗 ---------- */
.ob-banner { position: absolute; z-index: 80; left: 10px; right: 10px; top: calc(var(--safe-t) + 10px); padding: 12px; border-radius: 22px; background: rgba(28, 28, 34, .86); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: inset 0 0 0 1px var(--border-2), 0 18px 40px rgba(0, 0, 0, .45); transform: translateY(-140%); transition: transform .5s var(--pop); touch-action: manipulation; }
.ob-banner.show { transform: none; }
.ob-main { display: flex; gap: 11px; width: 100%; text-align: left; align-items: flex-start; }
.ob-av { width: 42px; height: 42px; flex: none; box-shadow: 0 0 0 2px var(--accent); }
.ob-av b { font-size: 17px; }
.ob-txt { min-width: 0; flex: 1; }
.ob-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ob-top b { font-size: 14.5px; }
.ob-top small { font-size: 11px; color: var(--muted); }
.ob-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.ob-actions { display: flex; gap: 8px; margin-top: 11px; padding-left: 53px; }
.ob-reply { flex: 1; height: 36px; border-radius: 999px; background: var(--accent); font-size: 13.5px; font-weight: 700; }
.ob-close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--muted); }
.ob-close svg { width: 16px; height: 16px; }

/* ---------- 全屏页面 ---------- */
.page { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); color: var(--text); transform: translate3d(100%, 0, 0); transition: transform .32s var(--spring); touch-action: pan-y; user-select: text; -webkit-user-select: text; }
.page.open { transform: none; }
.page.closing { pointer-events: none; transform: translate3d(100%, 0, 0); }
.pg-back { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--text); flex: none; }
.pg-back:hover { background: rgba(255, 255, 255, .08); }
.pg-back svg { width: 22px; height: 22px; }

/* ---------- 聊天 ---------- */
.chat-page { background: radial-gradient(120% 50% at 50% 0%, rgba(255, 77, 121, .1), transparent 60%), var(--bg); }
.ch-head { display: flex; align-items: center; gap: 4px; flex: none; padding: calc(var(--safe-t) + 10px) 10px 8px 6px; }
.ch-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; padding: 4px; border-radius: var(--r-md); }
.ch-avatar { width: 30px; height: 30px; }
.ch-avatar b { font-size: 13px; }
.ch-head-av { width: 40px; height: 40px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }
.ch-head-av b { font-size: 17px; }
.ch-head.lv-up .ch-head-av { animation: lvring 1.2s var(--spring); }
@keyframes lvring { 30% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 8px var(--gold), 0 0 30px var(--gold); transform: scale(1.08); } }
.ch-title { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-title > b { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ch-lv { font-style: normal; color: var(--gold); font-weight: 600; }
.ch-ty { display: none; color: var(--accent); }
.chat-page.is-typing .ch-idle { display: none; }
.chat-page.is-typing .ch-ty { display: inline; }
.ch-bond { flex: none; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; margin: 0 14px 4px; padding: 9px 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.bd-label { font-size: 11.5px; color: var(--muted); }
.bd-label b { color: var(--text); font-variant-numeric: tabular-nums; }
.bd-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bd-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: 0 50%; transition: transform .8s var(--spring); }
.bd-next { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted-2); }
.ch-body { flex: 1; min-height: 80px; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 14px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.ch-list { display: flex; flex-direction: column; gap: 10px; }
.ch-intro { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 20px 18px; text-align: center; }
.ch-intro-av { width: 64px; height: 64px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--border-2); }
.ch-intro-av b { font-size: 26px; }
.ch-intro > b { font-size: 16px; margin-top: 4px; }
.ch-intro > span { max-width: 280px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.ms-time { align-self: center; font-size: 11px; color: var(--muted-2); padding: 4px 0; font-variant-numeric: tabular-nums; }
.ms-row { display: flex; align-items: flex-end; gap: 8px; max-width: 84%; animation: msgin .32s var(--spring) both; }
@keyframes msgin { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ms-row.me { align-self: flex-end; }
.ms-row + .ms-row.them .ch-avatar { visibility: visible; }
.ms-bubble { padding: 10px 14px; border-radius: 20px; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.them .ms-bubble { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 6px; box-shadow: inset 0 0 0 1px var(--border); }
.me .ms-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.ms-typing .ms-bubble { display: flex; gap: 4px; padding: 15px 16px; }
.ms-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.ms-typing i:nth-child(2) { animation-delay: .15s; }
.ms-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
/* 系统消息：章节、升级、结果 */
.ms-sys { align-self: center; display: flex; justify-content: center; width: 100%; animation: msgin .4s var(--spring) both; }
.ms-chapter { margin: 10px 0 2px; gap: 10px; align-items: center; }
.ms-chapter::before, .ms-chapter::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--border-2)); }
.ms-chapter::after { transform: scaleX(-1); }
.ms-chapter span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .5px; }
.lv-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 26px; border-radius: 16px; background: linear-gradient(135deg, rgba(245, 197, 107, .18), rgba(255, 77, 121, .16)); box-shadow: inset 0 0 0 1px rgba(245, 197, 107, .35); animation: lvpop .7s var(--pop) both; }
@keyframes lvpop { from { transform: scale(.6); opacity: 0; } }
.lv-card small { font-size: 11px; color: var(--gold); letter-spacing: 2px; }
.lv-card b { font-size: 16px; }
.lv-spark { position: absolute; top: -8px; right: 10px; color: var(--gold); font-size: 18px; animation: spark 1.6s ease-in-out infinite; }
@keyframes spark { 50% { transform: scale(1.4) rotate(20deg); opacity: .6; } }
.ch-new { position: absolute; right: 16px; bottom: 150px; z-index: 3; padding: 7px 12px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
/* 选项 */
.ch-choices { display: none; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 4px 14px 10px; }
.ch-choices.show { display: flex; }
.ch-choices button { padding: 9px 14px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); color: var(--text); font-size: 13.5px; line-height: 1.35; text-align: left; animation: chip .4s var(--pop) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes chip { from { opacity: 0; transform: translateY(10px) scale(.9); } }
.ch-choices button:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(255, 77, 121, .55); }
/* 输入 */
.ch-compose { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(var(--safe-b) + 10px); border-top: 1px solid var(--border); background: rgba(11, 11, 14, .9); }
.ch-bar { flex: 1; display: flex; align-items: flex-end; gap: 6px; min-width: 0; padding: 4px 4px 4px 14px; border-radius: 22px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.ch-bar:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 77, 121, .6); }
.ch-bar textarea { flex: 1; min-width: 0; min-height: 34px; max-height: 100px; padding: 7px 0; resize: none; border: 0; background: none; color: var(--text); outline: none; font-size: 14.5px; line-height: 20px; }
.ch-bar textarea::placeholder { color: var(--muted-2); }
.ch-send { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.ch-send:disabled { opacity: .3; cursor: default; }
.ch-send svg { width: 17px; height: 17px; }
/* ---------- 消息列表 ---------- */
.ib-head { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 10px) 10px 8px 6px; }
.ib-head b { font-size: 17px; }
.ib-head span { width: 38px; }
.ib-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.ib-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; border-radius: var(--r-md); text-align: left; }
.ib-row:hover { background: var(--surface); }
.ib-av { width: 48px; height: 48px; }
.ib-av b { font-size: 19px; }
.ib-row.unread .ib-av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent); }
.ib-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ib-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ib-top b { font-size: 14.5px; }
.ib-top small { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.ib-msg { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row.unread .ib-msg { color: var(--text); }
.ib-msg em { font-style: normal; color: var(--muted-2); }
.ib-lv { font-size: 10.5px; color: var(--gold); }
.ib-dot { position: absolute; right: 12px; bottom: 14px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.ib-empty { text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 主页 ---------- */
.pf-head { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: calc(var(--safe-t) + 10px) 10px 8px; }
.pf-head .pg-back { background: rgba(0, 0, 0, .35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pf-body { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.pf-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 20px 16px; text-align: center; }
.pf-cover { position: relative; width: calc(100% + 40px); height: 170px; margin-bottom: -46px; overflow: hidden; background: linear-gradient(135deg, #3a1b2a, #1b1b24); }
.pf-cover i { position: absolute; inset: -30px; background: center / cover; filter: blur(26px) saturate(1.3); opacity: .75; }
.pf-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 30%, var(--bg)); }
.pf-av { position: relative; width: 92px; height: 92px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }
.pf-av b { font-size: 36px; }
.pf-hero h2 { margin: 14px 0 4px; font-size: 22px; }
.pf-label { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.pf-label b { color: var(--text); }
.pf-tags, .dc-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pf-tags span, .dc-tags span { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.pf-bio { margin: 14px 0 0; padding: 14px 16px; width: 100%; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-size: 14px; line-height: 1.7; color: var(--text-2); text-align: left; white-space: pre-wrap; }
.pf-bond { margin: 4px 16px 18px; padding: 14px; border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(255, 77, 121, .12), rgba(245, 197, 107, .06)), var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.pf-bond-top, .dc-bond-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; font-size: 12px; color: var(--muted); }
.pf-bond-top b, .dc-bond-top b { font-size: 13.5px; color: var(--gold); }
.dc-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.dc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: 0 50%; transition: transform .8s var(--spring); }
.pf-bond > small { font-size: 11px; color: var(--muted-2); }
.pf-sub { margin: 0 16px 10px; font-size: 15px; }
.pf-sub span { color: var(--muted); font-weight: 500; }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
.pf-cell { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 6px; background: var(--surface-2); }
.pf-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.pf-cell:hover img { transform: scale(1.03); }
.pg-badge { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 6px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11px; }
.pg-badge svg { width: 13px; height: 13px; }
.pg-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 5px; font-size: 11px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-foot { display: flex; gap: 10px; padding: 10px 14px calc(var(--safe-b) + 12px); border-top: 1px solid var(--border); background: rgba(11, 11, 14, .92); }
.pf-chat { height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; }
.pf-chat { flex: 1; background: var(--accent); color: #fff; }
.pf-chat svg { width: 22px; height: 22px; }
.pf-chat svg path:last-child { stroke: var(--accent); }

/* ---------- 首次引导 ---------- */
.guide { position: absolute; inset: 0; z-index: 85; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(8, 8, 12, .8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s; text-align: center; padding: 0 30px; }
.guide.open { opacity: 1; }
.guide.closing { opacity: 0; pointer-events: none; }
.gd-step { display: none; flex-direction: column; align-items: center; }
.gd-step.on { display: flex; animation: msgin .35s var(--spring); }
.gd-step h3 { margin: 22px 0 8px; font-size: 21px; }
.gd-step p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.gd-anim { position: relative; width: 120px; height: 150px; }
.gd-rail { position: absolute; left: 50%; top: 10px; bottom: 10px; width: 4px; margin-left: -2px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.gd-rail i { position: absolute; left: 0; right: 0; height: 40%; background: var(--accent); animation: rail 1.6s ease-in-out infinite; }
.gd-h .gd-rail { left: 10px; right: 10px; top: 50%; bottom: auto; width: auto; height: 4px; margin: -2px 0 0; }
.gd-h .gd-rail i { top: 0; bottom: 0; height: auto; width: 40%; animation-name: railh; }
@keyframes rail { 0% { top: 70%; } 100% { top: -40%; } }
@keyframes railh { 0% { left: 70%; } 100% { left: -40%; } }
.gd-hand { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -10px 0 0 -14px; animation: handv 1.6s ease-in-out infinite; }
.gd-h .gd-hand { animation-name: handh; }
@keyframes handv { 0% { transform: translateY(40px); opacity: 0; } 20%, 80% { opacity: 1; } 100% { transform: translateY(-50px); opacity: 0; } }
@keyframes handh { 0% { transform: translateX(40px); opacity: 0; } 20%, 80% { opacity: 1; } 100% { transform: translateX(-50px); opacity: 0; } }
.gd-chat { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); box-shadow: 0 12px 34px rgba(255, 77, 121, .5); animation: beat 1.6s ease-in-out infinite; }
.gd-chat svg { width: 44px; height: 44px; }
.gd-chat svg path:last-child { stroke: var(--accent); }
.gd-foot { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 46px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.gd-dots { display: flex; gap: 6px; }
.gd-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .3); transition: .25s; }
.gd-dots i.on { width: 18px; background: #fff; }
.gd-btn { min-width: 160px; height: 46px; padding: 0 26px; border-radius: 999px; background: var(--accent); font-size: 16px; font-weight: 700; }
.gd-tip { margin: 0; font-size: 12px; color: var(--text-3); }

/* ---------- 只做 H5：宽屏下居中显示手机尺寸 ---------- */
@media (min-width: 600px) {
  body { background: radial-gradient(700px 500px at 50% 35%, rgba(255, 77, 121, .1), transparent 70%), var(--bg); }
  .stage { align-items: center; }
  .app { width: min(430px, calc((100vh - 40px) * .5)); height: min(920px, calc(100vh - 40px)); border-radius: 36px; box-shadow: 0 0 0 8px #17171c, 0 0 0 9px #2b2b33, 0 40px 90px rgba(0, 0, 0, .6); }
}
@media (max-height: 640px) {
  .side { bottom: calc(var(--safe-b) + 140px); gap: 11px; }
  .sb-ic { width: 42px; height: 42px; }
  .ch-bond { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* 连续消息成组：只在最后一条显示头像，间距收紧 */
.ms-row.them:has(+ .ms-row.them) .ch-avatar { visibility: hidden; }
.ms-row.them + .ms-row.them, .ms-row.me + .ms-row.me { margin-top: -5px; }
.ib-row.unread .ib-main { padding-right: 30px; }

/* 头部主页按钮 */
.ch-home { height: 32px; padding: 0 13px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); font-size: 12.5px; color: var(--text-2); }
/* 视频推荐卡片 */
.ms-video { display: flex; gap: 10px; width: 236px; padding: 8px; border-radius: 18px; border-bottom-left-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); text-align: left; }
.ms-video:hover { box-shadow: inset 0 0 0 1px rgba(255, 77, 121, .5); }
.mv-cover { position: relative; width: 74px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-3); flex: none; }
.mv-cover img { width: 100%; height: 100%; object-fit: cover; }
.mv-play { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(4px); }
.mv-play svg { width: 14px; height: 14px; margin-left: 2px; }
.mv-cover em { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 5px; background: rgba(0, 0, 0, .5); font-size: 9.5px; font-style: normal; color: #fff; }
.mv-info { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.mv-info small { font-size: 11px; color: var(--accent); font-weight: 600; }
.mv-info b { font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mv-go { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); }
.mv-go svg { width: 12px; height: 12px; }
/* 演示按钮与控制台（仅 ?demo） */
.top-demo { position: absolute; left: 58px; top: calc(var(--safe-t) + 22px); height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(245, 197, 107, .18); box-shadow: inset 0 0 0 1px rgba(245, 197, 107, .45); color: var(--gold); font-size: 12px; font-weight: 600; pointer-events: auto; }
.dm-sheet { position: absolute; inset: 0; z-index: 88; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0); transition: background .25s; }
.dm-sheet.open { background: rgba(0, 0, 0, .55); }
.dm-panel { width: 100%; padding: 18px 16px calc(var(--safe-b) + 20px); border-radius: 24px 24px 0 0; background: var(--surface); box-shadow: inset 0 1px 0 var(--border-2); transform: translateY(100%); transition: transform .32s var(--spring); }
.dm-sheet.open .dm-panel { transform: none; }
.dm-head { margin-bottom: 14px; }
.dm-head b { display: block; font-size: 16px; color: var(--gold); }
.dm-head small { font-size: 12px; color: var(--muted); }
.dm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dm-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); font-size: 13px; line-height: 1.4; text-align: left; }
.dm-grid span { font-size: 20px; }
