/** 手机端主布局 */

/* ---------------- 外壳 ---------------- */

.app {
  position: relative;
}

.phone {
  position: relative;
  z-index: 1;
  /* <900 就是手机布局，铺满视口；别再卡 440 假装手机框 */
  width: 100%;
  max-width: none;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

/* ---------------- 内容区与标签页 ---------------- */

.viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tabviews {
  position: absolute;
  inset: 0;
}

.tabview {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.tabview:not(.is-active) {
  display: none;
}

.tabview.is-active {
  display: block;
  animation: fade-in 0.18s var(--ease-out) both;
}

/* ---------------- 页面栈 ---------------- */

.stack {
  position: absolute;
  inset: 0;
  z-index: var(--z-stack);
  pointer-events: none;
}

.stack:empty { display: none; }

.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  pointer-events: auto;
  will-change: transform, opacity;
}

.page.anim-in { animation: page-in 0.32s var(--ease) both; }
.page.anim-out { animation: page-out 0.26s var(--ease) both; }
.page.anim-fade-in { animation: fade-in 0.24s var(--ease-out) both; }
.page.anim-fade-out { animation: fade-out 0.2s var(--ease) both; }

@keyframes page-in {
  from { transform: translateX(38%); opacity: 0.7; }
  to { transform: none; opacity: 1; }
}

@keyframes page-out {
  from { transform: none; opacity: 1; }
  to { transform: translateX(38%); opacity: 0.6; }
}

/* ---------------- 头部 ---------------- */

.hd {
  flex: none;
  position: relative;
  z-index: var(--z-header);
  height: calc(var(--header-h) + var(--safe-t));
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--safe-t) 6px 0 4px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.hd-back {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text);
}

.hd-back:active { background: var(--bg-press); }
.hd-back .ic { width: 24px; height: 24px; }

.hd-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 2px;
}

.hd-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hd-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.2;
}

.hd-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.hd-actions .icon-btn { width: 40px; height: 40px; }

/* ---------------- 底部标签栏 ---------------- */

.tabbar {
  flex: none;
  position: relative;
  z-index: var(--z-tabbar);
  display: flex;
  align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  letter-spacing: 0.2px;
  transition: color 0.18s;
  position: relative;
}

.tab .ic { width: 26px; height: 26px; }

.tab.is-active { color: var(--brand); }

.tab-ic-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.tab-ic-wrap .badge {
  position: absolute;
  top: -4px;
  left: 14px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  border: 1.5px solid var(--bg-elev);
  box-sizing: content-box;
}

/* ---------------- 列表页顶部（消息 / 联系人 / 动态） ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--header-h) + 4px + var(--safe-t));
  padding: var(--safe-t) 10px 0 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.tb-avatar {
  flex: none;
  cursor: pointer;
}

.tb-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--bg-input);
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
}

.tb-search .ic { width: 16px; height: 16px; opacity: 0.8; }

/* ---------------- 消息会话列表 ---------------- */

.chat-list {
  background: var(--bg-elev);
  padding-bottom: 8px;
}

.chat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: var(--bg-elev);
  transition: background 0.12s;
  cursor: pointer;
  user-select: none;
}

.chat-row.is-active { background: var(--bg-hover); }

.chat-row + .chat-row::after {
  content: "";
  position: absolute;
  left: 76px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line);
  transform: scaleY(0.5);
}

.chat-row .avatar { --s: 48px; }

.chat-body {
  flex: 1 1 auto;
  min-width: 0;
}

.chat-line1 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-time {
  flex: none;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.chat-line2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.chat-preview {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-preview .draft { color: var(--danger); }
.chat-preview .at { color: var(--danger); }

.chat-flags {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-4);
}

.chat-flags .ic { width: 15px; height: 15px; }

.chat-flags .badge { margin-left: 2px; }

.pin-mark {
  flex: none;
  color: var(--text-4);
  display: grid;
  place-items: center;
}

.pin-mark .ic { width: 13px; height: 13px; }

/* 列表末尾留白，避免被标签栏遮住 */
.list-tail { height: 10px; }

/* ---------------- 聊天页 ---------------- */

.chat-page {
  background: var(--chat-bg);
}

.chat-page .chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 18px;
  overscroll-behavior: contain;
}

.chat-day {
  margin: 12px 0 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.chat-day span {
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .chat-day span { background: rgba(255, 255, 255, 0.08); }

.chat-sys {
  margin: 10px 32px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
}

.chat-sys span {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.045);
}

[data-theme="dark"] .chat-sys span { background: rgba(255, 255, 255, 0.07); }

.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 12px;
  animation: slide-up 0.18s var(--ease-out) both;
}

.msg.self { flex-direction: row-reverse; }

/* 同一人连续发言：合并显示，不再重复头像与昵称 */
.msg.is-cont { padding-top: 1px; }
.msg.is-cont .avatar { visibility: hidden; }
.msg.is-cont .msg-name { display: none; }
.msg.is-cont .msg-body { gap: 0; }

.msg .avatar { --s: 38px; }

.msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: calc(100% - 118px);
}

.msg.self .msg-body { align-items: flex-end; }

.msg-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
  padding: 0 3px;
  line-height: 1.2;
}

.msg-role {
  flex: none;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 15px;
  font-weight: 600;
}

.msg-role.is-owner {
  color: #c87800;
  background: rgba(255, 170, 40, 0.18);
}

.msg-role.is-admin {
  color: #2f6fed;
  background: rgba(47, 111, 237, 0.14);
}

.bubble {
  position: relative;
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 15px;
  background: var(--bubble-other);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.05);
  cursor: default;
  user-select: text;
}

.bubble::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 13px;
  width: 9px;
  height: 9px;
  background: inherit;
  border-radius: 0 0 0 2px;
  transform: rotate(45deg) scale(0.9);
  z-index: 0;
}

.bubble > * {
  position: relative;
  z-index: 1;
}

.msg.self .bubble {
  background: var(--bubble-self);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 144, 240, 0.18);
}

.msg.self .bubble::after {
  left: auto;
  right: -4px;
  border-radius: 0 0 2px 0;
  transform: rotate(-45deg) scale(0.9);
  background: var(--bubble-self-plain);
}

.bubble.is-plain {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.bubble.is-plain::after { display: none; }

/* 旧「引用块」→ 按 @ 提示展示 */
.bubble .quote {
  margin-bottom: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.35;
  color: #0079d6;
}

.bubble .quote.is-at .at {
  display: inline-block;
  padding: 1px 0;
  font-weight: 500;
}

.msg.self .bubble .quote,
.msg.self .bubble .quote .at {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
}

.bubble .quote b { display: none; }

/* 图片气泡 */
.bubble.has-media {
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  border-radius: 12px;
  width: 200px;
  max-width: 100%;
}

.bubble.has-media::after { display: none; }
.bubble.has-media .ph {
  display: block;
  width: 100%;
  border-radius: 12px;
  aspect-ratio: var(--ar, 1.3333);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
}

/* 文件卡片 */
.bubble.file {
  width: 232px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.file-ic {
  flex: none;
  width: 38px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(150deg, #6fa8ff, #2f6fe4);
}

.file-ic.pdf { background: linear-gradient(150deg, #ff8a7a, #e34432); }
.file-ic.doc { background: linear-gradient(150deg, #6aa9ff, #2f6fe4); }
.file-ic.xls { background: linear-gradient(150deg, #6dd49a, #1f9d55); }
.file-ic.zip { background: linear-gradient(150deg, #c0a4ff, #7b52d6); }

.file-info { min-width: 0; }
.file-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-info small { display: block; margin-top: 3px; font-size: 11.5px; opacity: 0.6; }

/* 消息元信息（时间 / 已读） */
.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-4);
  padding: 0 3px;
  font-variant-numeric: tabular-nums;
}

.msg.self .msg-meta { justify-content: flex-end; }

/* 输入框 */
.composer {
  flex: none;
  position: relative;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 7px 8px calc(7px + var(--safe-b));
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
}

.composer .icon-btn { width: 38px; height: 38px; color: var(--text-2); }

.cmp-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  min-height: 37px;
  max-height: 108px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bg-input);
}

.cmp-input {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 15px;
  line-height: 1.42;
  max-height: 94px;
  min-height: 23px;
  color: var(--text);
}

.cmp-input::placeholder { color: var(--text-4); }

.cmp-send {
  flex: none;
  height: 37px;
  padding: 0 15px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.45;
  transition: opacity 0.18s, transform 0.12s;
}

.cmp-send.is-on { opacity: 1; }
.cmp-send:active { transform: scale(0.96); }

/* 表情 / 更多面板 */
.panel {
  flex: none;
  display: none;
  flex-direction: column;
  height: 292px;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  animation: slide-up 0.2s var(--ease-out) both;
}

.panel.is-open { display: flex; }

.emoji-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 10px 4px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-cell {
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 8px;
  transition: background 0.12s;
}

.emoji-cell:active { background: var(--bg-hover); transform: scale(0.9); }

.emoji-tabs {
  flex: none;
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.emoji-tab {
  flex: none;
  width: 38px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--text-3);
}

.emoji-tab.on { background: var(--bg-soft); }

.more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
  padding: 20px 14px;
}

.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-2);
}

.more-ic {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--text);
  transition: transform 0.14s, background 0.14s;
}

.more-item:active .more-ic { transform: scale(0.92); background: var(--bg-press); }
.more-ic .ic { width: 26px; height: 26px; }

/* ---------------- 我的 ---------------- */

.me-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 18px 20px;
  background: linear-gradient(165deg, rgba(10, 132, 255, 0.12), rgba(10, 132, 255, 0) 72%), var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.me-hero .avatar { --s: 62px; }

.me-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.me-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-name.is-switch .me-name-caret {
  display: inline-flex;
  color: var(--text-3);
  flex-shrink: 0;
}

.me-name.is-switch .me-name-caret .ic {
  width: 16px;
  height: 16px;
}

.me-hero-info { cursor: pointer; }

.me-uin {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.me-sign {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.me-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--vip-deep);
  background: linear-gradient(135deg, #ffe6a8, #ffc75a);
}

.me-badge.is-level { color: var(--brand); background: var(--brand-soft); }

.me-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 12px 6px;
}

.me-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 4px 13px;
  border-radius: 14px;
  background: var(--bg-elev);
  font-size: 11.5px;
  color: var(--text-2);
  border: 1px solid var(--line);
  transition: transform 0.14s;
}

.me-tile:active { transform: scale(0.95); }
.me-tile .ic { width: 24px; height: 24px; color: var(--brand); }

.me-menu { margin-top: 10px; border-radius: 14px; overflow: hidden; }

/* ---------------- 设置 ---------------- */

.settings-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 30px;
  background: var(--bg);
}

.settings-group { margin-bottom: 10px; border-radius: 14px; overflow: hidden; background: var(--bg-elev); }

.settings-group .cell { min-height: 50px; padding: 9px 14px; }

.settings-group .cell + .cell::before { left: 14px; }

.settings-foot {
  padding: 18px 16px 8px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-4);
}

.settings-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding: 18px 16px;
  border-radius: 14px;
  background: var(--bg-elev);
}

.settings-hero .cell-main { min-width: 0; }

/* ---------------- 侧栏抽屉 ---------------- */

.drawer {
  position: absolute;
  inset: 0;
  z-index: var(--z-drawer);
  display: none;
}

.drawer.is-open { display: block; }

.drawer-mask {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  animation: fade-in 0.2s var(--ease-out) both;
}

.drawer-panel {
  position: relative;
  width: 85%;
  max-width: 330px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.2);
  animation: drawer-in 0.3s var(--ease) both;
  overflow: hidden;
}

.drawer.is-closing .drawer-panel { animation: drawer-out 0.24s var(--ease) both; }
.drawer.is-closing .drawer-mask { animation: fade-out 0.22s var(--ease) both; }

@keyframes drawer-in {
  from { transform: translateX(-100%); }
  to { transform: none; }
}

@keyframes drawer-out {
  from { transform: none; }
  to { transform: translateX(-100%); }
}

.drawer-hd {
  position: relative;
  padding: calc(24px + var(--safe-t)) 20px 18px;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(10, 132, 255, 0.22), transparent 70%),
    var(--bg-elev);
}

.drawer-hd .avatar { --s: 64px; }

.drawer-name {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.drawer-hd.is-switch { cursor: pointer; }

.drawer-caret {
  display: inline-flex;
  color: var(--text-3);
}

.drawer-caret .ic { width: 14px; height: 14px; }

.drawer-uin {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.drawer-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
}

.drawer-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0 10px;
}

.drawer-sep { height: 8px; background: var(--bg-sunken); margin: 6px 0; }

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  transition: background 0.14s;
}

.drawer-item:active { background: var(--bg-hover); }
.drawer-item .ic { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.drawer-item .di-label { flex: 1 1 auto; min-width: 0; }
.drawer-item .di-value { font-size: 12.5px; color: var(--text-3); }
.drawer-item .switch { margin-left: auto; }

.drawer-foot {
  padding: 12px 20px calc(16px + var(--safe-b));
  font-size: 11px;
  color: var(--text-4);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------------- 搜索页 ---------------- */

.search-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.search-field {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--bg-input);
}

.search-field .ic { width: 16px; height: 16px; color: var(--text-3); flex: none; }

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--text);
}

.search-cancel {
  flex: none;
  padding: 0 6px;
  font-size: 14.5px;
  color: var(--brand);
}

.search-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 14px 30px; }

.search-block { margin-bottom: 18px; }

.search-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elev);
  margin-bottom: 6px;
}

.search-result .hl { color: var(--brand); }

.search-empty { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ---------------- 群资料 ---------------- */

.group-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.group-hero .avatar { --s: 60px; }

.group-name { font-size: 19px; font-weight: 700; }
.group-meta { margin-top: 5px; font-size: 12.5px; color: var(--text-3); }

.group-section { margin-top: 10px; background: var(--bg-elev); }

.member-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px 6px;
  padding: 14px 12px 16px;
}

.member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  min-width: 0;
}

.member span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-add {
  width: 46px;
  height: 46px;
  border-radius: 30%;
  border: 1.5px dashed var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.member-add .ic { width: 22px; height: 22px; }

.group-notice {
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ---------------- 资料卡（底部弹层） ---------------- */

.profile-card {
  width: 100%;
  max-width: 100%;
  padding: 22px 20px calc(20px + var(--safe-b));
  border-radius: 20px 20px 0 0;
  background: var(--bg-elev);
  animation: sheet-in 0.3s var(--ease) both;
}

.overlay.is-closing .profile-card { animation: sheet-out 0.22s var(--ease) both; }

.profile-top { display: flex; gap: 14px; align-items: center; }
.profile-top .avatar { --s: 58px; }
.profile-name { font-size: 19px; font-weight: 700; }
.profile-sub { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }

.profile-sign {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.profile-actions .btn { flex: 1; }

/* ---------------- 图片查看器 ---------------- */

.viewer {
  position: absolute;
  inset: 0;
  z-index: var(--z-modal);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s both;
}

.viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-close {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(10px);
}

.viewer-close .ic { width: 20px; height: 20px; }

.viewer-tip {
  position: absolute;
  bottom: calc(22px + var(--safe-b));
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 360px) {
  .msg-body { max-width: calc(100% - 96px); }
  .emoji-grid { grid-template-columns: repeat(7, 1fr); }
  .more-grid { gap: 14px 4px; }
}

@media (max-height: 680px) {
  .panel { height: 240px; }
}
