/* 主页（聊天列表 / 分组 / 底部导航 / 占位页） */

/* ============ 顶部：小组件 + 功能行 ============ */
/* 主页没有顶栏，直接把顶部安全区加在页面内边距上；背景 / 壁纸仍铺满到状态栏后面 */
.chat-view{ padding-top:calc(6px + var(--sat)); overflow:visible; }
.chat-top{
  flex:0 0 auto;
  padding:6px 20px 4px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow:visible;
}
/* 小组件区（默认三张拍立得，可在「小组件美化」换成整图） */
.widget-zone{
  position:relative;
  height:148px;
  display:flex; align-items:center; justify-content:center;
  overflow:visible;
  flex-shrink:0;
  z-index:1;
  /* iOS：独立合成层，避免被祖先 overflow/动画裁成空白 */
  -webkit-transform:translateZ(0);
  transform:translateZ(0);
  isolation:isolate;
  /* 窄屏时压缩两侧拍立得间距，避免被 .app 裁切 */
  --wg-spread: 88px;
}
@media (max-width: 380px){
  .widget-zone{ --wg-spread: 68px; }
}
@media (max-width: 340px){
  .widget-zone{ --wg-spread: 54px; }
}
.widget-img{
  display:none;
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain;
  pointer-events:none;
}
/* 显示哪一个：由 data-style 决定；自定义图片（image）时用整图 */
.widget-zone .wg{ display:none; }
.widget-zone .polaroids{ display:block; }
.widget-zone[data-style="chat"] .polaroids,
.widget-zone[data-style="info"] .polaroids,
.widget-zone[data-style="custom"] .polaroids,
.widget-zone[data-style="image"] .polaroids{ display:none; }
.widget-zone[data-style="chat"] .wg-chat{ display:flex; }
.widget-zone[data-style="info"] .wg-info{ display:flex; }
.widget-zone[data-style="custom"] .wg-custom{ display:block; }
.widget-zone.has-img .polaroids,
.widget-zone.has-img .wg{ display:none !important; }
.widget-zone.has-img .widget-img{ display:block; }

/* ---- 内置小组件通用 ---- */
.wg{
  position:absolute; inset:0;
  width:100%; height:100%;
  box-sizing:border-box;
  font-size:11px; line-height:1.3; color:var(--ink);
}
.wg-ico{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; flex:0 0 auto;
}
.wg-ico svg{
  width:100%; height:100%;
  fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round;
}
.wg-ico img{ display:none; width:100%; height:100%; object-fit:cover; border-radius:4px; }
.wg-ico.has-img svg{ display:none; }
.wg-ico.has-img img{ display:block; }
.wg-ava{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; flex:0 0 auto;
  border-radius:50%; background:#C9C9CF; color:#fff; overflow:hidden;
}
.wg-ava svg{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.wg-ava img{ display:none; width:100%; height:100%; object-fit:cover; }
.wg-ava.has-img svg{ display:none; }
.wg-ava.has-img img{ display:block; }

/* ---- 聊天气泡 + 输入栏 ---- */
.wg-chat{
  flex-direction:column; justify-content:space-between;
  padding:6px 8px 6px;
  border-radius:18px; background:var(--sk-wg-bg, var(--fill));
}
.wg-msgs{ display:flex; flex-direction:column; gap:5px; }
.wg-msg{ display:flex; align-items:flex-end; gap:6px; }
.wg-msg.mine{ justify-content:flex-end; }
.wg-bubble{
  max-width:70%;
  padding:5px 10px;
  border-radius:12px; background:var(--card);
  font-size:11px; color:var(--ink);
  box-shadow:0 1px 2px rgba(0,0,0,.05);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wg-msg.peer .wg-bubble{ border-bottom-left-radius:4px; }
.wg-msg.mine .wg-bubble{ border-bottom-right-radius:4px; }
.wg-tools{
  display:flex; align-items:center; gap:6px;
  margin-top:4px;
}
.wg-tool{
  display:inline-flex; align-items:center; justify-content:center;
  height:20px; padding:0 9px;
  border-radius:10px; background:var(--card);
  font-size:10px; font-weight:500; color:var(--gray-1);
  box-shadow:0 0 0 1px var(--hairline);
}
.wg-tool.wg-ico{ width:24px; padding:0; }
.wg-tool.wg-ico svg{ width:12px; height:12px; }
.wg-tool.wg-more{ margin-left:auto; }
.wg-input{
  display:flex; align-items:center; gap:6px;
  height:26px; margin-top:5px; padding:0 8px;
  border-radius:13px; background:var(--card);
  box-shadow:0 0 0 1px var(--hairline);
}
.wg-heart{ width:14px; height:14px; color:var(--gray-2); }
.wg-input-text{
  flex:1; min-width:0;
  font-family:var(--font-num, inherit); font-size:10.5px; color:var(--gray-2);
  letter-spacing:.02em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* ---- 横向信息聚合 ---- */
.wg-info{
  flex-direction:row; gap:8px;
  padding:6px 8px 6px 4px;
  border-radius:18px; background:var(--sk-wg-bg, var(--fill));
}
.wg-rail{
  flex:0 0 22px;
  display:flex; flex-direction:column; align-items:center;
  gap:4px; padding-top:8px;
  color:var(--gray-1);
}
.wg-rail .wg-ico{ width:16px; height:16px; }
.wg-rail-line{ flex:0 0 26px; width:1px; background:var(--gray-3); }
.wg-info-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.wg-info-head{ display:flex; align-items:center; gap:6px; }
.wg-info-ava{ width:28px; height:28px; overflow:visible; background:#E4E4EA; color:#111; }
.wg-info-ava svg.wg-cat{ width:20px; height:20px; fill:currentColor; stroke:none; }
.wg-info-ava img{ border-radius:50%; }
.wg-cam{
  position:absolute; right:-3px; bottom:-3px;
  width:12px; height:12px; border-radius:50%;
  background:var(--card); color:var(--gray-1);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 0 1px var(--hairline);
}
.wg-cam svg{ width:8px; height:8px; fill:none; stroke:currentColor; stroke-width:1.8; }
.wg-info-name{ font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wg-star{ width:12px; height:12px; color:var(--ink); }
.wg-star svg{ fill:currentColor; stroke:none; }
.wg-week{ display:grid; grid-template-columns:repeat(7, 1fr); gap:2px; }
.wg-day{ display:flex; flex-direction:column; align-items:center; gap:1px; }
.wg-day-w{ font-size:8.5px; color:var(--gray-2); letter-spacing:.02em; }
.wg-day-n{
  width:15px; height:15px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-num, inherit); font-size:9.5px; color:var(--ink);
}
.wg-day.today .wg-day-n{ background:#C9C9CF; color:#fff; font-weight:600; }
.wg-music{ display:flex; align-items:center; gap:5px; color:var(--gray-1); }
.wg-music .wg-ico{ width:13px; height:13px; }
.wg-music-text{ flex:1; min-width:0; font-size:9.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wg-music-time{ font-family:var(--font-num, inherit); font-size:9px; color:var(--gray-2); }
.wg-check{ width:12px; height:12px; }
.wg-cards{ display:flex; align-items:stretch; gap:4px; height:40px; }
.wg-card{ border-radius:10px; background:var(--card); box-shadow:0 0 0 1px var(--hairline); }
.wg-card-main{
  flex:1; min-width:0;
  display:flex; flex-direction:column; justify-content:center; gap:2px;
  padding:0 8px;
}
.wg-weather{ display:flex; align-items:center; gap:4px; font-size:10.5px; font-weight:600; }
.wg-weather .wg-ico{ width:13px; height:13px; }
.wg-slogan{ font-size:8.5px; color:var(--gray-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wg-card-sq{ flex:0 0 40px; display:flex; align-items:center; justify-content:center; color:var(--gray-1); }
.wg-card-sq .wg-ico{ width:16px; height:16px; }
.wg-now{
  flex:0 0 auto; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  padding:0 2px; font-size:8.5px; color:var(--gray-2);
}
.wg-now .wg-ico{ width:12px; height:12px; }

/* ---- 自制小组件：只给容器，其余全交给自定义 CSS ---- */
.wg-custom{ overflow:hidden; }
.polaroids{
  position:relative;
  width:100%; height:100%;
  overflow:visible;
  -webkit-transform:translateZ(0);
  transform:translateZ(0);
}
.polaroid{
  position:absolute;
  top:50%; left:50%;
  width:74px; height:92px;             /* 含白边，照片本体 ≈ 2:3 */
  padding:5px 5px 14px;
  margin:0;
  border:none; border-radius:4px;
  background:var(--card);
  color:inherit;
  font:inherit;
  /* iOS Safari 默认 button 外观会把自定义背景/尺寸吃掉，看起来像「没小组件」 */
  -webkit-appearance:none;
  appearance:none;
  -webkit-tap-highlight-color:transparent;
  box-shadow:0 6px 16px -6px rgba(0,0,0,.28), 0 0 0 1px rgba(11,11,15,.06);
  cursor:pointer;
  transition:transform .28s var(--spring), box-shadow .2s;
  -webkit-transform:translate(-50%, -50%);
  transform:translate(-50%, -50%);
}
.polaroid-photo{
  display:block; width:100%; height:100%;
  background:var(--fill);
  border-radius:2px; overflow:hidden;
}
.polaroid-photo img{ display:block; width:100%; height:100%; object-fit:cover; }
.polaroid:not(.has-photo) .polaroid-photo img{ display:none; }
.polaroid:not(.has-photo) .polaroid-photo::after{
  content:'+';
  display:flex; width:100%; height:100%;
  align-items:center; justify-content:center;
  color:var(--gray-3); font-size:22px; font-weight:300;
}
/* 左中右微微弧形：两侧略低、略外倾（间距随屏宽收缩，避免小屏裁切） */
.polaroid.p-left { transform:translate(calc(-50% - var(--wg-spread, 92px)), calc(-50% + 8px)) rotate(-9deg); }
.polaroid.p-mid  { transform:translate(-50%, calc(-50% - 4px)) rotate(1deg); z-index:1; }
.polaroid.p-right{ transform:translate(calc(-50% + var(--wg-spread, 92px)), calc(-50% + 8px)) rotate(9deg); }
.polaroid.p-left:active { transform:translate(calc(-50% - var(--wg-spread, 92px)), calc(-50% + 8px)) rotate(-9deg) scale(.94); }
.polaroid.p-mid:active  { transform:translate(-50%, calc(-50% - 4px)) rotate(1deg) scale(.94); }
.polaroid.p-right:active{ transform:translate(calc(-50% + var(--wg-spread, 92px)), calc(-50% + 8px)) rotate(9deg) scale(.94); }

/* 功能行 */
.home-bar{
  display:flex; align-items:center; gap:10px;
}
.avatar-btn{
  flex:0 0 auto;
  width:38px; height:38px;
  padding:0; border:none; background:transparent;
  border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:transform .18s var(--spring);
}
.avatar-btn img{
  width:38px; height:38px; object-fit:cover;
  border-radius:50%;
  box-shadow:0 2px 6px rgba(0,0,0,.12);
}
.avatar-btn:active{ transform:scale(.9); }
.home-nick{
  flex:1; min-width:0;
  margin-left:-4px; padding:0 4px;
  border:none; background:transparent;
  text-align:left;
  font-family:inherit; font-size:15px; font-weight:600;
  color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  cursor:pointer;
}
.home-actions{
  flex:0 0 auto;
  display:flex; align-items:center; gap:6px;
}
.icon-btn.round{
  width:38px; height:38px;
  background:var(--fill);
}
@media (hover: hover) and (pointer: fine){
.icon-btn.round:hover{ background:rgba(var(--tint-rgb),.09); }
}

.icon-btn.round svg{ width:20px; height:20px; }
.icon-btn{
  width:44px; height:44px;
  border:none; background:transparent; color:var(--ink);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  transition:background .18s, transform .18s var(--spring);
}
@media (hover: hover) and (pointer: fine){
.icon-btn:hover{ background:rgba(var(--tint-rgb),.05); }
}

.icon-btn:active{ transform:scale(.88); }
.icon-btn svg{ width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* 搜索 */
.chat-search{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  padding:6px 20px 2px;
}
.searchbar{
  flex:1; min-width:0; height:38px;
  background:var(--fill);
  border-radius:999px;
  display:flex; align-items:center; gap:8px;
  padding:0 16px;
  color:var(--gray-2);
  transition:box-shadow .2s;
}
.searchbar:focus-within{ box-shadow:0 0 0 1.5px var(--ink); }
.searchbar svg{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; flex:0 0 auto; }
.searchbar input{
  flex:1; min-width:0;
  border:none; outline:none; background:transparent;
  font-family:inherit; font-size:14px; color:var(--ink);
}
.searchbar input::placeholder{ color:var(--gray-2); }

/* 分组：ALL / CHAT / GROUP / FRIENDS */
.chat-groups{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  padding:2px 20px 0;
}
.chips{
  display:flex; gap:4px;
  width:100%;
}
.chip{
  flex:1 1 0;
  height:34px; padding:0 6px;
  border:none; background:transparent;
  color:var(--gray-2);
  font-family:"Outfit", "Helvetica Neue", Arial, sans-serif;
  font-size:11px; font-weight:700;
  letter-spacing:.12em; text-transform:uppercase;
  display:flex; align-items:center; justify-content:center; gap:4px;
  cursor:pointer;
  position:relative;
  transition:color .2s;
}
@media (hover: hover) and (pointer: fine){
.chip:hover{ color:var(--ink); }
}

.chip .chip-count{
  font-size:10px; font-weight:600; color:var(--gray-3);
  letter-spacing:0;
  font-variant-numeric:tabular-nums;
  transition:color .2s;
}
.chip.active{ color:var(--ink); }
.chip.active .chip-count{ color:var(--gray-2); }
.chip::after{
  content:'';
  position:absolute;
  bottom:2px; left:50%;
  width:0; height:2px;
  border-radius:999px;
  background:var(--ink);
  transform:translateX(-50%);
  transition:width .25s var(--spring);
}
.chip.active::after{ width:14px; }
.chip:active{ transform:scale(.97); }

/* 聊天列表 */
.chat-list{
  flex:1;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:2px 0 84px;
  /* 列表滑到胶囊后面时，胶囊浮在内容上，内容从胶囊底下透过去 */
  scroll-padding-bottom:84px;
}
.chat-list::-webkit-scrollbar{ width:0; }
.chat-row{
  display:flex; align-items:center; gap:11px;
  padding:9px 20px;
  cursor:pointer;
  border-top:1px solid var(--hairline);
  transition:background .15s, transform .18s var(--spring);
}
.chat-row:first-child{ border-top:none; }
@media (hover: hover) and (pointer: fine){
.chat-row:hover{ background:rgba(var(--tint-rgb),.028); }
}

.chat-row:active{ background:rgba(var(--tint-rgb),.05); transform:scale(.985); }
.row-avatar{
  width:46px; height:46px;
  border-radius:50%;
  object-fit:cover;
  flex:0 0 auto;
  background:var(--fill);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.row-main{ flex:1; min-width:0; }
.row-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.row-name{
  font-size:14px; font-weight:600;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.row-time{
  font-size:11px; color:var(--gray-2);
  flex:0 0 auto;
  font-variant-numeric:tabular-nums;
}
.row-msg{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:2px; }
.row-last{
  font-size:12.5px; color:var(--gray-1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.row-typing{
  display:inline-flex; align-items:center; gap:3px;
  height:14px; vertical-align:middle;
}
.row-typing span{
  width:4px; height:4px; border-radius:50%;
  background:var(--gray-2);
  animation:dotJump 1.05s infinite;
}
.row-typing span:nth-child(2){ animation-delay:.16s; }
.row-typing span:nth-child(3){ animation-delay:.32s; }
.badge{
  flex:0 0 auto;
  min-width:18px; height:18px; padding:0 5px;
  border-radius:999px;
  background:var(--primary); color:var(--ink);
  font-size:10.5px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  font-variant-numeric:tabular-nums;
}
.list-empty{
  padding:48px 20px;
  text-align:center;
  font-size:13px; color:var(--gray-2);
  line-height:1.7;
}
.avatar-initial{
  flex:0 0 auto;
  width:46px; height:46px;
  border-radius:50%;
  background:var(--fill);
  color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-size:18px; font-weight:600;
}

/* ============ 会话行内联操作条（替代长按弹窗） ============ */
.row-actbar{
  display:flex; flex-wrap:wrap; gap:8px;
  padding:2px 20px 12px;
  animation:rowBarIn .22s var(--ease-out) both;
}
@keyframes rowBarIn{
  from{ opacity:0; transform:translateY(-6px); }
  to  { opacity:1; transform:none; }
}
.row-actbar button{
  flex:0 0 auto;
  height:34px; padding:0 14px;
  border:1px solid var(--hairline);
  border-radius:999px;
  background:var(--fill);
  font-family:inherit; font-size:12.5px; font-weight:500;
  color:var(--ink);
  cursor:pointer;
  transition:background .16s, transform .18s var(--spring);
}
.row-actbar button:active{ transform:scale(.95); background:rgba(var(--tint-rgb),.08); }
.row-actbar button.danger{ color:var(--danger); }

/* ============ 好友列表：分组可折叠，展开后整组包在一个胶囊里 ============ */
.qq-group{ padding:0 16px; }
.qq-head{
  width:100%;
  display:flex; align-items:center; gap:8px;
  padding:12px 6px 8px;
  border:none; background:none;
  cursor:pointer;
  font-family:inherit;
}
.qq-name{
  font-size:13px; font-weight:600;
  color:var(--ink);
}
.qq-count{
  margin-left:auto;
  font-size:11px; color:var(--gray-2);
  font-variant-numeric:tabular-nums;
}
.qq-body{
  overflow:hidden;
  background:rgba(255, 255, 255, .78);
  background:color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter:blur(16px) saturate(1.3);
  backdrop-filter:blur(16px) saturate(1.3);
  border:1px solid var(--hairline);
  border-radius:22px;
  margin-bottom:6px;
  box-shadow:0 8px 24px -12px rgba(0,0,0,.18);
}
.qq-group.collapsed .qq-body{ display:none; }
.qq-row{
  position:relative;
  display:flex; align-items:center; gap:11px;
  padding:9px 12px 9px 14px;
  cursor:pointer;
  transition:background .15s;
}
.qq-row + .qq-row::before{
  content:'';
  position:absolute; top:0; left:14px; right:14px;
  height:1px; background:var(--hairline);
}
@media (hover: hover) and (pointer: fine){
.qq-row:hover{ background:rgba(var(--tint-rgb),.03); }
}

.qq-row:active{ background:rgba(var(--tint-rgb),.05); }
.qq-row .row-avatar{ width:40px; height:40px; box-shadow:none; background:var(--card); }
.qq-row .avatar-initial{ width:40px; height:40px; font-size:16px; background:var(--card); }
.qq-main{ flex:1; min-width:0; }
.qq-nick{
  font-size:14px; font-weight:600; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.qq-real{
  font-size:11.5px; color:var(--gray-2);
  margin-top:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.qq-status{
  flex:0 0 auto;
  font-size:11px; color:var(--gray-3);
  font-variant-numeric:tabular-nums;
}
/* 头像和右边的气泡图标 = 进聊天；行内其他地方 = 改资料 */
.qq-av{ flex:0 0 auto; display:flex; }
.qq-go{
  flex:0 0 auto;
  width:32px; height:32px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  color:var(--gray-2);
  transition:background .15s, color .15s, transform .18s var(--spring);
}
.qq-go svg{
  width:18px; height:18px;
  fill:none; stroke:currentColor; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round;
}
@media (hover: hover) and (pointer: fine){
.qq-go:hover{ background:rgba(var(--tint-rgb),.06); color:var(--ink); }
}

.qq-go:active{ transform:scale(.9); }

/* ============ 创建角色 / 添加好友 ============ */
.create-head{
  display:flex; align-items:center; gap:2px;
  padding:var(--head-top) 14px 4px;
}
/* Two separate pairs, with no shared segmented-control background. */
.create-head #createSeg.create-seg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-width:0;margin:0 0 0 8px;padding:0;column-gap:clamp(12px,4vw,22px);background:transparent;border:0;border-radius:0;box-shadow:none}
#createSeg>.create-seg-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;min-width:0;gap:2px;padding:3px;border-radius:12px;background:var(--fill)}
#createSeg .seg-btn{min-width:0;height:38px;font-size:clamp(11px,3.25vw,13px);padding:0 2px;white-space:nowrap}
.create-head #createSeg[hidden]{display:none}
.create-head #createSeg:not([hidden])~.head-spacer{display:none}
@media(max-width:360px){.create-head #createSeg.create-seg{margin-left:4px;column-gap:12px}#createSeg .seg-btn{font-size:11px;padding:0}}
/* Chat号 可用性提示 */
.chat-id-hint{
  margin:2px 4px 0; font-size:12px; line-height:1.5;
}
.chat-id-hint.ok{ color:#2FA35C; }
.chat-id-hint.bad{ color:var(--danger); }
.head-spacer{ width:44px; flex:0 0 auto; }
.create-body{ padding-top:16px; }
.friend-hint{
  margin:14px 4px 0;
  font-size:12.5px; color:var(--gray-2);
  line-height:1.7;
}
.add-friend-results{
  margin-top:14px;
  display:flex; flex-direction:column;
  gap:0;
  border:1px solid var(--hairline);
  border-radius:14px;
  overflow:hidden;
  background:var(--bg);
}
.add-friend-row{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--hairline);
}
.add-friend-row:last-child{ border-bottom:none; }
.add-friend-row img{
  flex:0 0 auto;
  width:44px; height:44px; border-radius:50%;
  object-fit:cover; background:var(--fill);
}
.add-friend-meta{
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:2px;
}
.add-friend-id{
  font-size:15px; font-weight:650; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.add-friend-sub{
  font-size:12.5px; color:var(--gray-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.add-friend-act{
  flex:0 0 auto;
  height:32px; padding:0 14px;
  border:none; border-radius:999px;
  background:var(--primary); color:var(--ink);
  font-family:inherit; font-size:13px; font-weight:600;
  cursor:pointer;
}
.add-friend-act:active{ opacity:.85; }
.add-friend-act.done{
  background:var(--fill); color:var(--gray-2);
  cursor:default;
}
.add-friend-empty{
  padding:18px 14px;
  text-align:center;
  font-size:13.5px; color:var(--gray-2);
}
/* ---- 云端人设广场 ---- */
.cloud-sep{display:flex;align-items:center;gap:10px;margin:22px 2px 12px}
.cloud-sep::before,.cloud-sep::after{content:"";flex:1;height:1px;background:var(--hairline)}
.cloud-sep span{font-size:12.5px;font-weight:700;letter-spacing:.15em;color:var(--gray-2)}
.cloud-search{display:flex;flex-direction:column;gap:10px}
.cloud-search input{height:42px;border:1px solid var(--hairline);border-radius:12px;padding:0 14px;font-size:14px;background:var(--bg);color:var(--ink);font-family:inherit}
.cloud-rating-seg{display:flex;background:var(--fill);border-radius:999px;padding:3px;width:max-content}
.cloud-rating-seg button{border:none;background:none;padding:6px 14px;border-radius:999px;font-size:12.5px;font-weight:600;color:var(--gray-2);cursor:pointer;font-family:inherit}
.cloud-rating-seg button.on{background:var(--bg);color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.12)}
.cloud-tagrow{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.cloud-tagrow button{border:1px solid var(--hairline);background:var(--bg);border-radius:999px;padding:5px 12px;font-size:12px;color:var(--gray-2);cursor:pointer;font-family:inherit}
.cloud-tagrow button.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.cloud-grid{display:flex;flex-direction:column;gap:10px}
.cloud-card{display:flex;gap:12px;align-items:center;background:var(--bg);border:1px solid var(--hairline);border-radius:16px;padding:12px}
.cloud-avatar{width:52px;height:52px;border-radius:50%;object-fit:cover;flex:0 0 auto;background:var(--fill)}
.cloud-meta{flex:1;min-width:0}
.cloud-name{font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cloud-rating{font-size:10.5px;font-weight:800;border-radius:6px;padding:2px 6px;margin-left:6px;vertical-align:2px}
.cloud-rating.r18{background:#ff3b5c;color:#fff}
.cloud-rating.safe{background:var(--fill);color:var(--gray-2)}
.cloud-id{font-size:11.5px;color:var(--gray-2);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cloud-desc{font-size:12.5px;color:var(--ink);opacity:.75;margin-top:4px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.cloud-tags{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.cloud-tags span{font-size:11px;background:var(--fill);border-radius:999px;padding:2px 8px;color:var(--gray-2)}
.cloud-add{flex:0 0 auto;height:32px;padding:0 14px;border:none;border-radius:999px;background:var(--primary);font-size:13px;font-weight:700;cursor:pointer;color:var(--ink)}
.cloud-more{width:100%;margin-top:12px;height:38px;border-radius:12px;border:1px solid var(--hairline);background:var(--bg);color:var(--gray-2);font-size:13px;cursor:pointer;font-family:inherit}

/* ============ 底部导航：悬空胶囊 ============ */
.tabbar{
  /* 悬空胶囊：左右留边、不贴底，靠阴影做出悬浮感 */
  position:absolute; left:12px; right:12px; bottom:calc(var(--foot-bottom) + 6px);
  z-index:20;
  height:56px;
  max-height:100%;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  padding:0 8px;
  border:1px solid var(--hairline);
  border-radius:999px;
  background:color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter:blur(18px) saturate(1.4);
  backdrop-filter:blur(18px) saturate(1.4);
  box-shadow:0 12px 32px -8px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.35);
  transform:translateY(calc(var(--tabbar-shift, 0px) * -1));
  /* 防止个别 WebView 把底栏画到可视区外后完全点不到：保证仍可交互 */
  pointer-events:auto;
}
/* 聊天主页：胶囊本身保持原配色半透明毛玻璃，只去掉“整条通栏”的感觉 */
.app[data-route="chat"] .tabbar{ border-color:var(--hairline); background:color-mix(in srgb, var(--bg) 62%, transparent); }
.tab{
  flex:1;
  height:100%;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:3px;
  border:none; background:none;
  color:var(--gray-2);
  font-size:9.5px; font-weight:500;
  cursor:pointer;
  position:relative;
  padding:0;
  margin:auto 0;
  border-radius:999px;
  transition:color .2s;
}
.tab svg{
  width:22px; height:22px;
  fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
  transition:transform .35s var(--spring);
}
.tab.active{ color:var(--ink); }
.tab.active svg{ transform:scale(1.12); }
.tab-dot{
  display:none !important;
}
.tab.active .tab-dot{ background:transparent; }
.tab-badge{
  position:absolute; top:5px; right:calc(50% - 24px);
  min-width:16px; height:16px; padding:0 4px;
  border-radius:999px;
  background:var(--primary); color:var(--ink);
  font-size:9.5px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  border:2px solid var(--bg);
  font-variant-numeric:tabular-nums;
}

/* 有胶囊导航的页面：各滚动区底部留出胶囊高度，内容可滑到胶囊底下（胶囊浮在上面） */
.app.has-tabbar .feed-body,
.app.has-tabbar .tools-scroll,
.app.has-tabbar .fm-body,
.app.has-tabbar .settings-view .user-body,
.app.has-tabbar .user-body{
  padding-bottom:84px !important;
  scroll-padding-bottom:84px;
}
.placeholder-view{
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:0 44px 40px;
  gap:16px;
}
.ph-icon{
  width:72px; height:72px;
  border-radius:26px;
  background:var(--fill);
  color:var(--ink);
  display:flex; align-items:center; justify-content:center;
}
.ph-icon svg{
  width:32px; height:32px;
  fill:none; stroke:currentColor;
  stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.placeholder-view h2{
  font-size:18px; font-weight:600; margin:0;
}
.placeholder-view p{
  font-size:13.5px; color:var(--gray-1);
  margin:0; line-height:1.75;
  text-wrap:pretty;
}
.ph-tag{
  font-size:11px; font-weight:600;
  letter-spacing:.1em;
  color:var(--gray-2);
  padding:7px 14px;
  border-radius:999px;
  border:1px solid var(--hairline);
}

/* 首页只有一条搜索框，记录入口合并为左侧图标。 */
.searchbar .home-search-icon{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;margin:-8px 0 -8px -10px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;}
.searchbar .home-search-icon:focus-visible{outline:2px solid currentColor;outline-offset:-5px;}
