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

/* ============ 顶部：小组件 + 功能行 ============ */
.chat-view{ padding-top:10px; }
.chat-top{
  flex:0 0 auto;
  padding:6px 20px 4px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
/* 小组件区（默认三张拍立得，可在「小组件美化」换成整图） */
.widget-zone{
  position:relative;
  height:132px;
  display:flex; align-items:center; justify-content:center;
}
.widget-img{
  display:none;
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain;
  pointer-events:none;
}
/* 显示哪一个：由 data-style 决定；整图优先级最高 */
.widget-zone .wg{ display:none; }
.widget-zone[data-style="chat"] .polaroids,
.widget-zone[data-style="info"] .polaroids,
.widget-zone[data-style="custom"] .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(--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:#fff;
  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:#fff;
  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:#fff;
  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(--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:#fff; 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:#fff; 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%;
}
.polaroid{
  position:absolute;
  top:50%; left:50%;
  width:74px; height:92px;             /* 含白边，照片本体 ≈ 2:3 */
  padding:5px 5px 14px;
  border:none; border-radius:4px;
  background:#fff;
  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;
}
.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% - 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% + 92px), calc(-50% + 8px)) rotate(9deg); }
.polaroid.p-left:active { transform:translate(calc(-50% - 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% + 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);
}
.icon-btn.round:hover{ background:rgba(11,11,15,.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);
}
.icon-btn:hover{ background:rgba(11,11,15,.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;
}
.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 10px;
}
.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; }
.chat-row:hover{ background:rgba(11,11,15,.028); }
.chat-row:active{ background:rgba(11,11,15,.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;
}
.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(11,11,15,.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:var(--fill);
  border-radius:22px;
  margin-bottom:6px;
}
.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);
}
.qq-row:hover{ background:rgba(11,11,15,.03); }
.qq-row:active{ background:rgba(11,11,15,.05); }
.qq-row .row-avatar{ width:40px; height:40px; box-shadow:none; background:#fff; }
.qq-row .avatar-initial{ width:40px; height:40px; font-size:16px; background:#fff; }
.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;
}
.qq-go:hover{ background:rgba(11,11,15,.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;
}
.create-seg{ flex:1; margin:0 6px; }
.create-seg .seg-btn{ height:38px; font-size:13px; padding:0 2px; }
/* 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;
}
.wb-row{ cursor:pointer; }
.wb-row label{ width:auto; flex:1; text-align:left; color:var(--ink); font-weight:500; }
.wb-check{ flex:0 0 auto; color:var(--ink); display:flex; }
.wb-check svg{
  width:20px; height:20px;
  fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round;
}

/* ============ 底部导航（整体下移一点） ============ */
.tabbar{
  flex:0 0 auto;
  display:flex;
  border-top:1px solid var(--hairline);
  background:transparent;
  padding-bottom:max(0px, calc(env(safe-area-inset-bottom) - 8px));
}
/* 聊天主页：底栏完全透明，连分隔线也不要，直接透出主页背景 */
.app[data-route="chat"] .tabbar{ border-top-color:transparent; background:transparent; }
.tab{
  flex:1;
  min-height:56px;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:3px;
  border:none; background:none;
  color:var(--gray-2);
  font-size:10px; font-weight:500;
  cursor:pointer;
  position:relative;
  padding:10px 0 2px;               /* 图标文字整体再往下几像素 */
  transition:color .2s;
}
.tab svg{
  width:24px; height:24px;
  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{
  width:4px; height:4px; border-radius:50%;
  background:transparent;
  transition:background .25s;
}
.tab.active .tab-dot{ background:var(--primary); }
.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;
}

/* ============ 占位页（动态/功能/论坛/设置，后续逐页设置） ============ */
.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);
}
