/* ============================================================
   校园同学站 · 样式
   设计语言参考 DeepSeek Harness 界面：
   - 白 / 近黑双色层次，靠 1px 发丝边框分层，不用重阴影和渐变
   - 强调色只有一个蓝 rgb(65,118,230)，主按钮实色
   - 圆角 8 / 12 / 16 / 18，字号 12 / 13 / 14 / 16
   - 图标全部是自制线条 SVG（图标集见 index.html）
   ============================================================ */

:root {
  /* 层次 */
  --bg-base: #ffffff;
  --bg-platform: rgb(245, 246, 247);
  --bg-layer-1: #ffffff;
  --bg-soft: rgb(249, 250, 251);
  --bg-hover: rgba(38, 49, 72, .06);
  --bg-active: rgba(38, 49, 72, .10);
  --bubble: rgb(241, 243, 245);

  /* 边框 */
  --border-1: rgba(0, 0, 0, .06);
  --border-2: rgba(0, 0, 0, .10);
  --border-3: rgba(0, 0, 0, .16);

  /* 文字 */
  --text-1: rgb(15, 17, 21);
  --text-2: rgb(97, 102, 107);
  --text-3: rgb(129, 133, 140);

  /* 强调色 */
  --accent: rgb(65, 118, 230);
  --accent-hover: rgb(37, 99, 235);
  --accent-soft: rgb(234, 243, 255);
  --danger: rgb(220, 60, 60);
  --danger-soft: rgb(253, 236, 236);
  --ok: rgb(34, 197, 94);

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-pill: 18px;

  --rail-w: 216px;
  --list-w: 276px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, Menlo, "PingFang SC", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-base: rgb(21, 21, 23);
    --bg-platform: rgb(32, 32, 34);
    --bg-layer-1: rgb(35, 35, 36);
    --bg-soft: rgb(44, 44, 46);
    --bg-hover: rgba(255, 255, 255, .06);
    --bg-active: rgba(255, 255, 255, .12);
    --bubble: rgb(53, 54, 56);

    --border-1: rgba(255, 255, 255, .06);
    --border-2: rgba(255, 255, 255, .12);
    --border-3: rgba(255, 255, 255, .18);

    --text-1: rgb(249, 250, 251);
    --text-2: rgb(151, 157, 166);
    --text-3: rgb(129, 133, 140);

    --accent: rgb(86, 134, 254);
    --accent-hover: rgb(103, 158, 254);
    --accent-soft: rgba(86, 134, 254, .16);
    --danger: rgb(242, 90, 90);
    --danger-soft: rgba(242, 90, 90, .14);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  color: var(--text-1);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sub { color: var(--text-3); font-size: 13px; }
.hint { color: var(--text-3); font-size: 12px; }

/* ------------------------------ 图标 ------------------------------ */

.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }
.ico-xl { width: 24px; height: 24px; }

/* ------------------------------ 控件 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 6px 15px;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
  background: transparent;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
}
.btn:active { opacity: .8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { border-color: var(--border-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); }
.btn-quiet { color: var(--text-2); padding: 6px 10px; }
.btn-quiet:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-1); }
.btn-small { padding: 3px 11px; font-size: 13px; line-height: 20px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-1); }
.icon-btn-solid { background: var(--accent); color: #fff; width: 34px; height: 34px; }
.icon-btn-solid:hover { background: var(--accent-hover); color: #fff; }
.icon-btn-solid:disabled { background: var(--border-3); color: rgba(255, 255, 255, .8); cursor: not-allowed; }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
  margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-m);
  background: var(--bg-layer-1);
  outline: none;
  font-size: 14px;
  line-height: 22px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: none; }

select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-m);
  background: var(--bg-layer-1);
  outline: none;
  font-size: 14px;
  line-height: 22px;
}
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 登录页的账号类型选择（公开 / 私密） */
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 13.5px;
}
.radio-row + .radio-row { border-top: 1px solid var(--border-1); }
.radio-row input { margin: 3px 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.radio-text { color: var(--text-2); line-height: 19px; }
.radio-text b { color: var(--text-1); font-weight: 500; }
.card code {
  background: var(--bg-soft);
  border: 1px solid var(--border-1);
  padding: 0 4px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; font-size: 14px; }
.check input { accent-color: var(--accent); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  background: var(--bubble);
  border: 1px solid var(--border-1);
  font-weight: 500;
  font-size: 15px;
  flex: 0 0 auto;
  user-select: none;
  overflow: hidden;
}
.avatar.sq { border-radius: 11px; }

.card {
  background: var(--bg-layer-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-l);
  padding: 18px;
  margin-bottom: 14px;
}
.section-pad { padding: 18px 22px 48px; overflow-y: auto; height: 100%; }
.section-title { font-size: 14px; font-weight: 500; margin: 0 0 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tips { margin: 0 0 10px; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 21px; }
.tips li { margin-bottom: 6px; }

/* ------------------------------ 登录页 ------------------------------ */

.auth-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-platform);
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-layer-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-l);
  padding: 30px 26px 22px;
  text-align: center;
}
.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--border-2);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card h1 { font-size: 18px; font-weight: 500; margin: 16px 0 6px; }
.auth-sub { color: var(--text-2); font-size: 13px; margin: 0 0 22px; line-height: 20px; }
.auth-card .field { text-align: left; }
.auth-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-s);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 20px;
  margin-bottom: 12px;
  text-align: left;
}
.auth-tip {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ------------------------------ 主框架 ------------------------------ */

.app { height: 100%; display: flex; }

.sidebar {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: var(--bg-platform);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 6px; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--bg-layer-1);
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.brand-name { font-weight: 500; font-size: 14px; }

.me {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-m);
  padding: 7px 8px;
}
.me:hover { background: var(--bg-hover); }
.me-info { min-width: 0; }
.me-name { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12px; line-height: 16px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: var(--radius-s);
  text-align: left;
  font-size: 13.5px;
  color: var(--text-2);
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-item.active { background: var(--bg-active); color: var(--text-1); font-weight: 500; }
.nav-label { flex: 1 1 auto; }
.sidebar-foot { margin-top: auto; display: flex; gap: 4px; }

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 14px;
  padding: 1px 6px;
  border-radius: 999px;
  font-style: normal;
  min-width: 17px;
  text-align: center;
}

.main { flex: 1 1 auto; min-width: 0; position: relative; background: var(--bg-base); }
.tab { height: 100%; }

.pane-split { display: flex; height: 100%; }
.pane-list {
  width: var(--list-w);
  flex: 0 0 var(--list-w);
  border-right: 1px solid var(--border-1);
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}
.pane-head {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border-1);
  font-weight: 500;
  font-size: 13.5px;
}
.list-scroll { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.pane-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

.chat-head {
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-1);
}
.chat-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.chat-title > span:first-child {
  font-weight: 500;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-title .sub { line-height: 17px; }
.back-btn { display: none; }

/* ------------------------------ 列表项 ------------------------------ */

.conv-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-m);
  cursor: pointer;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: var(--bg-active); }
.conv-main { flex: 1 1 auto; min-width: 0; }
.conv-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.conv-title b {
  font-weight: 400;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.conv-item.active .conv-title b { font-weight: 500; }
.conv-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.conv-time { font-size: 11px; color: var(--text-3); flex: 0 0 auto; }
.conv-preview {
  font-size: 12.5px;
  line-height: 18px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-unread {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 15px;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 17px;
  text-align: center;
  flex: 0 0 auto;
}
.dot-online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

/* ------------------------------ 消息区 ------------------------------ */

/* 聊天主区：必须是 flex 列容器，否则消息一多会把输入框顶出屏幕 */
.chat-live {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
}
.empty-state > * { margin: 0; }
.empty-mark {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-m);
  border: 1px solid var(--border-2);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  margin-bottom: 4px;
}
.empty-state p:first-of-type { color: var(--text-1); font-weight: 500; font-size: 14px; }

.msg { display: flex; gap: 10px; max-width: 76%; }
.msg-other { align-self: flex-start; }
.msg-me { align-self: flex-end; flex-direction: row-reverse; }
.msg-body { min-width: 0; }
.msg-from { font-size: 12px; line-height: 16px; color: var(--text-3); margin-bottom: 3px; }
.msg-me .msg-from { text-align: right; }
.bubble {
  background: var(--bubble);
  border-radius: var(--radius-l);
  padding: 8px 13px;
  font-size: 14.5px;
  line-height: 22px;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-other .bubble { background: var(--bg-layer-1); border: 1px solid var(--border-2); }
.msg-meta { font-size: 11px; line-height: 15px; color: var(--text-3); margin-top: 3px; }
.msg-me .msg-meta { text-align: right; }
.msg-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-imgs img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-m);
  cursor: zoom-in;
  border: 1px solid var(--border-2);
  display: block;
}
.sys-msg {
  align-self: center;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-3);
  background: var(--bg-soft);
  padding: 3px 12px;
  border-radius: 999px;
  max-width: 80%;
  text-align: center;
}
.day-sep { align-self: center; font-size: 11.5px; color: var(--text-3); }

/* AI 消息：助手是正文，用户才是气泡（和 Harness 一致） */
.ai-msg { display: flex; gap: 12px; max-width: 100%; }
.ai-msg.user { align-self: flex-end; flex-direction: row-reverse; max-width: 76%; }
.ai-msg .ai-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: var(--bg-layer-1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  flex: 0 0 auto;
  overflow: hidden;
}
.ai-msg .ai-body { min-width: 0; overflow-x: auto; padding-top: 2px; }
.ai-msg.user .ai-body {
  background: var(--bubble);
  border-radius: var(--radius-l);
  padding: 8px 13px;
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 22px;
}
.ai-body p { margin: 0 0 10px; white-space: pre-wrap; }
.ai-body p:last-child { margin-bottom: 0; }
.ai-body .md-h { font-weight: 500; margin: 14px 0 6px; font-size: 15px; }
.ai-body .md-h:first-child { margin-top: 0; }
.ai-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--border-1);
  padding: 10px 12px;
  border-radius: var(--radius-m);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  margin: 10px 0;
}
.ai-body code.inline {
  background: var(--bg-soft);
  border: 1px solid var(--border-1);
  padding: 0 4px;
  border-radius: 5px;
  font-size: 13px;
  font-family: var(--font-mono);
}
.ai-body pre code { background: none; border: 0; padding: 0; }
.ai-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 11px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-m);
  color: var(--danger);
  font-size: 13.5px;
  line-height: 20px;
}
.ai-error .ico { margin-top: 2px; }
.ai-body ul { margin: 6px 0 10px; padding-left: 22px; }
.ai-body li { margin-bottom: 3px; }
.cursor-blink::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--text-2);
  vertical-align: -2px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* ------------------------------ 输入区 ------------------------------ */

.composer {
  border-top: 1px solid var(--border-1);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--bg-base);
}
.composer-box {
  border: 1px solid var(--border-2);
  border-radius: var(--radius-l);
  padding: 8px 8px 8px 12px;
  background: var(--bg-layer-1);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.composer-box:focus-within {
  border-color: var(--border-3);
  box-shadow: 0 0 0 3px var(--bg-hover);
}
.composer textarea {
  border: 0;
  padding: 2px 0;
  max-height: 150px;
  background: transparent;
  font-size: 14.5px;
  line-height: 22px;
}
.composer textarea:focus { box-shadow: none; }
.composer-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.composer-row .hint { flex: 1 1 auto; text-align: right; }
.attach { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 8px; }
.attach-item {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-s);
  overflow: hidden;
  border: 1px solid var(--border-2);
}
.attach-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-item button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.typing { font-size: 12px; color: var(--text-3); padding: 0 20px 4px; height: 17px; }

/* ------------------------------ 结果列表 ------------------------------ */

.search-row { display: flex; gap: 8px; margin-bottom: 18px; }
.result-list { display: flex; flex-direction: column; gap: 6px; }
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-m);
  padding: 8px 12px;
  background: var(--bg-layer-1);
}
.user-card-main { flex: 1 1 auto; min-width: 0; }
.user-card-name { font-weight: 500; font-size: 13.5px; }
.user-card-sub { font-size: 12px; line-height: 17px; color: var(--text-3); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.stat-box {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-m);
  padding: 12px 8px;
  text-align: center;
  background: var(--bg-soft);
}
.stat-num { font-size: 20px; font-weight: 500; line-height: 26px; }
.stat-label { font-size: 12px; color: var(--text-3); }

/* ------------------------------ 其它 ------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  padding: 24px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius-m); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: var(--text-1);
  color: var(--bg-base);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  line-height: 20px;
  z-index: 200;
  max-width: 86vw;
  text-align: center;
}
.toast.err { background: var(--danger); color: #fff; }

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .5);
  z-index: 300;
}
@media (prefers-color-scheme: dark) {
  .loading { background: rgba(0, 0, 0, .45); }
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bottom-nav { display: none; }

/* ------------------------------ 滚动条 ------------------------------ */

.list-scroll::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.section-pad::-webkit-scrollbar { width: 8px; }
.list-scroll::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.section-pad::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.list-scroll::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track,
.section-pad::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 手机端 ------------------------------ */

@media (max-width: 820px) {
  .sidebar { display: none; }
  .app { flex-direction: column; }
  .main { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-platform);
    border-top: 1px solid var(--border-1);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 50;
  }
  .bn-item {
    flex: 1;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 7px 0 5px;
    color: var(--text-3);
    font-size: 10.5px;
    font-style: normal;
    position: relative;
  }
  .bn-item em { font-style: normal; }
  .bn-item.active { color: var(--text-1); }
  .bn-item .badge { position: absolute; top: 3px; left: 50%; margin-left: 2px; }

  .pane-split { position: relative; }
  .pane-list { width: 100%; flex: 1 1 auto; border-right: 0; }
  .pane-body {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: var(--bg-base);
  }
  body.chat-open .pane-list { display: none; }
  body.chat-open .pane-body { display: flex; }
  .back-btn { display: inline-flex; }
  .msg { max-width: 86%; }
  .ai-msg.user { max-width: 86%; }

  #tab-contacts .pane-list, #tab-groups .pane-list { display: none; }
  #tab-contacts .pane-body, #tab-groups .pane-body { display: flex; position: static; }
  .grid2 { grid-template-columns: 1fr; }
  .section-pad { padding: 14px 14px 64px; }
  .messages { padding: 16px 14px 8px; }
}
