/* 易聊 · 深色三栏布局，移动端抽屉式侧栏。无外部字体/图片，国内加载快 */
:root {
  --bg: #313338;
  --bg-2: #2b2d31;
  --bg-3: #1e1f22;
  --bg-hover: #3f4248;
  --line: #26282c;
  --text: #dbdee1;
  --muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --ok: #23a55a;
  --danger: #da373c;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ================= 登录 ================= */
.login-wrap {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #3b3f6b 0%, #1e1f22 60%);
  overflow-y: auto;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-2);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: grid; place-items: center;
  margin: 0 auto 12px;
}
.login-card h1 { margin: 0; text-align: center; font-size: 22px; }
.login-card .sub { margin: 6px 0 18px; text-align: center; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; background: var(--bg-3); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--muted); }
.tab.active { background: var(--bg-hover); color: var(--text); font-weight: 600; }
#loginForm label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
#loginForm input {
  width: 100%;
  margin-top: 5px;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid #1a1b1e;
  background: var(--bg-3);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
#loginForm input:focus { border-color: var(--accent); }
.primary {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  margin-top: 4px;
}
.primary:hover { background: var(--accent-hover); }
.primary:disabled { opacity: .6; cursor: default; }
.err { color: #f66151; font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.tiny { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* ================= 主体布局 ================= */
.app { height: 100%; display: flex; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 10px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.brand-name { font-size: 16px; }
.me-badge { font-size: 11px; color: var(--muted); margin-left: auto; }
.brand-btn {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--text);
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 4px 6px; border-radius: 6px; max-width: 100%;
}
.brand-btn:hover { background: var(--bg-hover); }
.brand-btn .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-btn .chev { color: var(--muted); font-size: 12px; }

/* 侧栏分组（分类） */
.cat-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 4px 6px;
  font-size: 11px; letter-spacing: .04em; color: var(--muted);
  text-transform: uppercase; cursor: pointer; border-radius: 5px;
  user-select: none;
}
.cat-row:hover { color: var(--text); background: var(--bg-hover); }
.cat-arrow { width: 12px; flex: 0 0 auto; font-size: 11px; opacity: .9; }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { font-size: 10px; opacity: .6; }
.cat-tools { margin-left: auto; display: none; }
.cat-row:hover .cat-tools { display: inline-flex; }
.cat-add { padding: 0 5px; line-height: 16px; font-size: 12px; }

.chan-tools {
  display: flex; gap: 6px; padding: 10px 6px 0;
}
.chan-tools .mini { flex: 1; font-size: 12px; padding: 5px 6px; }
.chan-item .cicon.emoji { font-size: 14px; opacity: 1; line-height: 1; width: 16px; text-align: center; }

.chan-scroll { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.section-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 6px 4px;
  font-size: 11px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase;
}
.chan-list { display: flex; flex-direction: column; gap: 2px; }
.chan-item {
  display: flex; align-items: center; gap: 7px;
  border: 0; background: transparent; text-align: left;
  padding: 8px 9px; border-radius: 6px; color: var(--muted);
  font-size: 14px; width: 100%;
  overflow: hidden;
}
.chan-item:hover { background: var(--bg-hover); color: var(--text); }
.chan-item.active { background: var(--bg-hover); color: #fff; font-weight: 600; }
.chan-item .hash { opacity: .7; flex: 0 0 auto; }
.chan-item .cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-item .unread {
  margin-left: auto; flex: 0 0 auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}
.chan-del {
  margin-left: auto; border: 0; background: transparent; color: var(--muted);
  font-size: 15px; padding: 0 3px; border-radius: 4px; display: none;
}
.chan-item:hover .chan-del { display: inline-block; }
.chan-del:hover { color: var(--danger); }

.side-foot { padding: 10px; border-top: 1px solid var(--line); }
.me-name { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-all; }

/* 左下角：点开个人设置 */
.me-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 7px; border-radius: 8px; cursor: pointer; margin-bottom: 8px;
}
.me-btn:hover { background: var(--bg-hover); }
.me-avatar { flex: 0 0 32px; width: 32px; height: 32px; margin: 0; font-size: 13px; }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-hint { font-size: 11px; color: var(--muted); }
.me-gear { color: var(--muted); font-size: 13px; }

/* 个人设置里的头像 */
.avatar-row { align-items: center; gap: 16px; }
.avatar.big { flex: 0 0 72px; width: 72px; height: 72px; font-size: 26px; margin: 0; }
.avatar-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mini {
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.mini:hover { color: var(--text); background: var(--bg-hover); }
.mini.wide { display: block; width: 100%; padding: 8px; }

/* ================= 聊天区 ================= */
.chat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}
.chat-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2);
  z-index: 5;
}
.chat-head h1 { margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-sub { color: var(--muted); font-size: 12px; }

.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px 8px;
  scroll-behavior: auto;
}
.messages::-webkit-scrollbar, .chan-scroll::-webkit-scrollbar, .modal-list::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb, .chan-scroll::-webkit-scrollbar-thumb, .modal-list::-webkit-scrollbar-thumb {
  background: #1a1b1e; border-radius: 4px;
}

.empty { color: var(--muted); text-align: center; margin-top: 12vh; font-size: 14px; }

.day-sep {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px; margin: 18px 0 10px;
}
.day-sep::before, .day-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.msg { display: flex; gap: 12px; padding: 3px 6px; border-radius: 6px; position: relative; margin-top: 10px; }
.msg:hover { background: rgba(0, 0, 0, .06); }
.msg.cont { margin-top: 0; padding-top: 1px; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg.cont .head { display: none; }

.avatar {
  flex: 0 0 38px;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 15px;
  user-select: none;
  margin-top: 2px;
}
.avatar.bot { background: #5865f2; }
.msg-body { flex: 1; min-width: 0; }
.head { display: flex; align-items: baseline; gap: 8px; }
.name { font-weight: 600; font-size: 14px; color: #f2f3f5; }
.name.me { color: #a5b4ff; }
.time { font-size: 11px; color: var(--muted); }
.tag { font-size: 10px; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 4px; }
.text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14.5px; }
.text a { color: #00a8fc; text-decoration: none; }
.text a:hover { text-decoration: underline; }
/* 链接统一高亮（正文、卡片描述、卡片标题都算） */
.md-link { color: #00a8fc; text-decoration: none; border-bottom: 1px solid rgba(0, 168, 252, .35); }
.md-link:hover { text-decoration: none; border-bottom-color: #00a8fc; color: #4fc3ff; }
.embed .md-link { color: #4fc3ff; }
.mention {
  background: rgba(88, 101, 242, .25); color: #c9cdfb;
  border-radius: 4px; padding: 0 3px;
}
.mention.user { background: rgba(88, 101, 242, .28); }
.mention.role {
  background: rgba(88, 101, 242, .18);
  border: 1px solid rgba(88, 101, 242, .45);
}
.mention.special {
  background: rgba(250, 166, 26, .18);
  color: #f8d477;
  border: 1px solid rgba(250, 166, 26, .4);
}

/* 被 @ 到的消息，左侧一条高亮条 + 淡色底，扫一眼就能找到 */
.msg.mentioned {
  background: rgba(88, 101, 242, .08);
  box-shadow: inset 2px 0 0 var(--accent);
}
.msg.mentioned:hover { background: rgba(88, 101, 242, .12); }

/* 右键 / 长按菜单 */
.ctx-menu {
  position: fixed;
  z-index: 70;
  min-width: 188px;
  max-width: 280px;
  padding: 5px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
}
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 7px 9px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer;
}
.ctx-item:hover { background: rgba(88, 101, 242, .35); }
.ctx-item.danger { color: #f87171; }
.ctx-item.danger:hover { background: rgba(237, 66, 69, .22); }
.ctx-item[disabled] { opacity: .45; cursor: default; }
.ctx-item[disabled]:hover { background: transparent; }
.ctx-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* @ 提及候选框 */
.mention-box {
  position: absolute;
  left: 60px; right: 90px;
  bottom: calc(100% - 6px);
  max-height: 264px; overflow-y: auto;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 6px;
  z-index: 30;
}
.mention-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 6px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text);
  font-size: 14px; cursor: pointer;
}
.mention-item.on { background: rgba(88, 101, 242, .35); }
.mention-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.mention-label { font-weight: 600; }
.mention-desc { margin-left: auto; color: var(--muted); font-size: 12px; }
.msg-img {
  max-width: min(420px, 100%);
  max-height: 320px;
  border-radius: 8px;
  margin-top: 6px;
  display: block;
  cursor: pointer;
  background: var(--bg-3);
}
.msg-file {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 8px 10px;
  background: var(--bg-3); border-radius: 8px;
  color: #00a8fc; text-decoration: none; font-size: 13px;
}
.del-msg {
  position: absolute; top: 4px; right: 6px;
  border: 0; background: var(--bg-3); color: var(--muted);
  border-radius: 5px; padding: 0 6px; font-size: 13px; display: none;
}
.msg:hover .del-msg { display: block; }
.del-msg:hover { color: var(--danger); }

/* ================= Discord 风格 embed 卡片 ================= */
.embed {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 6px;
  padding: 10px 12px 10px 14px;
  max-width: 560px;
  background: var(--bg-2);
  border-left: 4px solid #4f545c;
  border-radius: 6px;
}
.embed-main { flex: 1; min-width: 0; }
.embed-author { font-size: 12.5px; color: #fff; font-weight: 600; margin-bottom: 4px; }
.embed-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.embed-title a { color: #00a8fc; text-decoration: none; }
.embed-title a:hover { text-decoration: underline; }
.embed-desc {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  margin-top: 2px;
}
.embed-desc a, .embed-field-value a { color: #00a8fc; text-decoration: none; }
.embed-desc a:hover, .embed-field-value a:hover { text-decoration: underline; }
.embed-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.embed-field { flex: 1 1 100%; min-width: 0; }
.embed-field.inline { flex: 0 1 auto; min-width: 32%; }
.embed-field-name { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.embed-field-value { font-size: 13.5px; color: var(--text); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.embed-footer { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.embed-thumb {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg-3);
  cursor: pointer;
}
.embed-image {
  max-width: min(420px, 100%);
  max-height: 300px;
  border-radius: 6px;
  margin-top: 8px;
  display: block;
  cursor: pointer;
}
.md-code {
  background: var(--bg-3);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12.5px;
}
.md-time {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
  font-variant-numeric: tabular-nums;
}
.md-pre {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 6px 0;
  overflow-x: auto;
  font-size: 12.5px;
  white-space: pre;
}
.md-pre code { font-family: ui-monospace, Consolas, "Courier New", monospace; }

/* ================= 输入框 ================= */
.typing { height: 18px; padding: 0 20px; font-size: 12px; color: var(--muted); }

.composer {
  position: relative;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composer textarea {
  flex: 1;
  resize: none;
  max-height: 160px;
  min-height: 42px;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid #1a1b1e;
  background: var(--bg-3);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  line-height: 1.4;
}
.composer textarea:focus { border-color: var(--accent); }
.icon-btn, .send-btn {
  border: 0; border-radius: var(--radius);
  height: 42px; padding: 0 14px;
  background: var(--bg-3); color: var(--muted);
}
.icon-btn:hover { color: var(--text); }
.send-btn { background: var(--accent); color: #fff; font-weight: 600; }
.send-btn:hover { background: var(--accent-hover); }

/* ================= 弹窗 / 遮罩 ================= */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 40;
}
.modal {
  position: fixed; z-index: 50;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(380px, calc(100vw - 32px));
  background: var(--bg-2);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.modal h2 { margin: 0 0 12px; font-size: 15px; }
.modal input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid #1a1b1e; background: var(--bg-3); color: var(--text); outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-list { max-height: 260px; overflow-y: auto; margin: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.pick {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--text);
  text-align: left; padding: 8px; border-radius: 8px;
}
.pick:hover { background: var(--bg-hover); }
.pick .avatar { flex: 0 0 30px; width: 30px; height: 30px; font-size: 13px; margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4b4d52; margin-left: auto; }
.dot.on { background: var(--ok); }

/* ================= 网页内确认弹窗（替代浏览器 confirm） ================= */
.confirm-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .62);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .12s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.confirm-box {
  width: min(380px, 100%);
  background: var(--bg-2);
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
}
.confirm-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.confirm-text { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 16px; }
.confirm-ops { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.confirm-ops .confirm-ok { width: auto; padding: 9px 18px; font-size: 13px; }
.confirm-ops .confirm-ok.danger { background: #b4342a; }
.confirm-ops .confirm-ok.danger:hover { background: #c94136; }
.confirm-ops .confirm-cancel { padding: 9px 14px; }

/* ================= 通知设置：开关行 / 静音列表 ================= */
.switch-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row input[type="checkbox"] {
  flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent); cursor: pointer;
}
.switch-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.switch-text .hint { margin: 0; }
.bio-input {
  width: 100%; padding: 9px 11px; border-radius: var(--radius);
  border: 1px solid #1a1b1e; background: var(--bg-3); color: var(--text);
  outline: none; resize: vertical; font: inherit; font-size: 13px; line-height: 1.6;
}
.bio-input:focus { border-color: var(--accent); }
.muted-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.muted-row { display: flex; align-items: center; gap: 8px; }
.muted-name { flex: 1; font-size: 13px; color: var(--text); }
.mute-mark { font-size: 10px; opacity: .55; margin-left: 2px; }
.member-sub {
  font-size: 11px; color: var(--muted); line-height: 1.4; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px;
}

/* ================= 设置抽屉（身份组 / 频道 / Webhook） ================= */
.drawer {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--bg-2);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column;
  animation: drawer-in .18s ease;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line, #26272b);
  font-weight: 600; font-size: 15px;
}
.drawer-head button { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px 28px; }
.tabs.small { margin-bottom: 14px; }
.tabs.small .tab { font-size: 13px; padding: 6px; }
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input[type="text"], .field input:not([type]), .field input[type="password"], .field select,
.field input[type="color"] {
  width: 100%; padding: 9px 11px; border-radius: var(--radius);
  border: 1px solid #1a1b1e; background: var(--bg-3); color: var(--text); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input[type="color"] { padding: 2px; height: 34px; cursor: pointer; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 0 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.row.between { justify-content: space-between; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); padding: 4px 0; }
.check input { accent-color: var(--accent); }
.perms { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.section-title {
  margin: 20px 0 8px; font-size: 12px; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
}
.form-card {
  background: var(--bg-3); border-radius: 10px; padding: 12px; margin-bottom: 14px;
  border: 1px solid #1a1b1e;
}
.form-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }

/* 邀请链接面板 */
.form-card .row input,
.form-card .row select {
  flex: 1 1 200px; min-width: 0; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid #1a1b1e; background: var(--bg-2); color: var(--text); outline: none;
  font: inherit; font-size: 13px;
}
.invite-code {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  background: var(--bg-3); padding: 4px 8px; border-radius: 6px; color: #f2f3f5;
}
.invite-url-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.invite-url-row input { flex: 1 1 180px; min-width: 0; }
.invite-url-row .mini { flex: 0 0 auto; padding: 8px 12px; white-space: nowrap; }
.invite-item {
  border: 1px solid #1f2124; border-radius: 10px; padding: 10px 12px; margin: 8px 0;
  background: var(--bg-3);
}
.invite-item .row.between { margin: 0 0 2px; }
.invite-item .chips { margin: 0; }
.invite-item.dead { opacity: 0.6; }
.invite-item.dead .invite-code { text-decoration: line-through; }
.invite-item .hint { margin: 4px 0 0; }
.member-group { margin: 0 0 14px; }
.member-group-title {
  font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.3px;
  margin: 0 0 6px; display: flex; align-items: center; gap: 6px;
}
.member-group-title .role-dot { width: 9px; height: 9px; }
.mini.acc { background: var(--accent); color: #fff; font-weight: 600; }
.mini.acc:hover { background: var(--accent-hover); color: #fff; }
.hint-line { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.hint-line:empty { display: none; }

.role-row, .member-row, .hook-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border-radius: 10px; background: var(--bg-3);
  margin-bottom: 6px;
}
.role-row { align-items: center; }
.role-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; }
.role-info { flex: 1; min-width: 0; }
.role-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-perms { font-size: 11px; color: var(--muted); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
  border: 1px solid #3a3b40; background: transparent; color: var(--muted);
  border-radius: 20px; padding: 2px 9px; font-size: 11px; cursor: pointer;
}
.chip:hover { border-color: #5a5b60; color: var(--text); }
.chip.on {
  color: #fff; border-color: var(--chip-color, var(--accent));
  background: var(--chip-color, var(--accent));
}
.chip.admin { border-color: transparent; background: var(--accent); color: #fff; cursor: default; }
.member-row .avatar, .hook-row .avatar { flex: 0 0 32px; width: 32px; height: 32px; font-size: 13px; margin: 0; }
.member-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.hook-url {
  font-size: 11px; color: var(--link, #00a8fc); word-break: break-all;
  margin-top: 3px; font-family: ui-monospace, Consolas, monospace;
}
.hook-ops { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.mini.danger { color: #f28b82; }
.mini.danger:hover { color: #fff; background: #c0392b; }
.avatar.has-img { background-size: cover; background-position: center; color: transparent; }

.brand-gear { margin-left: 6px; }
.me-badge { margin-left: auto; }
.head-gear { margin-left: 4px; }
.chan-slow { font-size: 11px; color: #faa61a; background: rgba(250, 166, 26, .12); padding: 1px 7px; border-radius: 10px; }
.lock { font-size: 10px; opacity: .75; margin-left: 4px; }
.tag.role-tag { background: transparent; border: 1px solid currentColor; }

/* ================= 图片查看器（灯箱） ================= */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 7, 9, .93);
  display: flex; flex-direction: column;
  backdrop-filter: blur(2px);
}
.lightbox.hidden { display: none; }
body.lb-open { overflow: hidden; }
.lb-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; color: #e7e9ee;
  background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
}
.lb-name {
  flex: 1; min-width: 0; font-size: 13px; color: #b9bdc7;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-zoom-wrap { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .07); border-radius: 8px; padding: 2px; }
.lb-btn {
  border: 0; background: rgba(255, 255, 255, .07); color: #e7e9ee;
  min-width: 32px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; padding: 0 8px;
}
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-pct { font-size: 12px; color: #cfd3db; min-width: 52px; }
.lb-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 0 12px;
}
.lb-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transform-origin: center center; will-change: transform;
  user-select: none; -webkit-user-drag: none;
  transition: transform .08s linear;
  box-shadow: 0 12px 50px rgba(0, 0, 0, .6);
  border-radius: 4px;
}
.lb-hint {
  flex: none; text-align: center; font-size: 12px; color: #7f848f;
  padding: 8px 12px 14px;
}
@media (max-width: 760px) {
  .lb-hint { display: none; }
  .lb-name { font-size: 12px; }
}

/* ================= 移动端 ================= */
.menu-btn {
  display: none;
  position: fixed; top: 10px; left: 10px; z-index: 60;
  width: 36px; height: 36px; border-radius: 8px;
  border: 0; background: var(--bg-3); color: var(--text); font-size: 17px;
}

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    /* 必须高于遮罩（40），否则手机上点不动频道列表 */
    z-index: 45;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .6);
  }
  .app.side-open .sidebar { transform: translateX(0); }
  .app.side-open .overlay { display: block !important; }
  .chat-head { padding-left: 54px; }
  .messages { padding: 12px 12px 4px; }
  .msg { gap: 9px; }
  .avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: 13px; }
  .composer { padding: 8px 10px 12px; }
  .msg-img { max-width: 100%; }
  .embed { max-width: 100%; padding: 9px 10px 9px 12px; }
  .embed-thumb { width: 56px; height: 56px; }
  .embed-image { max-width: 100%; }
  .embed-field.inline { flex: 1 1 100%; min-width: 0; }
  .drawer { width: 100vw; }
  .perms { grid-template-columns: 1fr; }
  .member-list { grid-template-columns: 1fr; }
  .hook-row { flex-wrap: wrap; }
  .hook-ops { justify-content: flex-start; width: 100%; }
  .mention-box { left: 12px; right: 12px; }
}

/* ================= 右下角消息小弹窗 ================= */
.popups {
  position: fixed; right: 16px; bottom: 78px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.popup {
  pointer-events: auto; width: 288px; max-width: calc(100vw - 32px);
  background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 9px 11px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  animation: pop-in .16s ease-out;
}
.popup.mention { border-left-color: #faa61a; background: #2f3040; }
.popup:hover { background: var(--bg-hover); }
@keyframes pop-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.popup-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.popup-chan { font-weight: 600; color: #b9bbbe; }
.popup-tag {
  font-size: 10.5px; background: #faa61a; color: #1e1f22;
  border-radius: 4px; padding: 0 4px; font-weight: 700;
}
.popup-x {
  margin-left: auto; border: 0; background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.popup-x:hover { color: var(--text); }
.popup-body { margin-top: 3px; font-size: 13px; line-height: 1.45; word-break: break-word; }
.popup-name { color: var(--text); font-weight: 600; margin-right: 4px; }
.popup-text { color: #d6d8dc; }
@media (max-width: 760px) {
  .popups { right: 10px; left: 10px; bottom: 76px; align-items: stretch; }
  .popup { width: auto; }
}

/* ================= v1.14：置顶 / 表情 / 搜索 / 权限覆盖 / 成员管理 / 日志 ================= */

.pin-bar { padding: 6px 16px; border-bottom: 1px solid #1f2023; background: #2b2d31; }
.pin-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pin-label { color: #faa61a; font-weight: 600; flex: none; }
.pin-text { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pin-panel {
  position: absolute; top: 52px; right: 12px; width: min(420px, calc(100% - 24px));
  max-height: 60vh; overflow: auto; z-index: 55;
  background: #2b2d31; border: 1px solid #1a1b1e; border-radius: 12px; padding: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.pin-panel-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.pin-row { padding: 8px; border-radius: 8px; background: var(--bg-3); margin-bottom: 6px; }
.pin-row-name { font-size: 12px; color: #faa61a; margin-bottom: 2px; }
.pin-row-text { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.pin-row-ops { display: flex; gap: 6px; margin-top: 6px; }

.react-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
/* 没有任何回应时这一行只有「＋」，平时淡出、鼠标移到消息上才显出来 */
.react-row.empty { opacity: 0; transition: opacity .12s; }
.msg:hover .react-row.empty, .react-row.empty:focus-within { opacity: 1; }
@media (hover: none) { .react-row.empty { opacity: 1; } }
.react {
  border: 1px solid #1a1b1e; background: var(--bg-3); color: var(--text);
  border-radius: 20px; padding: 2px 9px; font-size: 13px; cursor: pointer; line-height: 1.6;
}
.react:hover { border-color: var(--accent); }
.react.mine { border-color: var(--accent); background: rgba(88,101,242,.22); }
.react.add { color: var(--muted); }

.search-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  border-bottom: 1px solid #1f2023; background: var(--bg-3); flex-wrap: wrap;
}
.search-bar input {
  flex: 1; min-width: 160px; padding: 8px 11px; border-radius: 8px;
  border: 1px solid #1a1b1e; background: var(--bg-2); color: var(--text); outline: none;
}
.search-bar input:focus { border-color: var(--accent); }

.msg-id {
  font-size: 10px; color: var(--muted); border: 1px solid #1a1b1e; border-radius: 4px;
  padding: 0 4px; margin-left: 6px; cursor: pointer; font-family: ui-monospace, monospace;
}
.msg-id:hover { color: var(--text); border-color: var(--accent); }

.role-count { color: var(--muted); font-size: 12px; font-weight: 400; }

.ow-box { display: flex; flex-direction: column; gap: 6px; }
.ow-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ow-name { flex: 1; min-width: 100px; font-size: 13px; }
.ow-sel {
  padding: 4px 6px; border-radius: 6px; border: 1px solid #1a1b1e;
  background: var(--bg-3); color: var(--text); font-size: 12px;
}

.member-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.member-muted { font-size: 12px; color: #faa61a; margin-top: 4px; }

.dot.idle { background: #faa61a; }
.dot.dnd { background: #f04747; }

.log-box { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.log-row {
  display: grid; grid-template-columns: 140px 80px 90px 1fr; gap: 8px;
  font-size: 12px; padding: 6px 8px; border-radius: 6px; background: var(--bg-3);
}
.log-time { color: var(--muted); font-family: ui-monospace, monospace; }
.log-who { color: #4fc3ff; }
.log-act { color: #faa61a; }
.log-detail { color: var(--text); word-break: break-word; }

@media (max-width: 760px) {
  .log-row { grid-template-columns: 1fr; gap: 2px; }
  .pin-panel { top: auto; bottom: 70px; right: 8px; left: 8px; width: auto; }
  .ow-row { align-items: flex-start; }
}
/* v1.15：颜色行里的「不使用颜色」别被挤成竖排 */
.row .check { flex: none; white-space: nowrap; }
.row input[type="color"] { flex: 1; min-width: 80px; }
/* v1.16：管理员数据面板 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 14px; }
.stat-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat-num { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-hint { font-size: 11px; color: var(--muted); opacity: .8; margin-top: 4px; }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; margin-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 11px; color: var(--muted); }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar-fill { width: 100%; background: var(--accent); border-radius: 6px; min-height: 3px; }
.bar-day { font-size: 10px; color: var(--muted); }
.top-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.top-row:last-child { border-bottom: 0; }
.top-no { width: 18px; color: var(--muted); font-size: 12px; }
.top-name { flex: 1; font-size: 13px; }
.top-count { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { .bars { height: 100px; } }
/* ================= v1.17：侧栏公告条 / 编辑记录 / 批量身份组 ================= */
.announce-bar {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 6px 10px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.22), rgba(88, 101, 242, 0.06));
  border: 1px solid rgba(88, 101, 242, 0.35);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}
.announce-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.4;
}
.announce-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announce-bar.collapsed .announce-text { display: none; }
.announce-bar.collapsed { padding: 6px 10px; }

.edited-mark { color: var(--muted); font-size: 11px; margin-left: 6px; cursor: pointer; }
.edited-mark:hover { color: var(--text); text-decoration: underline; }

.edit-hist { max-height: 52vh; overflow: auto; margin: 10px 0; }
.edit-item { border-left: 3px solid var(--line); padding: 6px 10px; margin-bottom: 8px; background: var(--bg-3); border-radius: 6px; }
.edit-item.now { border-left-color: var(--accent); }
.edit-when { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.edit-text { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.confirm-box.wide { width: min(520px, 92vw); max-width: 520px; }

.invite-roles { margin: 4px 0 10px; }
.invite-roles .chip { cursor: pointer; }
.invite-roles .chip.on { background: rgba(88, 101, 242, 0.3); border-color: var(--accent); color: #fff; }

@media (max-width: 760px) {
  .announce-bar { margin: 6px 8px; font-size: 12px; }
  .edit-hist { max-height: 46vh; }
}
/* ---------- 备案号（首页底部 / 侧栏底部） ---------- */
.filing-foot { margin-top: 14px; text-align: center; font-size: 12px; line-height: 1.6; }
.filing-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.18); }
.filing-foot a:hover { color: var(--text); border-bottom-color: var(--accent); }
#filingFootSide.filing-foot { margin: 8px 0 2px; font-size: 11px; }
#filingFootSide.filing-foot a { color: #6b6f76; }