/* ============================================================
   交流群 · 样式表
   ============================================================ */

:root {
  --blue: #0ea5e9;
  --blue-deep: #0284c7;
  --blue-soft: #e0f2fe;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e8eef5;
  --bg: #f4f7fb;
  --white: #fff;
  --green: #10b981;
  --red: #ef4444;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, .08);
  --shadow-lg: 0 22px 55px rgba(15, 23, 42, .12);
  --radius: 14px;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
}

a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   登录 / 注册
   ============================================================ */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 8% -10%, #dbeafe 0%, transparent 62%),
    radial-gradient(900px 460px at 100% 4%, #ccfbf1 0%, transparent 58%),
    linear-gradient(160deg, #f8fafc, #eef4fb);
}

.auth-shell {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  width: 100%;
  max-width: 880px;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;  box-shadow: var(--shadow-lg);
  border: 1px solid #eef2f8;
}

.auth-shell.narrow { max-width: 440px; grid-template-columns: 1fr; }
.auth-body.embed {
  padding: 10px 12px;
  background: #fff;
  align-items: flex-start;
}
.auth-body.embed .auth-shell {
  grid-template-columns: 1fr;
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
}
.auth-body.embed .auth-aside { display: none; }

.auth-aside {
  padding: 44px 36px;
  color: #fff;
  background:
    radial-gradient(600px 320px at 100% 0%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(150deg, #0ea5e9, #0369a1);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 15px;
  font-size: 25px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  margin-bottom: 18px;
}

.auth-aside h1 { font-size: 22px; margin: 0 0 8px; letter-spacing: .5px; }
.auth-group { margin: 0 0 26px; font-size: 13px; color: rgba(255, 255, 255, .82); }
.auth-group b { color: #fff; }
.auth-points { margin: 0; padding-left: 18px; font-size: 13px; color: rgba(255, 255, 255, .85); }
.auth-points li { margin-bottom: 10px; }

.auth-main { padding: 46px 44px; }
.auth-main h2 { margin: 0 0 4px; font-size: 22px; }
.auth-sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }

.fld { display: block; margin-bottom: 15px; }
.fld span { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.fld input {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.fld input:focus { border-color: #38bdf8; background: #fff; box-shadow: 0 0 0 3px rgba(56, 189, 248, .16); }

.btn-primary {
  width: 100%;
  padding: 12px 18px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(2, 132, 199, .26);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(2, 132, 199, .32); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.sm { width: auto; margin: 0; padding: 10px 20px; font-size: 13px; }

.form-error, .form-ok {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.6;
}
.form-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.form-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.form-ok.err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.auth-foot { margin-top: 22px; text-align: center; font-size: 13px; color: var(--muted); }

/* 头像选择 */
.avatar-pick {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 20px;
  background: #f8fbff;
  border: 1px dashed #cfe2f3;
  border-radius: 12px;
}
.avatar-preview {
  position: relative;
  width: 68px; height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--blue-deep);
  font-size: 24px;
  font-weight: 700;
}
.avatar-preview.bad { box-shadow: 0 0 0 3px rgba(239, 68, 68, .35); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-tip b { display: block; font-size: 13px; color: var(--text); }
.avatar-tip span { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.avatar-tip input[type=file] { font-size: 12px; color: var(--muted); max-width: 100%; }

.admin-badge { display: inline-block; font-size: 12px; color: var(--blue-deep); background: var(--blue-soft); padding: 3px 10px; border-radius: 20px; margin-bottom: 12px; }

/* ============================================================
   聊天页面
   ============================================================ */

.chat-body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(900px 480px at 0% 0%, #e0f2fe 0%, transparent 60%),
    radial-gradient(800px 420px at 100% 100%, #d1fae5 0%, transparent 55%),
    #eef2f8;
  overflow: hidden;
}

.chat-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 920px;
  height: 100%;
  max-height: 880px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid #e6edf6;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  color: #fff;
  background:
    radial-gradient(520px 200px at 100% 0%, rgba(255, 255, 255, .18), transparent 70%),
    linear-gradient(120deg, #0ea5e9, #0284c7);
  box-shadow: 0 6px 18px rgba(2, 132, 199, .18);
  z-index: 5;
}

.group-badge {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 18px; font-weight: 700;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

.group-meta { min-width: 0; flex: 1; }
.group-meta h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-meta p { margin: 2px 0 0; font-size: 12px; color: rgba(255, 255, 255, .82); display: flex; align-items: center; gap: 5px; }
.group-meta .sep { opacity: .55; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, .28); display: inline-block; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 9px;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, .28); text-decoration: none; }
.icon-btn.muted { opacity: .55; }

.me-chip { display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; background: rgba(255, 255, 255, .16); border-radius: 20px; }
.me-chip img { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; display: block; }
.me-chip .letter-avatar { width: 27px; height: 27px; font-size: 13px; }
.me-name { font-size: 12.5px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-form { margin: 0; }

/* 消息区 */
.msg-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px 6px;
  background:
    radial-gradient(700px 320px at 100% 0%, #f0f9ff 0%, transparent 62%),
    #f7fafd;
  scroll-behavior: smooth;
  position: relative;
  overscroll-behavior: contain;
}

.msg-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }

.day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
  color: #94a3b8;
  font-size: 11.5px;
}
.day-divider::before,
.day-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, #e2e8f0);
}
.day-divider::after { background: linear-gradient(90deg, #e2e8f0, transparent); }
.day-divider span {
  margin: 0 10px;
  padding: 1px 10px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #eef2f7;
}

.msg-row { display: flex; gap: 9px; align-items: flex-start; }
.msg-row.self { flex-direction: row-reverse; }

.avatar {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  box-shadow: var(--shadow-sm);
}
.avatar-letter {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #0369a1;
  background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
}

.msg-body { max-width: min(72%, 560px); min-width: 0; }
.msg-row.self .msg-body { display: flex; flex-direction: column; align-items: flex-end; }

.msg-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #94a3b8; margin: 0 4px 5px; }
.msg-row.self .msg-meta { flex-direction: row-reverse; }
.msg-meta .name { color: #64748b; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bubble {
  display: inline-block;
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-sm);
  border: 1px solid #eef2f7;
}

.msg-row.self .bubble {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(2, 132, 199, .22);
}

.bubble.media { padding: 4px; background: #fff; border-color: #eef2f7; }
.msg-row.self .bubble.media { background: #fff; box-shadow: var(--shadow-sm); }

.bubble.media img.chat-image {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
}

/* 文件卡片 */
.file-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 300px;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fbfdff;
  border: 1px solid #eaf1f8;
  color: var(--ink);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.file-card:hover { background: #f4f9ff; border-color: #cfe7fa; text-decoration: none; }
.file-card-clickable { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.file-card-clickable:active { background: #eef7ff; border-color: #bfe0f6; }

.file-icon {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
}
.file-icon.word { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.file-icon.pdf  { background: linear-gradient(135deg, #ef4444, #dc2626); }
.file-icon.ppt  { background: linear-gradient(135deg, #f97316, #ea580c); }
.file-icon.xls  { background: linear-gradient(135deg, #16a34a, #15803d); }
.file-icon.other { background: linear-gradient(135deg, #64748b, #475569); }

.file-info { min-width: 0; flex: 1; }
.file-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size { display: block; font-size: 11px; color: #94a3b8; margin-top: 1px; }

.file-ops { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.file-op {
  font-size: 11.5px;
  line-height: 1.6;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid #dbe9f6;
  background: #fff;
  color: var(--blue-deep);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.file-op:hover { background: #eff8ff; border-color: #bfe0f6; text-decoration: none; }
.file-op.primary { background: #eaf6fe; border-color: #cdeafd; font-weight: 600; }

/* 空状态 / 跳转按钮 */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}
.empty-icon { font-size: 34px; opacity: .55; }

.jump-bottom {
  position: absolute;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  padding: 7px 16px;
  font-size: 12px;
  color: var(--blue-deep);
  background: #fff;
  border: 1px solid #d8e9f7;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  z-index: 6;
}

/* 输入区 */
.composer-wrap {
  padding: 10px 14px 12px;
  background: #fff;
  border-top: 1px solid #eef2f7;
  position: relative;
  z-index: 4;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px 6px 4px;
  background: #f7fafd;
  border: 1px solid #e5eef7;
  border-radius: 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.composer:focus-within { border-color: #7dd3fc; background: #fff; box-shadow: 0 0 0 3px rgba(56, 189, 248, .12); }

.composer-tools { display: flex; align-items: center; gap: 2px; padding-bottom: 2px; }

.tool-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-size: 17px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  transition: background .14s, transform .14s;
}
.tool-btn:hover { background: #e8f4fd; }
.tool-btn:active { transform: scale(.94); }

#msgInput {
  flex: 1;
  min-height: 36px;
  max-height: 132px;
  padding: 7px 6px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  overflow-y: auto;
}

.send-btn {
  flex-shrink: 0;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(2, 132, 199, .24);
  transition: opacity .15s, transform .15s;
}
.send-btn:hover { transform: translateY(-1px); }
.send-btn:disabled { opacity: .45; transform: none; box-shadow: none; cursor: not-allowed; }

.composer-status { margin-top: 6px; font-size: 12px; color: var(--muted); padding-left: 4px; }
.composer-status.err { color: var(--red); }

/* 表情面板 */
.emoji-panel {
  position: absolute;
  left: 14px;
  bottom: 100%;
  margin-bottom: 8px;
  width: 336px;
  max-width: calc(100vw - 28px);
  max-height: 262px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  z-index: 20;
}
.emoji-panel button {
  aspect-ratio: 1 / 1;
  font-size: 19px;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: background .12s, transform .12s;
}
.emoji-panel button:hover { background: #eff8fe; transform: scale(1.08); }

/* 图片查看 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 28, .86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }

/* 文档在线预览 */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 15, 26, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 240;
}
.preview-box {
  width: min(1040px, 96vw);
  height: min(820px, 92vh);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px 11px 16px;
  background: #f8fbfe;
  border-bottom: 1px solid #e9f0f7;
}
.preview-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.preview-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid #e0e9f2;
  background: #fff;
  color: #475569;
  font-size: 13px;
}
.preview-close:hover { background: #f1f7fd; }
.preview-body { flex: 1; min-height: 0; overflow: auto; background: #eef3f9; position: relative; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.preview-msg { padding: 52px 24px; text-align: center; color: #64748b; font-size: 13px; line-height: 1.9; }
.preview-msg-title { font-size: 15px; font-weight: 600; color: #334155; margin-bottom: 6px; }

.docx-holder { padding: 16px; background: #fff; min-height: 100%; }
.docx-holder .docx-wrapper { background: #f3f6fa; padding: 10px; }

.xlsx-wrap { padding: 12px 14px 16px; min-height: 100%; }
.sheet-select {
  margin-bottom: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.xlsx-table { overflow: auto; background: #fff; border: 1px solid #e6eef7; border-radius: 8px; }
.xlsx-table table { border-collapse: collapse; font-size: 12.5px; }
.xlsx-table td, .xlsx-table th {
  border: 1px solid #e6eef7;
  padding: 5px 9px;
  white-space: nowrap;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xlsx-table th { background: #f4f9fe; font-weight: 600; color: #0369a1; position: sticky; top: 0; }
.preview-note { padding: 10px 4px 0; font-size: 12px; color: #94a3b8; }

/* PDF 预览：本地 PDF.js 逐页渲染成图片，宽度自适应容器（手机竖屏整页显示） */
.pdf-holder {
  padding: 10px;
  min-height: 100%;
  background: #eef3f9;
}
.pdf-page {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .14);
}
.pdf-holder .preview-note { padding: 26px 8px; text-align: center; }

.preview-office { height: 100%; display: flex; flex-direction: column; }
.preview-office iframe { flex: 1; min-height: 0; }

/* 提示条 */
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translate(-50%, -14px);
  padding: 9px 18px;
  font-size: 13px;
  color: #fff;
  background: rgba(15, 23, 42, .9);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 300;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 滚动条 */
.msg-scroll::-webkit-scrollbar,
.emoji-panel::-webkit-scrollbar { width: 6px; }
.msg-scroll::-webkit-scrollbar-thumb,
.emoji-panel::-webkit-scrollbar-thumb { background: #d7e3ee; border-radius: 4px; }
.msg-scroll::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   管理后台
   ============================================================ */

.admin-body { background: #f3f6fa; min-height: 100vh; padding-bottom: 40px; }

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  background: #fff;
  border-bottom: 1px solid #e8eef5;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.admin-top-left { display: flex; align-items: center; gap: 12px; }
.admin-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-size: 18px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 6px 16px rgba(2, 132, 199, .24);
}
.admin-top h1 { margin: 0; font-size: 17px; }
.admin-top p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.admin-top-right { display: flex; align-items: center; gap: 8px; }
.admin-top-right form { margin: 0; }

.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 20px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  padding: 16px 18px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ebf1f8;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -18px; top: -18px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe, transparent);
}
.stat-label { display: block; font-size: 12.5px; color: var(--muted); }
.stat-card strong { display: block; font-size: 26px; font-weight: 700; color: var(--blue-deep); line-height: 1.25; }

.admin-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }

.panel {
  background: #fff;
  border: 1px solid #ebf1f8;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-tag { font-size: 12px; color: var(--blue-deep); background: var(--blue-soft); padding: 1px 9px; border-radius: 20px; }
.panel-hint { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 10px 0 0; }
.panel-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.panel-form + .panel-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #eef2f7; }
.panel-form .fld { margin: 0; flex: 1; min-width: 180px; }
.panel-form .fld.inline span { margin-bottom: 5px; }

.panel.danger { border-color: #fde2e2; background: linear-gradient(180deg, #fffafa, #fff); }

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: .15s;
  white-space: nowrap;
}
.btn-sm.ghost { background: #fff; color: var(--text); border-color: #dfe7f1; }
.btn-sm.ghost:hover { background: #f6fafe; border-color: #c8ddf1; text-decoration: none; }
.btn-sm.danger { background: #fff; color: #dc2626; border-color: #fbd5d5; }
.btn-sm.danger:hover { background: #fef2f2; }

.btn-danger {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f87171, #dc2626);
  border: 0;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .22);
  transition: transform .15s;
}
.btn-danger:hover { transform: translateY(-1px); }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 10px;
  background: #f8fbfe;
  border-bottom: 1px solid #ebf1f8;
  white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid #f1f5fa; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fbfdff; }

.table-avatar { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; display: block; }
.table-avatar.letter {
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #0369a1;
  background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
}

.chip { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.chip.tag-admin { background: #fff7ed; color: #c2410c; }
.chip.tag-user { background: #f1f5f9; color: #475569; }

.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; color: #475569; }
.muted { color: #94a3b8; font-size: 12.5px; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.empty-row { padding: 26px 0; text-align: center; color: #94a3b8; font-size: 13px; }

.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
}
.recent-item:hover { background: #f8fbfe; }
.recent-name { flex: 0 0 90px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-type { flex: 0 0 auto; color: var(--muted); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-text { flex: 1; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-link { flex: 1; color: var(--blue-deep); font-size: 12.5px; }
.recent-time { flex: 0 0 auto; }

.admin-foot { text-align: center; color: #94a3b8; font-size: 12px; margin: 6px 0 0; }
.admin-foot code, .panel-hint code { background: #eef4fa; padding: 1px 6px; border-radius: 5px; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { padding: 30px 28px; }
  .auth-aside h1 { font-size: 19px; }
  .auth-points { display: none; }
  .auth-main { padding: 30px 26px 34px; }

  .chat-body { padding: 0; }
  .chat-app { max-height: none; height: 100vh; border-radius: 0; border: 0; }
  .msg-scroll { padding: 12px 12px 4px; }
  .msg-body { max-width: 78%; }
  .me-name { display: none; }
  .jump-bottom { bottom: 120px; }
  .emoji-panel { left: 8px; right: 8px; width: auto; }
  .file-card { width: 250px; }

  .preview-modal { padding: 0; }
  .preview-box { width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .preview-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
  .preview-title { font-size: 12px; }
  .preview-actions { gap: 4px; }
  .preview-actions .file-op { font-size: 11px; padding: 0 7px; }
  .preview-close { width: 28px; height: 28px; }
  .preview-body { -webkit-overflow-scrolling: touch; overflow-x: hidden; }
  .pdf-holder { padding: 6px; }
  .pdf-page { margin-bottom: 8px; box-shadow: 0 1px 4px rgba(15, 23, 42, .16); }

  /* Word 页面按手机宽度重排，避免 794px 固定页宽把手机撑出横向滚动 */
  .docx-holder { padding: 0; overflow-x: hidden; }
  .docx-holder .docx-wrapper { padding: 0 !important; background: #fff; }
  .docx-holder .docx-wrapper > section.docx {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 0 8px !important;
    padding: 18px 12px !important;
    box-sizing: border-box;
    box-shadow: none !important;
  }
  .docx-holder .docx-wrapper > section.docx table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto;
    word-break: break-word;
  }
  .docx-holder .docx-wrapper > section.docx img {
    max-width: 100% !important;
    height: auto !important;
  }

  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 16px 12px; }
  .admin-top { padding: 12px 14px; }
}

/* ============================================================
   多群 / 私聊 / 撤回 / 内置头像（增量样式，覆盖前面单群布局）
   ============================================================ */

.chat-app {
  flex-direction: row;
  max-width: 1080px;
  align-items: stretch;
}

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

/* ---------- 侧边栏 ---------- */
.side {
  width: 236px;
  flex: 0 0 236px;
  display: flex;
  flex-direction: column;
  background: #fbfdff;
  border-right: 1px solid var(--line);
  min-height: 0;
  z-index: 6;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
  color: #fff;
  background: linear-gradient(120deg, #0ea5e9, #0284c7);
}
.side-brand {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-brand span { overflow: hidden; text-overflow: ellipsis; }
.side-close {
  display: none;
  border: 0;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px 14px;
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 6px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}
.side-count { font-weight: 500; color: #94a3b8; font-size: 11.5px; }

.mini-add {
  border: 1px dashed #bae6fd;
  background: #f0f9ff;
  color: var(--blue-deep);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.6;
}
.mini-add:hover { background: #e0f2fe; }

.conv-list { display: flex; flex-direction: column; gap: 4px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.conv-item:hover { background: #f1f8fe; }
.conv-item.active {
  background: #e8f4ff;
  border-color: #cfe9fb;
}
.conv-item.active b { color: var(--blue-deep); }

.conv-badge {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0369a1;
  background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
}

.conv-avatar-img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.conv-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
  flex: 1;
}
.conv-text b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-text i {
  font-style: normal;
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unread-badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}

.conv-empty {
  padding: 10px 8px;
  font-size: 12px;
  line-height: 1.7;
  color: #94a3b8;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.me-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-row .avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; }
.me-row-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-actions { display: flex; align-items: center; gap: 6px; }
.side-actions .icon-btn {
  color: var(--blue-deep);
  background: #f1f8fe;
  border-color: #dcecf9;
  height: 28px;
  font-size: 11.5px;
}
.side-actions .icon-btn:hover { background: #e0f2fe; text-decoration: none; }
.side-actions .logout-form { margin: 0 0 0 auto; }

/* 顶栏会话头像 */
.conv-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.conv-avatar-peer .conv-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.menu-btn { display: none; }

/* ---------- 内置头像 ---------- */
.avatar-preset {
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  border-radius: 10px;
  overflow: hidden;
}
.conv-avatar-img.avatar-preset,
.conv-avatar .avatar-preset { border-radius: 10px; }

/* ---------- 撤回 ---------- */
.recall-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 11.5px;
  padding: 0 2px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.recall-btn:hover { color: var(--red); }

.bubble.recalled,
.msg-row.self .bubble.recalled {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e6edf5;
  box-shadow: none;
  font-style: italic;
  font-size: 12.5px;
  padding: 7px 12px;
}

/* ---------- 找朋友弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .45);
  padding: 16px;
}
.modal-card {
  width: min(540px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.modal-head button {
  border: 0;
  background: #f1f5f9;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}
.modal-search {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
}
.modal-search input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dbe7f3;
  border-radius: 9px;
  font-size: 13px;
  outline: none;
}
.modal-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14, 165, 233, .15); }
.modal-search button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.modal-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 2px 12px 8px;
}
.modal-tip {
  margin: 0;
  padding: 10px 18px 14px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #94a3b8;
  border-top: 1px solid var(--line);
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-bottom: 1px dashed #eef4fa;
}
.friend-row:last-child { border-bottom: 0; }
.friend-row .avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; }
.friend-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.friend-info b {
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-info span { font-size: 11.5px; color: #94a3b8; }

.friend-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.friend-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #dbe7f3;
  background: #f8fbfe;
  color: var(--text);
  white-space: nowrap;
}
.friend-btn:hover:not(:disabled) { background: #eef7ff; border-color: #bfe3fb; }
.friend-btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.friend-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 多群侧栏的移动端抽屉 ---------- */
@media (max-width: 860px) {
  .chat-app { flex-direction: row; }
  .chat-main { width: 100%; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 258px;
    flex-basis: 258px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 12px 0 30px rgba(15, 23, 42, .16);
    background: #fff;
  }
  .side.open { transform: translateX(0); }
  .side-close { display: inline-flex; align-items: center; justify-content: center; }
  .menu-btn { display: inline-flex; }

  .friend-row { flex-wrap: wrap; }
  .friend-acts { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   后台：群管理表格内联表单
   ============================================================ */

.inline-row-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.inline-row-form input[type=text] {
  width: 110px;
  height: 28px;
  padding: 0 8px;
  font-size: 12.5px;
  color: var(--ink);
  border: 1px solid #dbe7f3;
  border-radius: 7px;
  background: #fff;
  outline: none;
}
.inline-row-form input[type=text]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
}

.table-avatar.avatar-preset {
  font-size: 14px;
  border-radius: 9px;
  overflow: hidden;
}
.stat-row { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1060px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   注册页：内置头像选择 / 性别 / 姓名手机号
   ============================================================ */

.grid2-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2-form .fld { margin-bottom: 12px; }
@media (max-width: 560px) { .grid2-form { grid-template-columns: 1fr; gap: 0; } }

.fld select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink);
  background: #f8fbfe;
  border: 1px solid #dce7f2;
  border-radius: 10px;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.fld select:focus { border-color: #38bdf8; background-color: #fff; box-shadow: 0 0 0 3px rgba(56, 189, 248, .16); }

.avatar-block {
  border: 1px solid #e6eff8;
  background: #fbfdff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}
.avatar-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.avatar-preview {
  width: 62px; height: 62px; flex: 0 0 62px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 30px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2edf8;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .22);
}
.avatar-block-tip b { display: block; font-size: 13px; color: var(--ink); }
.avatar-block-tip span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
@media (max-width: 560px) { .preset-grid { grid-template-columns: repeat(4, 1fr); } }

.preset-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 4px 5px;
  border: 1.5px solid #e6eff8;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.preset-item input { position: absolute; opacity: 0; pointer-events: none; }
.preset-item:hover { border-color: #bfe3fb; background: #f8fcff; }
.preset-item.on {
  border-color: var(--blue);
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
}
.preset-face {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .22);
}
.preset-label { font-size: 11px; color: var(--muted); }

.upload-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #dbe8f5;
  background: #fff;
  color: var(--blue-deep);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.upload-btn:hover { background: #f2f8fe; border-color: #bfe3fb; }
.upload-line input[type=file] { display: none; }
#uploadTip { font-size: 12px; color: #94a3b8; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  padding: 0;
}

/* ============================================================
   群头像
   ============================================================ */

.conv-avatar .conv-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}
.conv-avatar .conv-avatar-img.avatar-preset {
  display: grid;
  place-items: center;
  font-size: 22px;
}

.conv-avatar-img.avatar-preset {
  display: grid;
  place-items: center;
  font-size: 16px;
}
.conv-avatar-img.avatar-letter {
  display: grid;
  place-items: center;
  color: #0369a1;
  font-weight: 700;
  font-size: 14px;
}

.group-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px dashed #eef4fa;
}
.group-avatar-row:last-of-type { border-bottom: 0; }
.group-avatar-row .table-avatar { width: 40px; height: 40px; flex: 0 0 40px; }

.group-avatar-name {
  min-width: 110px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-avatar-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.group-avatar-field select {
  height: 30px;
  padding: 0 6px;
  font-size: 12.5px;
  color: var(--ink);
  border: 1px solid #dbe7f3;
  border-radius: 7px;
  background: #fff;
}
.group-avatar-field.file input[type=file] {
  font-size: 11.5px;
  max-width: 190px;
  color: var(--muted);
}
.group-avatar-row .btn-sm { margin-left: auto; }





/* ---------------- 群号 / 加群（v1.2） ---------------- */
.fld-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.6;
  color: #94a3b8;
}
.conv-item .conv-text i .conv-code {
  color: #0284c7;
  font-weight: 600;
}

/* ---------------- 用户 ID / 资料卡 / 审批（v1.3） ---------------- */
.side-tools { display: inline-flex; align-items: center; gap: 6px; }
.req-btn { position: relative; }
.req-badge {
  display: inline-block;
  margin-left: 4px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-style: normal;
  font-weight: 700;
}
.me-row { display: flex; align-items: center; gap: 9px; padding: 4px 2px; border-radius: 10px; }
.me-row:hover { background: #f1f5f9; }
.me-row-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.me-row-id { font-size: 11.5px; color: #94a3b8; letter-spacing: .4px; }
.clickable-avatar { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.clickable-avatar:hover { transform: scale(1.06); box-shadow: 0 0 0 2px #bae6fd; }

.profile-card { max-width: 360px; width: 92%; }
.profile-body { padding: 6px 4px 4px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; object-fit: cover; flex: none;
  background: #e0f2fe; overflow: hidden;
}
.profile-avatar.avatar-preset { font-size: 30px; }
.profile-name { font-size: 17px; font-weight: 700; color: #0f172a; }
.profile-id { margin-top: 3px; font-size: 13px; color: #0284c7; font-weight: 600; letter-spacing: .6px; }
.profile-meta { margin-top: 4px; font-size: 12px; color: #94a3b8; }
.profile-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px solid #eef2f7; }
.profile-acts .friend-btn { flex: 1; min-width: 110px; }
.join-pending-row {
  margin: 6px 0; padding: 11px 12px; border-radius: 10px;
  background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; font-size: 12.5px; line-height: 1.6;
}
.friend-cell { display: flex; align-items: center; gap: 8px; }
.btn-sm.primary { background: #0284c7; color: #fff; border-color: #0284c7; }
.btn-sm.primary:hover { background: #0369a1; border-color: #0369a1; }

/* ============================================================
   v1.4：后台文章统计 / 资料卡“个人主页”入口
   ============================================================ */
.stat-row { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1060px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

a.friend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}
a.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* v1.5：后台网站 Logo 预览 */
.site-logo-preview {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}
.site-logo-preview img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.site-logo-preview label { font-size: 12.5px; color: #64748b; }

.home-bg-preview {
  display: flex;
  flex-basis: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}
.home-bg-preview img {
  width: 180px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.home-bg-preview label { font-size: 12.5px; color: #64748b; }

.cat-rename-form { display: flex; align-items: center; gap: 8px; }
.cat-rename-form input[type=text] {
  width: 100%;
  max-width: 220px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
}
