/* ============ 基础 reset ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --brand: #B23AC9; --brand-d: #9A2FB0;
  --bg: #ededed; --bar: #f7f7f7; --white: #fff; --soft: #f0f0f0;
  --line: #e4e4e4; --text: #191919; --muted: #9a9a9a; --sub: #6b6b6b;
  --self: #F0D8FB; --link: #576b95; --danger: #fa5151;
  --hover: #e6e6e6; --active-row: #dfdfdf; --daypill: rgba(0,0,0,.15); --quote-bg: rgba(0,0,0,.05);
  --hd: 48px; --tab: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
/* 深色模式:切换开关会给 <html> 加 data-theme="dark" */
:root[data-theme="dark"] {
  --bg: #101012; --bar: #1b1b1d; --white: #262629; --soft: #333338;
  --line: #333338; --text: #e9e9ea; --muted: #7d7d82; --sub: #a6a6ac;
  --self: #4C2A5C; --hover: #2f2f34; --active-row: #2f2f34; --daypill: rgba(255,255,255,.14); --quote-bg: rgba(255,255,255,.08);
}
:root[data-theme="dark"] body { background: #000; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text); background: #000; font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; background: none; border: none; outline: none; }
img { display: block; }
.icon { display: block; }
ul { list-style: none; }

/* ============ 应用容器(桌面居中成手机) ============ */
#app { height: 100%; }
.app-root {
  position: relative; height: 100%; max-width: 500px; margin: 0 auto;
  background: var(--bg); overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.25);
}
@media (max-width: 500px) { .app-root { box-shadow: none; } }

/* ============ 电脑双栏布局(≥820px)============ */
.app-root.desktop { max-width: 1180px; height: 100vh; flex-direction: row; display: flex; }
.sidebar { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; position: relative; border-right: .5px solid var(--line); background: var(--bar); }
.side-body { flex: 1; position: relative; overflow: hidden; }
.side-tabs { display: flex; height: 58px; flex-shrink: 0; border-top: .5px solid var(--line); background: var(--bar); }
.side-tabs .tab-ic .icon { width: 24px; height: 24px; }
.main-pane { flex: 1; position: relative; background: var(--bg); overflow: hidden; min-width: 0; }
.pane-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }
.pane-empty-logo { width: 84px; height: 84px; border-radius: 20px; background: var(--soft); color: #fff; font-size: 38px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pane-empty p { font-size: 15px; }
/* 桌面下:tab 视图不再需要给移动底栏留空间;栈页面取消滑入动画、铺满右栏 */
.desktop .with-tab { padding-bottom: 0; }
.desktop .main-pane .page.over { animation: none; }
/* 桌面下会话列表高亮当前打开的会话 */
.row.active-chat { background: var(--active-row); }
.row.active-chat:active { background: var(--hover); }

/* ============ 通用页面/滚动区 ============ */
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.page.over { z-index: 20; animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ============ 顶部导航栏 ============ */
.nav {
  height: calc(var(--hd) + var(--safe-t)); padding-top: var(--safe-t);
  display: flex; align-items: center; background: var(--bar);
  border-bottom: .5px solid var(--line); flex-shrink: 0; position: relative;
}
.nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.nav-title small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.nav-btn { min-width: 52px; height: var(--hd); display: flex; align-items: center; justify-content: center; color: var(--text); }
.nav-btn.text { font-size: 15px; color: var(--text); padding: 0 14px; min-width: 0; }
.nav-btn.right { justify-content: flex-end; padding-right: 14px; }
.nav-left { min-width: 52px; }

/* ============ 底部 tab ============ */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tab) + var(--safe-b));
  padding-bottom: var(--safe-b); display: flex; background: var(--bar);
  border-top: .5px solid var(--line); z-index: 10;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #7a7a7a; font-size: 11px; }
.tab.active { color: var(--brand); }
.tab-ic { position: relative; }
.tab-ic .icon { width: 26px; height: 26px; }

/* 页面内容给 tab 留出空间 */
.with-tab { padding-bottom: calc(var(--tab) + var(--safe-b)); }

/* ============ 列表行 ============ */
.list { background: var(--white); }
.row { display: flex; align-items: center; padding: 10px 14px; background: var(--white); position: relative; }
.row:active { background: var(--hover); }
.row + .row::before, .row-line::after { content: ''; position: absolute; left: 68px; right: 0; top: 0; height: .5px; background: var(--line); }
.row-body { flex: 1; min-width: 0; margin-left: 12px; }
.row-title { font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.row-name { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: 12px; color: var(--muted); flex-shrink: 0; margin-left: 8px; }
.row-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.section-title { padding: 6px 14px; font-size: 13px; color: var(--sub); }

/* ============ 头像 ============ */
.avatar-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.avatar-img { border-radius: 6px; object-fit: cover; background: var(--soft); }
.avatar-fallback { border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 500; }
.online-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }

/* 未读红点/角标 */
.badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.badge.dot { min-width: 10px; height: 10px; padding: 0; right: -6px; top: -3px; }

/* ============ 空态 ============ */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 12px; padding: 40px; text-align: center; }

/* ============ 聊天窗口 ============ */
/* 聊天区禁用文字选择/iOS 长按弹层 → 长按引用/转发时不会误选中文字(复制走菜单) */
.chat-bg { flex: 1; overflow-y: auto; background: var(--bg); padding: 10px 0 6px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chat-bg img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; }
.action-sheet, .fwd-bar, .reply-bar { -webkit-user-select: none; user-select: none; }
.msg-day { text-align: center; margin: 10px 0; }
.msg-day span { font-size: 12px; color: #fff; background: var(--daypill); padding: 2px 8px; border-radius: 4px; }
.msg { display: flex; padding: 5px 12px; align-items: flex-start; gap: 9px; }
.msg.me { flex-direction: row-reverse; }
.bubble-wrap { max-width: 68%; display: flex; flex-direction: column; }
.msg.me .bubble-wrap { align-items: flex-end; }
.bubble { position: relative; padding: 9px 12px; border-radius: 6px; background: var(--white); font-size: 16px; word-break: break-word; white-space: pre-wrap; }
.msg.me .bubble { background: var(--self); }
.bubble.tail::after { content: ''; position: absolute; top: 12px; left: -5px; border: 6px solid transparent; border-right-color: var(--white); }
.msg.me .bubble.tail::after { left: auto; right: -5px; border-right-color: transparent; border-left-color: var(--self); }
.bubble.img { padding: 0; background: none !important; overflow: hidden; position: relative; }
.bubble.img img { max-width: 200px; max-height: 280px; border-radius: 6px; display: block; }

/* 上传进度:图片蒙层 + 百分比 */
.up-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 500; border-radius: 6px; }
/* 上传进度:文件/通用 线性进度条 */
.up-bar { position: relative; height: 4px; background: rgba(0,0,0,.14); border-radius: 2px; margin-top: 6px; width: 100%; max-width: 150px; }
.up-bar > span { position: absolute; left: 0; top: 0; height: 100%; background: var(--brand-d); border-radius: 2px; transition: width .12s linear; }
.up-bar > em { position: absolute; right: 0; top: -15px; font-size: 11px; color: var(--muted); font-style: normal; }
.bubble.voice { display: flex; align-items: center; gap: 8px; min-width: 66px; cursor: pointer; position: relative; padding-bottom: 12px; }
.voice-anim { display: inline-flex; align-items: flex-end; gap: 2px; height: 15px; color: var(--text); }
.voice-anim i { width: 3px; height: 5px; background: currentColor; border-radius: 2px; }
.bubble.voice.playing .voice-anim i { animation: vbar .9s ease-in-out infinite; }
.voice-anim i:nth-child(2) { animation-delay: .15s; }
.voice-anim i:nth-child(3) { animation-delay: .3s; }
@keyframes vbar { 0%, 100% { height: 4px; } 50% { height: 15px; } }
.voice-progress { position: absolute; left: 10px; right: 10px; bottom: 5px; height: 2px; background: rgba(0,0,0,.14); border-radius: 2px; overflow: hidden; }
.voice-progress > span { display: block; height: 100%; background: var(--brand-d); border-radius: 2px; }
.bubble.file { display: flex; align-items: center; gap: 10px; width: 230px; max-width: 100%; background: var(--white); }
.msg.me .bubble.file { background: var(--self); }
.file-info { flex: 1; min-width: 0; }
/* 长文件名:最多两行后省略,避免撑乱气泡 */
.file-name { font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.file-size { font-size: 12px; color: var(--muted); margin-top: 2px; }
.file-ic { width: 40px; height: 40px; color: var(--brand); flex-shrink: 0; }
.msg-meta { font-size: 11px; color: var(--muted); margin-top: 3px; padding: 0 2px; }
.msg-status { font-size: 11px; color: var(--muted); margin: 0 4px; align-self: flex-end; }
.msg-status.fail { color: var(--danger); }
.spin { width: 13px; height: 13px; border: 2px solid #bbb; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.typing-hint { font-size: 12px; color: var(--muted); padding: 2px 14px; }
.msg-recall { text-align: center; margin: 8px 0; font-size: 12px; color: var(--muted); }

/* 开关(深色模式等) */
.switch { width: 44px; height: 26px; border-radius: 13px; background: #c6c6cb; position: relative; transition: background .2s; flex-shrink: 0; }
.switch.on { background: var(--brand); }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.on i { left: 21px; }

/* 电脑端拖拽上传浮层 */
.drop-hint { position: absolute; inset: 0; z-index: 40; background: rgba(178,58,201,.12); border: 2px dashed var(--brand); display: flex; align-items: center; justify-content: center; color: var(--brand-d); font-size: 18px; font-weight: 500; pointer-events: none; }

/* 输入栏 */
.composer { flex-shrink: 0; background: var(--bar); border-top: .5px solid var(--line); padding: 7px 8px calc(7px + var(--safe-b)); display: flex; align-items: flex-end; gap: 7px; }
.composer .cbtn { width: 32px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--text); flex-shrink: 0; }
.composer-input { flex: 1; background: var(--white); border-radius: 6px; padding: 7px 10px; font-size: 16px; max-height: 100px; min-height: 34px; resize: none; line-height: 1.3; }
.send-btn { background: var(--brand); color: #fff; border-radius: 5px; padding: 0 14px; height: 34px; font-size: 15px; flex-shrink: 0; }
.hold-voice { flex: 1; height: 36px; background: var(--white); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 15px; user-select: none; touch-action: none; -webkit-user-select: none; }
.hold-voice.holding { background: #cfcfcf; }
.hold-voice.cancel { background: #f7c6c6; }
.panel { background: var(--bar); display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 16px; }
.panel-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.panel-item .pic { width: 56px; height: 56px; background: var(--white); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--sub); }

/* 录音浮层 */
.rec-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 50; pointer-events: none; }
.rec-box { background: rgba(60,60,60,.92); border-radius: 14px; padding: 22px 30px; color: #fff; text-align: center; min-width: 140px; }
.rec-wave { font-size: 30px; letter-spacing: 3px; height: 34px; }
.rec-time { margin-top: 8px; font-size: 15px; }

/* ============ 登录 ============ */
.auth { position: absolute; inset: 0; background: var(--white); display: flex; flex-direction: column; padding: 8vh 30px 30px; }
.auth h1 { font-size: 26px; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin-bottom: 34px; font-size: 14px; }
.field { border-bottom: .5px solid var(--line); padding: 12px 0; display: flex; align-items: center; }
.field label { width: 64px; font-size: 16px; color: var(--text); }
.field input { flex: 1; font-size: 16px; min-width: 0; }
.captcha-img { width: 110px; height: 40px; border-radius: 4px; margin-left: 8px; flex-shrink: 0; cursor: pointer; background: #f2f4f7; }
.btn { width: 100%; height: 46px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 17px; margin-top: 28px; transition: opacity .15s; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--soft); color: var(--text); margin-top: 12px; }
.btn.block-sm { height: 40px; font-size: 15px; margin-top: 0; }
.auth-switch { text-align: center; margin-top: 20px; color: var(--link); font-size: 15px; }
.err { color: var(--danger); font-size: 14px; margin-top: 14px; min-height: 18px; }

/* ============ 搜索框 ============ */
.searchbar { padding: 8px 12px; background: var(--bar); }
.searchbar-inner { background: var(--white); border-radius: 7px; height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--muted); }
.searchbar-inner input { flex: 1; color: var(--text); font-size: 15px; }

/* ============ 我的 ============ */
.me-head { display: flex; align-items: center; gap: 16px; padding: 26px 18px; background: var(--white); }
.me-name { font-size: 20px; font-weight: 500; }
.me-id { color: var(--muted); font-size: 13px; margin-top: 6px; }
.block { margin-top: 10px; }
.arrow { color: #c8c8c8; }

/* ============ 通用按钮行 ============ */
.big-action { margin: 20px 14px; }
.center-muted { text-align: center; color: var(--muted); padding: 14px; font-size: 13px; }

/* 向上分页加载更早历史:居中的旋转指示器(粉紫描边),淡入更柔和 */
.load-more { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 13px; min-height: 20px; color: var(--muted); font-size: 13px; animation: lmFade .25s ease; }
.lm-spin { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes lmFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .load-more { animation: none; } .lm-spin { animation-duration: 1.4s; } }

/* ============ toast / 过渡 ============ */
.toast { position: fixed; left: 50%; top: 42%; transform: translateX(-50%); background: rgba(0,0,0,.78); color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 15px; z-index: 100; max-width: 76%; text-align: center; }
.fade-enter-active, .fade-leave-active { transition: opacity .2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ============ splash ============ */
.splash { position: absolute; inset: 0; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.splash-logo { width: 76px; height: 76px; border-radius: 18px; background: rgba(255,255,255,.2); color: #fff; font-size: 34px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* 右上角弹出菜单 */
.pop-menu { position: absolute; top: 44px; right: 8px; background: #4c4c4c; border-radius: 8px; padding: 4px 0; min-width: 140px; z-index: 40; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.pop-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 16px; color: #fff; font-size: 15px; }
.pop-menu button:active { background: rgba(255,255,255,.1); }
.pop-mask { position: absolute; inset: 0; z-index: 30; }

/* 图片多选确认发送(底部弹层) */
.img-confirm { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bar); border-top: .5px solid var(--line); z-index: 45; padding-bottom: var(--safe-b); max-height: 60%; display: flex; flex-direction: column; }
.ic-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: .5px solid var(--line); }
.ic-head span { font-size: 14px; color: var(--sub); }
.ic-cancel { color: var(--sub); font-size: 15px; }
.ic-send { background: var(--brand); color: #fff; padding: 6px 18px; border-radius: 5px; font-size: 15px; }
.ic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 14px; overflow-y: auto; }
.ic-item { position: relative; aspect-ratio: 1; }
.ic-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.ic-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.ic-more { aspect-ratio: 1; border: 1px dashed #bbb; border-radius: 6px; color: #999; display: flex; align-items: center; justify-content: center; }

/* 引用块(气泡内) */
.quote-block { max-width: 100%; font-size: 12px; color: var(--sub); background: var(--quote-bg); border-left: 2px solid #b5b5b5; padding: 4px 8px; border-radius: 3px; margin-bottom: 3px; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg.me .quote-block { text-align: left; }

/* 引用输入条 */
.reply-bar { display: flex; align-items: center; gap: 8px; background: var(--bar); padding: 8px 12px; border-top: .5px solid var(--line); }
.reply-bar-text { flex: 1; min-width: 0; font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar-text b { color: var(--text); font-weight: 500; }
.rb-x { padding: 4px; color: #888; }

/* 表情面板 */
.emoji-panel { background: var(--bar); border-top: .5px solid var(--line); height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 10px; padding-bottom: calc(10px + var(--safe-b)); }
.emoji-btn { font-size: 26px; line-height: 1; padding: 6px 0; border-radius: 6px; }
.emoji-btn:active { background: #ddd; }

/* 多选:勾选框 + 底栏 */
.msg.selecting { cursor: pointer; }
.sel-box { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #bbb; background: var(--white); align-self: center; position: relative; }
.sel-box.on { background: var(--brand); border-color: var(--brand); }
.sel-box.on::after { content: ''; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fwd-bar { display: flex; justify-content: space-around; background: var(--bar); border-top: .5px solid var(--line); padding: 8px 0 calc(8px + var(--safe-b)); }
.fb-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--text); }
.fb-btn:disabled { color: #bbb; }

/* 消息操作菜单(底部) */
.action-mask { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 55; display: flex; align-items: flex-end; }
.action-sheet { width: 100%; background: var(--bar); padding: 8px 10px calc(8px + var(--safe-b)); }
.action-sheet button { width: 100%; background: var(--white); border-radius: 10px; padding: 14px; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.action-sheet .as-cancel { color: var(--danger); margin-bottom: 0; }

/* 转发目标选择(底部弹层) */
.fwd-picker { position: absolute; inset: 0; z-index: 56; background: var(--bg); display: flex; flex-direction: column; }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--bar); border-bottom: .5px solid var(--line); }
.fp-head span { font-size: 16px; font-weight: 500; }
.fp-head button { font-size: 15px; color: var(--text); }
.fp-ok { background: var(--brand); color: #fff; padding: 6px 16px; border-radius: 5px; }
.fp-ok:disabled { background: #b6e3c8; }
.fp-list { flex: 1; overflow-y: auto; background: var(--white); }
.fp-list .row .sel-box { margin-right: 10px; }

/* 头像放大 */
.avatar-zoom { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 60; display: flex; align-items: center; justify-content: center; }
.avatar-zoom img { width: 60vw; max-width: 300px; height: 60vw; max-height: 300px; object-fit: cover; border-radius: 12px; }
.avatar-zoom-fallback { width: 60vw; max-width: 300px; height: 60vw; max-height: 300px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 120px; font-weight: 500; }

/* 图片查看器(缩放/滑动) */
.viewer { position: fixed; inset: 0; background: #000; z-index: 60; overflow: hidden; touch-action: none; user-select: none; }
.viewer-track { display: flex; width: 100%; height: 100%; will-change: transform; }
.viewer-slide { flex: 0 0 100%; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.viewer-slide img { max-width: 100%; max-height: 100%; will-change: transform; -webkit-user-drag: none; }
.viewer-close { position: absolute; top: calc(10px + var(--safe-t)); right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; display: flex; align-items: center; justify-content: center; }
.viewer-count { position: absolute; bottom: calc(18px + var(--safe-b)); left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }

/* 请求项按钮 */
.req-actions { display: flex; gap: 8px; }
.mini-btn { padding: 5px 14px; border-radius: 5px; font-size: 14px; }
.mini-btn.ok { background: var(--brand); color: #fff; }
.mini-btn.no { background: var(--soft); color: var(--sub); }
.pill { font-size: 13px; color: var(--muted); }

/* 猫咪主题全屏特效(effects.js):亲亲飘落 / 抱抱大猫+爪印 / 爱心上飘。必须 pointer-events:none */
.fx-overlay { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.fx-fall { position: absolute; top: -8%; animation: fxFall 3s linear forwards; }
@keyframes fxFall { from { transform: translateY(0) rotate(-14deg); opacity: 1; } to { transform: translateY(125vh) rotate(16deg); opacity: .85; } }
.fx-rise { position: absolute; bottom: -8%; animation: fxRise 3s ease-out forwards; }
@keyframes fxRise { 0% { transform: translateY(0) scale(.7); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(-120vh) scale(1.15); opacity: 0; } }
/* 3D 抱抱:猫咪从深处扑到眼前 + 爱心圆环 3D 旋转 + 爪子从两侧环抱 */
.fx3d { position: absolute; inset: 0; perspective: 700px; transform-style: preserve-3d; display: flex; align-items: center; justify-content: center; }
.fx3d-cat { font-size: 110px; animation: fx3dPounce 3s cubic-bezier(.25,.6,.3,1) forwards; }
@keyframes fx3dPounce {
  0%   { transform: translateZ(-1000px) translateY(6vh) rotateY(-50deg); opacity: 0; }
  12%  { opacity: 1; }
  35%  { transform: translateZ(-450px) translateY(2vh) rotateY(25deg) rotateZ(-6deg); }
  60%  { transform: translateZ(60px) translateY(0) rotateY(-12deg) rotateZ(5deg); }
  74%  { transform: translateZ(320px) rotateY(0deg) rotateZ(0deg); }
  84%  { transform: translateZ(240px); }
  92%  { transform: translateZ(260px); opacity: 1; }
  100% { transform: translateZ(260px); opacity: 0; }
}
.fx3d-ring { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; animation: fx3dSpin 3s linear forwards; }
.fx3d-ring span { position: absolute; left: -17px; top: -17px; font-size: 34px; }
@keyframes fx3dSpin {
  0% { transform: rotateX(14deg) rotateY(0deg); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: rotateX(14deg) rotateY(300deg); opacity: 0; }
}
.fx3d-paw { position: absolute; bottom: 4vh; font-size: 88px; opacity: 0; }
.fx3d-paw.l { left: 2vw; animation: fx3dPawL 1s ease 1.8s forwards; }
.fx3d-paw.r { right: 2vw; animation: fx3dPawR 1s ease 1.8s forwards; }
@keyframes fx3dPawL {
  0% { opacity: 0; transform: translate(-90px, 70px) rotate(-50deg); }
  55% { opacity: 1; transform: translate(4vw, -5vh) rotate(18deg); }
  100% { opacity: 0; transform: translate(4vw, -6vh) rotate(18deg); }
}
@keyframes fx3dPawR { /* scaleX(-1) 镜像后,同样的位移值天然对称 */
  0% { opacity: 0; transform: scaleX(-1) translate(-90px, 70px) rotate(-50deg); }
  55% { opacity: 1; transform: scaleX(-1) translate(4vw, -5vh) rotate(18deg); }
  100% { opacity: 0; transform: scaleX(-1) translate(4vw, -6vh) rotate(18deg); }
}
