/* ============================================================
   云聊 - 科技感设计系统
   深空蓝黑 + 霓虹渐变 + 玻璃拟态
   ============================================================ */

:root {
  --bg-0: #05070f;
  --bg-1: #0a0e1a;
  --bg-2: #0f1526;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --text-0: #f0f4ff;
  --text-1: #a8b3cf;
  --text-2: #5c6a8a;
  --primary: #4f7cff;
  --primary-2: #00d4ff;
  --accent: #9d5cff;
  --danger: #ff4d6d;
  --success: #00e5a0;
  --warn: #ffb020;
  --grad-main: linear-gradient(135deg, #4f7cff 0%, #00d4ff 100%);
  --grad-hot: linear-gradient(135deg, #ff5f6d 0%, #ffc371 100%);
  --shadow-main: 0 8px 32px rgba(79, 124, 255, 0.35);
  --radius: 16px;
  --radius-lg: 24px;
  --tabbar-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  font-size: 15px;
  user-select: none;
  -webkit-user-select: none;
}

#app { height: 100%; }

/* ---------- 科技感背景 ---------- */
.tech-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(79,124,255,0.15), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0,212,255,0.10), transparent 55%),
    radial-gradient(700px 400px at 110% 80%, rgba(157,92,255,0.10), transparent 60%),
    var(--bg-0);
}
.tech-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.tech-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(0,212,255,0.08), transparent 30%),
              radial-gradient(circle at 80% 70%, rgba(157,92,255,0.08), transparent 30%);
  filter: blur(40px);
  animation: bgFloat 14s ease-in-out infinite alternate;
}
@keyframes bgFloat {
  0% { transform: translateY(-10px) scale(1); opacity: 0.8; }
  100% { transform: translateY(15px) scale(1.05); opacity: 1; }
}

/* ---------- 页面容器 ---------- */
.page {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  background: transparent;
}
.page.active { display: flex; animation: pageIn 0.28s ease; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 顶部导航 ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}
.navbar .title {
  font-size: 17px;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar .nav-left, .navbar .nav-right { display: flex; align-items: center; gap: 12px; min-width: 70px; }
.navbar .nav-right { justify-content: flex-end; }
.nav-btn {
  width: 34px; height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-0);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn:active { transform: scale(0.9); background: var(--bg-card-hover); }

/* ---------- 底部标签栏 ---------- */
.tabbar {
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-2);
  font-size: 10px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.tab-item .tab-icon {
  font-size: 22px;
  line-height: 1;
  filter: grayscale(1) opacity(0.6);
  transition: all 0.25s;
}
.tab-item.active { color: var(--primary-2); }
.tab-item.active .tab-icon {
  filter: none;
  transform: translateY(-2px) scale(1.1);
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.6);
}
.tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.5);
  animation: badgePop 0.3s ease;
}
@keyframes badgePop { from { transform: scale(0.5); } to { transform: scale(1); } }

/* ---------- 页面主体滚动区 ---------- */
.page-body {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  scrollbar-width: none;
}
.page-body::-webkit-scrollbar { display: none; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- 按钮 ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad-main);
  box-shadow: var(--shadow-main);
}
.btn-primary:active { box-shadow: 0 4px 16px rgba(79,124,255,0.3); }
.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-0);
}
.btn-danger { background: linear-gradient(135deg, #ff4d6d, #ff7a59); }
.btn-sm { height: 36px; font-size: 13px; border-radius: 10px; padding: 0 14px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ---------- 表单 ---------- */
.field {
  position: relative;
  margin-bottom: 14px;
}
.field input, .field textarea {
  width: 100%;
  height: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-0);
  font-size: 16px;
  padding: 0 16px;
  outline: none;
  transition: all 0.25s;
  font-family: inherit;
}
.field textarea { height: auto; padding: 12px 16px; resize: none; }
.field input:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.15);
  background: rgba(79, 124, 255, 0.05);
}
.field .label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  padding-left: 4px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(15, 21, 38, 0.95);
  border: 1px solid var(--border);
  color: var(--text-0);
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.error { border-color: rgba(255, 77, 109, 0.5); }
.toast.success { border-color: rgba(0, 229, 160, 0.5); }

/* ---------- 加载动画 ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  transition: opacity 0.5s;
}
.loading-screen.hide { opacity: 0; pointer-events: none; }
.loading-inner { text-align: center; }
.loading-ring {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid rgba(79, 124, 255, 0.15);
  border-top-color: var(--primary);
  border-right-color: var(--primary-2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-logo {
  font-size: 28px;
  font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 4px;
}
.loading-text { color: var(--text-2); font-size: 13px; margin-top: 10px; letter-spacing: 2px; }

/* ---------- 登录/注册页 ---------- */
.auth-page { justify-content: center; align-items: stretch; padding: 24px; }
.auth-page .page-body { display: flex; flex-direction: column; justify-content: center; }
.auth-logo { text-align: center; margin-bottom: 34px; }
.auth-logo .logo-icon {
  width: 84px; height: 84px;
  margin: 0 auto 16px;
  border-radius: 26px;
  background: var(--grad-main);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  box-shadow: var(--shadow-main);
  position: relative;
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-logo .logo-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 30px;
  background: var(--grad-main);
  opacity: 0.35;
  filter: blur(14px);
  z-index: -1;
}
.auth-logo h1 {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #9db8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 6px;
}
.auth-logo p { color: var(--text-2); font-size: 13px; margin-top: 8px; letter-spacing: 1px; }
.auth-switch {
  display: flex;
  margin: 22px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.auth-switch .sw-item {
  flex: 1;
  height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.25s;
}
.auth-switch .sw-item.active {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.35);
}
.auth-tip { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 18px; line-height: 1.8; }
.auth-tip .link { color: var(--primary-2); cursor: pointer; }

/* ---------- 注册选号 ---------- */
.num-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.num-cell {
  position: relative;
  padding: 14px 6px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
}
.num-cell .num {
  font-size: 19px;
  font-weight: 800;
  font-family: 'SF Mono', Consolas, monospace;
  letter-spacing: 1px;
  color: var(--text-0);
}
.num-cell .sub { font-size: 10px; color: var(--text-2); margin-top: 3px; }
.num-cell:active { transform: scale(0.94); }
.num-cell.selected {
  border-color: var(--primary);
  background: rgba(79, 124, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.25), 0 6px 20px rgba(79, 124, 255, 0.2);
}
.num-cell.selected .num { color: var(--primary-2); }
.num-cell.lucky { border-color: rgba(255, 176, 32, 0.45); }
.num-cell.lucky .num { color: #ffc371; }
.badge-lucky {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--grad-hot);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(255, 95, 109, 0.5);
  animation: luckyShine 1.6s ease-in-out infinite;
}
@keyframes luckyShine {
  0%, 100% { box-shadow: 0 3px 10px rgba(255, 95, 109, 0.5); }
  50% { box-shadow: 0 3px 18px rgba(255, 195, 113, 0.8); }
}
.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--bg-card);
  color: var(--primary-2);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
}
.refresh-btn:active { transform: scale(0.97); background: rgba(0, 212, 255, 0.08); }
.refresh-btn .icon { font-size: 16px; }
.refresh-btn.spinning .icon { animation: spin 0.6s linear infinite; }

/* ---------- 会话列表 ---------- */
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.conv-item:active { background: var(--bg-card-hover); }
.avatar {
  width: 48px; height: 48px;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  position: relative;
  background: linear-gradient(135deg, #4f7cff, #9d5cff);
  box-shadow: 0 4px 12px rgba(79, 124, 255, 0.3);
}
.avatar img { width: 100%; height: 100%; border-radius: 16px; object-fit: cover; }
.avatar .online-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-1);
}
.avatar.svc { background: linear-gradient(135deg, #00d4ff, #4f7cff); }
.conv-main { flex: 1; min-width: 0; }
.conv-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-name .qq-tag {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 400;
  margin-left: 6px;
  font-family: Consolas, monospace;
}
.conv-time { font-size: 11px; color: var(--text-2); flex-shrink: 0; }
.conv-preview {
  font-size: 13px;
  color: var(--text-1);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-unread {
  position: absolute;
  right: 14px; bottom: 12px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.section-title {
  font-size: 12px;
  color: var(--text-2);
  padding: 10px 6px 6px;
  letter-spacing: 1px;
}

/* ---------- 聊天页 ---------- */
.chat-page { background: rgba(5, 7, 15, 0.6); }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
  background:
    radial-gradient(800px 400px at 100% 0%, rgba(79,124,255,0.06), transparent 60%),
    radial-gradient(600px 300px at 0% 100%, rgba(157,92,255,0.06), transparent 60%);
}
.chat-body::-webkit-scrollbar { display: none; }
.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg-row .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 68%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}
.msg-row.theirs .msg-bubble {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  color: var(--text-0);
}
.msg-row.mine .msg-bubble {
  background: var(--grad-main);
  border-top-right-radius: 4px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.3);
}
.msg-bubble img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
}
.msg-meta {
  font-size: 10px;
  color: var(--text-2);
  margin-top: 4px;
  padding: 0 2px;
  display: flex;
  gap: 8px;
}
.msg-row.mine .msg-meta { justify-content: flex-end; }
.msg-date {
  text-align: center;
  font-size: 11px;
  color: var(--text-2);
  padding: 4px 0;
}

.chat-inputbar {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.inputbar-top {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.tool-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.tool-btn:active { background: var(--bg-card-hover); transform: scale(0.92); }
.emoji-panel {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 10px 6px 2px;
  max-height: 180px;
  overflow-y: auto;
}
.emoji-cell {
  display: flex; align-items: center; justify-content: center;
  height: 36px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, transform 0.15s;
}
.emoji-cell:active { background: var(--bg-card-hover); transform: scale(1.15); }
.chat-inputbar textarea {
  flex: 1;
  max-height: 120px;
  min-height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-0);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
}
.chat-inputbar textarea:focus { border-color: var(--primary); }
.send-btn {
  width: 46px; height: 46px;
  border-radius: 14px;
  border: none;
  background: var(--grad-main);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-main);
  flex-shrink: 0;
  transition: all 0.2s;
}
.send-btn:active { transform: scale(0.9); }

/* ---------- 联系人页 ---------- */
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}
.contact-item:active { background: var(--bg-card-hover); }
.contact-item .avatar { width: 44px; height: 44px; border-radius: 14px; }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 15px; font-weight: 600; }
.contact-qq { font-size: 11px; color: var(--text-2); font-family: Consolas, monospace; margin-top: 2px; }
.contact-bio {
  font-size: 12px; color: var(--text-1);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.add-btn {
  width: 34px; height: 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--primary-2);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- 搜索框 ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  height: 44px;
  margin-bottom: 14px;
}
.search-bar .icon { color: var(--text-2); font-size: 15px; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-0);
  font-size: 15px;
  height: 100%;
}
.search-bar input::placeholder { color: var(--text-2); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 86%;
  max-width: 340px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  animation: modalIn 0.25s ease;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: none; } }
.modal h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal .modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.modal .modal-btns .btn { flex: 1; }

/* 搜索结果卡片 */
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.search-result .avatar { width: 46px; height: 46px; }

/* ---------- 我的页 ---------- */
.profile-header {
  text-align: center;
  padding: 30px 0 22px;
}
.profile-header .avatar {
  width: 82px; height: 82px;
  margin: 0 auto 14px;
  border-radius: 26px;
  font-size: 34px;
  box-shadow: 0 8px 30px rgba(79, 124, 255, 0.4);
}
.profile-header .nick { font-size: 21px; font-weight: 800; }
.profile-header .qq {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
  font-family: Consolas, monospace;
  letter-spacing: 1px;
}
.profile-header .bio {
  font-size: 13px;
  color: var(--text-1);
  margin-top: 10px;
  max-width: 260px;
  margin-left: auto; margin-right: auto;
}
.menu-list { margin-top: 16px; overflow: hidden; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-card-hover); }
.menu-item .m-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: rgba(79, 124, 255, 0.12);
}
.menu-item .m-label { flex: 1; font-size: 15px; }
.menu-item .m-arrow { color: var(--text-2); font-size: 14px; }
.logout-btn {
  margin-top: 20px;
  background: rgba(255, 77, 109, 0.1);
  border: 1px solid rgba(255, 77, 109, 0.3);
  color: var(--danger);
}

/* 客服悬浮按钮 */
.svc-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + 24px);
  z-index: 100;
  width: 52px; height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #00d4ff, #4f7cff);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 28px rgba(0, 212, 255, 0.4);
  cursor: pointer;
  animation: fabPulse 2.4s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(0, 212, 255, 0.4); }
  50% { box-shadow: 0 8px 36px rgba(0, 212, 255, 0.7); }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state .e-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.5; }
.empty-state .e-text { font-size: 14px; line-height: 1.8; }

/* 输入密码可见性 */
.pw-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
}

/* 滚动条微调 */
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 增强组件：撤回/置顶/预览/分组 ---------- */

/* 撤回消息居中提示 */
.msg-center {
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 0;
  user-select: none;
}

/* 发送失败消息 */
.msg-row.failed .msg-bubble {
  opacity: 0.55;
  border: 1px dashed rgba(255, 77, 109, 0.5);
}
.msg-row.failed .msg-meta { color: var(--danger); }

/* 消息预览（长按菜单内） */
.msg-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 14px;
  word-break: break-word;
  max-height: 90px;
  overflow-y: auto;
}
.msg-preview img { max-width: 100%; border-radius: 8px; }

/* 图片全屏预览 */
.img-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.img-preview-mask img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* 置顶会话 */
.conv-item { position: relative; }
.conv-item.pinned { background: rgba(79, 124, 255, 0.06); }
.conv-item.pinned .conv-name { color: var(--primary-2); }
.pin-flag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 11px;
  opacity: 0.85;
  z-index: 2;
}

/* 联系人分组 */
.contact-group-title {
  font-size: 12px;
  color: var(--text-2);
  padding: 14px 14px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.contact-group-title .cg-count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-1);
}

/* 好友资料卡 */
.modal .avatar { margin: 0 auto; }

