:root {
  --green: #07c160;
  --green-dark: #059c4d;
  --bubble-self: #95ec69;
  --bg: #ededed;
  --side-bg: #f7f7f7;
  --text: #1a1a1a;
  --text-dim: #8a8a8a;
  --line: #e2e2e2;
  --danger: #fa5151;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

button:focus { outline: none !important; }
button:focus-visible { outline: none !important; box-shadow: none; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { background: var(--bg); }

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

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

.auth {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(7, 193, 96, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(7, 193, 96, 0.12), transparent 60%),
    #f2f2f2;
  overflow-y: auto;
}

.auth-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 30px 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(7, 193, 96, 0.35);
}

.brand h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: 1px;
}

.brand p {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.tabs {
  display: flex;
  gap: 8px;
  background: #f2f2f2;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.tab {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 14px;
  color: #555;
  transition: all 0.18s ease;
}

.tab.active {
  background: #fff;
  color: var(--green-dark);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.form { display: flex; flex-direction: column; gap: 14px; }

.form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: #666;
}

.form input {
  height: 44px;
  padding: 0 13px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}

.form input:focus {
  border-color: var(--green);
  background: #fff;
}

.primary {
  height: 46px;
  margin-top: 6px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: background 0.18s, transform 0.08s;
}

.primary:hover { background: var(--green-dark); }
.primary:active { transform: scale(0.985); }
.primary:disabled { opacity: 0.65; cursor: default; }

.hint {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.error {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--danger);
}

.auth-foot {
  position: fixed;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #a0a0a0;
  pointer-events: none;
}

/* ---------------- 主布局 ---------------- */

.main {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  width: 322px;
  min-width: 322px;
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-head {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f2f2f2;
}

.avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  user-select: none;
}

.avatar.me { width: 42px; height: 42px; border-radius: 8px; }

.avatar.peer { width: 36px; height: 36px; }

.side-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.side-id strong {
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-id span { font-size: 11.5px; color: var(--text-dim); }

/* 消息 / 通讯录 切换 */

.side-tabs {
  display: flex;
  height: 43px;
  flex: none;
  background: #f2f2f2;
  border-bottom: 1px solid var(--line);
}

.side-tab {
  flex: 1;
  position: relative;
  font-size: 13.5px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.side-tab.active {
  color: var(--green-dark);
  font-weight: 600;
}

.side-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--green);
}

.tab-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 400;
}

.side-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.side-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.contacts-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}

.requests-block h3,
.friends-block h3 {
  margin: 12px 16px 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #8a8a8a;
  display: flex;
  align-items: center;
  gap: 7px;
}

.small-count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e3e3e3;
  color: #777;
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
}

.request-item,
.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #ececec;
}

.request-item .info,
.friend-item .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.request-item strong,
.friend-item strong {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-item span,
.friend-item span {
  font-size: 11.5px;
  color: #a0a0a0;
}

.request-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.mini-btn {
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--green);
  color: #fff;
}

.mini-btn.plain {
  background: #f2f2f2;
  color: #666;
  border: 1px solid #e0e0e0;
}

.mini-btn:active { transform: scale(0.97); }

.contacts-empty {
  margin: 0;
  padding: 16px;
  font-size: 12px;
  color: #b4b4b4;
  text-align: center;
}

.search-item .search-action {
  margin-left: auto;
  flex: none;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11.5px;
  background: var(--green);
  color: #fff;
}

.search-item .search-action.muted {
  background: #f0f0f0;
  color: #999;
}

.search-item .search-action.outline {
  background: #fff;
  color: var(--green-dark);
  border: 1px solid var(--green);
}


.ghost-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 17px;
  color: #666;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.ghost-icon:hover { background: rgba(0, 0, 0, 0.06); }

.text-btn {
  width: auto;
  padding: 0 9px;
  font-size: 12.5px;
  color: #777;
  border: 1px solid #ddd;
  border-radius: 15px;
  height: 28px;
}

.text-btn:hover { background: rgba(0, 0, 0, 0.05); }

.search-wrap {
  position: relative;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.search-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e3e3e3;
  background: #fff;
}

.search-wrap input:focus { border-color: var(--green); }

.search-results {
  position: absolute;
  top: 54px;
  left: 14px;
  right: 14px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13);
  padding: 6px;
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.search-item:hover { background: #f2f2f2; }

.search-item .avatar { width: 34px; height: 34px; font-size: 13px; }

.search-item .info { flex: 1; min-width: 0; }

.search-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
}

.search-item span { font-size: 11.5px; color: var(--text-dim); }

.search-results .none {
  padding: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}

.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.chat-list:empty { display: none; }

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #ececec;
  transition: background 0.12s;
}

.chat-item:hover { background: #e9e9e9; }
.chat-item.active { background: #dedede; }

.chat-item .meta { flex: 1; min-width: 0; }

.chat-item .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.chat-item strong {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item time { font-size: 11px; color: #a8a8a8; flex: none; }

.chat-item .row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.preview {
  font-size: 12.5px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview.mine::before { content: "我: "; color: #b0b0b0; }

.badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
  flex: none;
}

.list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  text-align: center;
  font-size: 13px;
  color: #b5b5b5;
  line-height: 2;
}

.list-empty span { font-size: 11.5px; color: #c4c4c4; }

.chat-pane {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
}

.empty-state {
  margin: auto;
  text-align: center;
  color: #9a9a9a;
}

.empty-art {
  font-size: 46px;
  margin-bottom: 12px;
  opacity: 0.75;
}

.empty-state p { margin: 0 0 6px; font-size: 15px; color: #8b8b8b; }
.empty-state span { font-size: 12px; color: #ababab; }

.chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  height: 62px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: #ededed;
  border-bottom: 1px solid #dedede;
}

.back { display: none; }

.chat-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.chat-title strong {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title span {
  font-size: 11.5px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-title span.online { color: var(--green-dark); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.call {
  font-size: 19px;
}

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

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.load-more {
  align-self: center;
  padding: 6px 14px;
  font-size: 12px;
  color: #888;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
}

.time-divider {
  align-self: center;
  font-size: 11px;
  color: #b0b0b0;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 8px;
  border-radius: 6px;
}

.message-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 100%;
}

.message-row.mine {
  flex-direction: row-reverse;
}

.message-row .avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
  flex: none;
}

.message-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(62%, 460px);
}

.message-row.mine .message-col { align-items: flex-end; }

.bubble {
  position: relative;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.bubble::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -5px;
  border: 5px solid transparent;
  border-right-color: #fff;
}

.message-row.mine .bubble {
  background: var(--bubble-self);
}

.message-row.mine .bubble::before {
  left: auto;
  right: -5px;
  border-right-color: transparent;
  border-left-color: var(--bubble-self);
}

.voice-bubble {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 96px;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
}

.voice-play {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #333;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex: none;
  line-height: 1;
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.voice-wave i {
  width: 2px;
  background: #333;
  border-radius: 2px;
  opacity: 0.55;
}

.voice-dur {
  font-size: 12px;
  color: #333;
  margin-left: auto;
  flex: none;
}

.voice-bubble.playing .voice-wave i { animation: wave 0.9s ease-in-out infinite; }
.voice-bubble.playing .voice-wave i:nth-child(2) { animation-delay: 0.1s; }
.voice-bubble.playing .voice-wave i:nth-child(3) { animation-delay: 0.2s; }
.voice-bubble.playing .voice-wave i:nth-child(4) { animation-delay: 0.3s; }
.voice-bubble.playing .voice-wave i:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.5); }
}

.msg-tag {
  font-size: 10.5px;
  color: #aaa;
  padding: 0 2px;
}

.typing-indicator {
  align-self: flex-start;
  font-size: 11.5px;
  color: #999;
  padding-left: 48px;
  min-height: 14px;
}

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

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #f7f7f7;
  border-top: 1px solid #dedede;
}

.round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 17px;
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.15s, transform 0.1s;
}

.round-btn:hover { background: rgba(0, 0, 0, 0.05); }
.round-btn:active { transform: scale(0.94); }
.round-btn.active { background: #dcdcdc; }

.input-wrap {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e4e4e4;
  padding: 7px 10px;
  display: flex;
}

.input-wrap:focus-within { border-color: #cfcfcf; }

#textInput {
  flex: 1;
  border: none;
  resize: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
  max-height: 120px;
  padding: 2px 0;
}

.send-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 13.5px;
  flex: none;
  transition: background 0.15s, opacity 0.15s;
}

.send-btn:hover { background: var(--green-dark); }
.send-btn:disabled { opacity: 0.5; cursor: default; }

.hold-btn {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e4e4e4;
  font-size: 14px;
  color: #444;
  user-select: none;
  touch-action: none;
}

.hold-btn.recording {
  background: #e7e7e7;
  color: #333;
}

/* ---------------- 录音浮层 ---------------- */

.rec-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.32);
  z-index: 70;
  pointer-events: none;
}

.rec-box {
  width: 168px;
  padding: 22px 16px 16px;
  border-radius: 14px;
  background: rgba(30, 30, 30, 0.9);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(6px);
}

.rec-wave {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
}

.rec-wave i {
  width: 4px;
  height: 26px;
  border-radius: 3px;
  background: var(--green);
  animation: rec 0.9s ease-in-out infinite;
}

.rec-wave i:nth-child(2) { animation-delay: 0.12s; height: 18px; }
.rec-wave i:nth-child(3) { animation-delay: 0.24s; height: 30px; }
.rec-wave i:nth-child(4) { animation-delay: 0.36s; height: 20px; }
.rec-wave i:nth-child(5) { animation-delay: 0.48s; height: 14px; }

@keyframes rec {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.rec-time {
  margin-top: 12px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.rec-box p {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: #b9b9b9;
}

/* ---------------- 通话 ---------------- */

.call-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  z-index: 90;
  color: #fff;
  overflow: hidden;
}

.call-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(900px 700px at 20% 15%, #0f5d3d, transparent 65%),
    radial-gradient(800px 600px at 85% 85%, #0a3c2a, transparent 60%),
    #0b1411;
  filter: saturate(1.1);
}

.call-card {
  position: relative;
  text-align: center;
  width: min(360px, 88vw);
  padding: 40px 24px 34px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.call-avatar {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  font-size: 34px;
  margin: 0 auto 18px;
  background: #07c160;
  box-shadow: 0 0 0 8px rgba(7, 193, 96, 0.14);
}

.call-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
}

.call-card > p {
  margin: 0 0 34px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}

.call-actions {
  display: flex;
  justify-content: center;
  gap: 26px;
}

.call-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.12s, filter 0.15s;
}

.call-btn:active { transform: scale(0.94); }
.call-btn.end { background: var(--danger); }
.call-btn.accept { background: var(--green); }
.call-btn.mute { background: rgba(255, 255, 255, 0.18); font-size: 17px; }
.call-btn.mute.on { background: rgba(255, 255, 255, 0.42); }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 13px;
  z-index: 120;
  max-width: 80vw;
  text-align: center;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 760px) {
  .sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
  }

  .main.chat-open .sidebar { display: none; }

  .chat-pane { display: none; }
  .main.chat-open .chat-pane { display: flex; }

  .back { display: grid; }

  .message-col { max-width: 72%; }

  .messages { padding: 12px 12px 16px; }

  .composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }

  .auth-foot { display: none; }
}

@media (max-width: 380px) {
  .chat-item { padding: 10px 11px; }
  .send-btn { padding: 0 12px; }
}

/* ==================================================================
   微信式移动端布局：底部「消息 / 通讯录 / 我的」
   ================================================================== */

.main {
  display: block;
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

.home {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
  background: var(--bg);
}

.wx-head {
  position: relative;
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: #ededed;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 10;
}

.wx-head h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #111;
}

.wx-head-actions {
  position: absolute;
  right: 8px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
}

.wx-icon-btn {
  width: 38px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #1a1a1a;
  border-radius: 8px;
}

.wx-icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wx-icon-btn:active { background: rgba(0, 0, 0, 0.05); }

.home-body {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}

.view-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: #f7f7f7;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
}

.nav-item {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding-top: 3px;
  color: #1a1a1a;
  font-size: 11px;
  line-height: 1.2;
}

.nav-item.active { color: #07c160; }

.nav-icon {
  width: 27px;
  height: 26px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 5px);
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #fa5151;
  color: #fff;
  font-size: 10px;
  font-weight: 400;
}

/* 消息列表：微信式白底、细分割线、44px 头像 */

.chat-list { background: #fff; }

.chat-item {
  position: relative;
  height: 64px;
  padding: 9px 14px;
  background: #fff;
  border-bottom: none;
  gap: 11px;
}

.chat-item::after {
  content: "";
  position: absolute;
  left: 69px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #ededed;
  transform: scaleY(0.75);
}

.chat-item:hover { background: #f2f2f2; }
.chat-item.active { background: #dedede; }

.chat-item .avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 5px;
  font-size: 19px;
}

.chat-item strong {
  font-size: 15.5px;
  font-weight: 400;
  color: #111;
}

.chat-item time { font-size: 11.5px; }

.chat-item .row2 { margin-top: 5px; }

.chat-item .preview { font-size: 12.5px; color: #999; }

/* 通讯录 */

.contacts-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
  background: #fff;
}

.contact-entry {
  position: relative;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  background: #fff;
}

.contact-entry::after {
  content: "";
  position: absolute;
  left: 60px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #ededed;
  transform: scaleY(0.75);
}

.entry-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: #fff;
}

.entry-icon.orange { background: #fa9d3b; }
.entry-icon.green { background: #07c160; }

.entry-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-info { flex: 1; min-width: 0; }
.entry-info strong { font-size: 15.5px; font-weight: 400; color: #111; }

.chev {
  margin-left: 4px;
  color: #b2b2b2;
  font-size: 20px;
  line-height: 1;
  font-weight: 300;
}

.contact-entry .small-count { margin-left: auto; }

.request-item {
  padding: 10px 14px 10px 16px;
  background: #fff;
  border-bottom: 1px solid #ededed;
  gap: 10px;
}

.request-item .avatar { width: 40px; height: 40px; min-width: 40px; border-radius: 5px; }
.request-item strong { font-size: 14.5px; }
.request-item span { font-size: 11.5px; }

.request-actions .mini-btn { height: 29px; border-radius: 5px; font-size: 12.5px; }

.friend-list { background: #fff; }

.friend-item {
  height: 58px;
  padding: 8px 14px 8px 16px;
  background: #fff;
  border-bottom: 1px solid #ededed;
  gap: 11px;
}

.friend-item .avatar { width: 40px; height: 40px; min-width: 40px; border-radius: 5px; }
.friend-item strong { font-size: 15px; font-weight: 400; }
.friend-item span { font-size: 11.5px; }

.contacts-empty { padding: 14px 16px; text-align: left; }

/* 我的 */

.me-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 16px 20px;
  background: #fff;
  border-bottom: 1px solid #ededed;
}

.me-profile .avatar.me {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 7px;
  font-size: 27px;
}

.me-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.me-info strong {
  font-size: 20px;
  font-weight: 500;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-info span { font-size: 13px; color: #999; }

.me-group {
  margin-top: 8px;
  background: #fff;
  border-top: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
}

.me-row {
  position: relative;
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #fff;
  font-size: 15.5px;
  color: #111;
  text-align: left;
}

.me-row::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #ededed;
  transform: scaleY(0.75);
}

.me-row:last-child::after { display: none; }

.me-row span { flex: none; }
.me-row em {
  margin-left: auto;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 12.5px;
  color: #999;
}
.me-row i { margin-left: 8px; color: #b2b2b2; font-style: normal; font-size: 19px; }

.me-row.danger { justify-content: center; color: #fa5151; font-size: 16px; }

.me-foot {
  margin: 26px 0 10px;
  text-align: center;
  font-size: 11.5px;
  color: #bbb;
}

/* 聊天页：移动端整屏覆盖 */

.chat-pane {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: none;
  background: var(--bg);
}

.main.chat-open .home { display: none; }
.main.chat-open .chat-pane { display: flex; }
.main.chat-open .bottom-nav { display: none; }

.back {
  display: grid;
  width: 36px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  color: #111;
}

.chat-head {
  height: 52px;
  padding: 0 6px 0 4px;
  gap: 8px;
  background: #ededed;
  border-bottom: 1px solid #dedede;
}

.chat-head .avatar.peer { width: 36px; height: 36px; border-radius: 5px; }
.chat-title strong { font-size: 16px; }
.more { font-size: 19px; letter-spacing: 1px; }
.call { font-size: 20px; }

/* 底部操作面板 */

.sheet-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 105;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  width: 100%;
  max-width: 560px;
  padding-bottom: env(safe-area-inset-bottom);
  background: #f2f2f2;
  border-radius: 13px 13px 0 0;
  overflow: hidden;
  animation: sheet-up 0.18s ease-out;
}

.sheet-mask.prompt {
  align-items: flex-start;
  padding-top: 12vh;
}

.sheet-mask.prompt .sheet-panel {
  max-width: min(420px, calc(100% - 24px));
  border-radius: 13px;
  padding-bottom: 0;
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-header {
  background: #fff;
  padding: 15px 18px 13px;
  text-align: center;
  border-bottom: 1px solid #ededed;
}

.sheet-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.sheet-desc {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: #999;
}

.sheet-input {
  display: block;
  width: calc(100% - 32px);
  height: 44px;
  margin: 14px auto;
  padding: 0 12px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
}

.sheet-input:focus { border-color: var(--green); }

.sheet-body { padding: 10px 0 0; }

.sheet-button {
  display: block;
  width: 100%;
  height: 52px;
  background: #fff;
  color: #111;
  font-size: 16px;
  border-bottom: 1px solid #ededed;
}

.sheet-button:last-child { border-bottom: none; }
.sheet-button.danger { color: #fa5151; }
.sheet-button:active { background: #f2f2f2; }

.sheet-cancel {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  background: #fff;
  color: #111;
  font-size: 16px;
}

.sheet-note {
  background: #fff;
  padding: 14px 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #666;
  white-space: pre-wrap;
}


