:root {
  color-scheme: light;
  --brand: #12b7f5;
  --brand-deep: #0a9ed8;      /* 品牌色填充（按钮 hover 等，恒配白字） */
  --brand-text: #0a8fc4;      /* 浅色底上的品牌色文字 */
  --brand-soft: #e8f7ff;
  --brand-line: #cfe6f8;

  --bg: #f2f5f9;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --panel-3: #eef2f8;
  --rail: #e9eef6;

  --text: #1c2333;
  --text-2: #6b7684;
  --text-3: #98a2b3;

  --line: #e9edf3;
  --line-2: #e2e8f0;

  --danger: #f04452;
  --danger-text: #c0463d;
  --danger-soft: #fdeeec;
  --danger-line: #f7d3cf;

  --warn-text: #b26a00;
  --warn-soft: #fff3d6;
  --warn-line: #f6d99a;

  --ok: #26d07c;
  --ok-text: #22b57e;
  --ok-soft: #f2fbf6;
  --ok-line: #d6efe2;

  --gt-text: #7a3fd1;         /* 群头衔紫 */
  --gt-soft: #f3ecff;
  --gt-line: #d9c2fb;

  --active-soft: #e9f6ff;
  --link-hover: #066a92;
  --quote-bg: rgba(107, 118, 132, 0.08);

  --glass: rgba(255, 255, 255, 0.86);
  --glass-2: rgba(255, 255, 255, 0.92);
  --overlay: rgba(18, 28, 45, 0.42);
  --rail-hover: rgba(255, 255, 255, 0.75);

  --bubble: #ffffff;
  --chip-on-brand: #ffffff;   /* 我发出的气泡内的小胶囊保持浅底深字 */
  --bubble-mine: linear-gradient(135deg, #23c3ff, #0f9fe0);

  --shadow-sm: 0 1px 2px rgba(23, 43, 77, 0.06);
  --shadow-md: 0 8px 28px rgba(23, 43, 77, 0.1);
  --shadow-lg: 0 24px 70px rgba(23, 43, 77, 0.18);
}

/* ------------------------------------------------------------------ *
 * 深色主题：只重定义语义变量，组件规则尽量复用同一套
 * 对比度：正文 13.6:1、次要 5.6:1、弱化 4.6:1、品牌文字 8.9:1
 * ------------------------------------------------------------------ */
[data-theme="dark"] {
  color-scheme: dark;
  --brand: #2ec1f7;
  --brand-deep: #0a9ed8;
  --brand-text: #5fd3ff;
  --brand-soft: #103142;
  --brand-line: #1e4a62;

  --bg: #0e1219;
  --panel: #171d26;
  --panel-2: #1d242f;
  --panel-3: #242c39;
  --rail: #11161e;

  --text: #e8edf5;
  --text-2: #aab6c8;
  --text-3: #8b97a9;

  --line: #2a3341;
  --line-2: #333e4e;

  --danger: #f04452;
  --danger-text: #ff9c95;
  --danger-soft: #38222a;
  --danger-line: #57343c;

  --warn-text: #f0c26a;
  --warn-soft: #362b19;
  --warn-line: #5f4b25;

  --ok: #34d58a;
  --ok-text: #4cdd9c;
  --ok-soft: #163227;
  --ok-line: #24513c;

  --gt-text: #c9a6ff;
  --gt-soft: #2a2440;
  --gt-line: #453764;

  --active-soft: #173247;
  --link-hover: #9ce7ff;
  --quote-bg: rgba(255, 255, 255, 0.07);

  --glass: rgba(23, 29, 38, 0.86);
  --glass-2: rgba(23, 29, 38, 0.94);
  --overlay: rgba(3, 7, 13, 0.62);
  --rail-hover: rgba(255, 255, 255, 0.08);

  --bubble: #1d242f;
  --chip-on-brand: #ffffff;
  --bubble-mine: linear-gradient(135deg, #1477a6, #0b5d85);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 14px; color: var(--text); outline: none; }
.hidden { display: none !important; }
svg { fill: currentColor; width: 100%; height: 100%; display: block; }

/* ============================ 登录 / 注册 ============================ */
.auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e9f4ff 0%, #f7fafd 48%, #e8f9f4 100%);
  overflow: hidden;
  z-index: 10;
}
.auth-bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.auth-bg .b1 { width: 420px; height: 420px; background: #9fd8ff; top: -120px; left: -80px; }
.auth-bg .b2 { width: 380px; height: 380px; background: #b6f0e2; bottom: -140px; right: -60px; }
.auth-bg .b3 { width: 300px; height: 300px; background: #c9d8ff; bottom: 20%; left: 12%; opacity: 0.35; }

.auth-card {
  position: relative;
  width: 400px;
  padding: 30px 32px 22px;
  background: var(--glass-2);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .logo {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, #2fc9ff, #0a9ed8);
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(18, 183, 245, 0.35);
}
.auth-brand h1 { font-size: 21px; margin: 0; letter-spacing: 0.3px; }
.auth-brand p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }

.auth-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.auth-tabs .tab {
  padding: 0 0 10px; font-size: 15px; color: var(--text-2);
  position: relative; font-weight: 500;
}
.auth-tabs .tab.active { color: var(--text); font-weight: 700; }
.auth-tabs .tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  background: var(--brand); border-radius: 2px;
}

.auth-form { display: flex; flex-direction: column; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel-2); transition: all 0.16s;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px rgba(18, 183, 245, 0.12); }
.field textarea { resize: vertical; min-height: 68px; line-height: 1.6; }
.field .tag {
  font-style: normal; font-size: 11px; color: var(--text-3);
  background: var(--panel-3); border-radius: 6px; padding: 1px 6px;
}
.hint { color: var(--text-3); font-size: 11.5px; }

.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-box {
  width: 132px; height: 46px; flex: none; border-radius: 10px;
  overflow: hidden; cursor: pointer; border: 1px solid var(--line); background: var(--panel-2);
}
.captcha-box svg { width: 100%; height: 100%; }

.btn-primary {
  padding: 11px 18px; border-radius: 10px; color: #fff; font-size: 14.5px; font-weight: 600;
  background: linear-gradient(135deg, #21c1ff, #0a9ed8);
  box-shadow: 0 8px 18px rgba(18, 183, 245, 0.3);
  transition: transform 0.12s, box-shadow 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(18, 183, 245, 0.38); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-ghost {
  padding: 9px 16px; border-radius: 10px; background: var(--panel-3); color: var(--text-2);
  font-size: 13.5px; border: 1px solid var(--line); transition: all 0.15s;
}
.btn-ghost:hover { background: var(--panel-3); color: var(--text); }

.auth-hint { text-align: center; font-size: 12.5px; color: var(--text-3); margin: 2px 0 0; }
.auth-hint a { color: var(--brand-text); text-decoration: none; }
.auth-error { min-height: 16px; margin: 10px 0 0; color: var(--danger-text); font-size: 12.5px; text-align: center; }

/* ============================ 主框架 ============================ */
.app-screen {
  display: grid;
  grid-template-columns: 68px 288px 1fr;
  grid-template-rows: minmax(0, 1fr);   /* 关键：行高必须可收缩，否则内容会把整页顶高 */
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ---- 左侧导航 ---- */
.rail {
  background: var(--rail);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; gap: 6px;
  min-height: 0; overflow: hidden;
}
.rail-avatar {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #7dd3fc, #12b7f5);
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  margin: 2px 0 14px; transition: transform 0.15s;
  box-shadow: 0 4px 10px rgba(18, 183, 245, 0.3);
  overflow: hidden;
}
.rail-avatar:hover { transform: scale(1.06); }
.rail-nav { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; overflow-y: auto; min-height: 0; }
.rail-nav::-webkit-scrollbar { width: 0; }
.rail-bottom { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; }
.rail-btn {
  width: 44px; height: 44px; border-radius: 13px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: background 0.15s, color 0.15s; position: relative;
}
.rail-btn svg {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.rail-btn:hover { background: var(--rail-hover); color: var(--brand-text); }
.rail-btn.active { background: var(--panel); color: var(--brand-text); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .rail-btn.active { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: none; }
.rail-sep { width: 26px; height: 1px; background: var(--line-2); margin: 7px auto; flex: none; }

/* ---- 列表区 ---- */
.list-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0; overflow: hidden;
  position: relative;
}
.list-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--panel-2); border-radius: 9px; padding: 7px 10px;
  border: 1px solid transparent; transition: all 0.15s;
}
.search-box:focus-within { background: var(--panel); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 183, 245, 0.1); }
.search-box svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.search-box input { border: none; background: none; width: 100%; font-size: 13px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; padding: 8px; color: var(--text-2);
  transition: all 0.15s; flex: none;
}
.icon-btn:hover { background: var(--panel-3); color: var(--brand-text); }

.list-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 8px; font-size: 12px; color: var(--text-3); letter-spacing: 0.5px;
}
.list-count { font-size: 11px; color: var(--text-3); }

.list-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px 12px; }
.list-body::-webkit-scrollbar, .msg-scroll::-webkit-scrollbar, .pick-list::-webkit-scrollbar { width: 6px; }
.list-body::-webkit-scrollbar-thumb, .msg-scroll::-webkit-scrollbar-thumb, .pick-list::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 3px;
}

.conv-item {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 8px; border-radius: 10px; cursor: pointer;
  transition: background 0.12s; position: relative;
}
.conv-item:hover { background: var(--panel-3); }
.conv-item.active { background: var(--active-soft); }
.conv-item.active .conv-preview,
.conv-item.active .conv-time { color: var(--text-2); }
.conv-item.active::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.avatar {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px; position: relative;
  background: linear-gradient(135deg, #8ecdf7, #4aa8e8);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sq { border-radius: 12px; }
.avatar.group { background: linear-gradient(135deg, #9fd6ff, #5b9cf5); }
.avatar.official { background: linear-gradient(135deg, #ffd479, #f5a623); }
.avatar .dot {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; background: #26d07c; border: 2px solid var(--panel);
}
.conv-main { flex: 1; min-width: 0; }
.conv-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-3); flex: none; }
.conv-row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.conv-preview {
  font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; flex: 1; min-width: 0;
}
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.badge.mute { background: var(--line-2); }

.empty-list { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 40px 16px; line-height: 1.9; }

/* ---- 搜索结果 ---- */
.search-results {
  position: absolute; left: 8px; right: 8px; top: 58px;
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-md);
  border: 1px solid var(--line); z-index: 30; max-height: 62vh; overflow-y: auto;
  padding: 8px;
}
.sr-group { font-size: 11px; color: var(--text-3); padding: 6px 8px 4px; letter-spacing: 0.5px; }
.sr-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer;
}
.sr-item:hover { background: var(--panel-2); }
.sr-item .name { font-size: 13.5px; font-weight: 500; }
.sr-item .sub { font-size: 11.5px; color: var(--text-3); }
.sr-item .sr-action { margin-left: auto; font-size: 11.5px; color: var(--brand-text); }

/* ---- 联系人 ---- */
.contact-section { font-size: 11.5px; color: var(--text-3); padding: 12px 10px 6px; letter-spacing: 0.5px; }
.contact-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.contact-item:hover { background: var(--panel-3); }
.contact-item .name { font-size: 13.5px; }
.contact-item .sub { font-size: 11.5px; color: var(--text-3); }

/* ============================ 聊天区 ============================ */
.chat-panel {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  min-height: 0; overflow: hidden;
  background: var(--panel-2);
}
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-3); gap: 6px;
}
.empty-logo {
  width: 76px; height: 76px; border-radius: 22px; font-size: 40px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2fc9ff, #0a9ed8); display: flex; align-items: center;
  justify-content: center; margin-bottom: 10px; box-shadow: 0 16px 34px rgba(18, 183, 245, 0.28);
}
.empty-state h2 { margin: 0; font-size: 18px; color: var(--text); letter-spacing: 0.5px; }
.empty-state p { margin: 2px 0 0; font-size: 13px; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  height: 62px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; background: var(--glass); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.chat-head-main { min-width: 0; flex: 1; }
.chat-head h2 { margin: 0; font-size: 15.5px; font-weight: 600; }
.chat-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.chat-head-actions { display: flex; gap: 4px; }

.msg-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 16px 20px 8px; scroll-behavior: smooth;
  display: flex; flex-direction: column;
}
#msg-list { margin-top: auto; }
.load-more {
  text-align: center; font-size: 12px; color: var(--brand-text); cursor: pointer;
  padding: 6px 0 14px; opacity: 0.8;
}
.load-more:hover { opacity: 1; }

.msg-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: flex-start; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-col { max-width: min(62%, 560px); min-width: 0; }
.msg-meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; display: flex; gap: 8px; }
.msg-row.mine .msg-meta { justify-content: flex-end; }
.bubble {
  padding: 9px 13px; border-radius: 12px; background: var(--panel); font-size: 14px;
  line-height: 1.62; word-break: break-word; white-space: pre-wrap;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line-2);
  border-top-left-radius: 4px;
}
.msg-row.mine .bubble {
  background: var(--bubble-mine); color: #fff; border: none;
  border-top-left-radius: 12px; border-top-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(18, 183, 245, 0.28);
}
.bubble img { max-width: 260px; max-height: 320px; border-radius: 8px; display: block; cursor: zoom-in; }
.bubble.image { padding: 4px; background: var(--panel); }
.msg-row.mine .bubble.image { background: var(--brand-soft); }
.msg-time-sep {
  text-align: center; font-size: 11.5px; color: var(--text-3); margin: 14px 0 12px;
}
.msg-system {
  text-align: center; font-size: 12px; color: var(--text-3); margin: 12px auto;
  background: var(--panel-3); border-radius: 10px; padding: 5px 12px; max-width: 78%; line-height: 1.6;
}
.pending { opacity: 0.55; }
.typing-hint { font-size: 12px; color: var(--text-3); padding: 0 0 8px 4px; min-height: 18px; }

/* ---- 输入区 ---- */
.composer { flex: none; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 16px 10px; position: relative; }
.composer-tools { display: flex; align-items: center; gap: 4px; }
.tool-btn { width: 30px; height: 30px; padding: 6px; border-radius: 8px; color: var(--text-2); }
.tool-btn svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.tool-btn:hover { background: var(--panel-3); color: var(--brand-text); }
/* 深色模式下工具栏图标提亮，避免糊在深底上 */
[data-theme="dark"] .tool-btn { color: #cbd6e6; }
[data-theme="dark"] .tool-btn:hover { color: var(--brand); }
[data-theme="dark"] .icon-btn { color: #cbd6e6; }
[data-theme="dark"] .rail-btn { color: #dbe4f2; }
.composer-tip { margin-left: auto; font-size: 11px; color: var(--text-3); }
#msg-input {
  width: 100%; border: none; resize: none; max-height: 132px; min-height: 42px;
  padding: 6px 2px 2px; font-size: 14px; line-height: 1.6; background: transparent;
}
.composer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 2px; }
.char-count { font-size: 11px; color: var(--text-3); }
.btn-send {
  padding: 7px 22px; border-radius: 9px; color: #fff; font-weight: 600; font-size: 13.5px;
  background: linear-gradient(135deg, #21c1ff, #0a9ed8); box-shadow: 0 6px 14px rgba(18, 183, 245, 0.28);
}
.btn-send[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.emoji-panel {
  position: absolute; bottom: calc(100% + 6px); left: 14px; width: 322px; max-width: calc(100vw - 28px);
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-md);
  border: 1px solid var(--line); padding: 8px; z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
}
.emoji-panel:not(.hidden) { animation: popIn 0.14s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.emoji-tabs { display: flex; gap: 4px; padding: 0 2px 6px; border-bottom: 1px solid var(--line); flex: none; }
.emoji-tab {
  font-size: 12.5px; color: var(--text-2); padding: 4px 10px; border-radius: 7px;
  display: flex; align-items: center; gap: 4px;
}
.emoji-tab:hover { background: var(--panel-3); }
.emoji-tab.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.emoji-tab em { font-style: normal; font-size: 11px; color: var(--text-3); }
.emoji-tab.active em { color: var(--brand-text); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px;
  max-height: 188px; overflow-y: auto; overscroll-behavior: contain;
}
.emoji-grid::-webkit-scrollbar { width: 5px; }
.emoji-grid::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.emoji-grid.custom { grid-template-columns: repeat(6, 1fr); gap: 4px; }
.emoji-grid.hidden { display: none; }
.emoji-grid:not(.hidden) { animation: panelIn 0.14s ease-out; }
.emoji-cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1.2; padding: 4px 0; border-radius: 7px;
  min-height: 32px; transition: background 0.12s ease;
}
.emoji-cell:hover { background: var(--panel-3); }
.emoji-cell.custom { padding: 4px; cursor: pointer; }
.emoji-cell.custom img { width: 34px; height: 34px; object-fit: contain; display: block; }
.emoji-del {
  position: absolute; top: -3px; right: -3px; width: 15px; height: 15px; border-radius: 50%;
  background: rgba(28, 35, 51, 0.78); color: #fff; font-size: 9px; line-height: 15px;
  text-align: center; opacity: 0; transition: opacity 0.12s ease; padding: 0;
}
.emoji-cell:hover .emoji-del { opacity: 1; }
.emoji-del:hover { background: #e0483f; }
.emoji-empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 12px;
  padding: 22px 8px; line-height: 1.9;
}
.emoji-empty span { font-size: 11px; opacity: 0.85; }
.emoji-foot { font-size: 11px; color: var(--text-3); text-align: center; flex: none; }

/* ============================ 弹窗 ============================ */
.modal-mask {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(2px); padding: 24px;
}
.modal {
  background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 22px; position: relative; animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } }
.modal-title { margin: 0 0 16px; font-size: 16px; }
.modal-close {
  position: absolute; right: 14px; top: 12px; width: 28px; height: 28px;
  border-radius: 8px; color: var(--text-3); font-size: 14px; z-index: 3;
}
.modal-close:hover { background: var(--panel-3); color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .field { margin-bottom: 14px; }

.profile-modal { width: 520px; padding: 0; overflow: hidden; }
.cover-wrap { position: relative; height: 148px; background: var(--panel-3); }
.cover {
  height: 100%; background-size: cover; background-position: center;
  background-image: linear-gradient(120deg, #cbe9ff, #e8f7ff 45%, #d8f3ea);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cover-empty { font-size: 12.5px; color: var(--text-2); background: var(--glass-2); padding: 5px 12px; border-radius: 20px; }
.cover-edit {
  position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px;
  background: rgba(20, 30, 45, 0.55); color: #fff; font-size: 12px;
  padding: 6px 12px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(4px);
}
.cover-edit svg { width: 13px; height: 13px; }
.profile-body { padding: 0 24px 20px; }
.profile-head { display: flex; gap: 14px; align-items: flex-end; margin-top: -30px; margin-bottom: 18px; }
.big-avatar {
  width: 76px; height: 76px; border-radius: 20px; border: 3px solid var(--panel); flex: none;
  background: linear-gradient(135deg, #7dd3fc, #12b7f5); color: #fff;
  font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.profile-id { padding-bottom: 4px; min-width: 0; }
.profile-id h3 { margin: 0; font-size: 17px; }
.profile-id p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); }
.link-btn { color: var(--brand-text); font-size: 12px; margin-left: 6px; }
.inline-row { display: flex; gap: 8px; }
.inline-row input { flex: 1; }

.pick-list { border: 1px solid var(--line); border-radius: 10px; max-height: 210px; overflow-y: auto; padding: 6px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pick-item:hover { background: var(--panel-3); }
.pick-item input { width: 16px; height: 16px; accent-color: var(--brand); }
.pick-item .avatar { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
.pick-empty { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 18px; }

.info-modal { width: 420px; }
.info-cover { height: 96px; border-radius: 12px; background: linear-gradient(120deg, #d9f0ff, #e9fbf5); margin-bottom: 14px; display: flex; align-items: center; justify-content: center; }
.info-cover .avatar { width: 60px; height: 60px; font-size: 24px; border-radius: 16px; }
.info-name { font-size: 17px; font-weight: 600; text-align: center; }
.info-id { text-align: center; font-size: 12.5px; color: var(--text-3); margin: 5px 0 14px; }
.info-row { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.info-row span:first-child { color: var(--text-3); }
.info-notice { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 12px 0; }
.info-members { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-height: 168px; overflow-y: auto; }
.member-chip {
  display: flex; align-items: center; gap: 6px; background: var(--panel-2); border-radius: 20px;
  padding: 4px 10px 4px 5px; font-size: 12px; color: var(--text-2);
}
.member-chip .avatar { width: 22px; height: 22px; font-size: 11px; border-radius: 7px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(10, 16, 26, 0.86); z-index: 90;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
  opacity: 0; transition: opacity 0.18s ease;
}
.lightbox.open { opacity: 1; }
/* 关闭动画期间不吃鼠标事件，保证点完立刻能操作别处 */
.lightbox:not(.open) { pointer-events: none; }
.lightbox img {
  max-width: 90vw; max-height: 90vh; border-radius: 8px;
  transform: scale(0.94); opacity: 0.65;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.18s ease;
}
.lightbox.open img { transform: none; opacity: 1; }

/* ============================ 过渡动效 ============================ */
/* 切会话：消息列表淡入上浮，只跑一次，不拦截点击 */
#msg-list.msg-in { animation: msgIn 0.18s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
/* 切选项卡：列表淡入（display 由 none 恢复时自动重放） */
.list-body:not(.hidden) { animation: panelIn 0.16s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } }
/* 多选条：从底部轻轻浮起 */
.multiselect-bar:not(.hidden) { animation: barUp 0.16s ease-out; }
@keyframes barUp { from { opacity: 0; transform: translateY(8px); } }
.list-title, .conv-item, .contact-group-head { transition: background 0.14s ease, color 0.14s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.toast-stack { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: rgba(28, 35, 51, 0.92); color: #fff; font-size: 13px; padding: 9px 16px;
  border-radius: 10px; box-shadow: var(--shadow-md); animation: toastIn 0.2s ease-out;
}
.toast.err { background: rgba(220, 55, 70, 0.95); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

/* ============================ 窄屏 ============================ */
@media (max-width: 940px) {
  .app-screen { grid-template-columns: 62px 232px 1fr; }
  .msg-col { max-width: 74%; }
  .rail-btn { width: 42px; height: 42px; }
  .rail-btn svg { width: 23px; height: 23px; }
}
@media (max-width: 720px) {
  .app-screen { grid-template-columns: 54px 1fr; }
  .rail { padding: 12px 0 10px; }
  .list-panel { border-right: none; }
  /* 消息详情页：滑入 / 滑出过渡（代替 display 硬切换） */
  .chat-panel {
    position: fixed; inset: 0 0 0 54px; z-index: 40;
    transform: translateX(calc(100% + 54px)); visibility: hidden; pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 0.9, 0.36, 1), visibility 0s linear 0.28s;
    will-change: transform;
  }
  body.chat-open .chat-panel {
    transform: translateX(0); visibility: visible; pointer-events: auto;
    transition: transform 0.28s cubic-bezier(0.22, 0.9, 0.36, 1), visibility 0s;
  }
  body:not(.chat-open) .chat-panel { display: flex; }
  /* 消息详情页全屏遮罩淡出时压暗列表，增强“进入”的层次感 */
  body.chat-open .list-panel { opacity: 0.72; transition: opacity 0.28s ease; }
  body:not(.chat-open) .list-panel { opacity: 1; transition: opacity 0.28s ease; }
}

/* ============================ 头像 / 头衔 / 后台入口 ============================ */
.auth-foot { text-align: center; margin: 12px 0 0; font-size: 12px; }
.auth-foot a { color: var(--text-3); text-decoration: none; border-bottom: 1px dashed var(--line-2); padding-bottom: 1px; }
.auth-foot a:hover { color: var(--brand-text); border-color: var(--brand); }
.auth-theme-btn { font-size: 12px; color: var(--text-3); padding: 0; }
.auth-theme-btn:hover { color: var(--brand-text); }
.auth-sep { color: var(--text-3); margin: 0 6px; }

.title-chip {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px;
  font-size: 10.5px; line-height: 15px; font-weight: 500; vertical-align: 1px;
  color: var(--warn-text); background: linear-gradient(135deg, #fff3d6, #ffe7bd);
  border: 1px solid var(--warn-line); white-space: nowrap;
}
.msg-meta .title-chip { vertical-align: 0; }

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-edit { position: relative; display: block; cursor: pointer; }
.avatar-edit-badge {
  position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel); box-shadow: var(--shadow-sm);
}
.big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-title { margin: 3px 0 0; font-size: 12px; color: var(--text-2); }

.info-cover { position: relative; overflow: hidden; }
.info-cover .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 18px; }
.info-avatar-edit {
  position: absolute; right: 8px; bottom: 8px; padding: 4px 10px; border-radius: 14px;
  font-size: 11.5px; color: #fff; background: rgba(28, 35, 51, 0.55);
  backdrop-filter: blur(4px);
}
.info-avatar-edit:hover { background: rgba(18, 183, 245, 0.9); }
.member-chip em {
  font-style: normal; font-size: 10px; color: var(--warn-text); background: var(--warn-soft);
  border-radius: 4px; padding: 0 4px; margin-left: 2px;
}

/* ============================ 好友 ============================ */
.rail-badge {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: #d92d36; color: #fff; font-size: 10px; font-weight: 600;
  line-height: 15px; text-align: center; box-shadow: 0 0 0 2px var(--rail);
}

.sr-item .sr-action {
  margin-left: auto; font-size: 11.5px; color: var(--brand-text); background: none;
  border: none; padding: 4px 6px; border-radius: 6px; white-space: nowrap;
}
.sr-item .sr-action:hover { background: var(--brand-soft); }
.sr-item .sr-action[disabled] { color: var(--text-3); cursor: default; background: none; }
.sr-item .sr-action.primary { background: var(--brand); color: #fff; }

.req-card {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; margin: 0 2px 7px;
  background: linear-gradient(135deg, #f2fbff, #eef6ff); border: 1px solid #dcecf8;
  border-radius: 11px;
}
.req-card .req-info { min-width: 0; flex: 1; }
.req-card .req-name { font-size: 13px; font-weight: 500; }
.req-card .req-note {
  font-size: 11.5px; color: var(--text-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px;
}
.req-btns { display: flex; gap: 6px; flex: none; }
.req-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2);
}
.req-btn:hover { border-color: var(--line-2); }
.req-btn.ok { background: var(--brand); border-color: var(--brand); color: #fff; }
.req-btn.ok:hover { background: var(--brand-deep); }

.contact-item .contact-del {
  margin-left: auto; font-size: 11.5px; color: var(--text-3); background: none; border: none;
  padding: 3px 6px; border-radius: 6px; opacity: 0; transition: opacity 0.15s;
}
.contact-item:hover .contact-del { opacity: 1; }
.contact-item .contact-del:hover { color: var(--danger-text); background: var(--danger-soft); }

/* ============================ 右键菜单 / 引用 / 撤回 / 多选 ============================ */
.ctx-menu {
  position: fixed; z-index: 400; min-width: 112px; padding: 5px;
  background: var(--panel); border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(23, 43, 77, 0.18);
  animation: ctxIn 0.12s ease-out;
}
@keyframes ctxIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.ctx-item {
  display: block; width: 100%; text-align: left; padding: 7px 12px;
  border: none; border-radius: 7px; background: none;
  font-size: 13px; color: var(--text);
}
.ctx-item:hover { background: var(--brand-soft); color: var(--brand-text); }
.ctx-item.danger { color: var(--danger-text); }
.ctx-item.danger:hover { background: var(--danger-soft); color: var(--danger-text); }

/* 引用条 */
.reply-bar {
  display: flex; align-items: center; gap: 8px; margin: 2px 0 6px;
  padding: 6px 10px; border-left: 3px solid var(--brand);
  background: var(--brand-soft); border-radius: 8px;
}
.reply-bar-body { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: baseline; }
.reply-bar-title { flex: none; font-size: 11.5px; color: var(--brand-text); }
.reply-bar-text {
  font-size: 12px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-bar-close {
  flex: none; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
  background: none; color: var(--text-3); font-size: 11px; line-height: 20px;
}
.reply-bar-close:hover { background: var(--panel-3); color: var(--text); }

/* 气泡内的引用快照 */
.bubble.has-quote { display: flex; flex-direction: column; gap: 5px; }
.quote {
  display: flex; gap: 6px; min-width: 0;
  padding: 4px 8px; border-radius: 6px; border-left: 2px solid var(--line-2);
  background: var(--quote-bg);
  font-size: 12px; line-height: 1.5; white-space: normal;
}
.msg-row.mine .quote {
  background: rgba(255, 255, 255, 0.18);
  border-left-color: rgba(255, 255, 255, 0.7);
}
.quote-name { flex: none; font-weight: 500; opacity: 0.85; }
.quote-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-gone .quote-text { opacity: 0.6; font-style: italic; }

/* 撤回提示 */
.msg-recall { text-align: center; margin: 6px 0 10px; }
.msg-recall span {
  display: inline-block; padding: 3px 11px; border-radius: 10px;
  background: var(--panel-3); color: var(--text-2); font-size: 11.5px;
}

/* 多选 */
#msg-list.selecting .msg-row { position: relative; padding-left: 26px; cursor: pointer; }
#msg-list.selecting .msg-row.mine { padding-left: 0; padding-right: 26px; }
#msg-list.selecting .msg-row::before {
  content: ''; position: absolute; left: 2px; top: 8px;
  width: 16px; height: 16px; box-sizing: border-box;
  border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--panel);
}
#msg-list.selecting .msg-row.mine::before { left: auto; right: 2px; }
#msg-list.selecting .msg-row.selected::before {
  content: '✓'; background: var(--brand); border-color: var(--brand);
  color: #fff; font-size: 11px; line-height: 13px; text-align: center;
}
#msg-list.selecting .msg-row.selected .bubble { outline: 2px solid rgba(18, 183, 245, 0.35); outline-offset: 1px; }

.multiselect-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line);
}
.ms-count { font-size: 13px; color: var(--text-2); }
.ms-actions { display: flex; gap: 8px; }
.ms-btn {
  padding: 6px 16px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
}
.ms-btn:hover { border-color: var(--line-2); }
#ms-copy { background: var(--brand); border-color: var(--brand); color: #fff; }
#ms-copy:hover { background: var(--brand-deep); }
#ms-copy[disabled] { background: var(--panel-3); border-color: var(--line-2); color: var(--text-3); cursor: default; }

/* ============================ 群成员侧边栏 ============================ */
.chat-body { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; }
.chat-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* 折叠靠宽度过渡：内层定宽，展开/收起时内容被裁切而不是跟着挤压变形 */
.member-panel {
  width: 0; flex: none; overflow: hidden; display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); box-shadow: inset 1px 0 0 var(--line); visibility: hidden;
  transition: width 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0s linear 0.2s;
}
.member-panel.open { width: 214px; visibility: visible; transition-delay: 0s; }
.member-inner { width: 214px; flex: none; display: flex; flex-direction: column; min-height: 0; }
.member-panel.open .member-inner { animation: memberIn 0.2s ease-out; }
@keyframes memberIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}
.member-head {
  height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 14px; font-size: 12.5px; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.member-head em { font-style: normal; color: var(--text-3); }
.member-collapse { width: 24px; height: 24px; padding: 5px; border-radius: 7px; color: var(--text-3); }
.member-collapse:hover { background: var(--panel-3); color: var(--brand-text); }
.member-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px; }
.member-scroll::-webkit-scrollbar { width: 6px; }
.member-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.member-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 9px; cursor: pointer; position: relative;
}
.member-item:hover { background: var(--panel-2); }
.member-item.me { background: var(--panel-2); }
.member-info { flex: 1; min-width: 0; }
.member-name {
  font-size: 13px; display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-sub { margin-top: 2px; display: flex; gap: 4px; flex-wrap: wrap; min-height: 14px; }
.member-id { font-size: 11px; color: var(--text-3); }
.member-role {
  font-size: 10px; line-height: 15px; padding: 0 4px; border-radius: 4px;
  background: var(--panel-3); color: var(--text-2); white-space: nowrap;
}
.member-role.owner { background: linear-gradient(135deg, #fff3d6, #ffe7bd); color: var(--warn-text); border: 1px solid var(--warn-line); }
.member-role.admin { background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-line); }
.me-tag { font-style: normal; font-size: 10px; color: var(--brand-text); background: var(--brand-soft); border-radius: 4px; padding: 0 4px; }
.member-dot { width: 8px; height: 8px; border-radius: 50%; background: #26d07c; flex: none; }
.member-foot { flex: none; border-top: 1px solid var(--line); padding: 8px; }
.member-foot button {
  width: 100%; padding: 7px; border-radius: 8px; font-size: 12.5px;
  color: var(--text-2); background: var(--panel-3); border: 1px solid var(--line);
}
.member-foot button:hover { background: var(--panel-3); color: var(--brand-text); border-color: var(--brand-line); }

.avatar.sm { width: 30px; height: 30px; font-size: 12px; border-radius: 9px; }
.avatar.clickable { cursor: pointer; }
.icon-btn.active { background: var(--brand-soft); color: var(--brand-text); }

/* 群头衔：紫色，与全局金色头衔明确区分 */
.title-chip.gt {
  color: var(--gt-text);
  background: linear-gradient(135deg, #f3ecff, #e9dcff);
  border-color: var(--gt-line);
}

/* 拍一拍提示 */
.msg-pat { text-align: center; margin: 8px 0 12px; }
.msg-pat span {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-size: 11.5px; color: var(--warn-text);
  background: linear-gradient(135deg, #fff7e8, #fff1d6);
  border: 1px solid var(--warn-line);
}

/* ============================ 用户主页卡片 ============================ */
.user-modal { width: 400px; padding: 0; overflow: hidden; }
.uc-cover {
  height: 104px; background-size: cover; background-position: center;
  background-image: linear-gradient(120deg, #cbe9ff, #e8f7ff 45%, #d8f3ea);
}
.uc-body { padding: 0 20px 20px; }
.uc-head { display: flex; gap: 12px; align-items: flex-end; margin-top: -30px; margin-bottom: 12px; }
.uc-avatar {
  width: 68px; height: 68px; border-radius: 18px; border: 3px solid var(--panel); flex: none;
  background: linear-gradient(135deg, #7dd3fc, #12b7f5); color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.uc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.uc-meta { min-width: 0; padding-bottom: 2px; }
.uc-meta h3 { margin: 0; font-size: 17px; }
.uc-meta p { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }
.uc-titles { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.uc-title-label { font-size: 10.5px; color: var(--text-3); }
.uc-empty { color: var(--text-3); font-size: 11.5px; }
.uc-bio { margin: 0 0 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.uc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-btn {
  padding: 7px 14px; border-radius: 9px; font-size: 13px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
}
.uc-btn:hover { background: var(--panel-3); border-color: var(--brand-line); color: var(--brand-text); }
.uc-btn.primary {
  background: linear-gradient(135deg, #21c1ff, #0a9ed8); color: #fff; border: none;
  box-shadow: 0 6px 14px rgba(18, 183, 245, 0.26);
}
.uc-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ============================ 编辑群资料 ============================ */
.ge-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ge-avatar {
  width: 62px; height: 62px; border-radius: 16px; flex: none; overflow: hidden;
  background: linear-gradient(135deg, #9fd6ff, #5b9cf5); color: #fff;
  font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.ge-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 群资料页 */
.info-desc { text-align: center; font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin: 6px 0 0; }
.info-notice-wrap { margin: 12px 0; }
.info-notice-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--text-3); margin-bottom: 6px;
}
.info-notice.empty { color: var(--text-3); font-style: italic; }
.info-members-title { margin-top: 14px; font-size: 11.5px; color: var(--text-3); }
.member-chip.clickable { cursor: pointer; transition: background 0.15s; }
.member-chip.clickable:hover { background: var(--active-soft); }
.member-chip em.gt { color: var(--gt-text); background: var(--gt-soft); }

/* ============================ 设置 ============================ */
.settings-modal { width: 420px; }
.set-section { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.5px; margin: 16px 0 2px; }
.set-section:first-of-type { margin-top: 2px; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 2px; border-bottom: 1px dashed var(--line);
}
.set-name { font-size: 13.5px; }
.set-desc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sm-btn { padding: 5px 12px; font-size: 12.5px; }
.switch {
  width: 42px; height: 24px; flex: none; border-radius: 12px; padding: 0;
  background: var(--line-2); position: relative; transition: background 0.18s;
}
.switch span {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s;
}
.switch.on { background: var(--brand); }
.switch.on span { transform: translateX(18px); }
.set-foot { text-align: center; font-size: 11px; color: var(--text-3); margin: 16px 0 0; }

/* ============================ 窄屏：成员栏 ============================ */
@media (max-width: 1180px) {
  .member-panel.open { width: 180px; }
  .member-inner { width: 180px; }
}
@media (max-width: 940px) { .member-panel { display: none !important; } }

/* ============================ 群公告条 ============================ */
.notice-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12.5px; color: var(--warn-text);
  background: linear-gradient(90deg, #fff8e8, #fffdf6);
  border-bottom: 1px solid var(--warn-line);
}
.nb-icon { flex: none; font-size: 13px; }
.nb-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer;
}
.nb-text:hover { color: var(--warn-text); text-decoration: underline; }
.nb-close {
  flex: none; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  color: var(--warn-text); font-size: 11px; line-height: 20px;
}
.nb-close:hover { background: #f7ecd4; color: var(--warn-text); }

/* ============================ 输入框图片附件（粘贴） ============================ */
.attach-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 2px 6px; margin-bottom: 2px;
  border-bottom: 1px dashed var(--line);
  max-height: 160px; overflow-y: auto;
}
.attach-bar::-webkit-scrollbar { width: 6px; }
.attach-bar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.attach-item {
  position: relative; width: 62px; height: 62px; flex: none;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  animation: attachIn 0.16s ease-out;
}
@keyframes attachIn {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.attach-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 9px;
  display: block; cursor: zoom-in;
}
.attach-item.loading { display: flex; align-items: center; justify-content: center; }
.attach-spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--brand);
  animation: attachSpin 0.7s linear infinite;
}
@keyframes attachSpin { to { transform: rotate(360deg); } }
.attach-item.error { display: flex; align-items: center; justify-content: center; background: var(--danger-soft); border-color: var(--danger-line); }
.attach-tip { font-size: 11px; color: var(--danger-text); }

.attach-del {
  position: absolute; top: 2px; right: 2px; width: 17px; height: 17px;
  padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(24, 33, 45, 0.62); color: #fff; font-size: 9px;
  line-height: 15px; text-align: center;
}
.attach-del:hover { background: #e8544f; }
.attach-clear {
  flex: none; margin-left: 2px; padding: 5px 9px; border-radius: 8px;
  font-size: 11.5px; color: var(--text-3); background: var(--panel-3); border: 1px solid var(--line);
}
.attach-clear:hover { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-line); }

/* ============================ 输入框文件上传 ============================ */
.upload-bar {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 2px 6px; margin-bottom: 2px;
  border-bottom: 1px dashed var(--line);
  max-height: 186px; overflow-y: auto;
}
.upload-bar::-webkit-scrollbar { width: 6px; }
.upload-bar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.upload-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  animation: attachIn 0.16s ease-out;
}
.upload-item.error { background: var(--danger-soft); border-color: var(--danger-line); }
.upload-item.ready { background: var(--ok-soft); border-color: var(--ok-line); }

.up-ico {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.2px;
  color: #fff; background: linear-gradient(135deg, #23c3ff, #0f9fe0);
}
.upload-item.ready .up-ico { background: linear-gradient(135deg, #45d19a, #22b57e); }
.upload-item.error .up-ico { background: linear-gradient(135deg, #f0837d, #de5a52); }

.up-main { flex: 1; min-width: 0; }
.up-name {
  font-size: 12.5px; color: var(--text); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-sub {
  font-size: 11px; color: var(--text-3); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-item.error .up-sub { color: var(--danger-text); }
.up-track {
  height: 3px; margin-top: 5px; border-radius: 2px; background: #e4ebf3; overflow: hidden;
}
.up-track i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #23c3ff, #0f9fe0);
  border-radius: 2px; transition: width 0.18s ease-out;
}
.upload-item.ready .up-track i { background: #2fbe86; }
.upload-item.error .up-track i { background: #e2716a; }

.up-pct { flex: none; font-size: 11px; color: var(--brand-text); min-width: 34px; text-align: right; }
.up-ok { flex: none; color: var(--ok-text); font-size: 13px; font-weight: 700; }
.up-retry {
  flex: none; padding: 3px 9px; border-radius: 7px; font-size: 11px;
  color: var(--danger-text); background: var(--panel); border: 1px solid var(--danger-line);
}
.up-retry:hover { background: var(--danger-soft); }
.up-del {
  flex: none; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  color: var(--text-3); font-size: 11px; line-height: 20px; text-align: center;
}
.up-del:hover { background: var(--danger-soft); color: var(--danger-text); }

/* ============================ 消息里的文件卡片 ============================ */
.bubble.fileb { padding: 8px; background: var(--panel); white-space: normal; }
.msg-row.mine .bubble.fileb { background: var(--brand-soft); }

.file-card {
  display: flex; align-items: center; gap: 10px;
  min-width: 220px; max-width: 330px;
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-2);
  transition: background 0.15s, border-color 0.15s;
}
.file-card:hover { background: var(--active-soft); border-color: #cde8fa; }
.file-card.busy { opacity: 0.7; cursor: progress; }
.file-card.off {
  cursor: default; background: var(--panel-3); border-color: var(--line-2);
}
.file-card.off:hover { background: var(--panel-3); border-color: var(--line-2); }

.file-ico {
  flex: none; width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
  background: linear-gradient(135deg, #23c3ff, #0f9fe0);
}
.file-card.off .file-ico {
  background: var(--panel-3); color: var(--text-3); font-size: 15px;
}
.file-main { flex: 1; min-width: 0; }
.file-name {
  font-size: 13px; color: var(--text); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card.off .file-name { color: var(--text-3); text-decoration: line-through; text-decoration-color: #c9ced8; }
.file-sub { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.file-card.off .file-sub { color: var(--danger-text); }
.file-act {
  flex: none; padding: 4px 11px; border-radius: 8px; font-size: 11.5px;
  color: var(--brand-text); background: var(--panel); border: 1px solid var(--brand-line);
}
.file-card.off .file-act {
  color: var(--text-3); background: transparent; border-color: var(--line-2);
}

.file-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.nd-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px;
  color: var(--brand-text); background: var(--brand-soft); border: 1px solid var(--brand-line);
  white-space: nowrap;
}
.nd-chip:hover { background: #e0f3ff; border-color: var(--brand-line); }
.msg-row.mine .nd-chip { color: #0a6f9f; background: var(--chip-on-brand); border-color: var(--brand-line); }

/* 文本里的链接 */
.bubble a.plain-link { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
.bubble a.plain-link:hover { color: var(--link-hover); }
.msg-row.mine .bubble a.plain-link { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.7); }

.bubble a.nd-link {
  display: inline; color: var(--brand-text); text-decoration: none;
  border-bottom: 1px dashed var(--brand-line);
}
.bubble a.nd-link:hover { color: var(--link-hover); border-bottom-color: var(--brand); }
.nd-badge, .nd-code {
  display: inline-block; margin-left: 5px; padding: 0 6px;
  border-radius: 6px; font-size: 10.5px; line-height: 16px;
  vertical-align: 1px; white-space: nowrap;
}
.nd-badge { color: var(--brand-text); background: var(--brand-soft); border: 1px solid var(--brand-line); }
.nd-code { color: var(--warn-text); background: var(--warn-soft); border: 1px solid var(--warn-line); cursor: copy; }
.msg-row.mine .bubble a.nd-link { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.65); }
.msg-row.mine .nd-badge { color: #fff; background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.4); }
.msg-row.mine .nd-code { color: #7a4c00; background: #fff4d8; border-color: #f3dfae; }

/* ============================ 群禁言 ============================ */
.mute-bar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12.5px; color: #a33b34;
  background: linear-gradient(90deg, #fdeeec, #fff7f6);
  border-bottom: 1px solid var(--danger-line);
}
.mb-icon { flex: none; font-size: 13px; }
.mb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-role.muted {
  background: var(--danger-soft); color: var(--danger-text); border: 1px solid var(--danger-line);
}

#msg-input:disabled {
  background: var(--panel-2); color: var(--text-3); cursor: not-allowed;
}
.btn-send:disabled, .tool-btn:disabled {
  opacity: 0.5; cursor: not-allowed; box-shadow: none;
}

/* 禁言管理弹窗 */
.mute-modal { width: 480px; }
.mute-tip { margin: -4px 0 14px; font-size: 11.5px; color: var(--text-3); line-height: 1.7; }
.mute-section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.mute-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--text); margin-bottom: 10px;
}
.mute-sec-head em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.mute-sec-head em.on { color: var(--danger-text); }
.mute-all-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.mute-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
}
.mute-btn:hover { background: var(--panel-3); border-color: var(--brand-line); color: var(--brand-text); }
.mute-btn.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
.mute-btn.danger:hover { background: #fbdedb; }
.mute-btn.ghost { background: var(--panel); }
.mute-btn.sm { padding: 4px 9px; font-size: 11.5px; }
.mute-btn.active { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-text); }
.mute-select {
  padding: 6px 8px; border-radius: 8px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
}
.mute-members { max-height: 300px; overflow-y: auto; margin-top: 2px; }
.mute-members::-webkit-scrollbar { width: 6px; }
.mute-members::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.mute-member {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border-radius: 10px; border: 1px solid transparent;
}
.mute-member:hover { background: var(--panel-2); }
.mute-member.muted { background: #fdf7f6; }
.mute-member.focus { border-color: var(--danger-line); box-shadow: 0 0 0 2px rgba(192, 70, 61, 0.08); }
.mm-info { flex: 1; min-width: 0; }
.mm-name {
  font-size: 13px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mm-state { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.mute-member.muted .mm-state { color: var(--danger-text); }
.mm-actions { display: flex; gap: 6px; flex: none; }
.mute-empty { padding: 18px 0; text-align: center; font-size: 12px; color: var(--text-3); }

/* ============================ 主题切换控件 ============================ */
.theme-seg {
  display: flex; flex: none; padding: 2px; gap: 2px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 9px;
}
.theme-seg button {
  padding: 5px 10px; border-radius: 7px; font-size: 12px; color: var(--text-2);
  transition: background 0.14s ease, color 0.14s ease;
}
.theme-seg button:hover { color: var(--text); }
.theme-seg button.active { background: var(--panel); color: var(--brand-text); font-weight: 600; box-shadow: var(--shadow-sm); }
.ver-num { font-size: 11.5px; color: var(--brand-text); font-weight: 600; margin-left: 4px; }

/* ============================ 深色主题：渐变与彩色块 ============================ */
/* 变量解决不了的（渐变、彩色徽标、玻璃层）在这里逐项覆盖，保证不留浅色补丁 */
[data-theme="dark"] .auth-screen {
  background: linear-gradient(135deg, #0d1420 0%, #0b1017 48%, #0b1715 100%);
}
[data-theme="dark"] .auth-bg .b1 { background: #16577a; opacity: 0.45; }
[data-theme="dark"] .auth-bg .b2 { background: #14604f; opacity: 0.4; }
[data-theme="dark"] .auth-bg .b3 { background: #2a3a63; opacity: 0.32; }
[data-theme="dark"] .auth-card { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55); }

[data-theme="dark"] .cover,
[data-theme="dark"] .uc-cover {
  background-image: linear-gradient(120deg, #14283a, #16313a 45%, #14322c);
}
[data-theme="dark"] .info-cover { background: linear-gradient(120deg, #122b3a, #16302a); }

[data-theme="dark"] .notice-bar {
  background: linear-gradient(90deg, #33290f, #292317);
  border-bottom-color: #4a3a1c;
}
[data-theme="dark"] .nb-close:hover { background: #4a3a1c; color: var(--warn-text); }
[data-theme="dark"] .mute-bar {
  background: linear-gradient(90deg, #371f26, #291b21);
  border-bottom-color: #4d2c33;
}
[data-theme="dark"] .mute-bar .mb-btn,
[data-theme="dark"] .mute-bar button { color: var(--danger-text); }

[data-theme="dark"] .title-chip {
  color: var(--warn-text);
  background: linear-gradient(135deg, #3a2f14, #2e2611);
  border-color: var(--warn-line);
}
[data-theme="dark"] .title-chip.gt {
  color: var(--gt-text);
  background: linear-gradient(135deg, #2c2440, #251f36);
  border-color: var(--gt-line);
}
[data-theme="dark"] .member-role.owner {
  color: var(--warn-text);
  background: linear-gradient(135deg, #3a2f14, #2e2611);
  border-color: var(--warn-line);
}
[data-theme="dark"] .member-role.admin { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-line); }

[data-theme="dark"] .sr-request,
[data-theme="dark"] .friend-request {
  background: var(--panel-2);
  border-color: var(--line-2);
}

[data-theme="dark"] .bubble.fileb { background: var(--panel-2); }
[data-theme="dark"] .msg-row.mine .bubble.fileb { background: var(--brand-soft); }

[data-theme="dark"] .modal,
[data-theme="dark"] .emoji-panel,
[data-theme="dark"] .ctx-menu,
[data-theme="dark"] .search-results { box-shadow: 0 18px 46px rgba(0, 0, 0, 0.55); }

[data-theme="dark"] .switch span { background: #eef3fa; }
[data-theme="dark"] .switch:not(.on) { background: var(--line-2); }
[data-theme="dark"] .switch.on { background: var(--brand); }
[data-theme="dark"] .theme-seg button.active { background: var(--line-2); }

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-3); }

[data-theme="dark"] .empty-logo { box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45); }
[data-theme="dark"] .lightbox { background: rgba(3, 6, 11, 0.92); }


/* ============================ 页内确认弹窗 ============================ */
.confirm-mask { z-index: 260; opacity: 0; }
.confirm-mask.in { animation: cfMaskIn 0.16s ease-out forwards; }
.confirm-mask.out { animation: cfMaskOut 0.18s ease-in forwards; pointer-events: none; }
.confirm-modal { width: 356px; max-width: 100%; padding: 22px 22px 18px; border-radius: 16px; opacity: 0; }
.confirm-mask.in .confirm-modal { animation: cfPopIn 0.2s cubic-bezier(0.2, 0.9, 0.25, 1) forwards; }
.confirm-mask.out .confirm-modal { animation: cfPopOut 0.18s ease-in forwards; }
.confirm-title { margin: 0 0 8px; font-size: 15.5px; font-weight: 600; }
.confirm-text {
  margin: 0; font-size: 13px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.cf-btn {
  padding: 8px 18px; border-radius: 9px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.cf-btn:hover { background: var(--panel-3); color: var(--text); }
.cf-btn:active { transform: scale(0.97); }
.cf-btn.primary {
  border-color: transparent; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, #21c1ff, #0a9ed8);
  box-shadow: 0 6px 14px rgba(18, 183, 245, 0.28);
}
.cf-btn.danger {
  border-color: transparent; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, #f0685f, #d93a33);
  box-shadow: 0 6px 14px rgba(217, 58, 51, 0.26);
}
.cf-btn.primary:hover, .cf-btn.danger:hover { color: #fff; filter: brightness(1.06); }

@keyframes cfMaskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfMaskOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes cfPopIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes cfPopOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(0.97); } }

/* ============================ 设置：五分区 ============================ */
.settings-modal { width: min(720px, 94vw); max-height: min(700px, 90vh); display: flex; flex-direction: column; }
.settings-layout { display: flex; gap: 0; flex: 1; min-height: 0; margin-top: 6px; }
.set-side { width: 168px; border-right: 1px solid var(--line-2); padding: 6px 10px 6px 0; flex-shrink: 0; }
.set-side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.set-side-avatar .avatar { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
.set-side-meta { display: flex; flex-direction: column; min-width: 0; }
.set-side-meta b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-side-meta span { font-size: 11px; color: var(--text-3); }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav-btn {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px;
  border: none; background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; text-align: left;
}
.set-nav-btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.set-nav-btn:hover { background: var(--hover); color: var(--text-1); }
.set-nav-btn.active { background: var(--brand-soft, rgba(18, 183, 245, 0.12)); color: var(--brand-text); font-weight: 600; }
.set-main { flex: 1; min-width: 0; padding: 4px 4px 4px 16px; overflow-y: auto; }
.set-pane-title { margin: 2px 0 4px; font-size: 16px; }
.set-pane-sub { margin: 0 0 14px; font-size: 12px; color: var(--text-3); }
.set-profile-card {
  display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px;
  background: var(--hover); margin-bottom: 14px;
}
.set-profile-avatar .avatar { width: 52px; height: 52px; font-size: 20px; border-radius: 16px; }
.set-profile-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-profile-meta b { font-size: 14px; }
.set-profile-meta span { font-size: 12px; color: var(--text-3); }
.set-profile-bio { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.set-actions { display: flex; align-items: center; gap: 12px; }
.pwd-form { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin-bottom: 6px; }
.danger-btn { color: var(--danger, #d64550); border-color: var(--danger, #d64550); }
.danger-btn:hover { background: rgba(214, 69, 80, 0.1); }
.danger-text { color: var(--danger, #d64550); }
.set-section.danger { color: var(--danger, #d64550); }

/* 更新公告 */
.announce-box {
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px;
  max-height: 260px; overflow-y: auto; background: var(--hover); font-size: 13px;
}
.announce-body h3, .announce-body h4, .announce-body h5, .announce-body h6 { margin: 8px 0 4px; font-size: 14px; }
.announce-body p { margin: 6px 0; line-height: 1.6; word-break: break-word; }
.announce-body ul { margin: 6px 0; padding-left: 20px; }
.announce-body li { margin: 3px 0; line-height: 1.5; }
.announce-body code {
  padding: 1px 5px; border-radius: 5px; font-size: 12px;
  background: rgba(18, 183, 245, 0.12); color: var(--brand-text);
}
.announce-body a { color: var(--brand-text); }

/* ============================ 交友大厅 ============================ */
.discover-modal { width: min(560px, 94vw); }
.discover-tabs { display: flex; gap: 6px; margin: 8px 0 12px; border-bottom: 1px solid var(--line-2); }
.discover-tab {
  padding: 8px 18px; border: none; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.discover-tab.active { color: var(--brand-text); border-bottom-color: var(--brand); font-weight: 600; }
.discover-body { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.discover-sub { font-size: 12px; color: var(--text-3); margin: 2px 0 6px; }
.discover-loading { text-align: center; color: var(--text-3); font-size: 13px; padding: 28px 0; }
.dv-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer;
}
.dv-item:hover { background: var(--hover); }
.dv-item .avatar { width: 42px; height: 42px; font-size: 17px; border-radius: 13px; flex-shrink: 0; }
.dv-meta { flex: 1; min-width: 0; }
.dv-meta .name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dv-meta .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-item .tag { font-style: normal; font-size: 10.5px; color: var(--brand-text); background: rgba(18, 183, 245, 0.12); border-radius: 4px; padding: 0 5px; font-weight: 500; }

/* ============================ 举报 ============================ */
.report-modal { width: min(480px, 94vw); }
.report-tip { margin: 4px 0 10px; font-size: 12.5px; color: var(--text-3); }
.report-evidence { display: flex; flex-wrap: wrap; gap: 8px; }
.report-ev-add {
  width: 78px; height: 78px; border: 1.5px dashed var(--line-2); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11.5px; color: var(--text-3); cursor: pointer;
}
.report-ev-add:hover { color: var(--brand-text); border-color: var(--brand); }
.report-ev-add svg { width: 20px; height: 20px; fill: currentColor; }
.report-ev-thumb { position: relative; width: 78px; height: 78px; }
.report-ev-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.report-ev-del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: var(--danger, #d64550); color: #fff; font-size: 11px; cursor: pointer;
}

/* ============================ 注销账户 ============================ */
.deactivate-modal { width: min(480px, 94vw); }
.deact-warn-box {
  background: rgba(214, 69, 80, 0.08); border: 1px solid rgba(214, 69, 80, 0.35);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.7;
}
.deact-warn-box ul { margin: 6px 0 0; padding-left: 20px; }
.deact-confirm-label { margin: 12px 0 6px; font-size: 12.5px; color: var(--text-2); }
.deact-phrase {
  font-size: 12.5px; color: var(--danger, #d64550); background: var(--hover);
  border-radius: 8px; padding: 8px 10px; user-select: all; margin: 0 0 8px; line-height: 1.5;
}
#input-deact-confirm, #input-deact-pass { width: 100%; }
.deact-final-warn { font-size: 13px; line-height: 1.7; color: var(--text-1); margin: 6px 0 12px; }

/* ============================ @ 提及弹层 ============================ */
.mention-pop {
  position: fixed; z-index: 260; min-width: 260px; max-width: 320px; max-height: 260px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-md, 0 8px 28px rgba(0, 0, 0, 0.18)); padding: 5px;
  display: flex; flex-direction: column; gap: 1px;
}
.mention-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: none; border-radius: 9px;
  background: transparent; cursor: pointer; text-align: left; width: 100%;
}
.mention-item:hover, .mention-item.active { background: var(--hover); }
.mention-item .avatar { width: 28px; height: 28px; font-size: 12px; border-radius: 9px; flex-shrink: 0; }
.mention-badge {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
}
.mention-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; min-width: 0; }
.mention-sub { font-size: 11px; color: var(--text-3); margin-left: auto; flex-shrink: 0; }

/* ============================ 手机端适配 ============================ */
#btn-back-list { display: none; }
@media (max-width: 720px) {
  #btn-back-list { display: inline-flex; }
  .chat-head { gap: 6px; }
  .settings-layout { flex-direction: column; }
  .set-side { width: 100%; border-right: none; border-bottom: 1px solid var(--line-2); padding: 0 0 8px; }
  .set-nav { flex-direction: row; flex-wrap: wrap; }
  .set-nav-btn { padding: 7px 10px; font-size: 12.5px; }
  .set-main { padding: 12px 2px 2px; }
  .settings-modal { max-height: 92vh; }
  .mention-pop { left: 8px !important; right: 8px; max-width: none; }
}

/* ============================ 安全中心：两个独立入口（1.04.2） ============================ */
.sec-opts { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.sec-opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--panel-2, transparent); cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.sec-opt:hover { background: var(--hover); border-color: var(--brand); }
.sec-opt-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(18, 183, 245, 0.12); color: var(--brand-text);
}
.sec-opt-icon svg { width: 22px; height: 22px; fill: currentColor; }
.sec-opt-icon.danger { background: rgba(214, 69, 80, 0.12); color: var(--danger, #d64550); }
.sec-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sec-opt-text b { font-size: 14px; color: var(--text-1); }
.sec-opt-text span { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.sec-opt.danger .sec-opt-text b { color: var(--danger, #d64550); }
.sec-opt-arrow { width: 18px; height: 18px; fill: none; color: var(--text-3); flex-shrink: 0; }
.set-back {
  display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px;
  padding: 5px 10px 5px 6px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer;
}
.set-back:hover { background: var(--hover); color: var(--text-1); }
.set-back svg { width: 16px; height: 16px; }

/* ============================ 手机端：弹窗全屏化（1.04.2） ============================ */
@media (max-width: 720px) {
  .modal-mask { padding: 0; }
  .modal-mask .modal:not(.confirm-modal) {
    width: 100vw; max-width: 100vw;
    height: 100vh; max-height: 100vh;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    animation: sheetUp 0.26s cubic-bezier(0.22, 0.9, 0.36, 1);
  }
  /* 全屏后关闭按钮避开状态栏与内容重叠 */
  .modal-mask .modal:not(.confirm-modal) .modal-close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    width: 34px; height: 34px; font-size: 16px;
    background: var(--panel-3);
  }
  .settings-modal { max-height: 100dvh; }
  .profile-modal { padding: 0; }
  .profile-modal .modal-close { z-index: 5; }
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }

/* ============================ 群管理入口按钮（1.04.3） ============================ */
.gm-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--panel-2, transparent); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; flex-shrink: 0;
}
.gm-btn svg { width: 14px; height: 14px; fill: currentColor; }
.gm-btn:hover { color: var(--brand-text); border-color: var(--brand); background: rgba(18, 183, 245, 0.08); }

/* 群管理弹窗 */
.gmanage-modal { width: min(640px, 94vw); max-height: min(660px, 88vh); display: flex; flex-direction: column; }
.gm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin: 6px 0 14px; }
.gm-tab {
  padding: 9px 16px; border: none; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.gm-tab:hover { color: var(--text-1); }
.gm-tab.active { color: var(--brand-text); border-bottom-color: var(--brand); font-weight: 600; }
.gm-pane { overflow-y: auto; min-height: 0; }
.gm-pane-tip { margin: 0 0 12px; font-size: 12.5px; color: var(--text-3); }

.gm-notice-current {
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; background: var(--hover);
}
.gm-notice-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 12px; color: var(--text-3);
}
.gm-notice-meta .avatar { width: 22px; height: 22px; font-size: 10px; border-radius: 7px; }
.gm-notice-meta b { color: var(--text-1); font-size: 12.5px; }
.gm-notice-meta.info { margin-top: 8px; }
.gm-notice-body { background: transparent; border: none; padding: 0; max-height: 180px; }
.announce-body.info-notice-md { background: transparent; border: none; padding: 0; max-height: none; }

.gm-admin-list { display: flex; flex-direction: column; gap: 4px; max-height: 400px; overflow-y: auto; }
.gm-admin-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
}
.gm-admin-row:hover { background: var(--hover); }
.gm-admin-row .avatar { width: 34px; height: 34px; font-size: 14px; border-radius: 11px; }
.gm-admin-row .mm-info { flex: 1; min-width: 0; }
.gm-admin-row .btn-ghost { flex-shrink: 0; }

/* uiPrompt 输入框 */
.confirm-modal .cf-input {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2, transparent);
  color: var(--text-1); font-size: 13.5px; outline: none; margin: 2px 0 4px;
}
.confirm-modal .cf-input:focus { border-color: var(--brand); }

/* 更新公告弹窗 */
.announce-modal { width: min(520px, 94vw); }
.announce-modal-box { max-height: 46vh; margin-bottom: 4px; }

/* ==================== v1.04.4 转发 / 群公告查看 ==================== */

/* 合并转发消息卡片 */
.forward-card {
  min-width: 180px; max-width: 320px; cursor: pointer;
  border-left: 3px solid var(--brand);
  padding: 6px 10px 4px;
}
.forward-card:hover { filter: brightness(1.06); }
.forward-card .fc-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.forward-card .fc-preview {
  margin-top: 4px; font-size: 11.5px; line-height: 1.5;
  color: var(--text-3); word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.forward-card .fc-foot { margin-top: 4px; font-size: 11px; color: var(--brand-text); }
.bubble.forwardb { padding: 0; background: var(--panel-3); }

/* 转发弹窗 */
.forward-modal { width: min(400px, 94vw); }
.forward-summary { font-size: 12.5px; color: var(--text-3); margin: -6px 0 10px; }
.fw-search {
  width: 100%; box-sizing: border-box; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--panel-2); color: var(--text-1); outline: none;
}
.fw-search:focus { border-color: var(--brand); }
.fw-list {
  margin-top: 10px; max-height: 300px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.fw-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  cursor: pointer; border-bottom: 1px solid var(--line);
}
.fw-item:last-child { border-bottom: none; }
.fw-item:hover { background: var(--hover); }
.fw-item.selected { background: rgba(18, 183, 245, 0.12); }
.fw-item .avatar { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; flex-shrink: 0; overflow: hidden; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.fw-item .avatar img { width: 100%; height: 100%; object-fit: cover; }
.fw-item-name { font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-tag { font-style: normal; font-size: 10.5px; color: var(--brand-text); background: rgba(18, 183, 245, 0.12); border-radius: 4px; padding: 0 5px; }
.fw-empty { padding: 24px 0; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* 合并转发记录展开弹窗 */
.forward-view-modal { width: min(520px, 94vw); }
.fwd-view-list {
  max-height: 60vh; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px;
}
.fwv-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fwv-item:last-child { border-bottom: none; }
.fwv-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.fwv-meta b { font-size: 12.5px; color: var(--text-1); }
.fwv-meta span { font-size: 11px; color: var(--text-3); }
.fwv-body { font-size: 13px; color: var(--text-1); line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.fwv-img { max-width: 200px; max-height: 160px; border-radius: 8px; cursor: zoom-in; }
.fwv-file { font-size: 12.5px; color: var(--text-2); }

/* 群公告查看弹窗 */
.notice-view-modal { width: min(560px, 94vw); }
.notice-view-modal .gm-notice-meta { margin: -6px 0 10px; }
.notice-view-body {
  max-height: 58vh; overflow-y: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}

/* ==================== v1.04.5 会话置顶 / 免打扰 / 拉黑 ==================== */
.conv-pin { margin-right: 3px; font-size: 10px; }
.conv-muted { margin-right: 3px; font-size: 10.5px; opacity: 0.75; }
.badge.muted { background: var(--text-3); color: var(--panel); }
.fw-item .fw-tag, .title-chip { user-select: none; }

/* ============================ 社区（帖子） ============================ */
.community-modal {
  width: min(880px, 96vw);
  height: min(780px, 90vh);
  max-height: 90vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line); flex: none;
}
.cm-head-left { display: flex; align-items: baseline; gap: 10px; }
.cm-head-left .modal-title { margin: 0; }
.cm-total { font-size: 12px; color: var(--text-3); }
.cm-head-right { display: flex; align-items: center; gap: 8px; }
.community-modal .modal-close { position: static; }
.cm-new { padding: 7px 16px; border-radius: 10px; font-size: 13px; }

.cm-scroll { flex: 1; overflow-y: auto; padding: 14px 18px 20px; }
.cm-list { display: flex; flex-direction: column; gap: 14px; }
.cm-loading, .cm-empty { padding: 42px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.cm-more { display: flex; justify-content: center; padding: 14px 0 4px; }

.post-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px 10px;
  background: var(--panel); cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.post-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }

.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-av {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7dd3fc, #12b7f5);
  color: #fff; font-weight: 700; font-size: 14px;
}
.post-av img { width: 100%; height: 100%; object-fit: cover; }
.post-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.post-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.post-time { font-size: 12px; color: var(--text-3); }
.post-del {
  margin-left: auto; font-size: 12px; color: var(--text-3);
  padding: 4px 8px; border-radius: 8px;
}
.post-del:hover { color: var(--danger); background: var(--danger-soft); }

.post-title { margin: 0 0 8px; font-size: 16.5px; font-weight: 700; line-height: 1.4; }
.post-body { font-size: 13.5px; line-height: 1.68; color: var(--text); }
.post-body.clipped { max-height: 98px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent); mask-image: linear-gradient(180deg, #000 62%, transparent); }
.post-body p { margin: 0 0 8px; }
.post-body h3 { margin: 12px 0 6px; font-size: 15px; font-weight: 700; }
.post-body h4 { margin: 10px 0 6px; font-size: 15px; font-weight: 700; }
.post-body h5, .post-body h6 { margin: 8px 0 5px; font-size: 14px; font-weight: 600; }
.post-body ul { margin: 6px 0; padding-left: 20px; }
.post-body li { margin: 2px 0; }
.post-body blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--brand-line);
  color: var(--text-2); background: var(--panel-2); border-radius: 0 8px 8px 0;
}
.post-body pre {
  margin: 8px 0; padding: 10px 12px; background: var(--panel-3);
  border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.6;
}
.post-body code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  background: var(--panel-3); padding: 1px 5px; border-radius: 5px; font-size: 12.5px;
}
.post-body pre code { background: none; padding: 0; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.post-body a { color: var(--brand-text); }

.post-foot { margin-top: 8px; }
.post-open { font-size: 12.5px; color: var(--brand-text); padding: 2px 0; }

.post-images { display: grid; gap: 6px; margin-top: 10px; }
.post-images.n1 { grid-template-columns: 1fr; }
.post-images.n2 { grid-template-columns: repeat(2, 1fr); }
.post-images.n3, .post-images.n4, .post-images.n5,
.post-images.n6, .post-images.n7, .post-images.n8, .post-images.n9 {
  grid-template-columns: repeat(3, 1fr);
}
.post-img {
  position: relative; border-radius: 10px; overflow: hidden;
  background: var(--panel-3);
  border: 1px solid var(--line); aspect-ratio: 4 / 3; padding: 0; cursor: zoom-in;
}
/* 单图按原始比例显示（不裁切、不拉伸），多图才用九宫格裁切 */
.post-images.n1 .post-img { aspect-ratio: auto; display: flex; justify-content: center; background: var(--panel-2); cursor: zoom-in; }
.post-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 列表里的单图裁切铺满（整齐），详情里完整显示 */
.post-images.n1:not(.big) .post-img { height: 280px; }
.post-images.n1:not(.big) .post-img img { width: 100%; height: 100%; object-fit: cover; }
.post-images.n1.big .post-img img {
  width: auto; height: auto; max-width: 100%; max-height: 540px;
  object-fit: contain; border-radius: 9px;
}
.post-img-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px;
}
.post-img.loaded .post-img-ph { display: none; }
.post-img.loaded { background-color: var(--panel-2); }
.post-img.failed { background: var(--panel-2); }

.cm-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cm-back { font-size: 13px; color: var(--brand-text); padding: 4px 10px; border-radius: 8px; }
.cm-back:hover { background: var(--brand-soft); }
.post-detail { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.post-detail .post-title { font-size: 19px; margin: 2px 0 12px; }
.post-detail .post-head .post-time { margin-left: auto; }
.post-body.full { font-size: 14px; line-height: 1.75; }

.cm-editor { flex: 1; display: flex; flex-direction: column; padding: 14px 18px 16px; gap: 10px; overflow: hidden; }
.cm-title-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  font-size: 14px; font-weight: 600;
}
.cm-title-input:focus { border-color: var(--brand); background: var(--panel); }
.cm-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cm-toolbar button, .cm-imgbtn {
  min-width: 32px; height: 30px; padding: 0 9px; border-radius: 8px;
  font-size: 12.5px; color: var(--text-2); background: var(--panel-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: none;
}
.cm-toolbar button:hover, .cm-imgbtn:hover { background: var(--brand-soft); color: var(--brand-text); }
.cm-toolbar button.active { background: var(--brand-soft); color: var(--brand-text); }
.cm-pv-btn { margin-left: auto; }
.cm-edit-wrap { flex: 1; display: flex; min-height: 0; }
#cm-body {
  flex: 1; width: 100%; resize: none; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  font-family: inherit; font-size: 13.5px; line-height: 1.7;
}
#cm-body:focus { border-color: var(--brand); background: var(--panel); }
.cm-preview {
  flex: 1; overflow-y: auto; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  font-size: 13.5px; line-height: 1.7;
}
.cm-preview p { margin: 0 0 8px; }
.cm-preview ul { margin: 6px 0; padding-left: 20px; }
.cm-preview blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--brand-line); color: var(--text-2); }
.cm-preview pre { margin: 8px 0; padding: 10px 12px; background: var(--panel-3); border-radius: 10px; overflow-x: auto; }

.cm-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-thumb {
  width: 64px; height: 64px; border-radius: 10px; position: relative;
  background: var(--panel-3) center / cover no-repeat; border: 1px solid var(--line);
}
.cm-thumb-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-3); }
.cm-thumb.loaded .cm-thumb-ph { display: none; }
.cm-thumb-del {
  position: absolute; right: -6px; top: -6px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.cm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.cm-tip { font-size: 12px; color: var(--text-3); }
.cm-foot-btns { display: flex; gap: 8px; }

@media (max-width: 720px) {
  .community-modal { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .cm-scroll { padding: 12px 12px 18px; }
  .cm-head { padding: 12px 12px 10px; }
  .cm-editor { padding: 10px 12px 14px; }
  .post-body.clipped { max-height: 76px; }
}

/* ============================ 语音消息 ============================ */
.rec-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; padding: 9px 12px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 12px; font-size: 13px; color: var(--brand-text);
}
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  animation: recPulse 1s ease-in-out infinite;
}
@keyframes recPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.rec-hint { color: var(--text-2); flex: 1; }
.rec-btn {
  padding: 5px 12px; border-radius: 9px; font-size: 12.5px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2);
}
.rec-btn.rec-send { background: var(--brand); color: #fff; border-color: transparent; }
.rec-btn.rec-cancel:hover { background: var(--panel-3); }
#btn-voice.recording { background: var(--danger-soft); color: var(--danger); }

.voice-msg {
  display: inline-flex; align-items: center; gap: 9px;
  min-width: 120px; max-width: 260px; padding: 7px 12px 7px 8px;
  border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.voice-msg::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--progress, 0%); background: rgba(18, 183, 245, 0.14);
  pointer-events: none; transition: width 0.15s linear;
}
.voice-play {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.voice-play svg { width: 15px; height: 15px; fill: currentColor; }
.voice-bars { display: flex; align-items: center; gap: 2px; height: 22px; position: relative; z-index: 1; }
.voice-bars i {
  display: block; width: 2px; border-radius: 2px;
  height: var(--h, 40%); background: var(--brand-line);
}
.voice-msg.playing .voice-bars i { background: var(--brand); }
.voice-dur { font-size: 12px; color: var(--text-2); position: relative; z-index: 1; }
.voice-msg.expired { background: var(--panel-2); border-style: dashed; padding: 8px 12px; }
.voice-expired { font-size: 12.5px; color: var(--text-3); }

/* ============================ 橙币 ============================ */
.coins-modal { width: 420px; }
.coins-hero {
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
  background: linear-gradient(135deg, #fff3d6, #ffe2b0 55%, #ffd08a);
  color: #7a4a00;
}
[data-theme="dark"] .coins-hero { background: linear-gradient(135deg, #3b2d12, #4a3616 55%, #5a4018); color: #ffd79a; }
.coins-balance { display: flex; align-items: baseline; gap: 6px; }
.coins-balance b { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.coins-balance span { font-size: 13px; opacity: 0.8; }
.coins-sub { font-size: 12px; opacity: 0.75; margin-top: 3px; }

.coins-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coins-act {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); text-align: left;
}
.coins-act b { font-size: 14px; }
.coins-act span { font-size: 12px; color: var(--text-3); }
.coins-act:hover:not([disabled]) { border-color: var(--brand-line); background: var(--brand-soft); }
.coins-act.done { opacity: 0.6; }
.coins-act.ready { border-color: var(--warn-text); box-shadow: 0 0 0 1px rgba(178, 106, 0, 0.25) inset; }
.coins-act[disabled] { cursor: not-allowed; }

.coins-progress { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.coins-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.coins-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.3s; }
.coins-progress span { font-size: 11.5px; color: var(--text-3); }

.coins-logs-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 6px; font-size: 13px; color: var(--text-2);
}
.coins-more { font-size: 12px; color: var(--brand-text); padding: 3px 8px; border-radius: 7px; }
.coins-logs { max-height: 240px; overflow-y: auto; border-top: 1px solid var(--line); }
.coin-log {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid var(--line);
}
.coin-log-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coin-log-main b { font-size: 13px; font-weight: 500; }
.coin-log-time { font-size: 11.5px; color: var(--text-3); }
.coin-log-delta { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coin-log-delta.plus { color: #12864a; }
.coin-log-delta.minus { color: var(--danger); }
[data-theme="dark"] .coin-log-delta.plus { color: #4ade80; }
.coins-empty { padding: 22px 0; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* 红包 */
.rp-tip { font-size: 12.5px; color: var(--text-3); margin: -8px 0 12px; }
.rp-presets { display: flex; gap: 8px; margin-bottom: 4px; }
.rp-presets button {
  font-size: 12px; padding: 5px 10px; border-radius: 8px;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line-2);
}
.rp-presets button:hover { background: var(--brand-soft); color: var(--brand-text); }

.rp-card {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 12px; text-align: left;
  background: linear-gradient(135deg, #ff8a4c, #ff5f2e);
  color: #fff; border: none;
}
.rp-card-icon { font-size: 24px; flex: none; }
.rp-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rp-card-main b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-card-sub { font-size: 11.5px; opacity: 0.85; }
.rp-card-go {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); flex: none;
}

.rp-open-modal { width: 360px; text-align: center; }
.rp-cover {
  border-radius: 16px; padding: 22px 18px;
  background: linear-gradient(160deg, #ff7a45, #e8443a);
  color: #fff;
}
.rp-sender { font-size: 13px; opacity: 0.9; }
.rp-greeting { font-size: 17px; font-weight: 700; margin: 10px 0 18px; line-height: 1.4; }
.rp-open-btn {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto;
  background: #ffd166; color: #8a3b00; font-size: 22px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.rp-open-btn:active { transform: scale(0.96); }
.rp-amount b { font-size: 34px; font-weight: 800; margin-right: 2px; }
.rp-amount { font-size: 13px; }
.rp-summary { font-size: 12px; color: var(--text-3); margin: 14px 0 8px; text-align: left; }
.rp-list { max-height: 220px; overflow-y: auto; text-align: left; }
.rp-claim {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.rp-claim-amt { color: #c2521a; font-weight: 600; }
[data-theme="dark"] .rp-claim-amt { color: #ffb27a; }

/* 礼物 */
.gift-modal { width: 460px; }
.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 4px; }
.gift-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 8px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2);
}
.gift-item:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.gift-item.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.gift-item-emoji { font-size: 26px; line-height: 1; }
.gift-item-name { font-size: 13px; font-weight: 600; }
.gift-item-price { font-size: 11.5px; color: var(--warn-text); }

.gift-card {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 12px;
  background: linear-gradient(135deg, #fff2f6, #ffe3ec);
  border: 1px solid #ffd0de;
}
[data-theme="dark"] .gift-card { background: linear-gradient(135deg, #3a2027, #46232c); border-color: #5c2f3b; }
.gift-card-emoji { font-size: 26px; }
.gift-card-main { display: flex; flex-direction: column; gap: 2px; }
.gift-card-main b { font-size: 13.5px; }
.gift-card-sub { font-size: 11.5px; color: var(--text-3); }

/* ============================ 动态：页面式（不是弹窗） ============================ */
/* 去掉遮罩/居中卡片：直接铺满内容区，配合返回按钮，像切换页面 */
#modal-community.modal-mask {
  background: var(--bg);
  padding: 0;
  backdrop-filter: none;
  align-items: stretch;
  justify-content: stretch;
  z-index: 55;
}
#modal-community .community-modal {
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  box-shadow: none;
  animation: pageIn 0.2s ease-out;
}
@keyframes pageIn { from { opacity: 0; transform: translateX(14px); } }
.cm-back-home {
  width: 28px; height: 28px; border-radius: 8px; margin-right: 2px;
  color: var(--text-2); font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.cm-back-home:hover { background: var(--panel-3); color: var(--text); }
#modal-community .cm-head { padding-top: 12px; }
@media (max-width: 720px) {
  #modal-community .community-modal { border-radius: 0; }
}
/* 动态内容在大屏上居中收窄，更像信息流页面 */
#modal-community .cm-scroll { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
#modal-community .cm-head { width: 100%; max-width: 860px; margin-left: auto; margin-right: auto; }

/* ============================ 开发者中心 ============================ */
.dev-modal { width: 620px; }
.dev-tabs { display: flex; gap: 6px; margin: -6px 0 14px; flex-wrap: wrap; }
.dev-tab {
  padding: 6px 12px; border-radius: 9px; font-size: 13px;
  color: var(--text-2); background: var(--panel-2);
}
.dev-tab.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.dev-body { max-height: 62vh; overflow-y: auto; }
.dev-create {
  padding: 12px; border-radius: 12px; background: var(--panel-2);
  border: 1px solid var(--line); margin-bottom: 12px;
}
.dev-create-row { display: flex; gap: 8px; margin-bottom: 8px; }
.dev-create-row select, .dev-create-row input {
  flex: 1; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel); font-size: 13px;
}
.dev-create-row select { flex: 0 0 96px; }
.dev-create-row .btn-primary { flex: 0 0 auto; padding: 8px 16px; border-radius: 9px; }
.dev-hint { font-size: 11.5px; color: var(--text-3); margin: 2px 0 0; }
.dev-hint code, .dev-doc code { background: var(--panel-3); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

.dev-app {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  margin-bottom: 10px; background: var(--panel);
}
.dev-app-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dev-app-kind {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-text);
}
.dev-app-name { font-size: 14px; }
.dev-app-id { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.dev-app-desc { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.dev-app-token {
  font-size: 11.5px; padding: 7px 10px; border-radius: 8px;
  background: var(--panel-3); overflow-x: auto; white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace; color: var(--text-2);
}
.dev-app-ops { display: flex; gap: 8px; margin-top: 8px; }
.dev-app-ops button {
  font-size: 12px; padding: 5px 10px; border-radius: 8px;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line-2);
}
.dev-app-ops button:hover { background: var(--brand-soft); color: var(--brand-text); }
.dev-app-ops button.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }

.dev-square-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.dev-square-emoji { font-size: 22px; }
.dev-square-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dev-square-main b { font-size: 13.5px; }
.dev-square-desc { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-square-owner { font-size: 11.5px; color: var(--text-3); flex: none; }

.dev-doc h4 { margin: 14px 0 6px; font-size: 13.5px; }
.dev-doc p, .dev-doc li { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.dev-doc ul { padding-left: 18px; }
.dev-doc pre {
  background: var(--panel-3); padding: 10px 12px; border-radius: 10px;
  overflow-x: auto; font-size: 12px; line-height: 1.6;
}
.dev-doc pre code { background: none; padding: 0; }
.dev-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.dev-table th, .dev-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dev-table th { color: var(--text-3); font-weight: 500; }
.coins-balance b.unlimited { color: #b26a00; }
[data-theme="dark"] .coins-balance b.unlimited { color: #ffd79a; }
/* 橙币页：跨作品总账余额 */
.coins-ct {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; margin: -6px 0 12px;
  border-radius: 10px; background: var(--panel-2); border: 1px dashed var(--line-2);
  font-size: 12.5px; color: var(--text-2);
}
.coins-ct b { font-size: 15px; color: #e07b1a; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .coins-ct b { color: #ffb45e; }

/* ============================ 装扮商城 ============================ */
.coins-store-entry {
  width: 100%; margin-top: 12px; padding: 10px;
  border-radius: 10px; font-size: 12.5px;
  background: var(--brand-soft); color: var(--brand-text);
  border: 1px dashed var(--brand-line);
}
.coins-store-entry:hover { background: var(--brand-line); color: #fff; }

.store-modal { width: 620px; max-width: 94vw; }
.store-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.store-head .modal-title { margin: 0 0 12px; }
.store-balance { font-size: 12.5px; color: var(--text-3); }
.store-balance b { font-size: 16px; color: #e07b1a; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .store-balance b { color: #ffb45e; }

.store-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.store-tab {
  padding: 6px 14px; border-radius: 9px; font-size: 13px;
  color: var(--text-2); background: var(--panel-2);
}
.store-tab.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

.store-body { max-height: 60vh; overflow-y: auto; }
.store-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.store-loading, .store-empty { padding: 40px 0; text-align: center; color: var(--text-3); font-size: 13px; }

.store-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: var(--panel); display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.store-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.store-card.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

.store-preview {
  height: 84px; border-radius: 10px; margin-bottom: 6px;
  background: var(--panel-2) center / cover no-repeat;
  border: 1px dashed var(--line-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.store-preview .bubble {
  display: inline-block; max-width: 92%; font-size: 12.5px;
  padding: 7px 11px; line-height: 1.4; white-space: nowrap;
  border-radius: 10px; border-top-left-radius: 10px; border-top-right-radius: 10px;
}

.store-name { font-size: 13.5px; font-weight: 600; }
.store-slogan { font-size: 11.5px; color: var(--text-3); min-height: 16px; }
.store-btn {
  margin-top: 6px; padding: 7px 0; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; width: 100%;
}
.store-btn.buy { background: var(--brand); color: #fff; }
.store-btn.buy:hover { filter: brightness(1.06); }
.store-btn.equip { background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-line); }
.store-btn.equip:hover { background: var(--brand); color: #fff; }
.store-btn.on { background: var(--panel-3); color: var(--text-3); cursor: default; }
.store-tip { margin-top: 12px; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

@media (max-width: 560px) {
  .store-grid { grid-template-columns: 1fr; }
  .store-body { max-height: 56vh; }
}

/* ---------------- 气泡皮肤 ---------------- */
/* 对方与自己各用各的装扮，所以要同时覆盖默认与 .mine 样式 */
.bubble.bub-bubble-sakura,
.msg-row.mine .bubble.bub-bubble-sakura {
  background: linear-gradient(135deg, #fff2f7, #ffdfec);
  color: #8a2f4f; border: 1px solid #ffd0e0;
  box-shadow: 0 3px 10px rgba(255, 143, 184, 0.22);
}
.bubble.bub-bubble-mint,
.msg-row.mine .bubble.bub-bubble-mint {
  background: linear-gradient(135deg, #eafcf4, #d2f5e6);
  color: #1f6b4f; border: 1px solid #b8ecd6;
  box-shadow: 0 3px 10px rgba(46, 190, 140, 0.18);
}
.bubble.bub-bubble-night,
.msg-row.mine .bubble.bub-bubble-night {
  background: linear-gradient(135deg, #2c313d, #1b1f28);
  color: #e8ecf5; border: 1px solid #3b4353;
  box-shadow: 0 4px 14px rgba(10, 14, 22, 0.45);
}
.bubble.bub-bubble-sunset,
.msg-row.mine .bubble.bub-bubble-sunset {
  background: linear-gradient(135deg, #ff9d5c, #ff6459);
  color: #fff; border: none;
  box-shadow: 0 4px 14px rgba(255, 106, 90, 0.34);
}
.bubble.bub-bubble-galaxy,
.msg-row.mine .bubble.bub-bubble-galaxy {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 68%, rgba(255, 255, 255, 0.4) 0 1px, transparent 2px),
    radial-gradient(circle at 46% 82%, rgba(255, 255, 255, 0.3) 0 1px, transparent 2px),
    linear-gradient(135deg, #2b1b56, #4b2b8f 55%, #1c2a60);
  color: #f1eaff; border: 1px solid #5b3fa0;
  box-shadow: 0 4px 16px rgba(75, 43, 143, 0.38);
}
.bubble.bub-bubble-gold,
.msg-row.mine .bubble.bub-bubble-gold {
  background: linear-gradient(135deg, #fbf0c4, #e9c76d 50%, #d3a53c);
  color: #5a3c00; border: 1px solid #c79a34;
  box-shadow: 0 4px 14px rgba(198, 150, 40, 0.32);
}

/* ---------------- 头像框 ---------------- */
.avatar[class*="fr-"] { overflow: visible; }
.avatar[class*="fr-"] img { border-radius: inherit; }
.avatar[class*="fr-"]::before {
  content: ''; position: absolute; inset: -4px; border-radius: inherit;
  padding: 4px; z-index: 2; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.avatar.fr-frame-glow::before {
  background: conic-gradient(from 0deg, #ffd479, #ff9ec7, #8ecdf7, #ffd479);
}
.avatar.fr-frame-glow { box-shadow: 0 0 12px rgba(255, 180, 210, 0.55); }
.avatar.fr-frame-sakura::before {
  background: conic-gradient(from 0deg, #ffc2d8, #ff8fb8, #ffd9e7, #ff9ec7, #ffc2d8);
}
.avatar.fr-frame-gold::before {
  background: conic-gradient(from 0deg, #f7e7b0, #d4a63f, #fff6d0, #b8862b, #f7e7b0);
}
.avatar.fr-frame-gold { box-shadow: 0 0 10px rgba(212, 166, 63, 0.45); }
.avatar.fr-frame-neon::before {
  background: conic-gradient(from 0deg, #00e5ff, #b14aff, #ff2e88, #00e5ff);
}
.avatar.fr-frame-neon { box-shadow: 0 0 14px rgba(177, 74, 255, 0.6); }
.avatar.fr-frame-star::before {
  background: conic-gradient(from 0deg, #7a5cff, #22d3ee, #ff7ad9, #7a5cff);
  animation: framePulse 2.4s ease-in-out infinite;
}
.avatar.fr-frame-star { box-shadow: 0 0 14px rgba(122, 92, 255, 0.55); }
@keyframes framePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ============================ 个人主页 ============================ */
.home-modal {
  width: 520px; max-width: 94vw; padding: 0;
  max-height: 88vh; overflow-y: auto; overflow-x: hidden;
}
.home-modal .modal-close {
  position: absolute; right: 12px; top: 10px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.28); color: #fff; font-size: 13px;
}
.home-modal .modal-close:hover { background: rgba(0, 0, 0, 0.45); }

.home-cover {
  height: 96px; background-size: cover; background-position: center;
  position: relative;
}
.home-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 60%);
}

.home-head { display: flex; gap: 12px; padding: 0 20px; margin-top: -32px; align-items: flex-end; position: relative; z-index: 2; }
.home-avatar > .avatar {
  width: 76px; height: 76px; font-size: 28px; border-radius: 20px;
  border: 3px solid var(--panel); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}
.home-id { flex: 1; min-width: 0; padding-bottom: 6px; }
.home-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.home-name-row b { font-size: 18px; font-weight: 700; }
.home-username { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.home-actions { display: flex; gap: 8px; padding-bottom: 6px; flex: none; }
.home-btn {
  padding: 7px 13px; border-radius: 9px; font-size: 12.5px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2);
}
.home-btn:hover { background: var(--panel-3); }
.home-btn.primary { background: var(--brand); color: #fff; border-color: transparent; }
.home-btn.primary:hover { filter: brightness(1.06); }
.home-btn[disabled] { opacity: 0.6; cursor: default; }

.home-bio { padding: 14px 20px 0; font-size: 13px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }
.home-bio.muted { color: var(--text-3); }

.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 20px 0; }
.home-stats > div { background: var(--panel-2); border-radius: 11px; padding: 10px 4px; text-align: center; }
.home-stats b { display: block; font-size: 17px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.home-stats span { font-size: 11.5px; color: var(--text-3); }

.home-sec { padding: 18px 20px 0; }
.home-sec:last-child { padding-bottom: 20px; }
.home-sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 9px;
}
.home-sec-head em { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--text-3); }

.home-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.home-gift {
  position: relative; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 6px 9px; text-align: center;
  transition: transform 0.12s, border-color 0.12s;
}
.home-gift:hover { transform: translateY(-1px); border-color: var(--brand-line); }
.home-gift-emoji { display: block; font-size: 26px; line-height: 1.25; }
.home-gift-name { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.home-gift-num {
  position: absolute; right: 6px; top: 6px; font-size: 10.5px; font-weight: 600;
  background: var(--brand); color: #fff; border-radius: 8px; padding: 0 5px; line-height: 16px;
}

.home-recent { border-top: 1px solid var(--line); }
.home-recent-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.home-recent-emoji { font-size: 18px; flex: none; }
.home-recent-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-recent-main b { font-weight: 600; }
.home-recent-amt { color: #12864a; font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .home-recent-amt { color: #4ade80; }
.home-recent-time { font-size: 11px; color: var(--text-3); flex: none; }
.home-empty { padding: 20px 0; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ============================ 个性设置 ============================ */
.set-field { margin-bottom: 16px; }
.set-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 7px;
}
.set-label em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--text-3); margin-left: 4px; }
.set-input {
  width: 100%; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  font-size: 13px; color: var(--text); outline: none;
}
.set-input:focus { border-color: var(--brand); background: var(--panel); }
.set-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }
.set-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.color-dots { display: flex; gap: 10px; flex-wrap: wrap; }
.color-dots button {
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  background: var(--dot); border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s, box-shadow 0.12s;
}
.color-dots button:hover { transform: scale(1.08); }
.color-dots button.active {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--dot);
}

.pat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pat-chip {
  padding: 7px 13px; border-radius: 10px; font-size: 12.5px;
  background: var(--panel-2); color: var(--text-2);
  border: 1px solid var(--line-2);
  transition: all 0.12s;
}
.pat-chip:hover { border-color: var(--brand-line); color: var(--brand-text); }
.pat-chip.active {
  background: var(--brand-soft); color: var(--brand-text);
  border-color: var(--brand); font-weight: 600;
}
.pat-preview {
  padding: 14px; border-radius: 11px; text-align: center;
  background: var(--panel-2); border: 1px dashed var(--line-2);
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}

/* 提示音列表 */
.sound-head { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.sound-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.sound-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.sound-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sound-item-main b { font-size: 12.5px; font-weight: 600; }
.sound-item-main span { font-size: 11px; color: var(--text-3); }
.sound-item-main span.custom { color: var(--brand-text); }
.sound-btn {
  padding: 5px 11px; border-radius: 8px; font-size: 12px;
  background: var(--panel); color: var(--text-2);
  border: 1px solid var(--line-2);
}
.sound-btn:hover { border-color: var(--brand-line); color: var(--brand-text); }
.sound-btn.danger:hover { border-color: var(--danger-line); color: var(--danger); }

/* 个人主页：在线状态 */
.home-status { display: inline-flex; align-items: center; gap: 5px; }
.home-status i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.home-home-title { color: var(--brand-text); }

/* ============================ 主题色 ============================ */
:root[data-accent="red"] {
  --brand: #f04452; --brand-text: #c8333f;
  --brand-soft: #fdecee; --brand-line: #f8d0d4;
  --bubble-mine: linear-gradient(135deg, #ff7b7b, #ef3b4a);
}
:root[data-accent="orange"] {
  --brand: #f59e0b; --brand-text: #b45309;
  --brand-soft: #fff7e6; --brand-line: #fde3b3;
  --bubble-mine: linear-gradient(135deg, #ffb547, #f08a00);
}
:root[data-accent="green"] {
  --brand: #10b981; --brand-text: #0b7d5c;
  --brand-soft: #e8faf3; --brand-line: #c3efdf;
  --bubble-mine: linear-gradient(135deg, #45d9a4, #0ba372);
}
:root[data-accent="purple"] {
  --brand: #8b5cf6; --brand-text: #6d3fd4;
  --brand-soft: #f2ecff; --brand-line: #ddd0fb;
  --bubble-mine: linear-gradient(135deg, #a98bfb, #7c4df0);
}
:root[data-accent="pink"] {
  --brand: #ec4899; --brand-text: #c02c74;
  --brand-soft: #fdecf4; --brand-line: #f9cfe2;
  --bubble-mine: linear-gradient(135deg, #ff7ab8, #e0308a);
}

/* 深色主题下柔化底色 */
[data-theme="dark"][data-accent="red"] { --brand-soft: #3a1f24; --brand-line: #5c2f36; --bubble-mine: linear-gradient(135deg, #b3313c, #7d1f27); }
[data-theme="dark"][data-accent="orange"] { --brand-soft: #3a2c14; --brand-line: #5c4520; --bubble-mine: linear-gradient(135deg, #b06d0a, #7a4a05); }
[data-theme="dark"][data-accent="green"] { --brand-soft: #163227; --brand-line: #24513c; --bubble-mine: linear-gradient(135deg, #0f7d5c, #0a5540); }
[data-theme="dark"][data-accent="purple"] { --brand-soft: #2a2440; --brand-line: #453764; --bubble-mine: linear-gradient(135deg, #6d47d0, #4a2d96); }
[data-theme="dark"][data-accent="pink"] { --brand-soft: #3a1f2c; --brand-line: #5c2f45; --bubble-mine: linear-gradient(135deg, #b02c6e, #7d1f4e); }

/* ============================ GC Auth ============================ */
.dev-textarea {
  width: 100%; padding: 8px 10px; border-radius: 9px; resize: vertical;
  border: 1px solid var(--line-2); background: var(--panel);
  font-family: inherit; font-size: 12.5px; line-height: 1.6; color: var(--text);
  margin-bottom: 8px;
}
.dev-textarea:focus { border-color: var(--brand); outline: none; }
#dev-auth .dev-create-row input { width: 100%; }
.dev-app-token[data-copy] { cursor: pointer; }
.dev-app-token[data-copy]:hover { color: var(--brand-text); }
.dev-app-token.pkce { color: var(--brand-text); background: var(--brand-soft); }
