* { margin: 0; padding: 0; box-sizing: border-box; }

/* hidden 属性必须优先于任何 display 声明，否则 display:flex 等会覆盖它 */
[hidden] { display: none !important; }

:root {
  --nav-bg: #2B2F33;
  --accent: #12B7F5;
  --bubble-me: #95EC69;
  --red: #FA5151;
  --green: #3EB575;

  /* 浅色主题 */
  --bg-app: #FFFFFF;
  --bg-panel: #F7F8FA;
  --bg-chat: #FBFCFD;
  --bg-input: #FAFBFC;
  --bg-hover: #EDEFF2;
  --bg-active: #E2F2FD;
  --bg-btn: #F2F4F7;
  --bg-disabled: #F5F6F8;
  --border: #E8EAED;
  --text-1: #333333;
  --text-2: #666666;
  --text-3: #999999;
  --text-4: #B0B6BF;
  --text-5: #9AA0A6;
  --bubble-other: #FFFFFF;
  --bubble-other-border: #E8EAED;
  --modal-mask: rgba(20, 24, 32, .45);
  --toast-bg: rgba(30, 34, 40, .92);
  --scroll-thumb: #D5D9DE;
  --scroll-thumb-hover: #C0C6CD;
}

/* 深色主题 */
html[data-theme="dark"] {
  --bg-app: #1F242A;
  --bg-panel: #171B20;
  --bg-chat: #14181D;
  --bg-input: #22272E;
  --bg-hover: #262C34;
  --bg-active: #1E3A4A;
  --bg-btn: #2A3038;
  --bg-disabled: #1C2127;
  --border: #2F363F;
  --text-1: #E6E9ED;
  --text-2: #B8C0C9;
  --text-3: #8A939E;
  --text-4: #6A7480;
  --text-5: #7A8490;
  --bubble-other: #262C34;
  --bubble-other-border: #333B44;
  --bubble-me: #4F8A38;
  --modal-mask: rgba(0, 0, 0, .6);
  --toast-bg: rgba(10, 12, 14, .94);
  --scroll-thumb: #3A424C;
  --scroll-thumb-hover: #4A535F;
}

body { font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--text-1); overflow: hidden;
  background: var(--bg-app); transition: background .25s, color .25s; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; outline: none; border: none; color: var(--text-1); }
a { color: var(--accent); }

/* ============ 登录页（左侧表单 / 右侧背景图） ============ */
.login-page { position: fixed; inset: 0; display: flex; background: var(--bg-app); }
.login-left { flex: 0.6; background: var(--bg-app); display: flex; align-items: center; justify-content: center;
  padding: 36px 36px; overflow-y: auto; }
.login-right { flex: 1.8; position: relative; overflow: hidden; }
.login-right::before { content: ''; position: absolute; inset: -14px;
  background: url('assets/login-bg.png') center/cover no-repeat;
  filter: blur(var(--login-blur, 8px)); }

/* ============ 登录页布局模式（管理后台可切换） ============ */
/* 左表单右背景（默认） */
.login-page[data-layout="split-right"] { flex-direction: row-reverse; }
.login-page[data-layout="center"] .login-left { position: absolute; inset: 0; z-index: 1; background: none; padding: 20px; }
.login-page[data-layout="center"] .login-right { position: absolute; inset: 0; z-index: 0; }
.login-page[data-layout="center"] .login-form-wrap { background: var(--bg-app); border-radius: 16px;
  padding: 36px 40px; box-shadow: 0 24px 64px rgba(0, 10, 30, .45); }
.login-form-wrap { width: 100%; max-width: 320px; }
.login-title { font-size: 24px; font-weight: 700; color: var(--text-1); margin-bottom: 20px; text-align: left; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.login-tabs .tab { flex: 1; padding: 10px 0; color: var(--text-2); font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; }
.login-tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.login-method-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.login-method-tabs .method-tab { font-size: 12.5px; color: var(--text-3); padding: 4px 12px; border-radius: 14px;
  border: 1px solid var(--border); cursor: pointer; background: var(--bg-input); }
.login-method-tabs .method-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(18, 183, 245, .08); }
.form-item { margin-bottom: 14px; }
.form-item input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px;
  font-size: 14px; background: var(--bg-input); transition: border-color .15s, box-shadow .15s; }
.form-item input::placeholder { color: var(--text-4); }
.form-item input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18, 183, 245, .15); background: var(--bg-app); }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-img { width: 110px; height: 42px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; flex-shrink: 0; object-fit: cover; }
.email-code-row { display: flex; gap: 10px; }
.email-code-row input { flex: 1; }
.email-code-row .btn { flex-shrink: 0; height: 42px; min-width: 96px; }
.btn { padding: 9px 18px; border-radius: 8px; font-size: 14px; background: var(--bg-btn); color: var(--text-1); transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.mini { padding: 4px 12px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; height: 42px; font-size: 15px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.login-links { margin-top: 12px; text-align: right; }
.login-links a { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; white-space: pre-line; }
.login-foot { margin-top: 14px; text-align: center; color: var(--text-4); font-size: 12px; }

/* ============ 主界面 ============ */
.main-page { position: fixed; inset: 0; display: flex; background: var(--bg-app); }
.side-nav { width: 64px; background: var(--nav-bg); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; }
.nav-avatar { width: 40px; height: 40px; border-radius: 10px; color: #fff; font-size: 18px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px; user-select: none; cursor: pointer;
  background-size: cover; background-position: center; }
.nav-avatar:hover { opacity: .85; }
.nav-btn { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #9BA1A8; transition: background .12s, color .12s; }
.nav-btn:hover { background: rgba(255, 255, 255, .08); color: #E8EAED; }
.nav-btn.active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-btn svg { width: 22px; height: 22px; }
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

.side-panel { width: 300px; border-right: 1px solid var(--border); background: var(--bg-panel); display: flex; flex-direction: column; }
.panel-search { padding: 10px 12px 6px; }
.panel-search input { width: 100%; height: 34px; border-radius: 17px; background: var(--bg-app); border: 1px solid var(--border); padding: 0 14px; font-size: 13px; transition: border-color .15s; }
.panel-search input::placeholder { color: var(--text-4); }
.panel-search input:focus { border-color: var(--accent); }
.panel-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 8px; }
.panel-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.toolbar-btns { display: flex; gap: 2px; }
.tool-btn { position: relative; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.tool-btn:hover { background: var(--bg-hover); }
.tool-btn svg { width: 18px; height: 18px; }
.tool-badge { position: absolute; top: 1px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.panel-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.panel-empty { text-align: center; color: var(--text-4); font-size: 13px; line-height: 1.9; margin-top: 60px; white-space: pre-line; }
.panel-group-title { font-size: 12px; color: var(--text-3); padding: 10px 10px 4px; }
.conv-item, .friend-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.conv-item:hover, .friend-item:hover { background: var(--bg-hover); }
.conv-item.active { background: var(--bg-active); }
.avatar { position: relative; width: 40px; height: 40px; border-radius: 10px; color: #fff; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; user-select: none;
  background-size: cover; background-position: center; }
.avatar.online::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--green); border: 2px solid var(--bg-app); }
.avatar.group-avatar { font-size: 14px; border-radius: 12px; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; }
.conv-name { font-size: 14px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11px; color: var(--text-4); flex-shrink: 0; margin-left: 6px; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; gap: 6px; }
.conv-last { font-size: 12px; color: var(--text-5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; flex-shrink: 0; }
.req-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* ============ 聊天区 ============ */
.chat-area { flex: 1; display: flex; flex-direction: column; background: var(--bg-chat); min-width: 0; position: relative; isolation: isolate; }
/* 聊天背景层：模糊只作用在背景，不影响消息内容（覆盖整个聊天区，含空状态） */
.chat-area::before {
  content: ''; position: absolute; inset: 0;
  background: var(--chat-bg, none);
  background-size: cover; background-position: center;
  filter: blur(var(--chat-blur, 0px));
  z-index: -1; pointer-events: none;
  transition: filter .2s;
}
.chat-area > * { position: relative; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-4); font-size: 14px; }
.chat-header { height: 60px; border-bottom: 1px solid var(--border); background: var(--bg-app); display: flex; align-items: center; padding: 0 18px; gap: 12px; flex-shrink: 0; }
.chat-peer-avatar { width: 40px; height: 40px; border-radius: 10px; color: #fff; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; user-select: none; background-size: cover; background-position: center; }
.chat-peer-info { flex: 1; min-width: 0; }
.chat-peer-name { font-size: 15px; font-weight: 600; color: var(--text-1); }
.chat-peer-status { font-size: 12px; color: var(--text-3); }
.chat-peer-status.online { color: var(--green); }
.chat-more-btn { color: var(--text-2); font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.chat-more-btn:hover { background: var(--bg-hover); }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 20px 16px; }
.msg-time { text-align: center; color: var(--text-4); font-size: 11px; margin: 12px 0 8px; }
.msg-row { display: flex; gap: 8px; margin: 6px 0; align-items: flex-start; }
.msg-row.own { flex-direction: row-reverse; }
.msg-row .avatar { width: 36px; height: 36px; font-size: 15px; border-radius: 9px; }
.msg-body { max-width: 62%; display: flex; flex-direction: column; }
.msg-row.own .msg-body { align-items: flex-end; }
.msg-name { font-size: 12px; color: var(--text-3); margin: 0 2px 3px; }
.bubble { padding: 9px 13px; border-radius: var(--bubble-radius-custom, 10px); font-size: 14px; line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.msg-row:not(.own) .bubble { background: var(--bubble-other); border: 1px solid var(--bubble-other-border); border-top-left-radius: 3px; }
.msg-row.own .bubble { background: var(--bubble-me-custom, var(--bubble-me)); border-top-right-radius: 3px;
  background-image: var(--bubble-img-custom, none); background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
  color: var(--bubble-text, inherit); }
.chat-input-area { border-top: 1px solid var(--border); padding: 10px 16px 14px; background: var(--bg-app); display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; flex-shrink: 0; }
#chat-input { flex: 1; height: 40px; max-height: 120px; resize: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; line-height: 1.4; transition: border-color .15s; background: var(--bg-input); }
#chat-input::placeholder { color: var(--text-4); }
#chat-input:focus { border-color: var(--accent); }
#chat-input:disabled { background: var(--bg-disabled); }
.input-tool-btn { width: 34px; height: 34px; border-radius: 8px; color: var(--text-5); flex-shrink: 0;
  background: transparent; border: none; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.input-tool-btn:hover { background: var(--bg-hover); color: var(--accent); }
.input-tool-btn svg { width: 18px; height: 18px; }
#btn-emoji { font-size: 18px; }

/* 消息内视频 */
.file-video { display: block; max-width: 300px; max-height: 240px; border-radius: 8px; margin-top: 4px; }

/* ============ 世界频道（聊天窗口式，可全屏） ============ */
.world-view { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--bg-chat); }
.world-view.fullscreen { position: fixed; inset: 0; z-index: 90; }
.world-header { height: 60px; border-bottom: 1px solid var(--border); background: var(--bg-app); display: flex; align-items: center; gap: 12px; padding: 0 18px; flex-shrink: 0; }
.world-header-title { font-size: 16px; font-weight: 600; color: var(--text-1); }
.world-header-sub { font-size: 12px; color: var(--text-4); }
.moment-list { flex: 1; overflow-y: auto; padding: 14px 18px; }
.world-input { border-top: 1px solid var(--border); padding: 10px 16px 14px; background: var(--bg-app); flex-shrink: 0; }
.world-input textarea { width: 100%; min-height: 44px; max-height: 120px; resize: vertical; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: var(--bg-input); color: var(--text-1); }
.world-input textarea:focus { border-color: var(--accent); }
.world-input-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.moment-img-preview { min-width: 72px; height: 72px; border-radius: 8px; background-size: cover; background-position: center;
  border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-3); padding: 4px; }
.moment-card { background: var(--bg-app); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.moment-head { display: flex; align-items: center; gap: 10px; }
.moment-head .avatar { width: 38px; height: 38px; font-size: 15px; }
.moment-info { flex: 1; min-width: 0; }
.moment-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.moment-time { font-size: 11px; color: var(--text-4); margin-top: 1px; }
.moment-content { font-size: 14px; line-height: 1.6; color: var(--text-1); margin: 10px 0 4px; white-space: pre-wrap; word-break: break-word; }
.moment-img { max-width: 100%; max-height: 320px; border-radius: 10px; margin-top: 8px; cursor: pointer; display: block; }
.moment-video { max-width: 100%; max-height: 320px; border-radius: 10px; margin-top: 8px; display: block; }
.moment-foot { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.moment-foot .btn.liked { color: var(--red); background: rgba(250, 81, 81, .1); }

/* 表情面板 */
.emoji-panel { position: absolute; bottom: 62px; left: 318px; width: 348px; max-height: 220px; overflow-y: auto;
  background: var(--bg-app); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .18);
  padding: 10px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; z-index: 50; }
.emoji-item { font-size: 20px; text-align: center; padding: 3px 0; border-radius: 6px; cursor: pointer; user-select: none; }
.emoji-item:hover { background: var(--bg-hover); }

/* 微信风格 "+" 面板 */
.plus-panel { position: absolute; bottom: 62px; left: 318px; width: 236px;
  background: var(--bg-app); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .18);
  padding: 14px 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; z-index: 50; }
.plus-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 6px 0; border-radius: 8px; }
.plus-item:hover { background: var(--bg-hover); }
.plus-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center; }
.plus-icon svg { width: 22px; height: 22px; color: var(--text-2); }
.plus-item:hover .plus-icon svg { color: var(--accent); }
.plus-item > span:last-child { font-size: 12px; color: var(--text-2); }
#btn-emoji svg { width: 20px; height: 20px; }
#btn-send { height: 40px; padding: 0 24px; border-radius: 10px; font-size: 14px; }

/* 文件消息卡片 */
.file-card { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px; padding: 8px 12px; min-width: 200px; max-width: 260px; }
html[data-theme="dark"] .file-card { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); }
.file-icon { font-size: 22px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.file-download { font-size: 12px; color: var(--accent); text-decoration: none; flex-shrink: 0; padding: 3px 8px; border-radius: 6px; }
.file-download:hover { background: rgba(18, 183, 245, .1); }
.file-img { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; cursor: pointer; }
.msg-row.own .file-card { background: rgba(255, 255, 255, .35); }
html[data-theme="dark"] .msg-row.own .file-card { background: rgba(255, 255, 255, .1); }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: var(--modal-mask); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.right { justify-content: flex-end; }
.modal-mask.right .modal { height: 100%; max-height: 100%; border-radius: 0; width: 430px; }
.modal { width: 420px; max-height: 78vh; overflow-y: auto; background: var(--bg-app); border-radius: 14px; padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--text-1); }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-input { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 14px; background: var(--bg-input); }
.modal-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-section { font-size: 13px; color: var(--text-2); margin: 14px 0 8px; font-weight: 600; }
.member-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.member-item, .invite-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.member-item:hover, .invite-item:hover { background: var(--bg-hover); }
.member-item .avatar, .invite-item .avatar { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.member-tag { color: var(--text-3); font-size: 11px; }
.invite-item { justify-content: space-between; }
.invite-item .btn { flex-shrink: 0; }
.modal-empty { color: var(--text-4); font-size: 13px; text-align: center; padding: 12px; }
.detail-avatar { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 12px; color: #fff; font-size: 28px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.detail-name { text-align: center; font-size: 17px; font-weight: 600; }
.detail-sub { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 4px; }

/* ============ 群头像 / 群聊码 / 群文件 ============ */
.group-detail-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 4px; }
.group-detail-avatar-wrap .detail-avatar { margin: 0; }
.group-code-box { display: flex; gap: 14px; align-items: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.group-qr { width: 150px; height: 150px; flex-shrink: 0; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.group-qr svg { width: 100%; height: 100%; display: block; }
.group-qr .modal-empty { padding: 8px; }
.group-code-info { flex: 1; min-width: 0; font-size: 13px; color: var(--text-1); display: flex; flex-direction: column; gap: 6px; }
.group-code-link { color: var(--text-3); font-size: 12px; word-break: break-all; line-height: 1.5; }
.group-code-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.group-files { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.gfile-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.gfile-item:hover { background: var(--bg-hover); }
.gfile-icon { font-size: 18px; flex-shrink: 0; width: 26px; text-align: center; }
.gfile-info { flex: 1; min-width: 0; }
.gfile-name { font-size: 13px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gfile-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.gfile-item .btn { flex-shrink: 0; }
.member-item { flex-wrap: wrap; }
.member-ops { display: flex; gap: 6px; margin-left: auto; }
.member-ops .btn { padding: 2px 8px; font-size: 11px; }
.btn.mini.danger { color: #E5484D; border-color: rgba(229, 72, 77, .4); }
.btn.mini.danger:hover { background: rgba(229, 72, 77, .12); }

/* ============ 扫码加入页(join.html) ============ */
.join-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fdfdfd 0%, #f8f8f8 100%); padding: 20px; }
.join-card { width: 100%; max-width: 400px; background: var(--bg-app); border-radius: 16px; padding: 28px; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); color: var(--text-1); text-align: center; }
.join-avatar { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 14px; color: #fff; font-size: 30px; font-weight: 600; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.join-name { font-size: 20px; font-weight: 700; }
.join-sub { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.join-code { margin-top: 10px; font-size: 14px; }
.join-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.join-actions .btn { width: 100%; }
.join-question { margin-top: 14px; }
.join-question input { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 14px; background: var(--bg-input); color: var(--text-1); }
.join-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); }
.join-login-hint { margin-top: 18px; font-size: 13px; color: var(--text-3); }

/* 右键菜单 */
.ctx-menu { position: fixed; z-index: 9999; min-width: 132px; padding: 5px;
  background: var(--bg-app); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .28); user-select: none; }
.ctx-item { padding: 7px 12px; font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--text-1); }
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.danger { color: #E5484D; }
.ctx-item.danger:hover { background: rgba(229, 72, 77, .12); }
.msg-row.recalled .bubble { opacity: .65; font-style: italic; }

/* ============ 设置弹窗 ============ */
/* 聊天背景设置 */

.settings-section:has(.bg-preview) { flex-direction: column; align-items: stretch; gap: 10px; }
.bg-preview { width: 100%; height: 110px; border-radius: 10px; border: 1px solid var(--border);
  background-color: var(--bg-input); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-4); font-size: 12px; text-align: center; padding: 0 12px; }
.bg-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.bg-swatch { width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.bg-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(18, 183, 245, .3); }
.bg-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.bg-blur-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bubble-section { flex-direction: column; align-items: stretch; gap: 10px; }
.bubble-preview { width: 100%; height: 92px; border-radius: 10px; border: 1px solid var(--border);
  background-color: var(--bg-input); display: flex; align-items: flex-end; justify-content: flex-start; padding: 10px; }
.bubble-demo { max-width: 62%; padding: 9px 13px; font-size: 13px; line-height: 1.5;
  border-radius: var(--bubble-radius-custom, 10px); border-top-right-radius: 3px;
  background: var(--bubble-me-custom, var(--bubble-me));
  background-image: var(--bubble-img-custom, none); background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
  color: var(--bubble-text, inherit); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.bubble-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.bubble-swatch { width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.bubble-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(18, 183, 245, .3); }
.bubble-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bubble-blur-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bg-blur-label { font-size: 12px; color: var(--text-3); flex: none; }
.bg-blur-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.bg-blur-val { font-size: 12px; color: var(--text-2); width: 36px; text-align: right; flex: none; }

/* 世界频道 scope tabs */
.world-scope-tabs { display: flex; gap: 4px; margin-left: 14px; }
.scope-tab { font-size: 12.5px; color: var(--text-3); padding: 3px 12px; border-radius: 12px;
  border: 1px solid var(--border); cursor: pointer; background: var(--bg-input); }
.scope-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(18, 183, 245, .08); }

/* 好友圈导航 active 高亮 */
#nav-moments-friends.active { background: var(--accent); color: #fff; }

.settings-section { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-section:last-of-type { border-bottom: none; }
.settings-label { flex: 1; font-size: 14px; }
.settings-label .sub { font-size: 12px; color: var(--text-4); margin-top: 2px; }
.settings-avatar { width: 56px; height: 56px; border-radius: 14px; background-size: cover; background-position: center;
  color: #fff; font-size: 22px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.theme-switch { position: relative; width: 52px; height: 28px; border-radius: 14px; background: var(--border); transition: background .2s; flex-shrink: 0; }
.theme-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.theme-switch.on { background: var(--accent); }
.theme-switch.on::after { left: 27px; }

/* ============ Toast ============ */
.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: var(--toast-bg); color: #fff;
  padding: 10px 20px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 70vw; }

/* ============ 消息引用 / 转发 ============ */
.quote-bar { flex: 0 0 100%; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-hover); border-left: 3px solid var(--accent); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; color: var(--text-2); }
.quote-bar-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.quote-bar-text b { color: var(--accent); }
.msg-quote { border-left: 3px solid var(--accent); background: rgba(0, 0, 0, .05); border-radius: 6px;
  padding: 5px 9px; margin-bottom: 6px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); cursor: pointer;
  white-space: pre-wrap; word-break: break-word; }
.msg-quote b { color: var(--accent); font-weight: 600; }
html[data-theme="dark"] .msg-quote { background: rgba(255, 255, 255, .07); }
.msg-row.own .msg-quote { background: rgba(255, 255, 255, .35); }
html[data-theme="dark"] .msg-row.own .msg-quote { background: rgba(255, 255, 255, .12); }
.msg-flash .bubble { animation: msg-flash 1.2s ease; }
@keyframes msg-flash { 0%, 100% { box-shadow: none; } 35% { box-shadow: 0 0 0 3px rgba(18, 183, 245, .55); } }
.fwd-list { max-height: 320px; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.fwd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.fwd-item:hover { background: var(--bg-hover); }
.fwd-item .avatar { width: 34px; height: 34px; font-size: 14px; border-radius: 9px; }
.fwd-item-info { min-width: 0; }
.fwd-item-name { font-size: 14px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-item-sub { font-size: 12px; color: var(--text-3); }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-track { background: transparent; }
