/* =========================================================================
   SafeChat 视觉升级 v2（设计层）
   -------------------------------------------------------------------------
   思路：
   1) 用「扁平描边」换成「圆角 + 柔和投影 + 发丝线」，做出 App 的层次感
   2) 消息做「分组」：同一个人连续发言合并成一段，只有段尾显示时间/对勾
   3) 输入区做成悬浮胶囊条，发送键用渐变 + 投影
   4) 聊天区加极淡的点阵壁纸，避免"一整块纯色网页"
   5) 全部颜色走令牌，深色/浅色共用一套结构
   ========================================================================= */

:root {
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --canvas: #080e14;
  --panel: #0f1822;
  --panel-2: #131e29;
  --rail: #0b141d;
  --chat-bg: #0a121a;
  --dot: rgba(255, 255, 255, .035);
  --ink: #e9eff6;
  --ink-2: #8b9bab;
  --ink-3: #5f6f7d;
  --hairline: rgba(255, 255, 255, .065);
  --hairline-2: rgba(255, 255, 255, .1);
  --row-active: rgba(74, 156, 255, .14);
  --row-hover: rgba(255, 255, 255, .045);
  --accent: #4a9cff;
  --accent-2: #35c2f0;
  --accent-grad: linear-gradient(135deg, #63b3ff 0%, #2f7df6 100%);
  --accent-glow: rgba(47, 125, 246, .55);
  --bubble-in: #16222e;
  --bubble-out: linear-gradient(180deg, #2c6193 0%, #27527e 100%);
  --bubble-out-border: rgba(120, 190, 255, .16);
  --link: #6bc0ff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-2: 0 6px 18px -8px rgba(0, 0, 0, .6);
  --shadow-3: 0 24px 60px -28px rgba(0, 0, 0, .85);
  --ring: rgba(74, 156, 255, .22);
  --online: #3ddc97;
  --wall-glow-1: rgba(47, 125, 246, .12);
  --wall-glow-2: rgba(53, 194, 240, .08);
  --panel-glass: rgba(15, 24, 34, .88);
}

[data-theme="light"] {
  --canvas: #eaeff6;
  --panel: #ffffff;
  --panel-2: #f4f7fb;
  --rail: #f8fafd;
  --chat-bg: #eaf0f7;
  --dot: rgba(20, 40, 70, .055);
  --ink: #10202e;
  --ink-2: #5f7183;
  --ink-3: #93a3b3;
  --hairline: rgba(18, 40, 70, .075);
  --hairline-2: rgba(18, 40, 70, .12);
  --row-active: linear-gradient(180deg, #e9f2ff 0%, #e0eeff 100%);
  --row-hover: #f2f6fb;
  --accent: #2f7df6;
  --accent-2: #1f9cf0;
  --accent-grad: linear-gradient(135deg, #5aa9ff 0%, #2f7df6 100%);
  --accent-glow: rgba(47, 125, 246, .38);
  --bubble-in: #ffffff;
  --bubble-out: linear-gradient(180deg, #d9edff 0%, #c9e2ff 100%);
  --bubble-out-border: rgba(47, 125, 246, .16);
  --link: #1e73cf;
  --shadow-1: 0 1px 2px rgba(16, 40, 70, .07);
  --shadow-2: 0 8px 22px -12px rgba(16, 40, 70, .28);
  --shadow-3: 0 28px 70px -30px rgba(16, 40, 70, .45);
  --ring: rgba(47, 125, 246, .22);
  --online: #17a06a;
  --wall-glow-1: rgba(47, 125, 246, .08);
  --wall-glow-2: rgba(53, 194, 240, .07);
  --panel-glass: rgba(255, 255, 255, .9);
}

/* 基础字体与观感 */
body {
  font-family: "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.003em;
}
.mono, .li-time, .msg-meta, .media-meta { font-variant-numeric: tabular-nums; }

/* ---------------- 左侧图标栏 ---------------- */
.rail {
  background: var(--rail);
  border-right: 1px solid var(--hairline);
  padding: 12px 0 14px;
  gap: 6px;
}
.rail-btn {
  width: 42px; height: 42px; border-radius: 13px;
  color: var(--ink-3);
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.rail-btn svg { width: 21px; height: 21px; }
.rail-btn:hover { background: var(--row-hover); color: var(--ink); }
.rail-btn.nav.active {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 8px 18px -8px var(--accent-glow);
}
.rail-btn.logo { color: var(--accent); }
.rail-btn.logo:hover { background: transparent; transform: none; }
.rail-badge {
  background: var(--danger); border: 2px solid var(--rail);
  box-shadow: 0 2px 8px -2px rgba(239, 83, 80, .8);
}
.avatar-btn { width: 40px; height: 40px; }
.avatar-btn .avatar { width: 40px; height: 40px; box-shadow: 0 0 0 2px var(--rail), 0 0 0 3px var(--hairline-2); }

/* ---------------- 列表栏 ---------------- */
.list-panel { background: var(--panel); border-right: 1px solid var(--hairline); }
.list-head {
  padding: 14px 14px 12px;
  border-bottom: 0;
  box-shadow: 0 1px 0 var(--hairline);
  position: relative; z-index: 2;
  background: var(--panel);
}
.list-title-row { padding: 0 2px 10px; }
.list-title-row h2 { font-size: 20px; font-weight: 700; letter-spacing: -.35px; }
.list-actions .icon-btn {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--panel-2);
  transition: background .16s, transform .16s;
}
.list-actions .icon-btn svg { width: 19px; height: 19px; }
.list-actions .icon-btn:hover { background: var(--row-hover); transform: translateY(-1px); }
.search-wrap .search-ico { left: 12px; width: 16px; height: 16px; }
.search-wrap input {
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 35px;
  font-size: 13.5px;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.search-wrap input:focus {
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}
.list-scroll { padding: 8px 6px 12px; }
.list-item {
  border-radius: 14px;
  padding: 9px 10px;
  margin: 1px 0;
  position: relative;
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.list-item::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(.2);
  width: 3px; height: 26px; border-radius: 3px; background: var(--accent);
  opacity: 0; transition: opacity .18s, transform .18s;
}
.list-item:hover { background: var(--row-hover); }
.list-item.active { background: var(--row-active); }
.list-item.active::before { opacity: 1; transform: translateY(-50%) scaleY(1); }
.li-name { font-size: 14.8px; font-weight: 600; letter-spacing: -.1px; }
.li-time { font-size: 11px; color: var(--ink-3); }
.li-preview { font-size: 13px; color: var(--ink-2); }
.li-badge {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 6px 12px -6px var(--accent-glow);
  min-width: 20px; height: 20px;
}
.list-item.active .li-name { color: var(--ink); }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--ink-3); padding: 14px 12px 6px;
}

/* ---------------- 头像 ---------------- */
.avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  font-weight: 600; letter-spacing: .2px;
}
.avatar .online-dot { border-color: var(--panel); box-shadow: 0 0 0 2px var(--panel); }

/* ---------------- 聊天区 ---------------- */
.chat-panel { background-color: var(--chat-bg); }
.chat-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
  opacity: .85;
}
.chat-head, .msg-scroll, .composer { position: relative; z-index: 1; }
.chat-head {
  height: 64px; flex: 0 0 64px;
  padding: 0 12px 0 14px;
  background: var(--panel);
  border-bottom: 0;
  box-shadow: 0 1px 0 var(--hairline), 0 12px 28px -24px rgba(16, 40, 70, .8);
}
.chat-head-avatar .avatar {
  width: 40px; height: 40px; font-size: 15px;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--ring);
}
.chat-head-name { font-size: 15.5px; font-weight: 650; letter-spacing: -.15px; }
.chat-head-sub { font-size: 12.2px; color: var(--ink-2); margin-top: 2px; }
.chat-head-actions .icon-btn { width: 36px; height: 36px; border-radius: 11px; }
.chat-head-actions .icon-btn:hover { background: var(--panel-2); }

/* ---------------- 消息 ---------------- */
.msg-inner { padding: 16px 0 10px; }
.msg-row { padding: 0 14px; margin-bottom: 3px; align-items: flex-end; }
.msg-row.cont { margin-top: -2px; margin-bottom: 2px; }
.msg-col { max-width: min(560px, 70%); }
.bubble {
  border-radius: var(--radius-md);
  padding: 8px 13px 7px;
  font-size: 14.7px;
  line-height: 1.52;
  letter-spacing: -.002em;
  box-shadow: var(--shadow-1);
  border: 1px solid transparent;
}
.msg-row.in .bubble {
  background: var(--bubble-in);
  border-color: var(--hairline);
  border-bottom-left-radius: 6px;
}
.msg-row.out .bubble {
  background: var(--bubble-out);
  border-color: var(--bubble-out-border);
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px -10px var(--accent-glow);
}
[data-theme="light"] .msg-row.out .bubble { color: #10283f; }

/* 分组：同一人连续消息（cont=接上一条，tail=后面还有同人消息） */
.msg-row.in .avatar { visibility: hidden; }
.msg-row.in:not(.cont) .avatar { visibility: visible; }
.msg-row.cont .msg-sender { display: none; }
.msg-row:not(.tail) .msg-meta { display: none; }
.msg-row.cont.in .bubble { border-top-left-radius: 6px; }
.msg-row.cont.out .bubble { border-top-right-radius: 6px; }
.msg-row:not(.tail).in .bubble { border-bottom-left-radius: 6px; }
.msg-row:not(.tail).out .bubble { border-bottom-right-radius: 6px; }
.msg-row .avatar { margin-bottom: 0; }
.chat-empty { position: relative; z-index: 1; }
.msg-meta {
  font-size: 10.8px;
  color: var(--ink-3);
  margin: 4px 6px 2px;
  letter-spacing: .15px;
}
.msg-meta .ticks.read { color: var(--accent); font-weight: 700; }
.msg-sender { font-size: 12px; margin: 2px 8px 4px; letter-spacing: -.1px; }
.msg-sep { margin: 16px 0 12px; }
.msg-sep span {
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--sep-bg); color: var(--ink-2);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(10px);
}
.msg-system span {
  font-size: 11.5px; padding: 5px 13px; border-radius: 999px;
  background: var(--sep-bg); border: 1px solid var(--hairline);
  color: var(--ink-2); backdrop-filter: blur(10px);
}
.msg-unread { margin: 14px 18px 10px; font-size: 11px; letter-spacing: .4px; }
.msg-unread::before, .msg-unread::after { background: var(--hairline-2); }

/* 媒体 */
.bubble.media { padding: 4px; border-radius: var(--radius-md); }
.msg-row.in .bubble.media { border-bottom-left-radius: 6px; }
.msg-row.out .bubble.media { border-bottom-right-radius: 6px; }
.img-single { border-radius: 12px; }
.album { border-radius: 12px; gap: 3px; }
.album-cell { border-radius: 0; }
.album-cell:first-child { border-top-left-radius: 9px; }
.bubble-caption { padding: 8px 9px 4px; font-size: 14.5px; }
.media-meta { font-size: 10.8px; padding: 4px 8px 3px; color: var(--ink-3); }
.media-meta .ticks.read { color: var(--accent); font-weight: 700; }
.bubble.file-card { border-radius: var(--radius-md); }
.file-row { padding: 11px 13px; gap: 12px; }
.file-ico {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 8px 18px -10px var(--accent-glow);
}
.file-name { font-size: 13.6px; }
.file-size { color: var(--ink-2); }
.file-dl { border-radius: 11px; }
.file-dl:hover { background: var(--row-hover); }

/* ---------------- 输入区：悬浮胶囊 ---------------- */
.composer {
  padding: 8px 14px calc(14px + var(--safe-b));
  background: transparent;
  border-top: 0;
}
.composer-row {
  align-items: flex-end;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 8px;
  box-shadow: var(--shadow-2);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.composer-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-2);
}
.composer textarea {
  background: transparent;
  box-shadow: none;
  border-radius: 14px;
  padding: 9px 8px;
  font-size: 14.7px;
  min-height: 40px;
}
.composer textarea:focus { box-shadow: none; }
.composer .icon-btn { width: 36px; height: 36px; border-radius: 11px; color: var(--ink-3); }
.composer .icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.send-btn {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--accent-grad);
  box-shadow: 0 10px 20px -10px var(--accent-glow);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s;
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 24px -10px var(--accent-glow); filter: none; background: var(--accent-grad); }
.send-btn:active { transform: scale(.94); }
.send-btn svg { width: 19px; height: 19px; }
.attach-preview { padding: 2px 2px 10px; gap: 8px; }
.att-chip {
  width: 70px; height: 70px; border-radius: 12px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-1);
  background: var(--panel-2);
}
.att-chip .rm { width: 19px; height: 19px; font-size: 11px; background: rgba(12, 22, 32, .72); backdrop-filter: blur(4px); }
.reply-bar { border-radius: var(--radius-xs); }

/* ---------------- 弹层 / 表单 / 按钮 ---------------- */
.btn {
  border-radius: 11px;
  font-weight: 600;
  transition: transform .14s var(--ease), box-shadow .18s var(--ease), background .18s, filter .18s;
}
.btn.primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 10px 22px -12px var(--accent-glow);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -12px var(--accent-glow); background: var(--accent-grad); }
.btn.ghost { border-color: var(--hairline-2); }
.btn.ghost:hover { background: var(--row-hover); }
.btn.danger { box-shadow: 0 10px 22px -14px rgba(239, 83, 80, .9); }

.modal {
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-3);
  overflow: auto;
}
.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
}
.modal-head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.modal-body { padding: 18px 20px 22px; }
.modal-foot { padding: 14px 20px 18px; border-top: 1px solid var(--hairline); }
.modal .row { border-bottom: 1px solid var(--hairline); padding: 12px 6px; }
.modal .row-click { border-radius: 12px; }
.modal .row-click:hover { background: var(--row-hover); }

.field > span { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); }
.field input, .field textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--panel-2);
  padding: 12px 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input:focus, .field textarea:focus {
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}
.switch { border-radius: 999px; }
.switch::after { box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

/* 右键菜单 / 提示条 */
.ctx-menu {
  border-radius: 14px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-3);
  padding: 6px;
  backdrop-filter: blur(16px);
}
.ctx-menu button { border-radius: 9px; padding: 9px 11px; font-size: 13.4px; }
.ctx-menu button:hover { background: var(--row-hover); }
.toast {
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--hairline);
  font-size: 13.2px;
  backdrop-filter: blur(14px);
}
.scroll-down {
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--hairline);
}
.scroll-down-badge { background: var(--accent-grad); box-shadow: 0 4px 10px -4px var(--accent-glow); }

/* 表情面板 */
.emoji-panel { border-radius: var(--radius-lg); border: 1px solid var(--hairline); box-shadow: var(--shadow-3); }
.emoji-tabs button { border-radius: 10px 10px 0 0; }
.emoji-grid button { border-radius: 10px; }
.emoji-stickers button { border-radius: 12px; }

/* ---------------- 空状态 ---------------- */
.empty-inner { gap: 14px; max-width: 380px; }
.empty-inner h3 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.empty-inner p { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.chat-empty > .empty-inner > svg {
  filter: drop-shadow(0 16px 30px var(--accent-glow));
  color: var(--accent);
  opacity: .16;
}

/* ---------------- 登录页 ---------------- */
.auth-bg {
  background:
    radial-gradient(1200px 700px at 12% 4%, rgba(90, 169, 255, .28), transparent 62%),
    radial-gradient(900px 700px at 88% 96%, rgba(53, 194, 240, .22), transparent 60%),
    radial-gradient(700px 500px at 70% 20%, rgba(120, 90, 220, .10), transparent 60%),
    linear-gradient(160deg, var(--canvas), #dce8f4 55%, var(--canvas));
}
[data-theme="dark"] .auth-bg {
  background:
    radial-gradient(1200px 700px at 12% 4%, rgba(47, 125, 246, .30), transparent 62%),
    radial-gradient(900px 700px at 88% 96%, rgba(53, 194, 240, .18), transparent 60%),
    radial-gradient(700px 500px at 70% 20%, rgba(120, 90, 220, .16), transparent 60%),
    linear-gradient(160deg, #070c12, #0c1620 55%, #070c12);
}
.auth-card {
  border-radius: var(--radius-xl);
  padding: 30px 26px 24px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  backdrop-filter: blur(22px) saturate(1.2);
  animation: authIn .4s var(--ease);
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.auth-brand { gap: 14px; margin-bottom: 24px; }
.brand-logo {
  width: 54px; height: 54px; border-radius: 17px;
  background: var(--accent-grad);
  box-shadow: 0 14px 30px -14px var(--accent-glow);
}
.brand-logo svg path:first-of-type { fill: #fff; opacity: .18; }
.auth-brand h1 { font-size: 22px; letter-spacing: -.5px; }
.auth-brand p { font-size: 12px; color: var(--ink-2); }
.auth-tabs { border-radius: 13px; padding: 4px; }
.auth-tab { border-radius: 10px; font-size: 13.5px; }
.auth-tab.active { box-shadow: 0 8px 18px -10px var(--accent-glow); }
.auth-hint { color: var(--ink-3); }
.btn.big { border-radius: 14px; padding: 13px; font-size: 15px; letter-spacing: .3px; }
.pw-meter { gap: 6px; }
.pw-meter i { height: 4px; border-radius: 4px; }

/* ---------------- 滚动条 ---------------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(130, 155, 180, .32), rgba(130, 155, 180, .22));
  border: 2px solid transparent; background-clip: content-box; border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(130, 155, 155, .45); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
[data-theme="light"] *::-webkit-scrollbar-thumb { background: rgba(60, 90, 120, .22); background-clip: content-box; }

/* ---------------- 手机端微调 ---------------- */
@media (max-width: 860px) {
  .list-head { padding: calc(14px + var(--safe-t)) 14px 12px; }
  .list-item { border-radius: 16px; padding: 11px 12px; margin: 2px 0; }
  .list-item .avatar { width: 50px; height: 50px; }
  .chat-head { height: auto; padding: calc(10px + var(--safe-t)) 10px 10px; }
  .chat-head-avatar .avatar { width: 38px; height: 38px; }
  .bubble { font-size: 15.5px; border-radius: 18px; padding: 9px 13px 8px; }
  .msg-row.out .bubble { border-bottom-right-radius: 6px; }
  .msg-row.in .bubble { border-bottom-left-radius: 6px; }
  .msg-col { max-width: 82%; }
  .composer { padding: 6px 10px calc(10px + var(--safe-b)); }
  .composer-row { border-radius: 22px; padding: 5px 5px 5px 6px; }
  .send-btn { width: 40px; height: 40px; border-radius: 16px; }
  .emoji-panel { border-radius: 18px; }
  .modal { border-radius: 0; }
}

/* 细节微调 */
.list-actions { gap: 6px; }
.rail-mid { gap: 8px; }
.list-title-row { align-items: center; }
.chat-empty .empty-inner > svg { width: 88px; height: 88px; }

/* 文件卡片 & 输入框细节 */
.bubble.file-card { padding: 0; overflow: hidden; }
.bubble.file-card .file-row { padding: 12px 14px; }
[data-theme="light"] .composer textarea { background: transparent; box-shadow: none; }
[data-theme="dark"] .composer textarea { background: transparent; box-shadow: none; }
.composer-row { gap: 4px; }
.msg-row .msg-col { gap: 0; }

/* ===== 最后一轮手感打磨 ===== */
.list-panel { box-shadow: 1px 0 0 var(--hairline), 12px 0 28px -26px rgba(16, 40, 70, .55); }
.msg-row { border-radius: 14px; }
.msg-row:hover { background: color-mix(in srgb, var(--row-hover) 60%, transparent); }
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .msg-row:hover { background: transparent; }
}
.send-btn { border-radius: 50%; }
.send-btn svg { transform: translateX(1px); }
.send-btn:active { transform: scale(.92); }
.chat-head .icon-btn { border-radius: 50%; }
.chat-head .icon-btn:hover { background: var(--panel-2); }
.li-badge { font-weight: 700; letter-spacing: -.2px; }
.chat-head-name { font-weight: 680; }
.msg-col { transform-origin: bottom; }
.bubble-caption { color: var(--ink); }
[data-theme="light"] .msg-row.out .bubble-caption { color: #10283f; }

/* 输入框与最后一条消息之间留呼吸空间 */
.msg-inner { padding-bottom: 20px; }
.composer { padding-top: 6px; }

/* 桌面端：满幅铺开（不要外框！真客户端都是顶到窗口边） */
@media (min-width: 861px) {
  body { background: var(--panel); }
  .shell {
    margin: 0;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    overflow: hidden;
  }
}

/* ===== 桌面端无边框：自绘窗口控制 + 拖拽区 ===== */
.win-controls { display: none; }
html[data-own-frame] .win-controls {
  display: flex;
  position: fixed; top: 0; right: 0; z-index: 60;
  -webkit-app-region: no-drag;
}
html[data-own-frame] .wc {
  width: 46px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .14s, color .14s;
}
html[data-own-frame] .wc svg { width: 12px; height: 12px; }
html[data-own-frame] .wc:hover { background: var(--row-hover); color: var(--ink); }
html[data-own-frame] .wc.close:hover { background: #e81123; color: #fff; }

/* 可拖动区域：列表头 + 会话头；内部控件不拖 */
html[data-own-frame] .list-head,
html[data-own-frame] .chat-head { -webkit-app-region: drag; }
html[data-own-frame] .list-head .icon-btn,
html[data-own-frame] .list-head input,
html[data-own-frame] .chat-head .icon-btn,
html[data-own-frame] .chat-head-info,
html[data-own-frame] .chat-head-avatar { -webkit-app-region: no-drag; }

/* 给右上角窗口按钮让位 */
html[data-own-frame] .list-title-row { padding-right: 146px; }
html[data-own-frame] .chat-head { padding-right: 150px; }
