:root {
  --bg-black: #000000;
  --bg-panel: #111111;
  --bg-hover: #1a1a1a;
  --neon-green: #bdfe30;
  --text-white: #ffffff;
  --text-gray: #888888;
  --red: #ff453a;
  --border-color: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background-color: var(--bg-black);
  color: var(--text-white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ==================== 1. 伪装层：AI 文字游戏 ==================== */
#disguise-game-layer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; background: var(--bg-black);
}
.game-header {
  padding: max(16px, env(safe-area-inset-top)) 20px 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-color); background: var(--bg-panel);
}
.game-title {
  font-size: 16px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--neon-green); font-family: monospace;
}
.game-logo {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: #222; border: 1px solid var(--border-color);
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
.game-log-container {
  flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  font-size: 15px; line-height: 1.6;
}
.game-bubble {
  padding: 12px 16px; border-radius: 12px; max-width: 88%; word-break: break-word;
  white-space: pre-wrap; animation: fadeIn 0.25s ease;
}
.game-bubble.assistant {
  align-self: flex-start; background: #161616; border: 1px solid var(--border-color);
  color: #dedede; border-left: 3px solid var(--neon-green);
}
.game-bubble.user { align-self: flex-end; background: #262626; color: #fff; }

.game-input-area {
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  background: var(--bg-panel); border-top: 1px solid var(--border-color);
}
.game-input-wrap { position: relative; }
#game-input {
  width: 100%; background: #1f1f1f; border: 1px solid var(--border-color);
  border-radius: 22px; padding: 12px 84px 12px 16px; color: #fff; outline: none; font-size: 15px;
}
#game-input:focus { border-color: rgba(189, 254, 48, 0.4); }
#game-send-btn {
  position: absolute; right: 5px; top: 5px; bottom: 5px;
  background: var(--neon-green); color: #000; border: none; font-weight: 700;
  padding: 0 16px; border-radius: 18px; cursor: pointer; font-size: 14px; transition: transform 0.1s;
}
#game-send-btn:active { transform: scale(0.92); }

/* ==================== 2. 通讯主面板 ==================== */
#dashboard {
  position: fixed; inset: 0; z-index: 50;
  display: none; flex-direction: column; background: var(--bg-black);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s;
}
.view-container {
  flex: 1; display: none; flex-direction: column;
  overflow-y: auto; padding-bottom: 100px; animation: fadeIn 0.3s ease;
}
.view-container.active { display: flex; }

.dash-header {
  padding: max(20px, env(safe-area-inset-top)) 20px 10px 20px; font-size: 24px; font-weight: bold;
  letter-spacing: 1px; position: sticky; top: 0; background: var(--bg-black); z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
}
.header-plus {
  width: 36px; height: 36px; border-radius: 50%; background: #181818; border: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--neon-green);
}
.header-plus:active { transform: scale(0.92); }
.header-plus svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; }

.empty-hint { text-align: center; color: var(--text-gray); font-size: 13px; padding: 60px 20px; }

.list-item-wrapper { border-bottom: 1px solid var(--border-color); }
.list-item {
  display: flex; align-items: center; padding: 14px 20px;
  background: var(--bg-black); cursor: pointer;
}
.list-item:active { background: var(--bg-hover); }

.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-panel); object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.group-avatar {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; overflow: hidden;
  background: #1c1c1c; border: 1px solid rgba(255,255,255,0.1);
  display: grid; gap: 1px;
}
.group-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; background: #222; }
.group-avatar.g1 { grid-template-columns: 1fr; }
.group-avatar.g2, .group-avatar.g4 { grid-template-columns: 1fr 1fr; }
.group-avatar.g3 { grid-template-columns: 1fr 1fr; }
.group-avatar.g3 img:first-child { grid-column: 1 / 3; }
.group-avatar.g9 { grid-template-columns: 1fr 1fr 1fr; }

.item-content { flex: 1; margin-left: 14px; min-width: 0; }
.item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; gap: 8px; }
.item-name { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-time { font-size: 12px; color: var(--text-gray); flex-shrink: 0; }
.item-bottom { display: flex; align-items: center; gap: 10px; }
.item-preview { flex: 1; min-width: 0; font-size: 13px; color: var(--text-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 17px; }
.badge {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.profile-header {
  display: flex; flex-direction: column; align-items: center;
  padding: max(30px, env(safe-area-inset-top)) 20px 26px; border-bottom: 1px solid var(--border-color);
}
.profile-header .avatar { width: 80px; height: 80px; margin-bottom: 14px; cursor: pointer; transition: transform 0.2s; }
.profile-header .avatar:active { transform: scale(0.95); }
.profile-name { font-size: 20px; font-weight: bold; }
.profile-name.unset { color: var(--text-gray); font-weight: 500; font-size: 16px; }

.settings-list { padding: 6px 20px; }
.setting-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--border-color);
  font-size: 15px; cursor: pointer; transition: opacity 0.2s;
}
.setting-item:active { opacity: 0.7; }
.setting-item svg { width: 18px; height: 18px; }
.setting-item .chev { fill: none; stroke: var(--text-gray); stroke-width: 2; stroke-linecap: round; }

.switch { position: relative; width: 46px; height: 28px; border-radius: 14px; background: #333; transition: background 0.2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch.on { background: var(--neon-green); }
.switch.on::after { transform: translateX(18px); background: #000; }

/* 底部悬浮液态导航：4 个入口 */
.floating-nav-wrapper {
  position: fixed; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 400px; z-index: 100;
}
.floating-nav {
  background: var(--bg-panel); border: 1px solid var(--border-color);
  border-radius: 40px; padding: 6px; display: flex; position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
}
.nav-indicator {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4);
  background: #222; border-radius: 30px; z-index: 1;
  transition: transform 0.35s cubic-bezier(0.5, -0.4, 0.2, 1.4); pointer-events: none;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px 0; position: relative; z-index: 2;
  color: var(--text-gray); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: color 0.3s ease;
}
.nav-item svg { width: 22px; height: 22px; margin-bottom: 4px; fill: currentColor; }
.nav-item.active { color: var(--neon-green); }
.nav-dot {
  position: absolute; top: 4px; left: calc(50% + 8px); min-width: 8px; height: 8px; border-radius: 4px;
  background: var(--red); display: none;
}
.nav-dot.show { display: block; }

/* ==================== 3. 独立聊天窗口 ==================== */
#chat-room {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg-black); z-index: 200; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
#chat-room.open { transform: translateX(0); }

.chat-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(15px, env(safe-area-inset-top)) 15px 15px 15px;
  background: var(--bg-black); border-bottom: 1px solid var(--border-color);
}
.chat-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-header-right { display: flex; justify-content: flex-end; }
.chat-header-center { font-size: 16px; font-weight: bold; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
#chat-room.mode-c2c .chat-header-center { display: none; }
#chat-room.mode-c2c .chat-header { grid-template-columns: 1fr auto; }
#chat-room.mode-group .c2c-only { display: none; }

.btn-header-circle {
  width: 40px; height: 40px; border-radius: 50%; background: #181818; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.05); transition: background 0.2s;
}
.btn-header-circle:active { background: #252525; transform: scale(0.95); }
.btn-header-circle svg { width: 20px; height: 20px; fill: none; stroke: var(--text-white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-header-circle.clear svg { stroke: var(--text-gray); }
.btn-header-circle.clear:active svg { stroke: var(--red); }

.chat-header-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-panel); }
.chat-header-name {
  font-size: 16px; font-weight: bold; cursor: pointer; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-bottom: 1px dashed rgba(255,255,255,0.18); padding-bottom: 1px;
}

.chat-messages {
  flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.chat-messages::before { content: ''; flex: 1 1 auto; }

.msg-row { display: flex; gap: 8px; align-items: flex-start; }
.msg-row.self { flex-direction: row-reverse; }
.msg-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-panel); }
#chat-room.mode-c2c .msg-avatar, #chat-room.mode-c2c .msg-name { display: none; }
.msg-col { display: flex; flex-direction: column; max-width: 76%; min-width: 0; }
.msg-row.self .msg-col { align-items: flex-end; }
.msg-name { font-size: 12px; color: var(--text-gray); margin: 0 4px 3px; }

.msg-bubble {
  background: var(--bg-panel); padding: 8px 12px; border-radius: 18px;
  font-size: 15px; display: inline-block; position: relative; max-width: 100%;
}
.msg-bubble.self { background: var(--neon-green); color: #000; border-bottom-right-radius: 4px; }
.msg-bubble.other { border-bottom-left-radius: 4px; }
.msg-text { line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; display: inline; }
.msg-meta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.65em; margin-left: 8px; vertical-align: bottom; position: relative; top: 2px;
}
.msg-bubble.self .msg-meta { color: rgba(0, 0, 0, 0.55); }
.msg-bubble.other .msg-meta { color: rgba(255, 255, 255, 0.45); }
.msg-bubble.has-img { padding: 4px; }
.msg-bubble.has-img .msg-meta { display: flex; justify-content: flex-end; margin: 3px 6px 2px 0; top: 0; }
.msg-img { max-width: 200px; max-height: 260px; border-radius: 14px; display: block; cursor: zoom-in; }
.tick { width: 1.5em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tick.read { stroke: #0b57d0; }
.tick.fail { stroke: var(--red); }
.msg-bubble.self.sending { opacity: 0.7; }

/* 输入区：+ 按钮嵌入输入框左侧弧形，上下贴满 */
.chat-input-area { margin: 10px 15px max(15px, env(safe-area-inset-bottom)) 15px; }
.input-field-container {
  position: relative; background: #181818; min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 24px;
  display: flex; align-items: flex-end;
}
.btn-plus {
  width: 46px; height: 46px; border-radius: 50%; background: #262626; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-white);
  margin: -1px 0 -1px -1px;
}
.btn-plus:active { background: #333; }
.btn-plus svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; }
#msg-input {
  flex: 1; min-width: 0; background: transparent; border: none; padding: 13px 132px 12px 10px;
  color: var(--text-white); resize: none; outline: none; font-size: 15px; line-height: 20px;
  max-height: 130px; font-family: inherit;
}
#send-btn {
  background: var(--neon-green);
  color: #000; border: none; padding: 0 14px; height: 36px; border-radius: 18px;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: transform 0.15s;
}
#send-btn:active { transform: scale(0.9); }

/* ==================== 4. 模态框 ==================== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 10000;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.overlay.show { display: flex; }
.custom-modal {
  background: var(--bg-panel); width: 88%; max-width: 340px; padding: 24px; max-height: 90dvh; overflow-y: auto;
  border-radius: 20px; border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.custom-modal.wide { max-width: 560px; width: 94%; }
.custom-modal h3 { margin-bottom: 16px; text-align: center; font-size: 18px; }
.modal-msg { font-size: 14px; color: #ccc; text-align: center; line-height: 1.6; padding: 4px 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-btn { flex: 1; padding: 12px; font-size: 14px; border-radius: 12px; border: none; font-weight: bold; cursor: pointer; }
.modal-btn.cancel { background: rgba(255,255,255,0.1); color: var(--text-white); }
.modal-btn.confirm { background: var(--neon-green); color: #000; }
.modal-btn.danger { background: rgba(255,69,58,0.15); color: var(--red); }
.modal-btn:active { transform: scale(0.97); }
.modal-btn.block { width: 100%; flex: none; margin-top: 10px; }

.input-style {
  width: 100%; padding: 12px; background: #222; border: 1px solid rgba(255,255,255,0.1);
  color: #fff; border-radius: 12px; outline: none; font-size: 14px; margin-bottom: 10px; font-family: inherit;
}
.input-style:focus { border-color: rgba(189,254,48,0.4); }
textarea.input-style.big { min-height: 42dvh; resize: vertical; line-height: 1.5; }
.field-label { font-size: 12px; color: var(--text-gray); margin: 2px 2px 6px; }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 4px; }
.qr-box canvas { width: 190px; height: 190px; border-radius: 10px; background: #fff; image-rendering: pixelated; }
.qr-fail { font-size: 12px; color: var(--text-gray); text-align: center; padding: 14px 0; }
.link-text { width: 100%; background: #1b1b1b; padding: 10px; border-radius: 10px; font-size: 11px; word-break: break-all; color: var(--neon-green); max-height: 64px; overflow: hidden; }
.row-btns { display: flex; gap: 10px; width: 100%; }
.row-btns .modal-btn { margin-top: 0; padding: 10px; }

.friend-profile { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
.friend-profile .avatar { width: 76px; height: 76px; }
.friend-name { font-size: 18px; font-weight: 700; cursor: pointer; border-bottom: 1px dashed rgba(255,255,255,0.25); padding-bottom: 1px; }
.divider { height: 1px; background: var(--border-color); margin: 14px 0; }
.pwd-row { display: flex; gap: 8px; }
.pwd-row .input-style { margin-bottom: 0; }
.pwd-row .modal-btn { flex: none; padding: 0 16px; }

.pick-list { max-height: 34dvh; overflow-y: auto; margin: 4px 0; }
.pick-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.pick-item .avatar { width: 38px; height: 38px; }
.pick-item .pick-name { flex: 1; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #444; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pick-item.on .pick-box { background: var(--neon-green); border-color: var(--neon-green); }
.pick-item.on .pick-box::after { content: ''; width: 6px; height: 11px; border: solid #000; border-width: 0 2.4px 2.4px 0; transform: rotate(45deg) translate(-1px, -1px); }

#avatar-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 11000;
  display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(5px);
}
#avatar-modal.show { display: flex; }
.avatar-sheet {
  background: #181818; width: 100%; max-height: 80dvh; overflow-y: auto; border-radius: 24px 24px 0 0;
  padding: 25px 20px max(25px, env(safe-area-inset-bottom)); animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.avatar-sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; justify-items: center; }
.preset-avatar-item {
  width: 62px; height: 62px; border-radius: 50%; object-fit: cover;
  cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s, transform 0.1s; background: #222;
}
.preset-avatar-item:active { transform: scale(0.92); border-color: var(--neon-green); }

#image-viewer {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95);
  z-index: 12000; justify-content: center; align-items: center; cursor: zoom-out;
}
#viewer-img { max-width: 92%; max-height: 92%; object-fit: contain; border-radius: 12px; }

#toast {
  position: fixed; left: 50%; top: max(24px, env(safe-area-inset-top)); transform: translate(-50%, -20px);
  background: #222; color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 13px;
  z-index: 20000; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  border: 1px solid var(--border-color); max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 微信内打开指引 */
#wechat-guide {
  position: fixed; inset: 0; z-index: 30000; background: rgba(0,0,0,0.94); display: none;
  flex-direction: column; align-items: flex-end; padding: max(16px, env(safe-area-inset-top)) 22px 0 22px;
}
#wechat-guide.show { display: flex; }
#wechat-guide svg { width: 84px; height: 110px; stroke: var(--neon-green); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; }
#wechat-guide .guide-text { margin-top: 10px; align-self: stretch; text-align: right; font-size: 18px; line-height: 1.8; color: #fff; }
#wechat-guide .guide-text b { color: var(--neon-green); }
#wechat-guide .guide-sub { margin-top: 10px; align-self: stretch; text-align: right; font-size: 13px; color: var(--text-gray); }


/* ==================== 5. 语音 / 视频消息 ==================== */
.input-actions { position: absolute; right: 5px; bottom: 5px; display: flex; align-items: center; gap: 6px; }
.btn-mic {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: #262626; color: var(--text-white);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.btn-mic:active { background: #333; transform: scale(0.92); }
.btn-mic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.rec-bar {
  position: absolute; inset: 0; z-index: 3; display: none; align-items: center; gap: 12px;
  padding: 0 5px; background: #181818; border-radius: 24px;
}
.input-field-container.recording .rec-bar { display: flex; }
.rec-cancel {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: #262626; color: var(--text-white);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.rec-cancel svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex-shrink: 0; animation: recPulse 1s ease-in-out infinite; }
@keyframes recPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
.rec-time { flex: 1; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-white); }
.rec-send {
  height: 36px; padding: 0 16px; border-radius: 18px; border: none; background: var(--neon-green);
  color: #000; font-weight: 700; font-size: 14px; cursor: pointer;
}
.rec-send:active { transform: scale(0.92); }

.msg-bubble.has-voice { padding: 8px 12px; }
.voice-msg { display: inline-flex; align-items: center; gap: 10px; min-width: 96px; cursor: pointer; vertical-align: middle; user-select: none; -webkit-user-select: none; }
.voice-play {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.msg-bubble.self .voice-play { background: rgba(0, 0, 0, 0.14); }
.msg-bubble.other .voice-play { background: rgba(255, 255, 255, 0.12); }
.voice-play svg { width: 14px; height: 14px; fill: currentColor; }
.voice-play .ic-pause { display: none; }
.voice-msg.playing .ic-play { display: none; }
.voice-msg.playing .ic-pause { display: block; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.voice-wave i { display: block; width: 3px; border-radius: 2px; background: currentColor; opacity: 0.5; }
.voice-msg.playing .voice-wave i { opacity: 1; animation: voiceBar 0.9s ease-in-out infinite; }
.voice-msg.playing .voice-wave i:nth-child(3n) { animation-delay: 0.15s; }
.voice-msg.playing .voice-wave i:nth-child(3n+1) { animation-delay: 0.3s; }
@keyframes voiceBar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.45); } }
.voice-sec { font-size: 13px; font-variant-numeric: tabular-nums; }

.msg-video { max-width: 220px; max-height: 300px; border-radius: 14px; display: block; background: #000; }

/* ==================== 6. 左滑删除（群组列表） ==================== */
.list-item-wrapper { position: relative; overflow: hidden; }
.list-item { position: relative; z-index: 1; touch-action: pan-y; will-change: transform; transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1); }
.list-item.dragging { transition: none; }
.swipe-del {
  position: absolute; right: 0; top: 0; bottom: 0; width: 84px; z-index: 0;
  border: none; background: var(--red); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ==================== 7. 好友资料卡 ==================== */
.custom-modal.profile {
  width: 92%; max-width: 430px; padding: 22px 20px 20px; border-radius: 28px; background: #0c0d0f;
}
.fp-head {
  position: relative; display: flex; align-items: center; gap: 18px;
  padding: 2px 40px 18px 4px; border-bottom: 1px solid var(--border-color);
}
.fp-head .avatar { width: 76px; height: 76px; }
.fp-head .friend-name {
  flex: 0 1 auto; min-width: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom-color: rgba(255,255,255,0.14);
}
.fp-close {
  position: absolute; top: -4px; right: -6px; width: 38px; height: 38px; border: none; background: none;
  color: var(--text-white); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fp-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.fp-card {
  background: #101215; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 22px;
  padding: 16px; margin-top: 16px;
}
.fp-title { font-size: 17px; font-weight: 700; margin: 2px 0 14px 2px; }
.fp-card .pwd-row .input-style { height: 48px; border-radius: 14px; background: #181b1f; }
.fp-card .pwd-row .modal-btn { height: 48px; padding: 0 22px; border-radius: 14px; font-size: 15px; }

.invite-row { display: flex; gap: 14px; align-items: stretch; }
.qr-slot { flex: 0 0 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.qr-slot canvas { width: 116px; height: 116px; border-radius: 14px; background: #fff; image-rendering: pixelated; cursor: pointer; }
.qr-tip { font-size: 10px; color: var(--text-gray); }
.invite-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: #14171a; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 16px; padding: 10px 10px 10px 14px;
}
.invite-link .link-text {
  flex: 1; min-width: 0; width: auto; background: none; padding: 0; max-height: none; border-radius: 0;
  font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
  cursor: pointer;
}
.copy-btn {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: #1d2024;
  border: 1px solid rgba(255, 255, 255, 0.07); color: var(--text-white);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.copy-btn:active { background: #2a2e33; transform: scale(0.94); }
.copy-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.fp-primary {
  display: block; width: 100%; height: 54px; margin-top: 18px; border: none; border-radius: 18px;
  background: var(--neon-green); color: #000; font-size: 17px; font-weight: 700; cursor: pointer;
}
.fp-danger {
  display: block; width: 100%; height: 48px; margin-top: 14px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 69, 58, 0.1); border: 1px solid rgba(255, 69, 58, 0.32); color: var(--red);
  font-size: 16px; font-weight: 600;
}
.fp-primary:active, .fp-danger:active { transform: scale(0.98); }
