* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #FAF7F2; color: #2B2420; min-height: 100vh;
}
.hidden { display: none !important; }

/* 登录 */
.login-box {
  width: 320px; margin: 14vh auto; background: #fff; padding: 32px;
  border-radius: 20px; box-shadow: 0 8px 32px rgba(43,36,32,0.08);
  display: flex; flex-direction: column; gap: 14px;
}
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 8px; }
.login-box input {
  height: 44px; padding: 0 14px; border: 1px solid #F0EAE3;
  border-radius: 12px; font-size: 14px;
}
.login-box button {
  height: 44px; border: none; border-radius: 12px; background: #FF6B35;
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.err { color: #ef4444; font-size: 13px; text-align: center; min-height: 16px; }

/* 面板：左侧菜单 + 右侧内容 */
.panel {
  display: flex; min-height: 100vh; max-width: 1200px; margin: 0 auto;
}
.sidebar {
  width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid #F0EAE3;
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-size: 18px; font-weight: 800; padding: 6px 10px 20px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.snav {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: none;
  border-radius: 12px; background: transparent; font-size: 14px; color: #6b625b;
  cursor: pointer; text-align: left; font-weight: 600;
}
.snav:hover { background: #FAF7F2; }
.snav.active { background: #FF6B35; color: #fff; }
.side-foot { padding-top: 16px; border-top: 1px solid #F0EAE3; }
.side-foot .ghost { width: 100%; }
.content { flex: 1; min-width: 0; padding: 24px; }
.ghost {
  background: #fff; border: 1px solid #F0EAE3; border-radius: 10px;
  padding: 8px 16px; cursor: pointer; font-size: 13px;
}

/* 卡片 */
.cards { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.card {
  flex: 1; min-width: 140px; background: #fff; border-radius: 16px;
  padding: 18px; box-shadow: 0 4px 16px rgba(43,36,32,0.05);
  display: flex; flex-direction: column; gap: 6px;
}
.card b { font-size: 28px; }
.card span { font-size: 13px; color: #9A8F86; }
.card.warn b { color: #f59e0b; }
.card.ok b { color: #10b981; }
.card.bad b { color: #ef4444; }

/* 过滤 */
.filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.fbtn {
  padding: 8px 18px; border-radius: 999px; border: none; background: #fff;
  font-size: 14px; color: #9A8F86; cursor: pointer;
}
.fbtn.active { background: #FF6B35; color: #fff; font-weight: 600; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 4px 16px rgba(43,36,32,0.05);
  display: flex; gap: 14px; align-items: center;
  min-width: 0;
}
.item .info { flex: 1; min-width: 0; text-align: left; }
.item .name { font-size: 16px; font-weight: 700; }
.item .meta { font-size: 13px; color: #9A8F86; margin-top: 4px; }
.item.clickable { cursor: pointer; }
.item.clickable:hover { box-shadow: 0 8px 24px rgba(43,36,32,0.1); }
.item .meta-sub { font-size: 12px; color: #B5A896; margin-top: 6px; line-height: 1.5; }
.item .meta-sub code { color: #4b443e; }
.item .meta-time { font-size: 12px; color: #B5A896; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; margin-right: 6px; }
.tag.pending { background: #f59e0b; }
.tag.approved { background: #10b981; }
.tag.rejected { background: #ef4444; }
.tag.banned { background: #b91c1c; }
.actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; flex-wrap: nowrap;
}
.actions button {
  flex: 0 0 auto;
  padding: 8px 14px; border-radius: 10px; border: none; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.b-ok { background: #10b981; color: #fff; }
.b-bad { background: #ef4444; color: #fff; }
.b-warn { background: #f59e0b; color: #fff; }
.b-edit { background: #FF6B35; color: #fff; }
.b-del { background: #fff; border: 1px solid #F0EAE3; color: #ef4444; }
/* 统一按钮四角稍圆 */
.b-ok, .b-bad, .b-edit, .b-del, .b-warn { border-radius: 10px; }
.empty { text-align: center; color: #9A8F86; padding: 60px 0; }

/* 配置管理 */
#configSection h2 { font-size: 17px; margin: 22px 0 8px; }
#configSection .hint-line { font-size: 13px; color: #9A8F86; margin-bottom: 10px; }
/* 发现页/找搭子页显示模式 */
.mode-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.mode-opt {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #F0EAE3; border-radius: 12px; padding: 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.mode-opt:has(input:checked) { border-color: #FF6B35; box-shadow: 0 0 0 2px rgba(255,107,53,0.15); }
.mode-opt input { width: 18px; height: 18px; flex-shrink: 0; }
.mode-opt b { font-size: 15px; color: #2B2420; }
.mode-opt span { font-size: 13px; color: #8A8078; line-height: 1.6; }
.cat-list { display: flex; flex-direction: column; gap: 10px; }
/* 分类管理：现在只有 name 输入框 + 保存 + 删除 三列 */
.cat-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  align-items: center; background: #fff; border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(43,36,32,0.04);
}
.cat-row input {
  height: 38px; padding: 0 10px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}
.cat-row button { min-width: 72px; }
.cat-row .c-color { padding: 2px; height: 38px; cursor: pointer; }
.cat-row .c-emoji { text-align: center; }
.b-edit { background: #FF6B35; color: #fff; }

/* 标签管理：name 输入框 + 保存 + 删除 三列 */
.tag-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  align-items: center; background: #fff; border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(43,36,32,0.04);
}
.tag-row input {
  height: 38px; padding: 0 10px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}
.tag-row button { min-width: 72px; }
.tag-index { color: #9A8F86; font-size: 14px; text-align: center; }
.tag-add { display: flex; gap: 8px; margin-top: 10px; }
.tag-add input {
  flex: 1; height: 40px; padding: 0 12px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}
.b-del { background: #ef4444; color: #fff; }
.b-ok { background: #10b981; color: #fff; }
.wide { width: 100%; margin-top: 14px; height: 46px; font-size: 15px; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; }

.cfg-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.cfg-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #6b625b; }
.cfg-form input {
  height: 42px; padding: 0 12px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}

/* 工具栏：搜索 + 过滤 */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
#searchBox {
  flex: 1; min-width: 200px; height: 42px; padding: 0 16px;
  border: 1px solid #F0EAE3; border-radius: 999px; font-size: 14px;
}
.toolbar .filter { margin: 0; }

/* 分类筛选下拉（发布审核页） */
.cat-filter {
  height: 42px; padding: 0 12px; border: 1px solid #F0EAE3;
  border-radius: 10px; font-size: 14px; color: #4b443e; background: #fff; cursor: pointer;
  min-width: 130px;
}

/* 用户管理筛选工具栏 */
.u-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}

/* 群缩略图 + 分类色块 */
.item .thumb {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: #F0EAE3;
}
.item .thumb.none {
  display: flex; align-items: center; justify-content: center; font-size: 30px; background: #F5F1EC;
}
.ctag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; color: #fff;
  font-size: 12px; font-weight: 600; margin-right: 6px;
}
code { background: #F0EAE3; padding: 1px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.pinfo { font-size: 13px; color: #9A8F86; }

/* 模态框 */
.modal {
  position: fixed; inset: 0; background: rgba(43,36,32,0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-box {
  background: #fff; border-radius: 18px; padding: 24px; width: 100%; max-width: 420px;
  max-height: 88vh; overflow: auto; box-shadow: 0 16px 48px rgba(43,36,32,0.2);
  display: flex; flex-direction: column; gap: 12px;
}
.modal-box h3 { font-size: 18px; }
.modal-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #6b625b; }
.modal-box input, .modal-box select {
  height: 40px; padding: 0 12px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions button { flex: 1; height: 42px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
/* 群详情弹窗：更宽容纳地图 */
#editModal .modal-box {
  max-width: 640px;
  display: block;           /* 覆盖基础 flex，内容超高时可靠滚动、不被压缩 */
  overflow-y: auto;
  border-radius: 0;         /* 不要圆角，四角统一直角 */
}
/* 群详情弹窗：各区块间距放宽，避免紧凑 */
#editModal .modal-box > * { margin-bottom: 24px; }
#editModal .modal-box > *:last-child { margin-bottom: 0; }
#editModal .modal-box .mod-head { margin-bottom: 8px; }
/* 弹窗头部：标题 + 右上角关闭 */
.mod-head { display: flex; align-items: center; justify-content: space-between; }
.mod-close {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: #F5F1EC; color: #6b625b; font-size: 16px; cursor: pointer; line-height: 1;
}
.mod-close:hover { background: #FFE3D6; color: #FF6B35; }
/* 标题信息区 */
.d-head { display: flex; align-items: center; gap: 16px; }
.d-avatar {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover;
  background: #F7F3EE; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #B5A896; font-size: 13px; cursor: pointer;
}
.d-info { flex: 1; min-width: 0; }
.d-name { font-size: 18px; font-weight: 700; }
.d-sub { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ctag { color: #FF6B35; font-weight: 600; font-size: 13px; }
/* 群标签胶囊 */
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.d-tag {
  font-size: 12px; font-weight: 600; color: #6B5F50;
  background: #F2EDE6; padding: 2px 10px; border-radius: 999px;
}
/* 群位置地图 */
.emap {
  height: 300px;
  min-height: 300px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #F0EAE3;
  z-index: 1;
}
/* 图片区块 */
.p-sec { display: flex; flex-direction: column; gap: 8px; }
.p-title { font-size: 13px; color: #6b625b; }
/* 群二维码 + 群主二维码 并排 */
.p-grid { display: flex; gap: 20px; }
.p-grid .p-sec { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pv-img {
  width: 100%; height: 180px; object-fit: contain; border-radius: 12px;
  background: #F7F3EE; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #B5A896; cursor: pointer;
}
.pv-list { display: flex; flex-wrap: wrap; gap: 10px; }
.muted { color: #B5A896; font-size: 13px; }
/* 信息行：label 左 + 内容右，规整 */
.d-rows { display: flex; flex-direction: column; border: 1px solid #F0EAE3; border-radius: 12px; overflow: hidden; }
.d-row { display: flex; align-items: flex-start; padding: 14px 16px; }
.d-row + .d-row { border-top: 1px solid #F0EAE3; }
.d-row span { width: 60px; flex-shrink: 0; color: #9A8F86; font-size: 14px; }
.d-row b { flex: 1; font-weight: 500; color: #4b443e; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
#uBody h4 { margin: 12px 0 6px; font-size: 14px; }
.umin { font-size: 13px; color: #4b443e; padding: 6px 0; border-bottom: 1px solid #F5F1EC; }

/* 用户管理 */
#usersSection .hint-line { margin-bottom: 14px; }

/* ===== 广告管理 ===== */
#adsSection .hint-line { font-size: 13px; color: #9A8F86; margin-bottom: 12px; }
.ad-add {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(43,36,32,0.04);
}
.ad-add input[type="text"] {
  height: 38px; padding: 0 10px; border: 1px solid #F0EAE3; border-radius: 10px; font-size: 14px; min-width: 140px;
}
.file-btn {
  display: inline-flex; align-items: center; cursor: pointer;
  padding: 8px 14px; border-radius: 10px; font-size: 13px;
}
.ad-row {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 12px;
  align-items: center; background: #fff; border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(43,36,32,0.04);
}
.ad-thumb {
  width: 84px; height: 56px; border-radius: 8px; overflow: hidden;
  background: #F7F3EE; display: flex; align-items: center; justify-content: center;
  color: #B5A896; font-size: 12px;
}
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ad-name { font-weight: 600; color: #4b443e; font-size: 14px; }
.ad-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #6B5F50; cursor: pointer; }
.ad-switch input { cursor: pointer; }
