:root {
  --bg: #0d0f16;
  --panel: #141821;
  --panel-2: #1a1f2c;
  --panel-glass: rgba(22, 27, 40, 0.6);
  --border: #232a3a;
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #eef1f8;
  --muted: #949db3;
  --accent: #7c6cff;
  --accent-2: #9aa3ff;
  --accent-glow: rgba(124, 108, 255, 0.45);
  --green: #2fd08d;
  --danger: #ff5c7a;
  --radius: 14px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.35);
}

/* 亮色主题 */
:root[data-theme="light"] {
  --bg: #f2f3f9;
  --panel: #ffffff;
  --panel-2: #eef0f8;
  --panel-glass: rgba(255, 255, 255, 0.72);
  --border: #e2e5f0;
  --border-soft: rgba(15, 20, 40, 0.05);
  --text: #171b29;
  --muted: #6b7387;
  --accent: #5b5bd6;
  --accent-2: #6c77ff;
  --accent-glow: rgba(91, 91, 214, 0.35);
  --green: #16a34a;
  --danger: #e04063;
  --shadow-lg: 0 20px 60px rgba(30, 35, 70, 0.22);
  --shadow-md: 0 12px 34px rgba(30, 35, 70, 0.16);
}
:root[data-theme="light"] .msg-loading { color: var(--muted); }
:root[data-theme="light"] .lv { background: #ececf5; color: var(--muted); }
:root[data-theme="light"] .ann-form .ann-input { background: var(--panel-2); }
:root[data-theme="light"] .modal-mask { background: rgba(20,22,35,.4); }

/* 强制 hidden 生效：防止显式 display(flex 等) 覆盖 hidden 属性 */
[hidden] { display: none !important; }

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

html, body { height: 100%; }

body {
  font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
/* 星河背景 canvas 放在最底层 */
#starfield { z-index: 0; }
.topbar, .layout, .toast, .profile-card, .panel, .modal-mask { position: relative; z-index: 1; }

/* ---------- 顶部导航 ---------- */
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--panel-glass);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #fff;
  box-shadow: 0 6px 18px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 700; font-size: 16px;
  background: linear-gradient(90deg, var(--text), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: .2px;
}
.brand-sub { font-size: 12px; color: var(--muted); }

.topnav { display: flex; align-items: center; gap: 10px; }

.nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border);
  text-decoration: none; cursor: pointer;
  transition: all .15s;
}
.nav-btn:hover { border-color: var(--accent); background: #22263a; }
.nav-btn.nav-enter {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #fff;
  box-shadow: 0 4px 14px rgba(108,107,255,.35);
}
.nav-btn.nav-enter:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.userbox { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3a3f63, #2c3150);
  display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff;
  border: 2px solid var(--accent);
}
.user-name { font-size: 13.5px; color: var(--text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border-soft); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: all .18s;
}
.icon-btn .ic { display: block; }
.icon-btn:hover { color: var(--accent-2); border-color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 12px var(--accent-glow); }

/* ---------- 布局 ---------- */
.layout { height: calc(100vh - 60px); position: relative; }

/* ---------- 认证 ---------- */
.auth-screen {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--panel-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-title {
  font-size: 23px; font-weight: 700; margin-bottom: 6px;
  background: linear-gradient(90deg, var(--text), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

.tabs { display: flex; background: var(--panel-2); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.tab { flex: 1; padding: 9px; border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; border-radius: 9px; transition: all .2s; }
.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 4px 14px var(--accent-glow);
}

.auth-form .field { display: block; margin-bottom: 15px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 10px;
  color: var(--text); font-size: 14px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.form-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-bottom: 8px; }
.btn-primary {
  width: 100%; padding: 12px; border: none; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 18px var(--accent-glow); transition: all .2s;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 22px var(--accent-glow); }
.btn-secondary {
  padding: 9px 14px; flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--accent); background: transparent; color: var(--accent-2);
  border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 600; transition: all .18s;
}
.btn-secondary:hover { background: var(--accent-glow); box-shadow: 0 0 10px var(--accent-glow); }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; min-width: 0; letter-spacing: 2px; font-size: 15px; }
.form-hint { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.form-hint a, .inline-link { color: var(--accent-2); text-decoration: none; }
.form-hint a:hover, .inline-link:hover { text-decoration: underline; }
.auth-enter { margin-top: 20px; text-align: center; border-top: 1px solid var(--border); padding-top: 16px; }

/* ---------- 聊天界面 ---------- */
.chat-screen { position: absolute; inset: 0; display: flex; }

.sidebar {
  width: 230px; background: var(--panel-glass);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border-right: 1px solid var(--border-soft);
  padding: 16px 12px; overflow-y: auto; flex-shrink: 0;
}
.sidebar-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 4px 6px 8px; }
.sidebar-head2 { margin-top: 20px; }
.room-list, .member-list { list-style: none; }
.room-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px; margin-bottom: 2px; transition: all .12s;
}
.room-item:hover { background: var(--panel-2); }
.room-item.active { background: var(--accent); color: #fff; }
.room-icon { opacity: .5; font-weight: 700; }
.room-item.active .room-icon { opacity: .9; }

.member-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font-size: 13px; color: var(--muted); border-radius: 8px;
}
.member-list .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* 主聊天 */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--border-soft); background: var(--panel-glass);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
.chat-room { font-weight: 700; font-size: 15px; }
.chat-online { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chat-online .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.messages { flex: 1; overflow-y: auto; padding: 20px 18px 10px; }
.msg-loading { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

.msg { display: flex; gap: 10px; margin-bottom: 16px; }
.bubble { max-width: 75%; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { text-align: right; }
.meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.who { font-weight: 600; font-size: 13px; }
.msg.mine .who { color: var(--accent-2); }
.time { font-size: 11px; color: var(--muted); }
.text {
  display: inline-block; background: var(--panel-2); border: 1px solid var(--border);
  padding: 9px 13px; border-radius: 12px; font-size: 14px; line-height: 1.55;
  word-break: break-word; white-space: pre-wrap; text-align: left;
}
.msg.mine .text { background: var(--accent); border-color: var(--accent); color: #fff; }

.composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 14px 18px 18px; border-top: 1px solid var(--border-soft); background: var(--panel-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.composer textarea {
  flex: 1; resize: none; max-height: 140px;
  padding: 11px 14px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 11px; color: var(--text); font-size: 14px; line-height: 1.5;
  outline: none; font-family: inherit; transition: border-color .15s;
}
.composer textarea:focus { border-color: var(--accent); }
.btn-send {
  width: 44px; height: 44px; border: none; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: grid; place-items: center; cursor: pointer; transition: all .15s;
  box-shadow: 0 4px 14px rgba(108,107,255,.35);
}
.btn-send:hover { filter: brightness(1.08); }

/* ---------- Toast ---------- */
/* ---------- 官方徽章 ---------- */
.official-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffb347, #ff6b6b);
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
  user-select: none;
}
.official-badge.big { min-width: 24px; height: 24px; font-size: 13px; border-radius: 7px; }
.official-badge.tiny { min-width: 14px; height: 14px; font-size: 9px; padding: 0 2px; }

/* ---------- 留言等级 ---------- */
.lv {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  background: #2a2e3d;
  color: var(--muted);
  vertical-align: middle;
  margin-left: 4px;
}

/* ---------- 点赞栏 ---------- */
.like-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .18s;
}
.like-btn .ic { display: block; }
.like-btn:hover { color: var(--accent-2); border-color: var(--accent); transform: scale(1.08); }
.like-btn:hover .ic { fill: var(--accent-2); }
.likes-count { font-size: 11.5px; color: var(--muted); }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; }
.mini-btn .ic { display: block; }
.mini-btn.fav-btn:hover { color: #f4b942; border-color: #f4b942; }
.fav-btn.fav-on { color: #f4b942; }
.fav-btn.fav-on .ic { fill: #f4b942; }

/* ---------- 公告区 ---------- */
.announcement-box {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
}
.ann-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.ann-tag::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,107,255,.25);
}
.announcement-list { list-style: none; }
.announcement-list li {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.ann-title { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.ann-content { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 4px; word-break: break-word; }
.ann-meta { font-size: 11px; color: var(--muted); }

.ann-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ann-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; outline: none; font-family: inherit;
}
.ann-input:focus { border-color: var(--accent); }
textarea.ann-input { resize: none; }
.ann-submit {
  align-self: flex-start;
  padding: 8px 18px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
}
.ann-submit:hover { filter: brightness(1.08); }

/* ---------- 资料卡（弹层） ---------- */
.profile-card {
  position: fixed; z-index: 200;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 280px;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  background: var(--panel-glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.pc-head { display: flex; justify-content: center; }
.pc-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 700; font-size: 26px; color: #fff;
}
.pc-name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.pc-official { font-size: 12px; color: #ffb347; font-weight: 600; }
.pc-level { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.btn-close {
  padding: 8px 22px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel-2); color: var(--muted);
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn-close:hover { border-color: var(--accent); color: var(--text); }
.pc-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ---------- 通用头像（emoji + 色块） ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 15px;
  color: #fff;
}
.msg-avatar { width: 36px; height: 36px; font-size: 17px; }
.mem-avatar { width: 26px; height: 26px; font-size: 13px; }
.pc-avatar.avatar { width: 60px; height: 60px; font-size: 28px; }

/* ---------- 搜索框 ---------- */
.sidebar-search { padding: 0 4px 10px; }
.sidebar-search input {
  width: 100%;
  padding: 8px 11px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 12.5px; outline: none;
}
.sidebar-search input:focus { border-color: var(--accent); }

/* ---------- 用量条 ---------- */
.usage-box { margin-top: 16px; padding: 0 4px; }
.usage-track {
  height: 8px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--border);
  overflow: hidden;
}
.usage-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--accent));
  border-radius: 5px;
  transition: width .6s ease;
}
.usage-text { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- 消息内的迷你按钮/举报 ---------- */
.mini-btn {
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 12px; padding: 2px 6px; border-radius: 5px;
}
.mini-btn:hover { color: var(--danger); }
.meta .report { margin-left: auto; font-size: 13px; }
.meta .del { color: var(--muted); opacity: .6; font-size: 13px; transition: all .15s; }
.meta .del:hover { color: var(--danger); opacity: 1; background: rgba(255, 92, 122, .12); }

/* ---------- 表情回应 ---------- */
.react-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.react-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 22px; padding: 0 8px;
  font-size: 12px; border-radius: 11px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); transition: all .15s;
}
.react-btn:hover { border-color: var(--accent); }
.react-btn.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent-2); }
.react-add {
  width: 22px; height: 22px; border-radius: 11px; cursor: pointer;
  background: transparent; border: 1px dashed var(--border); color: var(--muted);
  font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.react-add:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---------- 置顶 ---------- */
.pin-tag {
  margin-left: 6px; font-size: 10px; font-weight: 700; color: #f4b942;
  background: rgba(244, 185, 66, .14); border: 1px solid rgba(244, 185, 66, .4);
  padding: 1px 7px; border-radius: 9px; vertical-align: 1px; letter-spacing: .5px;
}
.mini-btn.pin { color: var(--muted); }
.mini-btn.pin.active { color: #f4b942; background: rgba(244, 185, 66, .12); }
.msg.pinned .bubble { border-color: rgba(244, 185, 66, .45); box-shadow: 0 0 0 1px rgba(244,185,66,.12); }

/* ---------- 消息内联编辑 ---------- */
.edit-box { margin-top: 6px; }
.edit-box textarea {
  width: 100%; min-height: 60px; resize: vertical;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit; outline: none;
}
.edit-actions { display: flex; gap: 8px; margin-top: 6px; justify-content: flex-end; }
.edit-save, .edit-cancel {
  border: none; cursor: pointer; border-radius: 8px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 600;
}
.edit-save { background: var(--accent); color: #fff; }
.edit-save:hover { filter: brightness(1.08); }
.edit-cancel { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- 活跃榜单 ---------- */
.rank-panel { width: 340px; }
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 380px; }
.rank-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); transition: all .15s;
}
.rank-item:hover { border-color: var(--accent); }
.rank-item.me { border-color: var(--accent); background: var(--accent-glow); }
.rank-no { width: 30px; text-align: center; font-weight: 800; font-size: 14px; color: var(--accent-2); flex-shrink: 0; }
.rank-avatar { flex-shrink: 0; }
.rank-name { flex: 1; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { font-size: 12px; color: var(--muted); flex-shrink: 0; }

/* ---------- 我的收藏 ---------- */
.fav-panel { width: 360px; }
.fav-list { list-style: none; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 360px; }
.fav-item {
  position: relative; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); transition: all .15s;
}
.fav-item:hover { border-color: var(--accent); }
.fav-item .mini-btn.del { position: absolute; top: 8px; right: 8px; opacity: .55; }
.fav-item .mini-btn.del:hover { opacity: 1; }
.fav-room { font-size: 10.5px; font-weight: 700; color: var(--accent-2); letter-spacing: .4px; }
.fav-text { font-size: 13.5px; margin: 4px 0; word-break: break-word; line-height: 1.45; }
.fav-meta { font-size: 11px; color: var(--muted); }

/* ---------- 本周热帖 ---------- */
.hot-posts { margin: 4px 18px 12px; }
.hot-title { font-size: 12.5px; font-weight: 700; color: var(--accent-2); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.hot-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 22px; cursor: pointer;
  background: var(--panel-glass); border: 1px solid var(--border);
  color: var(--text); font-size: 12.5px; transition: all .15s;
}
.hot-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.hot-rank { flex-shrink: 0; }
.hot-author { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-likes { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }

/* ---------- 面板（私信/设置/举报管理） ---------- */
.panel {
  position: fixed; z-index: 150;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 360px; max-width: 92vw;
  background: var(--panel-glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 15px; margin-bottom: 12px;
}
.panel-head > span { display: inline-flex; align-items: center; gap: 8px; }
.panel-head > span .ic { color: var(--accent-2); display: block; }
.dm-list { height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dm-item { max-width: 80%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.dm-item.mine { align-self: flex-end; background: var(--accent); border-color: var(--accent); color: #fff; }
.dm-content { font-size: 13.5px; word-break: break-word; }
.dm-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.dm-item.mine .dm-time { color: rgba(255,255,255,.8); }
.dm-form { display: flex; gap: 8px; }
.dm-form input {
  flex: 1; padding: 9px 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; outline: none;
}
.dm-form input:focus { border-color: var(--accent); }

/* ---------- 设置：头像网格 ---------- */
.settings-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-opt {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.avatar-opt:hover { transform: scale(1.06); }
.avatar-opt.sel { border-color: #fff; box-shadow: 0 0 0 3px var(--accent); }

/* ---------- 举报弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: 380px; max-width: 92vw;
  background: var(--panel-glass);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
}
.modal-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ---------- 举报管理（官方） ---------- */
.admin-report-list { list-style: none; max-height: 300px; overflow-y: auto; }
.admin-report-list li {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.rep-meta { font-size: 12.5px; word-break: break-word; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: #2a2e3d; color: var(--text); padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; border: 1px solid var(--border); z-index: 100;
  opacity: 0; transition: all .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .sidebar { width: 72px; padding: 12px 8px; }
  .room-item { justify-content: center; font-size: 0; }
  .room-item .room-icon { font-size: 16px; }
  .sidebar-head { text-align: center; }
  .member-list { display: none; }
  .brand-sub { display: none; }
  .topbar { padding: 0 14px; }
  .nav-btn { padding: 7px 10px; }
  .bubble { max-width: 85%; }
}

/* ============ 顶部 Tab（聊天 / 动态 / 成员） ============ */
.chat-screen { flex-direction: column; }
.main-tabs {
  display: flex; gap: 6px; flex-shrink: 0;
  padding: 10px 16px;
  background: var(--panel-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.main-tab {
  padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--border-soft); background: var(--panel-2);
  color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s;
}
.main-tab .ic { display: block; }
.main-tab:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.main-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent; box-shadow: 0 4px 14px var(--accent-glow);
}
.chat-view { flex: 1; display: flex; min-height: 0; }
.social-view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 18px 22px; overflow-y: auto; }
.members-view { flex: 1; overflow-y: auto; padding: 18px 22px; }

/* ============ 动态墙 ============ */
.social-head { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.social-head h2 { font-size: 18px; display: inline-flex; align-items: center; gap: 8px; }
.social-head h2 .ic { color: var(--accent-2); }
#postForm { display: flex; flex-direction: column; gap: 8px; }
#postInput { width: 100%; min-height: 60px; resize: none; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 14px; outline: none; font-family: inherit; }
#postInput:focus { border-color: var(--accent); }
.post-feed { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }

.post-card {
  background: var(--panel-glass);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border: 1px solid var(--border-soft); border-radius: 16px; padding: 14px 16px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: var(--shadow-md); }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-avatar { width: 38px; height: 38px; font-size: 18px; }
.post-who { display: flex; flex-direction: column; }
.post-author { font-weight: 600; font-size: 13.5px; cursor: pointer; }
.post-author:hover { color: var(--accent-2); }
.post-time { font-size: 11px; color: var(--muted); }
.post-body { margin: 10px 0 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.post-ops { display: flex; gap: 6px; margin-top: 12px; }
.post-btn {
  padding: 6px 13px; border-radius: 16px; border: 1px solid var(--border-soft);
  background: var(--panel-2); color: var(--muted); font-size: 12.5px; cursor: pointer; transition: all .18s;
  display: inline-flex; align-items: center; gap: 5px;
}
.post-btn .ic { display: block; }
.post-btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.post-btn.liked { background: rgba(255,92,122,.15); color: var(--danger); border-color: transparent; }
.post-btn.liked .ic { fill: currentColor; }
.post-btn .ic-like { fill: currentColor; }
.post-btn .ic-star { fill: #f4b942; }
.post-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.post-comments { margin-top: 12px; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.pcomment { font-size: 13px; color: var(--text); line-height: 1.5; word-break: break-word; }
.pc-time { color: var(--muted); font-size: 10.5px; }
.pcomment-form { display: flex; gap: 8px; margin-top: 10px; }
.pcomment-input { flex: 1; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 13px; outline: none; }
.pcomment-input:focus { border-color: var(--accent); }

/* @提及 与 链接 */
.mention { color: var(--accent-2); font-weight: 600; cursor: pointer; border-radius: 4px; padding: 0 2px; }
.mention-plain { color: var(--muted); }
.mini-btn.fav-btn:hover { color: #f4b942; }
.fav-btn.fav-on { color: #f4b942; }

/* ============ 成员页 ============ */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.member-card {
  background: var(--panel-glass);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; transition: all .18s;
}
.member-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.mc-avatar { width: 46px; height: 46px; font-size: 22px; }
.mc-name { font-weight: 600; font-size: 14px; }
.mc-lv { font-size: 11.5px; color: var(--accent-2); }
.mc-bio { font-size: 12px; color: var(--muted); word-break: break-word; max-width: 100%; }

/* ============ 通知中心 ============ */
.notif-panel { width: 380px; max-height: 460px; }
.notif-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mini-pill { padding: 4px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); font-size: 12px; cursor: pointer; }
.mini-pill.active { background: var(--accent); color: #fff; border-color: transparent; }
.notif-list { list-style: none; max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 0; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; }
.notif-item.unread { border-left: 3px solid var(--accent); background: rgba(108,107,255,.06); }
.nt-avatar { width: 30px; height: 30px; font-size: 14px; }
.nt-body { flex: 1; }
.nt-text { font-size: 13px; line-height: 1.5; word-break: break-word; }
.nt-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.notif-item .mini-btn { margin-left: auto; align-self: center; }
#btnNotif.has-badge { position: relative; color: var(--accent-2); }
#btnNotif.has-badge::after { content: ''; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--panel); }

/* ============ 关注 / 粉丝面板 ============ */
.follow-panel { width: 320px; max-height: 440px; }
.follow-list { list-style: none; max-height: 340px; overflow-y: auto; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.follow-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.follow-list li:hover { border-color: var(--accent); }

/* ============ 资料卡社交区 ============ */
.pc-social { width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.pc-stats { display: flex; justify-content: center; gap: 8px; }
.linkish { background: none; border: none; color: var(--accent-2); font-size: 12.5px; cursor: pointer; padding: 0; }
.linkish:hover { text-decoration: underline; }
.pc-social-ops { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.btn-close.following { border-color: var(--green); color: var(--green); }
.btn-close { display: inline-flex; align-items: center; gap: 6px; }
.btn-close .ic { display: block; }
/* ============ 移动端响应式 ============ */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0; width: 240px;
    z-index: 90; transform: translateX(-100%); transition: transform .24s ease;
    background: var(--panel-glass); backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-right: 1px solid var(--border-soft); box-shadow: 12px 0 40px rgba(0,0,0,.35);
  }
  body.side-open .sidebar { transform: translateX(0); }
  .nav-toggle { display: grid !important; }
  .side-mask { position: fixed; inset: 60px 0 0 0; z-index: 85; background: rgba(0,0,0,.5); }
  .chat-view { display: block; }
  .chat-main { width: 100%; }
  .topbar { padding: 0 12px; height: 56px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 15px; }
  .chat-screen .main-tabs { overflow-x: auto; padding: 8px 10px; }
  .chat-screen .main-tab { flex-shrink: 0; }

  /* 弹窗/面板移动端全屏化 */
  .panel { width: 100%; max-width: none; top: 12px; left: 0; right: 0; bottom: 12px; margin: 0 6px; border-radius: 16px; transform: none; }
  .modal-mask { padding: 12px; }
  .modal { width: 100%; max-width: none; }
  .profile-card { width: 86vw; }

  .composer textarea { font-size: 15px; }
  .messages { padding: 12px 10px; }
  .msg-avatar { width: 30px; height: 30px; font-size: 14px; }

  .announcement-box { margin: 8px; }
  .usage-box { display: none; }
}
@media (max-width: 460px) {
  .topbar .nav-btn { font-size: 12.5px; padding: 6px 10px; }
  .topbar .nav-enter { display: none; }
  #btnTheme, #btnSettings, #btnDm, #btnNotif { width: 30px; height: 30px; }
  .chat-room { font-size: 14px; }
  .chat-online { font-size: 11.5px; }
  .auth-card { padding: 26px 18px; }
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}
