/* ==========================================================
   轻语 QingYu · 界面样式
   设计语言：柔光蓝紫 / 玻璃拟态 / 细腻微动效
   ========================================================== */
:root {
  --brand: #3b6cf6;
  --brand-2: #7c5cff;
  --brand-3: #46b2ff;
  --ink: #141d33;
  --ink-2: #56618c;
  --ink-3: #8e99b7;
  --bg: #edf1fa;
  --card: #ffffff;
  --line: #e8edf8;
  --line-2: #f1f4fb;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(26, 43, 86, .06);
  --shadow: 0 12px 36px rgba(26, 43, 86, .09);
  --shadow-lg: 0 26px 70px rgba(21, 35, 74, .18);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-xs { width: 13px; height: 13px; }

/* ---------- 极光背景 ---------- */
.aurora { position: fixed; inset: 0; overflow: hidden; z-index: -1; }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(59, 108, 246, .07) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 72%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 18s var(--ease) infinite alternate; }
.o1 { width: 520px; height: 520px; background: #b6c9ff; top: -180px; left: -140px; }
.o2 { width: 460px; height: 460px; background: #d9c7ff; bottom: -170px; right: -110px; animation-delay: -6s; }
.o3 { width: 380px; height: 380px; background: #b8eaff; top: 38%; left: 46%; animation-delay: -12s; }
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, -50px, 0) scale(1.15); }
}

/* ==========================================================
   登录页
   ========================================================== */
.auth-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 404px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 26px;
  padding: 38px 34px 28px;
  box-shadow: var(--shadow-lg);
  animation: cardIn .7s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }

.brand { text-align: center; margin-bottom: 26px; }
.brand-logo {
  width: 60px; height: 60px; margin: 0 auto 14px;
  border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 70%, var(--brand-3));
  box-shadow: 0 12px 30px rgba(59, 108, 246, .35);
  animation: logoPulse 3.4s ease-in-out infinite;
}
.brand-logo .ico { width: 28px; height: 28px; stroke-width: 2; }
@keyframes logoPulse {
  0%, 100% { transform: translateY(0) rotate(0); box-shadow: 0 12px 30px rgba(59,108,246,.32); }
  50% { transform: translateY(-5px) rotate(-3deg); box-shadow: 0 20px 40px rgba(124,92,255,.32); }
}
.brand h1 { font-size: 30px; letter-spacing: 6px; font-weight: 700; padding-left: 6px;
  background: linear-gradient(120deg, #24365f, #4a5fa8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { margin-top: 6px; font-size: 11.5px; letter-spacing: 2.4px; color: var(--ink-3); }

.auth-tabs { position: relative; display: flex; background: #eef2fc; border-radius: 14px; padding: 4px; margin-bottom: 24px; }
.auth-tab { position: relative; z-index: 2; flex: 1; padding: 10px; border-radius: 11px; font-weight: 600; color: var(--ink-2); transition: color .3s; }
.auth-tab.active { color: #fff; }
.auth-tab-glow { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 18px rgba(59,108,246,.32);
  transition: transform .42s var(--ease); }
.auth-tabs[data-step="1"] .auth-tab-glow { transform: translateX(100%); }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 0 0 7px 4px; letter-spacing: .3px; }
.field input {
  width: 100%; padding: 13px 15px; border-radius: 13px; border: 1.5px solid #e4eaf8; background: #fff;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.field input::placeholder { color: #b3bcd3; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(59,108,246,.13); }

.btn-main {
  width: 100%; padding: 14px; border-radius: 14px; color: #fff; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 12px 26px rgba(59,108,246,.3);
  transition: transform .2s var(--ease), box-shadow .25s, filter .25s;
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(59,108,246,.36); filter: saturate(1.1); }
.btn-main:active { transform: translateY(0) scale(.985); }
.btn-main:disabled { opacity: .6; pointer-events: none; }
.btn-main .ico { color: #fff; }
.btn-sm { width: auto; padding: 10px 20px; border-radius: 11px; font-size: 13px; }
#auth-submit { margin-top: 6px; }
.auth-hint { margin-top: 16px; text-align: center; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ==========================================================
   主框架
   ========================================================== */
.app { display: grid; grid-template-columns: 84px 1fr; height: 100vh; animation: appIn .55s var(--ease) both; }
@keyframes appIn { from { opacity: 0; transform: scale(.99); } to { opacity: 1; transform: none; } }

.rail {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 0 16px; background: rgba(255,255,255,.72); backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
}
.rail-logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px rgba(59,108,246,.3);
  margin-bottom: 12px;
}
.rail-logo .ico { width: 21px; height: 21px; }
.rail-nav { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0 8px; }
.rail-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 0 9px; border-radius: 13px; color: var(--ink-3); font-size: 11px; font-weight: 600;
  transition: color .25s, background .25s, transform .2s var(--ease);
}
.rail-btn .ico { width: 21px; height: 21px; transition: transform .3s var(--ease); }
.rail-btn:hover { color: var(--brand); background: rgba(59,108,246,.07); }
.rail-btn:hover .ico { transform: translateY(-2px); }
.rail-btn.active { color: var(--brand); background: linear-gradient(135deg, rgba(59,108,246,.13), rgba(124,92,255,.1)); }
.rail-btn.active::before {
  content: ""; position: absolute; left: -8px; top: 50%; width: 3px; height: 22px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--brand-2)); transform: translateY(-50%);
  animation: barIn .3s var(--ease);
}
@keyframes barIn { from { height: 0; } to { height: 22px; } }
.dot-badge {
  position: absolute; top: 5px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: linear-gradient(135deg, #ff6b6b, #f43f5e); color: #fff;
  font-size: 10px; font-style: normal; line-height: 16px; text-align: center;
  box-shadow: 0 3px 8px rgba(244,63,94,.4); animation: badgePop .35s var(--ease);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }

.rail-bottom { margin-top: auto; position: relative; }
.rail-avatar {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
  background: hsl(var(--hue, 220) 72% 92%); color: hsl(var(--hue, 220) 62% 42%);
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease);
}
.rail-avatar:hover { transform: scale(1.07) rotate(-2deg); }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }

.workspace { position: relative; overflow: hidden; }
.page { position: absolute; inset: 0; display: none; animation: pageIn .4s var(--ease); }
.page.active { display: flex; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================
   消息页
   ========================================================== */
.page-messages { padding: 14px 16px 16px 14px; gap: 14px; }

.convo-panel {
  width: 290px; flex: none; display: flex; flex-direction: column;
  background: rgba(255,255,255,.8); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.7); border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.convo-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 18px 12px; }
.convo-head h2 { font-size: 19px; letter-spacing: .5px; }
.convo-head p { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3);
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.icon-btn:hover { color: var(--brand); background: rgba(59,108,246,.1); transform: scale(1.06); }

.convo-search {
  display: flex; align-items: center; gap: 8px; margin: 0 14px 10px;
  padding: 9px 12px; border-radius: 11px; background: #f3f6fd; border: 1.5px solid transparent;
  transition: border-color .2s, background .2s;
}
.convo-search:focus-within { border-color: rgba(59,108,246,.4); background: #fff; }
.convo-search .ico { color: var(--ink-3); flex: none; }
.convo-search input { width: 100%; border: none; background: none; font-size: 12.5px; }
.convo-search input::placeholder { color: #adb7cf; }

.convo-list { flex: 1; overflow-y: auto; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 2px; }

.convo-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 10px; border-radius: 13px;
  text-align: left; transition: background .2s, transform .2s var(--ease);
}
.convo-item:hover { background: #f2f6ff; }
.convo-item.active { background: linear-gradient(120deg, rgba(59,108,246,.1), rgba(124,92,255,.07)); }
.convo-item.active .ci-name { color: var(--brand); }
.ci-avatar {
  position: relative; width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  background: hsl(var(--hue, 220) 74% 93%); color: hsl(var(--hue, 220) 62% 42%);
}
.ci-avatar.group { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 17px; }
.ci-main { flex: 1; min-width: 0; }
.ci-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ci-name { font-size: 13.5px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-time { font-size: 10.5px; color: var(--ink-3); flex: none; }
.ci-prev { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-badge {
  flex: none; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: #ff5f72;
  color: #fff; font-size: 10px; font-style: normal; line-height: 17px; text-align: center; box-shadow: 0 3px 8px rgba(255,95,114,.35);
}

/* ----- 聊天区 ----- */
.chat-panel {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: rgba(255,255,255,.86); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.75); border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 14px 22px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.2));
}
.chat-id h3 { font-size: 16px; letter-spacing: .4px; }
.chat-id p { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.chat-actions { display: flex; gap: 4px; }

.chat-scroll {
  flex: 1; overflow-y: auto; padding: 18px 22px 8px;
  background:
    radial-gradient(circle at 12% 8%, rgba(59,108,246,.05), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(124,92,255,.05), transparent 42%);
  scroll-behavior: smooth;
}

.msg-row { display: flex; gap: 10px; margin-bottom: 18px; animation: msgIn .38s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.msg-avatar {
  width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: hsl(var(--hue, 220) 74% 93%); color: hsl(var(--hue, 220) 62% 42%);
}
.msg-main { max-width: min(66%, 560px); min-width: 0; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.msg-name { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.msg-time { font-size: 10.5px; color: #a9b3ca; }

.bubble {
  position: relative; display: inline-block; padding: 10px 14px; border-radius: 14px 14px 14px 5px;
  background: #fff; box-shadow: 0 3px 14px rgba(32,48,90,.07); border: 1px solid #eef2fb;
  font-size: 13.5px; line-height: 1.62; word-break: break-word; white-space: pre-wrap;
}
.msg-row.me { flex-direction: row-reverse; }
.msg-row.me .msg-main { display: flex; flex-direction: column; align-items: flex-end; }
.msg-row.me .msg-meta { flex-direction: row-reverse; }
.msg-row.me .bubble {
  border-radius: 14px 14px 5px 14px; color: #fff; border: none;
  background: linear-gradient(135deg, #4a79f8, #6c5cf7);
  box-shadow: 0 6px 18px rgba(74,121,248,.28);
}
.bubble-img { padding: 4px; background: #fff; border-radius: 14px; max-width: 260px; }
.bubble-img img { display: block; width: 100%; border-radius: 11px; cursor: zoom-in; transition: transform .3s var(--ease); }
.bubble-img img:hover { transform: scale(1.015); }
.msg-row.me .bubble-img { background: #fff; box-shadow: 0 6px 18px rgba(74,121,248,.2); }

.bubble-voice {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; min-width: 140px; cursor: pointer;
}
.v-play { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.9); color: var(--brand); box-shadow: 0 2px 8px rgba(30,50,100,.12); transition: transform .2s; }
.msg-row.me .v-play { background: rgba(255,255,255,.22); color: #fff; }
.v-play:hover { transform: scale(1.08); }
.v-bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.v-bars i { width: 3px; border-radius: 2px; background: currentColor; opacity: .35; height: 30%; }
.msg-row.me .v-bars i { background: #fff; opacity: .5; }
.v-bars.playing i { animation: vbar .8s ease-in-out infinite; }
.v-bars.playing i:nth-child(odd) { animation-delay: .18s; }
.v-bars.playing i:nth-child(3n) { animation-delay: .36s; }
@keyframes vbar { 0%,100% { height: 25%; } 50% { height: 100%; } }
.v-dur { font-size: 11.5px; opacity: .8; }

.bubble-file { display: inline-flex; align-items: center; gap: 10px; padding: 11px 14px; }
.f-ico { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: rgba(59,108,246,.1); color: var(--brand); }
.msg-row.me .f-ico { background: rgba(255,255,255,.2); color: #fff; }
.f-meta b { display: block; font-size: 12.5px; font-weight: 600; }
.f-meta span { font-size: 10.5px; opacity: .7; }

.sys-line { display: flex; justify-content: center; margin: 8px 0 20px; animation: msgIn .4s var(--ease) both; }
.sys-line span {
  max-width: 78%; padding: 6px 14px; border-radius: 20px; background: rgba(59,108,246,.07);
  font-size: 11.5px; color: #7180a4; text-align: center; line-height: 1.6;
}
.sys-line.call span { background: rgba(124,92,255,.08); color: #7b6bc9; }

.typing-line { height: 0; overflow: hidden; padding: 0 24px; font-size: 11.5px; color: var(--ink-3); transition: height .25s, padding .25s; }
.typing-line.show { height: 26px; padding: 5px 24px 0; }
.typing-line b { color: var(--brand); font-weight: 600; }

/* ----- 输入区 ----- */
.composer {
  border-top: 1px solid var(--line-2); padding: 10px 16px 16px;
  background: rgba(255,255,255,.92);
}
.composer-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.tool-btn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3);
  transition: all .2s var(--ease); }
.tool-btn:hover { color: var(--brand); background: rgba(59,108,246,.1); transform: translateY(-1px); }
.tool-btn.recording { color: #fff; background: linear-gradient(135deg, #ff5f72, #f43f5e); animation: recPulse 1.4s infinite; }
@keyframes recPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(244,63,94,.5); } 50% { box-shadow: 0 0 0 9px rgba(244,63,94,0); } }
.composer-tip { margin-left: auto; font-size: 10.5px; color: #b2bbd0; }

.composer-body {
  display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 14px;
  border-radius: 15px; background: #f4f7fd; border: 1.5px solid transparent; transition: border-color .25s, background .25s, box-shadow .25s;
}
.composer-body:focus-within { border-color: rgba(59,108,246,.42); background: #fff; box-shadow: 0 0 0 4px rgba(59,108,246,.08); }
#msg-input {
  flex: 1; border: none; background: none; resize: none; max-height: 132px; line-height: 1.55; padding: 6px 0; font-size: 13.5px;
}
#msg-input::placeholder { color: #b0bace; }
.send-btn {
  width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(59,108,246,.3); transition: transform .2s var(--ease), box-shadow .2s;
}
.send-btn:hover { transform: scale(1.06) rotate(-4deg); box-shadow: 0 9px 20px rgba(59,108,246,.38); }
.send-btn:active { transform: scale(.94); }

.recording-bar {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 14px; border-radius: 13px;
  background: linear-gradient(120deg, #fff1f3, #fff6f2); border: 1px solid #ffd9de; animation: msgIn .3s var(--ease);
}
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #f43f5e; animation: recPulse 1.2s infinite; }
#rec-time { font-variant-numeric: tabular-nums; font-weight: 600; color: #e2415b; font-size: 12.5px; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 24px; }
.rec-wave i { flex: 1; max-width: 5px; border-radius: 3px; background: linear-gradient(#ff8fa0, #f43f5e); height: 20%; transition: height .12s; }
.ghost-btn { padding: 7px 14px; border-radius: 9px; font-size: 12px; color: var(--ink-2); background: #fff; border: 1px solid #e7ecf7; }
.ghost-btn:hover { color: var(--bad); border-color: #ffd2d8; }
.send-mini { padding: 7px 15px; border-radius: 9px; font-size: 12px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #ff6b81, #f43f5e); box-shadow: 0 4px 12px rgba(244,63,94,.28); }
.send-mini:hover { filter: brightness(1.05); }

/* ==========================================================
   通讯录 / 动态 / 我的 通用页头
   ========================================================== */
.page-contacts, .page-moments, .page-profile { flex-direction: column; padding: 26px 30px; overflow-y: auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; letter-spacing: .5px; }
.page-head p { margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.inline-field { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 11px; background: rgba(255,255,255,.9);
  border: 1.5px solid #e7ecf7; box-shadow: var(--shadow-sm); transition: border-color .2s; }
.inline-field:focus-within { border-color: rgba(59,108,246,.45); }
.inline-field .ico { color: var(--ink-3); }
.inline-field input { border: none; background: none; width: 150px; font-size: 12.5px; }

.btn-soft {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 17px; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  color: var(--brand); background: rgba(59,108,246,.1); transition: all .25s var(--ease);
}
.btn-soft:hover { background: rgba(59,108,246,.16); transform: translateY(-1px); }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 11px; font-size: 12.5px;
  color: var(--ink-2); background: #fff; border: 1px solid #e8ecf6; transition: all .25s; }
.btn-ghost:hover { color: var(--bad); border-color: #ffd4da; background: #fff8f9; }

/* ---------- 成员卡 ---------- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.member-card {
  padding: 16px; border-radius: var(--r-md); background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.8);
  box-shadow: var(--shadow-sm); transition: transform .28s var(--ease), box-shadow .28s;
  animation: msgIn .4s var(--ease) both;
}
.member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.mc-top { display: flex; align-items: center; gap: 12px; }
.m-avatar {
  position: relative; width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; background: hsl(var(--hue, 220) 74% 93%); color: hsl(var(--hue, 220) 62% 42%);
}
.presence { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #fff; background: #c3cad9; }
.presence.on { background: var(--ok); }
.presence.on::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(34,197,94,.5); animation: ring 2s infinite; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.presence.busy { background: var(--bad); }
.presence.away { background: var(--warn); }
.mc-top h4 { font-size: 14px; }
.mc-top p { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.m-status { margin: 12px 0 13px; font-size: 12px; color: var(--ink-2); min-height: 18px;
  padding: 7px 11px; border-radius: 10px; background: #f6f8fe; }
.m-actions { display: flex; gap: 8px; }
.m-actions button {
  flex: 1; padding: 8px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--brand);
  background: rgba(59,108,246,.09); transition: all .2s;
}
.m-actions button:hover { background: rgba(59,108,246,.17); }
.m-actions button.call { color: #7c5cff; background: rgba(124,92,255,.1); }
.m-actions button.call:hover { background: rgba(124,92,255,.18); }

/* ---------- 动态 ---------- */
.moment-composer {
  display: none; grid-template-columns: 44px 1fr; gap: 12px; align-items: start;
  padding: 16px; border-radius: var(--r-md); background: rgba(255,255,255,.95); box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.9); margin-bottom: 18px;
}
.moment-composer.show { display: grid; animation: msgIn .35s var(--ease); }
.mc-avatar { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 700;
  background: hsl(var(--hue, 220) 74% 93%); color: hsl(var(--hue, 220) 62% 42%); }
#moment-text { border: none; background: #f5f8fe; border-radius: 12px; padding: 12px 14px; resize: vertical;
  min-height: 62px; font-size: 13px; line-height: 1.6; }
.mc-attach { position: relative; grid-column: 2; width: 120px; margin-top: 10px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.mc-attach img { display: block; width: 100%; height: 90px; object-fit: cover; }
.chip-x { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; }
.mc-foot { grid-column: 2; display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.moment-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 10px; }
.moment-card {
  padding: 18px 20px; border-radius: var(--r-md); background: rgba(255,255,255,.93);
  border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow-sm); transition: box-shadow .3s, transform .3s var(--ease);
  animation: msgIn .45s var(--ease) both;
}
.moment-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mo-head { display: flex; align-items: center; gap: 11px; }
.mo-head h4 { font-size: 13.5px; }
.mo-head p { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.mo-text { margin: 13px 0 0; font-size: 13.5px; line-height: 1.75; color: #2a3352; white-space: pre-wrap; word-break: break-word; }
.mo-img { margin-top: 12px; max-width: 360px; border-radius: 13px; display: block; box-shadow: var(--shadow-sm); cursor: zoom-in; transition: transform .3s var(--ease); }
.mo-img:hover { transform: scale(1.012); }
.mo-foot { display: flex; align-items: center; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px dashed #eef2fa; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px;
  font-size: 12px; color: var(--ink-2); transition: all .2s; }
.like-btn:hover { background: #fff1f4; color: #f43f5e; }
.like-btn.on { color: #f43f5e; background: #fff1f4; }
.like-btn.on .ico { fill: #f43f5e; stroke: #f43f5e; animation: heartPop .5s var(--ease); }
@keyframes heartPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.cmt-btn { padding: 6px 12px; border-radius: 9px; font-size: 12px; color: var(--ink-3); transition: all .2s; }
.cmt-btn:hover { background: #f3f6fd; color: var(--brand); }
.mo-comments { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.cmt-item { font-size: 12px; line-height: 1.6; color: #4c5878; padding: 8px 12px; border-radius: 9px; background: #f7f9fe; }
.cmt-item b { color: var(--brand); font-weight: 600; }
.cmt-item span { color: #a4aec7; font-size: 10.5px; margin-left: 6px; }
.cmt-form { display: none; gap: 8px; margin-top: 10px; }
.cmt-form.show { display: flex; }
.cmt-form input { flex: 1; border: 1.5px solid #e8edf8; border-radius: 10px; padding: 9px 12px; font-size: 12px; background: #f8fafe; }
.cmt-form input:focus { border-color: rgba(59,108,246,.45); background: #fff; }
.cmt-form button { padding: 0 14px; border-radius: 10px; font-size: 12px; color: #fff; background: var(--brand); }
.empty-tip { text-align: center; padding: 40px; color: var(--ink-3); font-size: 12.5px; }

/* ---------- 我的 ---------- */
.profile-hero {
  display: flex; align-items: center; gap: 20px; padding: 26px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, rgba(59,108,246,.12), rgba(124,92,255,.1) 60%, rgba(70,178,255,.1));
  border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); margin-bottom: 16px; flex-wrap: wrap;
}
.ph-avatar { width: 78px; height: 78px; border-radius: 22px; display: grid; place-items: center; font-size: 26px; font-weight: 700;
  background: hsl(var(--hue, 220) 74% 93%); color: hsl(var(--hue, 220) 62% 42%); border: 3px solid #fff; box-shadow: var(--shadow);
}
.ph-main { flex: 1; min-width: 180px; }
.ph-main h2 { font-size: 21px; letter-spacing: .5px; }
.ph-main > p { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.ph-tags { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.tag { padding: 4px 10px; border-radius: 8px; font-size: 11px; background: #fff; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.tag-admin { color: #b07800; background: #fff8e6; }
.tag-status { color: var(--brand); background: rgba(59,108,246,.1); }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.panel-card { padding: 20px; border-radius: var(--r-md); background: rgba(255,255,255,.93); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow-sm); }
.panel-card h3 { font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.panel-card h3::before { content: ""; width: 4px; height: 14px; border-radius: 3px; background: linear-gradient(var(--brand), var(--brand-2)); }
.status-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.status-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 11px; font-size: 12.5px;
  background: #f6f9fe; color: var(--ink-2); border: 1.5px solid transparent; transition: all .2s; }
.status-item:hover { background: #eef3fe; }
.status-item.active { border-color: rgba(59,108,246,.5); background: #fff; color: var(--brand); font-weight: 600; }
.sd { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sd-online { background: var(--ok); } .sd-busy { background: var(--bad); } .sd-away { background: var(--warn); } .sd-invisible { background: #b6bed0; }
.stat-row { display: flex; gap: 10px; margin-bottom: 12px; }
.stat { flex: 1; text-align: center; padding: 14px 6px; border-radius: 12px; background: #f6f9fe; }
.stat b { display: block; font-size: 22px; background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 11px; color: var(--ink-3); }
.muted { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ==========================================================
   管理控制台
   ========================================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px;
  background: rgba(16, 26, 50, .42); backdrop-filter: blur(6px);
  animation: fadeIn .28s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.admin-panel {
  width: min(880px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modalIn .42s var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
.admin-head {
  display: flex; align-items: center; justify-content: space-between; padding: 20px 22px;
  background: linear-gradient(120deg, #1f3b8f, #3b5bd0 60%, #5b46c9); color: #fff;
}
.admin-title { display: flex; align-items: center; gap: 13px; }
.admin-badge { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28); }
.admin-title h2 { font-size: 16.5px; letter-spacing: .5px; }
.admin-title p { margin-top: 3px; font-size: 11px; color: rgba(255,255,255,.72); }
.admin-head .icon-btn { color: rgba(255,255,255,.85); }
.admin-head .icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px 22px 4px; }
.astat { padding: 12px 14px; border-radius: 13px; background: #f5f8fe; border: 1px solid #eef2fb; }
.astat b { display: block; font-size: 21px; color: #26356a; }
.astat span { font-size: 10.5px; color: var(--ink-3); }

.admin-notice { display: flex; gap: 9px; padding: 14px 22px 6px; }
.admin-notice input { flex: 1; padding: 11px 14px; border-radius: 11px; border: 1.5px solid #e7ecf7; background: #f8fafe; font-size: 12.5px; }
.admin-notice input:focus { border-color: rgba(59,108,246,.45); background: #fff; }

.admin-table-wrap { flex: 1; overflow-y: auto; padding: 8px 22px 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; color: var(--ink-3);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tr { transition: background .2s; }
.admin-table tbody tr:hover { background: #f7faff; }
.u-cell { display: flex; align-items: center; gap: 10px; }
.u-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  background: hsl(var(--hue, 220) 74% 93%); color: hsl(var(--hue, 220) 62% 42%); }
.u-name { font-weight: 600; }
.u-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 20px; font-size: 10.5px; }
.pill.on { background: #eafaf0; color: #17803d; }
.pill.off { background: #f2f5fb; color: #8e99b7; }
.pill.ban { background: #fff0f1; color: #c22234; }
.num { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.act-btn { padding: 6px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 600; transition: all .2s; }
.act-btn.ban { color: #d92d3f; background: #fff0f1; }
.act-btn.ban:hover { background: #ffe0e4; }
.act-btn.unban { color: #17803d; background: #eafaf0; }
.act-btn.unban:hover { background: #d8f5e4; }
.act-btn:disabled { opacity: .45; pointer-events: none; }

/* ==========================================================
   通话
   ========================================================== */
.call-mask { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(14, 20, 40, .55); backdrop-filter: blur(10px); animation: fadeIn .3s; }
.call-card {
  width: 300px; padding: 34px 26px 26px; border-radius: 28px; text-align: center;
  background: linear-gradient(165deg, #1c2a4d, #253468 60%, #33265e); color: #fff; box-shadow: var(--shadow-lg);
  animation: modalIn .45s var(--ease) both;
}
.call-avatar {
  width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 28px; display: grid; place-items: center;
  font-size: 30px; font-weight: 700; background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.24);
  box-shadow: 0 0 0 8px rgba(255,255,255,.06); animation: callBreath 2.6s ease-in-out infinite;
}
@keyframes callBreath { 0%,100% { box-shadow: 0 0 0 6px rgba(255,255,255,.05); } 50% { box-shadow: 0 0 0 14px rgba(255,255,255,.02); } }
.call-card h2 { font-size: 18px; letter-spacing: .5px; }
#call-state { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.65); letter-spacing: .5px; }
.call-wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 22px; margin: 16px 0 0; }
.call-wave span { width: 4px; border-radius: 3px; background: rgba(255,255,255,.6); height: 25%; animation: vbar 1s ease-in-out infinite; }
.call-wave span:nth-child(2n) { animation-delay: .2s; } .call-wave span:nth-child(3n) { animation-delay: .4s; }
.call-actions { display: flex; justify-content: center; gap: 22px; margin-top: 26px; }
.call-btn { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .2s; }
.call-btn:hover { transform: scale(1.08); }
.call-btn.reject { background: linear-gradient(135deg, #ff5f72, #e5344a); box-shadow: 0 10px 24px rgba(229,52,74,.4); }
.call-btn.reject .ico { transform: rotate(135deg); }
.call-btn.answer { background: linear-gradient(135deg, #34d399, #16a34a); box-shadow: 0 10px 24px rgba(22,163,74,.4); }
.call-sub-actions { display: flex; justify-content: center; gap: 16px; margin-top: 18px; }
.mini-round { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.14); transition: background .2s; }
.mini-round:hover { background: rgba(255,255,255,.24); }
.mini-round.off { background: rgba(244,63,94,.3); }

/* ==========================================================
   图片预览 / 表情 / Toast
   ========================================================== */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 40px;
  background: rgba(10, 15, 30, .82); backdrop-filter: blur(8px); animation: fadeIn .25s; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: modalIn .35s var(--ease); }
.lb-close { position: absolute; top: 22px; right: 24px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.14); }
.lb-close:hover { background: rgba(255,255,255,.26); }

.emoji-pop {
  position: fixed; z-index: 55; width: 288px; padding: 12px; border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-lg); border: 1px solid #eef2fb; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  animation: popIn .22s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.emoji-pop button { font-size: 20px; padding: 6px 0; border-radius: 8px; transition: background .15s, transform .15s; }
.emoji-pop button:hover { background: #f2f6ff; transform: scale(1.18); }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 12px; font-size: 12.5px; font-weight: 500;
  background: rgba(22, 32, 58, .92); color: #fff; box-shadow: 0 12px 30px rgba(15,25,50,.28);
  backdrop-filter: blur(8px); animation: toastIn .35s var(--ease);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast.ok::before { content: "✓"; color: #4ade80; font-weight: 700; }
.toast.err::before { content: "!"; color: #ff8095; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #d6deee; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #c1cbe0; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 1080px) {
  .convo-panel { width: 250px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 68px 1fr; }
  .rail-btn span { display: none; }
  .rail-btn { padding: 12px 0; }
  .page-messages { padding: 10px; gap: 10px; }
  .convo-panel { width: 210px; }
  .page-contacts, .page-moments, .page-profile { padding: 18px 16px; }
}
@media (max-width: 720px) {
  .convo-panel { display: none; }
  .chat-panel { border-radius: 18px; }
  .msg-main { max-width: 78%; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-panel { max-height: 92vh; border-radius: 18px; }
  .profile-hero { padding: 18px; gap: 14px; }
  .ph-avatar { width: 62px; height: 62px; font-size: 21px; }
  .auth-card { padding: 30px 22px 22px; border-radius: 22px; }
}
