/* 动起来 · 墨蓝主题（C2 品牌色 #3E5FAE → #1F2E66：沉稳高级 · 冷白底） */
:root {
  --brand: #3E5FAE;        /* 墨蓝 · 亮端 */
  --brand-deep: #1F2E66;   /* 墨蓝 · 深端 */
  --grad: linear-gradient(135deg, #3E5FAE 0%, #1F2E66 100%);
  --green: #34C77B;        /* 在线 · 活力绿 */
  --ink: #232A42;          /* 墨蓝深灰（主文字） */
  --ink-2: #7C86A0;        /* 冷灰（次级文字） */
  --bg: #F5F7FB;           /* 冷白 */
  --card: #FFFFFF;
  --card-2: #EDF1F8;
  --line: #DFE5F0;         /* 冷色细描边 */
  --brand-tint: #E9EEF8;
  --bubble-blue: #6E93CC;  /* 话题气泡角标 */
  --danger: #FF5A5F;       /* 未读 */
  --gold-bg: #FFF4D6;
  --gold-text: #B27B00;
  --shadow: 0 6px 24px rgba(31, 46, 102, 0.14);
  /* 顶栏底边位置（含 safe-area）：JS 按实际高度（含窄屏两行换行）实时更新，面板/话题栏据此让位 */
  --topbar-bottom: calc(62px + env(safe-area-inset-top));
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- 地图 ---------- */
#map { position: fixed; inset: 0; z-index: 0; background: #E9EDF4; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.75); font-size: 10px; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
/* 单行布局：logo 固定最左，功能按钮组右对齐；手机放不下时按钮组可左右滑动 */
.top-actions {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 9px 8px; /* 上下内边距为未读徽标(top:-7px)留溢出空间，避免被滚动容器裁剪 */
}
.top-actions::-webkit-scrollbar { display: none; }
/* 空间足够时按钮组靠右（首个按钮 auto margin）；溢出时 margin 归零，可从头向右滑动 */
.top-actions > :first-child { margin-left: auto; }
/* 滑动引导：按钮组溢出时可滑动方向的边缘浮现渐变淡出 + 方向箭头，提示可左右滑动 */
.top-wrap { position: relative; display: flex; flex: 1; min-width: 0; }
.scroll-hint {
  position: absolute; top: 0; bottom: 0; width: 34px; z-index: 3;
  display: flex; align-items: center; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.scroll-hint-l { left: 0; justify-content: flex-start; background: linear-gradient(to right, rgba(255, 255, 255, 0.94) 35%, rgba(255, 255, 255, 0)); }
.scroll-hint-r { right: 0; justify-content: flex-end; background: linear-gradient(to left, rgba(255, 255, 255, 0.94) 35%, rgba(255, 255, 255, 0)); }
.scroll-hint i {
  font-style: normal; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-tint); color: rgba(62, 95, 174, 0.55); font-size: 10px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.scroll-hint.show { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-hint.show i { animation: hintNudgeL 1.1s ease-in-out infinite; }
  .scroll-hint-r.show i { animation-name: hintNudgeR; }
}
@keyframes hintNudgeL { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-2px); } }
@keyframes hintNudgeR { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-svg { height: 32px; width: auto; display: block; }
.online-chip {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 10px;
  font-size: 12px; font-weight: 700; line-height: 1; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  white-space: nowrap; cursor: pointer;
}
.chip-arrow { display: inline-block; margin-left: 2px; font-size: 10px; transition: transform 0.2s; }
.online-chip.open .chip-arrow { transform: rotate(180deg); }
.online-chip.open, .online-chip.on { border-color: var(--brand); color: var(--brand-deep); }
/* 「在线的人」选中保持态与顶部按钮统一（带浅蓝底） */
.online-chip.on { background: var(--brand-tint); }
.online-chip b { color: var(--brand-deep); }
/* 显示范围下拉菜单：自定义弹层（原生 select 弹层位置无法控制），与面板一致显示在顶栏正下方 */
.dist-menu {
  position: fixed; top: var(--topbar-bottom); right: 10px; z-index: 1250;
  display: flex; flex-direction: column; gap: 2px; min-width: 130px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px; box-shadow: var(--shadow);
}
.dist-menu button {
  border: none; background: none; text-align: left; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--ink);
  padding: 9px 14px; border-radius: 9px;
}
.dist-menu button.on { background: var(--brand-tint); color: var(--brand-deep); }
.dist-menu button:active { background: var(--card-2); }
/* 第二行：距离/附近的人/聊天室/话题/消息/设置 全部左对齐 */
.icon-btn { border: none; background: none; font-size: 17px; cursor: pointer; color: var(--ink-2); padding: 4px 5px; border-radius: 10px; }
.icon-btn svg { width: 19px; height: 19px; display: block; }
.icon-btn:active { background: var(--card-2); }
.top-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 12px; font-weight: 700; line-height: 1; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.top-btn:active { background: var(--card-2); }
.top-btn.on { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }
.top-btn.open .chip-arrow { transform: rotate(180deg); }
.top-btn.open { border-color: var(--brand); color: var(--brand-deep); }
/* 距离筛选按钮：品牌色浅底+品牌描边+深蓝字，与其他按钮选中态区分；布局由 v-btn 决定 */
.top-btn.dist-btn {
  background: var(--ic-bg); border: 1.5px solid var(--brand); color: var(--brand-deep);
}
.top-btn.dist-btn:active { background: var(--ic-bg); filter: brightness(.95); }
.top-btn.dist-btn.open { border-color: var(--brand-deep); color: var(--brand-deep); }
/* 纵向功能按钮（图标上 · 文字下）：比横排窄约一半，手机一行放得下 */
.top-btn.v-btn, .online-chip.v-btn { flex-direction: column; gap: 3px; height: auto; padding: 5px 9px 4px; border-radius: 12px; }
/* 彩色贴纸按钮：底色充满整个按钮，面性图标直接坐在底色上（挖空即透出底色） */
.v-btn .tb-ico { font-style: normal; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ic-fg); flex-shrink: 0; }
.v-btn .tb-ico svg { width: 17px; height: 17px; display: block; } /* 图标尽量充满 22px 预留位，按钮外尺寸不变 */
.tb-dist  { --ic-fg: #3E5FAE; --ic-bg: #E8F0FE; --icut: #E8F0FE; }
.tb-near  { --ic-fg: #0AB861; --ic-bg: #E5FFF2; --icut: #E5FFF2; }
.tb-room  { --ic-fg: #F59E0B; --ic-bg: #FFF3E2; --icut: #FFF3E2; }
.tb-forum { --ic-fg: #DB2777; --ic-bg: #FDEEF5; --icut: #FDEEF5; }
.tb-msg   { --ic-fg: #0D9488; --ic-bg: #EAFBF8; --icut: #EAFBF8; }
.tb-set   { --ic-fg: #6F6FFF; --ic-bg: #F0EFFE; --icut: #F0EFFE; }
.top-btn.tb-dist, .online-chip.tb-near, .top-btn.tb-room, .top-btn.tb-forum, .top-btn.tb-msg, .top-btn.tb-set { background: var(--ic-bg); border-color: transparent; }
.top-btn.tb-dist:active, .online-chip.tb-near:active, .top-btn.tb-room:active, .top-btn.tb-forum:active, .top-btn.tb-msg:active, .top-btn.tb-set:active { background: var(--ic-bg); filter: brightness(.95); }
.online-chip.tb-near b { color: var(--ic-fg); }
/* 选中/展开态仍以品牌蓝高亮（盖过贴纸底色）；距离按钮保持自有深蓝描边 */
.top-btn.tb-dist.on, .online-chip.tb-near.on, .top-btn.tb-room.on, .top-btn.tb-forum.on, .top-btn.tb-msg.on, .top-btn.tb-set.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-deep); }
.online-chip.tb-near.open, .top-btn.tb-room.open, .top-btn.tb-forum.open, .top-btn.tb-msg.open, .top-btn.tb-set.open { border-color: var(--brand); color: var(--brand-deep); }
.v-btn .tb-txt { display: flex; align-items: center; font-size: 11px; line-height: 1; }
.v-btn .tb-txt .chip-arrow { font-size: 8px; margin-left: 1px; }
/* 窄屏逐级收紧：单行放不下时按钮组横向滑动（logo 固定），仅缩字号/间距提升一屏可见数 */
@media (max-width: 480px) {
  #topbar { gap: 6px; padding: 0 10px; }
  .top-actions { gap: 6px; padding: 8px 6px; }
  .online-chip, .top-btn { height: 28px; padding: 0 8px; }
  .top-btn { font-size: 11px; gap: 3px; }
  .top-btn.v-btn, .online-chip.v-btn { padding: 4px 7px 3px; gap: 2px; }
  .v-btn .tb-ico { width: 20px; height: 20px; border-radius: 5px; }
  .v-btn .tb-ico svg { width: 16px; height: 16px; }
  .v-btn .tb-txt { font-size: 10px; }
  .online-chip { font-size: 11px; }
  .brand-svg { height: 22px; }
}
@media (max-width: 340px) {
  .online-chip, .top-btn { height: 26px; padding: 0 6px; }
  .brand-svg { height: 18px; }
  .top-btn { font-size: 10.5px; }
  .top-btn.v-btn, .online-chip.v-btn { padding: 3px 6px 2px; }
  .v-btn .tb-ico { width: 18px; height: 18px; border-radius: 5px; }
  .v-btn .tb-ico svg { width: 14px; height: 14px; }
  .v-btn .tb-txt { font-size: 9.5px; }
  .online-chip { font-size: 10.5px; }
}

/* ---------- 顶栏未读徽标（「在线的人」= 好友申请 ·「消息」= 未读聊天+话题回复） ---------- */
.online-chip, .top-btn { position: relative; }
.top-badge {
  position: absolute; top: -7px; right: -8px;
  min-width: 14px; height: 15px; padding: 0 4px; box-sizing: content-box;
  background: #FA5151; color: #fff; border: 2px solid #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 15px; font-style: normal; text-align: center;
  pointer-events: none; z-index: 2;
}

/* ---------- 话题筛选栏 ---------- */
#topicBar {
  position: fixed; top: calc(var(--topbar-bottom) + 4px); left: 10px; right: 10px; z-index: 990;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#topicBar::-webkit-scrollbar { display: none; }
.chips { display: flex; gap: 8px; width: max-content; }
.chips-wrap { flex-wrap: wrap; width: auto; }
/* 聊天室面板专属 */
.croom-emoji { width: 34px; height: 34px; border-radius: 12px; background: rgba(52, 199, 123, 0.15); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.nl-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--card-2); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(28, 35, 66, 0.12); }
.croom-fixed-title { justify-content: center; color: var(--ink-2); font-size: 12px; font-weight: 700; letter-spacing: 3px; padding: 14px 8px 4px !important; cursor: default !important; }
.croom-compose { flex-direction: column !important; align-items: stretch !important; cursor: default !important; gap: 0 !important; }
.croom-compose input { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; margin: 6px 0 12px; outline: none; background: var(--card); }
.croom-compose input:focus { border-color: var(--brand); }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); color: var(--ink-2);
  font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s; box-shadow: 0 2px 8px rgba(31, 46, 102, 0.08);
}
.chip.on {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(62, 95, 174, 0.4);
}

/* ---------- 右侧工具栏 ---------- */
#tools {
  position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  transition: right 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.tool-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  box-shadow: var(--shadow); font-size: 15px; font-weight: 800; color: var(--brand-deep);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.tool-btn:active { transform: scale(0.9); }
.tool-btn.emoji { font-size: 19px; font-weight: 400; }

/* ---------- 地图用户头像标记（44px，与面板完全一致：性别彩环 + 同款阴影） ---------- */
.mk { position: relative; width: 44px; height: 44px; cursor: pointer; }
.mk-dot .mk-avatar {
  position: absolute; inset: 0; border-radius: 50%;
  background: #fff; border: 2px solid #3E7BD6;
  box-shadow: 0 2px 8px rgba(28, 35, 66, 0.14);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mk-f .mk-avatar { border-color: #E8618C; }
.mk-dot .mk-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* 自己：呼吸光环（性别色） */
.mk-self .mk-avatar::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(62, 123, 214, 0.8);
  animation: pulse 1.8s ease-out infinite;
}
.mk-self.mk-f .mk-avatar::after { border-color: rgba(232, 97, 140, 0.8); }
@keyframes pulse { 0% { transform: scale(0.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
/* 选中：放大 + 深色描边环 */
.mk-sel .mk-avatar {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(34, 52, 84, 0.5);
}
.mk-dot .mk-name {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; color: #2A3050; white-space: nowrap;
  background: rgba(255, 255, 255, 0.96); padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(28, 35, 66, 0.25);
}
.mk-sel .mk-name, .mk-self .mk-name { display: block; }
.mk-self.mk-m .mk-name { background: #3E7BD6; color: #fff; }
.mk-self.mk-f .mk-name { background: #E8618C; color: #fff; }
.mk-dot .mk-unread {
  position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; padding: 0;
  border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- 话题图标：发帖人头像 + 气泡角标（地图标记 / 面板列表共用） ---------- */
.topic-ico { position: relative; display: block; width: 100%; height: 100%; }
.topic-ico > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 2px 6px rgba(28, 35, 66, 0.14); }
/* 徽章（方案 B）：无底板，emoji 直接叠加头像右下角，白色投影描边保证清晰 */
.tico-b, .tico-c {
  position: absolute; right: -4px; bottom: -4px;
  font-size: 24px; line-height: 1; font-style: normal;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(28, 35, 66, 0.35));
}
.tico-lg { width: 34px; height: 34px; flex-shrink: 0; }
.tico-lg .tico-b, .tico-lg .tico-c { font-size: 18px; right: -3px; bottom: -3px; }

/* ---------- 附近的伙伴 / 话题 / 聊天室 / 我的消息（右上角弹出面板，互斥显示） ---------- */
#peoplePanel,
#topicPanel,
#roomPanel,
#msgPanel {
  position: fixed; left: 10px; right: 10px; top: var(--topbar-bottom); z-index: 1150;
  background: var(--card); border-radius: 20px; border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(28, 35, 66, 0.22);
  max-height: 60vh; display: flex; flex-direction: column;
  animation: dropDown 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes dropDown { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
#peoplePanel > header,
#topicPanel > header,
#roomPanel > header,
#msgPanel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 6px 16px; }
#peopleTitle, #topicPanelTitle, #roomPanelTitle, #msgPanelTitle { font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap; }
#peopleTitle b, #topicPanelTitle b, #roomPanelTitle b { color: var(--brand-deep); }
/* 话题面板分类下拉：浅蓝圆底 + 墨蓝箭头（方案C，与顶栏距离下拉同款）；置于「用户话题」分组内 */
.panel-filter-row { padding: 2px 14px 8px; }
.panel-sel {
  width: 100%; padding: 9px 42px 9px 12px; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Ccircle cx='13' cy='13' r='13' fill='%23E9EEF8'/%3E%3Cpath d='M8.5 10.5 L13 15 L17.5 10.5' fill='none' stroke='%233E5FAE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 26px 26px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
}
.panel-sel:focus { border-color: var(--brand); }
.tp-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-tint); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
/* 面板 Tab（我的消息） */
.forum-tabs { display: flex; gap: 18px; padding: 8px 16px 0; border-bottom: 1px solid var(--line); }
.ft-tab {
  border: none; background: none; padding: 6px 2px 8px; cursor: pointer;
  font-size: 13px; font-weight: 800; color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.ft-tab.on { color: var(--brand-deep); border-bottom-color: var(--brand); }
.left-time { color: var(--ink-2); }
.expired-tag { color: var(--danger); font-weight: 700; }
#nearbyList, #topicList, #roomList, #msgList { list-style: none; overflow-y: auto; padding: 4px 8px 10px; }
#nearbyList li,
#topicList li,
#roomList li,
#msgList li {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px;
  border-radius: 14px; cursor: pointer;
}
#nearbyList li:active, #topicList li:active, #roomList li:active, #msgList li:active { background: var(--card-2); }
#nearbyList li.sel, #topicList li.sel, #roomList li.sel { background: var(--brand-tint); }
#nearbyList .empty, #topicList .empty, #roomList .empty, #msgList .empty { justify-content: center; text-align: center; color: var(--ink-2); font-size: 13px; line-height: 1.9; cursor: default; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(28, 35, 66, 0.14); background: var(--card-2); }
/* 性别彩环（面板 / 聊天 / 地图统一：男蓝 / 女粉） */
.av-m { border: 2px solid #3E7BD6; }
.av-f { border: 2px solid #E8618C; }
.nl-info { flex: 1; min-width: 0; }
.nl-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.tag { font-size: 10px; background: var(--gold-bg); color: var(--gold-text); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
/* 「我」标签：附近列表中标识自己的行 */
.me-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-deep); flex-shrink: 0; }
.nl-meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }
/* 状态分级：30 分钟内在线（琥珀）/ 离线（灰） */
.recent-dot { width: 6px; height: 6px; border-radius: 50%; background: #E6A23C; display: inline-block; }
.offline-dot { width: 6px; height: 6px; border-radius: 50%; background: #B8BFCC; display: inline-block; }
/* 「聊一句 / 进入 / 详情」行内按钮：白底 + 品牌色描边，选中行浅蓝底上依然醒目 */
.nl-chat {
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand-deep);
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; flex-shrink: 0; box-shadow: 0 1px 4px rgba(62, 95, 174, 0.22);
  transition: transform 0.12s;
}
.nl-chat:active { transform: scale(0.93); }
.nl-unread {
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 800;
  min-width: 22px; height: 22px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
/* 「在线的人」面板 Tab 徽标（收到的好友申请数） */
.tab-badge {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 2px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
/* 好友页次级按钮（拒绝 / 删除）：白底灰描边，与「聊一句」形成主次 */
.nl-ghost {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px;
  cursor: pointer; flex-shrink: 0; transition: transform 0.12s;
}
.nl-ghost:active { transform: scale(0.93); }
.pending-tag { font-size: 11px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; flex-shrink: 0; }
.fr-off .avatar { opacity: 0.55; filter: grayscale(0.4); }
/* 聊天头部「＋ 好友」（与「聊一句」同款胶囊，稍小） */
.chat-add { padding: 5px 10px; margin-right: 2px; }
.nl-chat:disabled { opacity: 0.55; cursor: default; box-shadow: none; }

/* ---------- 聊天面板（私聊 / 话题聊天室共用） ---------- */
#chatPanel {
  position: fixed; left: 0; right: 0; bottom: 0; height: 78vh; z-index: 1200;
  background: var(--card); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 40px rgba(28, 35, 66, 0.2);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  animation: slideUp 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(70px); opacity: 0; } to { transform: none; opacity: 1; } }
.room-chips { padding: 8px 14px 10px; flex-wrap: wrap; width: auto; gap: 6px; border-bottom: 1px solid var(--line); }
#chatPanel > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-peer { flex: 1; min-width: 0; }
#chatName { font-weight: 800; font-size: 16px; }
#chatMeta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.avatar-box { display: flex; align-items: center; justify-content: center; background: var(--card-2); overflow: hidden; }
.avatar-box img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.room-emoji { font-size: 24px; line-height: 1; }
#chatMessages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.msg { display: flex; gap: 8px; max-width: 84%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.m-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; align-self: flex-end; background: var(--card-2); }
.msg-col { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.m-name { font-size: 11px; color: var(--ink-2); margin: 0 0 3px 2px; font-weight: 600; }
.bubble {
  background: var(--card); padding: 10px 12px; border-radius: 4px 16px 16px 16px;
  border: 1px solid var(--line);
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
.msg.mine .bubble { background: var(--grad); color: #fff; border-color: transparent; border-radius: 16px 4px 16px 16px; }
.m-time { display: block; font-size: 10px; opacity: 0.55; margin-top: 4px; }
#chatPanel > footer { padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
#chatSend { border: none; background: var(--grad); color: #fff; border-radius: 999px; padding: 0 24px; min-height: 42px; font-size: 15px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
#chatSend:active { opacity: 0.85; transform: scale(0.96); }

/* ---------- 富文本编辑器（聊天 / 话题 / 动态通用） ---------- */
.rt-wrap { display: flex; flex-direction: column; gap: 6px; }
.rt-tools-slot, .ft-reply-wrap > div:first-child, #ftComposeTools { margin-bottom: 2px; }
.rt-tools { display: flex; gap: 2px; overflow-x: auto; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; scrollbar-width: none; }
.rt-tools::-webkit-scrollbar { display: none; }
.rt-btn { min-width: 34px; height: 30px; border: none; background: none; border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer; flex-shrink: 0; padding: 0 6px; }
.rt-btn:active { background: #fff; color: var(--brand-deep); }
.rt-row { display: flex; gap: 10px; align-items: flex-end; }
.rt-input { flex: 1; min-height: 42px; max-height: 130px; overflow-y: auto; border: 1px solid var(--line); background: var(--card-2); border-radius: 14px; padding: 10px 14px; font-size: 14px; outline: none; line-height: 1.5; text-align: left; font-family: inherit; word-break: break-word; }
.rt-input:focus { border-color: var(--brand); background: #fff; }
.rt-input:empty::before { content: attr(data-placeholder); color: var(--ink-2); pointer-events: none; }
.rt-input img { max-width: 150px; max-height: 100px; border-radius: 10px; display: block; margin: 4px 0; }
.rt-input a { color: var(--brand); text-decoration: underline; }
.rt-input ol, .rt-input ul { padding-left: 20px; margin: 4px 0; }
.rt-tall { min-height: 110px; max-height: 260px; }
.rt-pop { position: fixed; z-index: 3200; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(21, 26, 46, 0.18); padding: 10px; }
.rt-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.rt-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.rt-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.rt-emoji { border: none; background: none; font-size: 20px; cursor: pointer; border-radius: 8px; padding: 2px; }
.rt-emoji:active { background: var(--card-2); }
.rt-link-row { display: flex; gap: 8px; align-items: center; }
.rt-link-input { width: 220px; max-width: 56vw; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; outline: none; font-family: inherit; }
.rt-link-input:focus { border-color: var(--brand); }
.rt-link-ok { border: none; background: var(--grad); color: #fff; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* 消息气泡里的富文本 */
.bubble img { max-width: min(200px, 58vw); max-height: 200px; border-radius: 12px; display: block; cursor: zoom-in; }
.bubble ol, .bubble ul { padding-left: 20px; margin: 4px 0; }
.bubble a { color: #1F5AE0; text-decoration: underline; }
.msg.mine .bubble a { color: #fff; }
.ft-content, .ft-reply-text { white-space: normal; }
.ft-content img, .ft-reply-text img { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; margin: 6px 0; }
.ft-content a, .ft-reply-text a { color: var(--brand); text-decoration: underline; }
.ft-content ol, .ft-reply-text ol, .ft-content ul, .ft-reply-text ul { padding-left: 20px; margin: 4px 0; }
.ft-reply-wrap { display: flex; flex-direction: column; gap: 6px; width: 100%; }
#ftReplyInput { border-radius: 14px; }

/* ---------- 设置：自定义头像 / 个人动态 ---------- */
.st-av-row { display: flex; gap: 14px; align-items: center; text-align: left; }
.st-avatar-now { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(28, 35, 66, 0.16); background: var(--card-2); flex-shrink: 0; }
.st-av-btns { display: flex; flex-direction: column; gap: 8px; }
.mini-btn { border: 1.5px solid var(--brand); background: #fff; color: var(--brand-deep); font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.mini-btn:active { opacity: 0.8; }
.mini-btn.ghost { border-color: var(--line); color: var(--ink-2); }
.mini-btn:disabled { opacity: 0.55; cursor: default; }
.ob-title-sub { font-size: 11px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
#stStatus { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit; background: var(--card-2); text-align: left; resize: none; min-height: 76px; line-height: 1.6; }
#stStatus:focus { border-color: var(--brand); background: #fff; }
.st-status-foot { display: flex; justify-content: flex-end; font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.st-status-foot .over { color: #E5484D; font-weight: 700; }

/* 头像裁剪弹窗 */
.av-modal { max-width: 340px; width: calc(100vw - 48px); }
.av-crop-wrap { position: relative; width: 280px; height: 280px; max-width: 100%; margin: 12px auto 0; border-radius: 50%; overflow: hidden; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); touch-action: none; }
#avCanvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.av-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--ink-2); font-size: 13px; line-height: 1.8; text-align: center; padding: 0 30px; }
.av-zoom { width: 100%; margin-top: 14px; accent-color: var(--brand); }

/* 人物资料卡 */
.profile-card { position: relative; text-align: center; max-width: 320px; width: calc(100vw - 48px); }
.pc-x { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 15px; color: var(--ink-2); cursor: pointer; padding: 4px; }
.pc-avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(28, 35, 66, 0.18); background: var(--card-2); }
.pc-name { font-size: 17px; font-weight: 800; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pc-meta { font-size: 12px; color: var(--ink-2); margin-top: 6px; line-height: 1.7; }
.pc-status { background: var(--card-2); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--ink); text-align: left; line-height: 1.6; margin-top: 12px; word-break: break-word; }
.pc-status-time { display: block; font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.pc-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: center; flex-wrap: wrap; }

/* 人物列表里的个人动态（低调小字） */
.nl-status { font-size: 11px; color: #9AA6BF; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }

/* ---------- 弹层（入场 / 设置） ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
  background: linear-gradient(160deg, #4665B8 0%, #1F2E66 100%);
}
#settingsModal { background: rgba(21, 26, 46, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
/* 确认/密码弹窗：半透明压暗，叠在设置面板之上（DOM 顺序靠后自然更高） */
#logoutConfirm, #pwModal { background: rgba(21, 26, 46, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ob-card {
  background: var(--card); border-radius: 26px; padding: 28px 24px;
  width: 100%; max-width: 400px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(21, 26, 46, 0.32); text-align: center;
  animation: pop 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.ob-wordmark { width: 196px; max-width: 72%; height: auto; display: block; margin: 6px auto 0; }
.ob-card h2 { font-size: 19px; margin-bottom: 4px; }
.slogan { color: var(--ink-2); font-size: 12px; margin: 8px 0 18px; line-height: 1.6; letter-spacing: 1px; }
#obName, #obId, #obPw, #stName {
  width: 100%; border: 2px solid var(--line); border-radius: 14px;
  padding: 12px 16px; font-size: 15px; outline: none; text-align: center;
  background: #F8FAFD; font-family: inherit; transition: border-color 0.2s;
}
#obName:focus, #obId:focus, #obPw:focus, #stName:focus { border-color: var(--brand); }
/* 记住ID和密码：本地凭证勾选行 */
.ob-remember {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.ob-remember input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
/* 登录/校验错误提示 */
.ob-auth-tip { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--danger); text-align: center; }
.ob-auth-tip.ok { color: var(--green); } /* 操作成功反馈 */
/* 危险操作按钮（退出登录） */
.danger-btn {
  width: 100%; border: none; background: var(--danger); color: #fff;
  font-size: 15px; font-weight: 700; letter-spacing: 2px; text-indent: 2px;
  padding: 12px; border-radius: 16px; cursor: pointer; margin-top: 12px;
  transition: transform 0.15s, opacity 0.15s;
}
.danger-btn:active { transform: scale(0.97); opacity: 0.9; }
/* 设置面板内区块分隔线 */
.st-divider { height: 1px; background: var(--line); margin: 16px 0 2px; }
/* 退出登录确认弹窗 */
.ob-confirm { max-width: 320px; }
.ob-confirm h2 { margin-bottom: 6px; }
.ob-confirm-text { color: var(--ink-2); font-size: 14px; line-height: 1.7; margin: 8px 0 4px; }
/* 登录/注册模式切换 */
.ob-mode { margin-bottom: 14px; }
/* 登录ID输入框 + 本机账号下拉（选账号自动填 ID 和密码） */
.ob-id-wrap { position: relative; }
.ob-id-wrap #obId { padding-right: 32px; }
.ob-id-caret {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--ink-2); font-size: 13px;
  cursor: pointer; padding: 6px 8px; line-height: 1;
}
.ob-acc-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: 168px; overflow-y: auto;
}
.ob-acc-item {
  border: none; background: none; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ob-acc-item b { font-weight: 700; }
.ob-acc-item span { font-size: 11px; color: var(--ink-2); flex-shrink: 0; }
.ob-acc-item:active, .ob-acc-item:hover { background: var(--card-2); }
#stId, #pwCur, #pwNew, #pwNew2 {
  width: 100%; border: 2px solid var(--line); border-radius: 14px;
  padding: 11px 14px; font-size: 14px; outline: none; text-align: center;
  background: #F8FAFD; font-family: inherit; transition: border-color 0.2s;
}
#pwCur, #pwNew, #pwNew2 { margin-bottom: 8px; }
#pwCur:focus, #pwNew:focus, #pwNew2:focus { border-color: var(--brand); }
/* ID 注册后不可修改：只读态置灰 */
#stId[readonly] { color: var(--ink-2); background: var(--card-2); cursor: not-allowed; }
.ob-title { text-align: left; font-size: 13px; font-weight: 800; color: var(--ink-2); margin: 18px 0 10px; letter-spacing: 1px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ag-item { position: relative; border: 3px solid transparent; border-radius: 18px; cursor: pointer; background: none; padding: 0; transition: transform 0.15s, border-color 0.15s; }
.ag-item img { width: 100%; aspect-ratio: 1; border-radius: 15px; object-fit: cover; display: block; }
.ag-item.sel { border-color: var(--brand); transform: scale(1.05); box-shadow: 0 6px 18px rgba(62, 95, 174, 0.45); }
.ag-item.sel::after {
  content: '✓'; position: absolute; right: -6px; top: -6px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.primary-btn {
  width: 100%; border: none; background: var(--grad); color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: 4px; text-indent: 4px;
  padding: 14px; border-radius: 16px; cursor: pointer; margin-top: 20px;
  box-shadow: 0 6px 20px rgba(62, 95, 174, 0.45); transition: transform 0.15s, opacity 0.15s;
}
.primary-btn:active { transform: scale(0.97); opacity: 0.9; }
.ghost-btn { width: 100%; border: none; background: none; color: var(--ink-2); font-size: 14px; padding: 12px; cursor: pointer; margin-top: 4px; }
.ob-tip { font-size: 11px; color: var(--ink-2); margin-top: 12px; line-height: 1.7; }
.seg { display: flex; background: var(--card-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: none; background: none; padding: 9px; border-radius: 9px; font-size: 13px; cursor: pointer; color: var(--ink-2); font-weight: 600; }
.seg button.on { background: #fff; color: var(--brand-deep); box-shadow: 0 2px 8px rgba(62, 95, 174, 0.18); }

/* ---------- 话题广场 ---------- */
#forumPanel {
  position: fixed; inset: 0; z-index: 2050;
  background: rgba(21, 26, 46, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.forum-card {
  background: var(--card); width: 100%; max-width: 560px; height: min(82vh, 720px);
  border-radius: 22px; display: flex; flex-direction: column; overflow: hidden;
  animation: pop 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.forum-card > header { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.forum-title { font-size: 16px; font-weight: 800; }
.forum-new-btn {
  margin-left: auto; border: none; background: var(--brand-tint); color: var(--brand-deep);
  font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.forum-chips { padding: 10px 14px; border-bottom: 1px solid var(--line); }
#forumBody { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ft-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; background: var(--card); }
.ft-card:active { background: var(--card-2); }
.ft-head { display: flex; align-items: center; gap: 10px; }
.ft-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex-shrink: 0; }
.ft-info { flex: 1; min-width: 0; }
.ft-title { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-meta { font-size: 11px; color: var(--ink-2); margin-top: 3px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ft-replies { font-size: 11px; color: var(--brand-deep); background: var(--brand-tint); padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.ft-excerpt { font-size: 12px; color: var(--ink-2); margin-top: 8px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ft-empty { text-align: center; color: var(--ink-2); font-size: 13px; padding: 40px 0; line-height: 1.9; }
.ft-back { align-self: flex-start; border: none; background: none; color: var(--brand-deep); font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px 0; }
.ft-detail { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.ft-detail h3 { font-size: 17px; line-height: 1.4; margin-bottom: 8px; }
.ft-detail .ft-meta img { vertical-align: -3px; }
.ft-content { font-size: 14px; line-height: 1.7; margin-top: 10px; white-space: pre-wrap; }
.ft-replies-title { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-top: 4px; }
.ft-reply { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.ft-reply-text { font-size: 13px; line-height: 1.6; margin-top: 2px; }
.ft-quote { color: var(--brand-deep); background: var(--brand-tint); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.ft-reply-act { border: none; background: none; color: var(--brand-deep); font-size: 11px; font-weight: 600; cursor: pointer; padding: 4px 0 0; margin-top: 2px; }
.ft-reply-act:hover { text-decoration: underline; }
.ft-replying { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--brand-deep); background: var(--brand-tint); border-radius: 999px; padding: 4px 10px; margin-bottom: 2px; }
.ft-replying button { border: none; background: none; color: var(--ink-2); cursor: pointer; font-size: 12px; padding: 0 2px; }
.ft-reply-bar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0 2px; background: var(--card); }
#ftReplyInput { flex: 1; border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 10px 16px; font-size: 13px; outline: none; font-family: inherit; }
#ftReplySend { border: none; background: var(--grad); color: #fff; border-radius: 999px; padding: 0 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.ft-compose input, .ft-compose textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font-size: 14px; outline: none; font-family: inherit; background: #FAFBFD; margin-top: 10px;
}
.ft-compose textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.ft-compose .primary-btn { margin-top: 14px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 3000; background: rgba(30, 37, 64, 0.93); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 13px;
  max-width: 86vw; text-align: center; box-shadow: 0 8px 24px rgba(21, 26, 46, 0.3);
}

/* ---------- 桌面端适配 ---------- */
@media (min-width: 768px) {
  #peoplePanel, #topicPanel, #roomPanel, #msgPanel { left: auto; right: 16px; width: 340px; max-height: calc(100vh - 200px); }
  #chatPanel {
    left: auto; right: 16px; top: 112px; bottom: 16px; height: auto; width: 360px;
    border-radius: 22px;
    animation: slideIn 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
  }
  body.chat-open #tools { right: 392px; }
}
@keyframes slideIn { from { transform: translateX(50px); opacity: 0; } to { transform: none; opacity: 1; } }
