/* ============ 基础重置与变量 ============ */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --sidebar-bg: #1e1b4b;
  --sidebar-hover: #312e81;
  --sidebar-active: #4338ca;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #cf1322;
  --warn: #f59e0b;
  --info: #3b82f6;
  --accent: #36bfb0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius: 10px;
  --radius-sm: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
input { font-family: inherit; }

/* ============ 登录页 ============ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  padding: 20px;
}
.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}
.logo-icon.small {
  width: 36px;
  height: 36px;
  font-size: 14px;
  border-radius: 8px;
  margin-bottom: 0;
}
.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
/* radio/checkbox 不是文本输入框,不能套上面的 width/边框/padding,否则会变成灰色长框 */
.form-group input[type="radio"],
.form-group input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}
/* 统一控件高度:搜索框 / 按钮 / 筛选下拉 均为 38px,字号 14px,圆角 6px(--radius-sm) */
.btn-primary {
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  height: 38px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }

.btn-outline {
  background: var(--card-bg);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .2s;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-outline.active {
  background: var(--primary);
  color: #fff;
}
/* 实心危险按钮(封禁等):.btn-primary.btn-danger-solid */
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: var(--danger); filter: brightness(.92); }
/* 分段开关(开启/关闭):统一替代各处内联三元样式 */
.seg { display: inline-flex; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--border); }
.seg-btn { border: none; padding: 6px 20px; font-size: 13px; cursor: pointer; background: #f1f5f9; color: var(--text-muted); transition: all .2s; }
.seg-btn.on { background: var(--accent); color: #fff; }
.seg-btn.off { background: var(--danger); color: #fff; }

/* ============ 布局 ============ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ============ 侧边栏 ============ */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* 屏幕小/菜单多时支持滚动 — min-height:0 让 flex 子元素允许收缩(默认 auto 会撑爆父容器) */
  overflow-y: auto;
  min-height: 0;
  /* 隐藏滚动条样式美化(Webkit) */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.3);
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #c7d2e8;
  transition: all .15s;
}
.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 2px 8px rgba(67,56,202,.4);
}
/* 侧边栏分组小标题 */
.nav-group {
  font-size: 11px;
  font-weight: 600;
  color: rgba(199,210,232,.45);
  letter-spacing: .5px;
  padding: 14px 14px 4px;
  user-select: none;
}
.nav-group:first-child { padding-top: 4px; }
/* 权限管理页内顶部 tab(账号管理 / 角色管理) */
.admin-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.admin-subtabs a {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-subtabs a:hover { color: var(--primary, #4338ca); }
.admin-subtabs a.active {
  color: var(--primary, #4338ca);
  border-bottom-color: var(--primary, #4338ca);
}
/* §驾驶舱:仪表盘经营与系统概览摘要卡 */
.cockpit { margin-bottom: 24px; }
.cockpit-title {
  font-size: 15px; font-weight: 600; color: var(--text, #1e293b);
  margin: 4px 0 12px; display: flex; align-items: center; gap: 8px;
}
.cockpit-title::before { content: ''; width: 3px; height: 15px; background: var(--primary, #4338ca); border-radius: 2px; }
.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.cockpit-card {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--border, #eef0f4); border-radius: 14px;
  padding: 18px 20px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cockpit-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.cockpit-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.cockpit-revenue::before { background: linear-gradient(180deg,#f59e0b,#f97316); }
.cockpit-turn::before { background: linear-gradient(180deg,#3b82f6,#06b6d4); }
.cockpit-system::before { background: linear-gradient(180deg,#10b981,#14b8a6); }
.cockpit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cockpit-icon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cockpit-icon svg { width: 21px; height: 21px; }
.cockpit-name { font-size: 14px; font-weight: 600; color: var(--text, #1e293b); }
.cockpit-arrow { margin-left: auto; font-size: 12px; color: #94a3b8; opacity: 0; transform: translateX(-4px); transition: all .18s ease; white-space: nowrap; }
.cockpit-card:hover .cockpit-arrow { opacity: 1; transform: translateX(0); }
.cockpit-main { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.cockpit-value { font-size: 32px; font-weight: 700; color: var(--text, #1e293b); line-height: 1; letter-spacing: -.5px; }
.cockpit-unit { font-size: 13px; color: #94a3b8; }
.cockpit-sub { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: #64748b; align-items: center; }
.cockpit-sub b { color: var(--text, #1e293b); font-weight: 600; }
.cockpit-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cockpit-dot.on { background: var(--success, #10b981); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.cockpit-dot.off { background: var(--danger, #ef4444); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
/* 侧边栏未读角标 — 红圆角 + 白字数字,贴右对齐 */
.sidebar-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ff3b30;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(255,59,48,.4);
}
.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #94a3b8;
  transition: all .15s;
}
.logout-btn svg { width: 20px; height: 20px; }
.logout-btn:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

/* ============ 主内容 ============ */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-bar h2 {
  font-size: 20px;
  font-weight: 700;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,.4); }
.status-dot.offline { background: var(--danger); }

.content-body {
  flex: 1;
  padding: 24px 32px;
}

/* ============ 统计卡片 ============ */
.stats-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .stats-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.users { background: #ede9fe; color: #7c3aed; }
.stat-icon.groups { background: #dbeafe; color: #2563eb; }
.stat-icon.friends { background: #fce7f3; color: #db2777; }
.stat-icon.moments { background: #d1fae5; color: #059669; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.stat-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ============ 仪表盘网格 ============ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* 系统监控卡片 hover 效果:只作用于"可点击"卡片(.card-clickable),纯展示卡不动 */
.system-grid .card { border: 1px solid transparent; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.10); border-color: var(--primary); }
.card-clickable:active { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.10); transition-duration: .08s; }
/* 「点击查看详情 →」提示:默认略淡,hover 变亮加粗、箭头右滑 */
.detail-hint { color: var(--primary); opacity: .72; transition: opacity .2s ease; }
.card-clickable:hover .detail-hint { opacity: 1; font-weight: 600; }
.detail-hint .hint-arrow { display: inline-block; transition: transform .2s ease; }
.card-clickable:hover .detail-hint .hint-arrow { transform: translateX(4px); }
.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.card-body {
  padding: 20px 24px;
}

/* ============ 最近注册列表 ============ */
.recent-list { display: flex; flex-direction: column; gap: 14px; }
.recent-item { display: flex; align-items: center; gap: 12px; }
.recent-info { display: flex; flex-direction: column; }
.recent-name { font-size: 14px; font-weight: 500; }
.recent-time { font-size: 12px; color: var(--text-muted); }

/* ============ 头像 ============ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.avatar.small { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; }
.avatar.large { width: 72px; height: 72px; border-radius: 16px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.group-avatar { background: linear-gradient(135deg, #3b82f6, #06b6d4); }

/* ============ 工具栏 ============ */
.page-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  height: 38px;
  padding: 0 14px;
  flex: 1;
  max-width: 480px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  padding: 0;
  height: 100%;
  width: 100%;
  background: transparent;
}

/* ============ 数据表格 ============ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: #f8fafc; }
.data-table tr:last-child td { border-bottom: none; }
.mono { font-family: 'Courier New', monospace; font-size: 13px; }
.user-cell { display: flex; align-items: center; gap: 10px; }

/* ============ 按钮小 ============ */
.btn-sm {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text);
  transition: all .15s;
  margin-right: 4px;
}
.btn-sm:hover { background: var(--primary); color: #fff; }
.btn-sm.btn-warn { color: var(--warn); }
.btn-sm.btn-warn:hover { background: var(--warn); color: #fff; }
.btn-sm.btn-danger { color: var(--danger); display: inline-flex; align-items: center; gap: 4px; }
.btn-sm.btn-danger:hover { background: var(--danger); color: #fff; }

/* ============ 徽章 ============ */
.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 10px;
  display: inline-block;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-vip { background: #fef3c7; color: #a16207; border: 1px solid #facc15; }
.badge-svip { background: #ede9fe; color: #6d28d9; border: 1px solid #c4b5fd; }
.badge-free { background: #f1f5f9; color: #64748b; }
.vip-expire-warn { color: #d97706; font-weight: 600; }

/* ============ 朋友圈审核 badge / 操作按钮 / 驳回原因 ============ */
.audit-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  display: inline-block;
  white-space: nowrap;
}
.audit-badge.badge-pending { background: #fef3c7; color: #92400e; }
.audit-badge.badge-passed { background: #d1fae5; color: #065f46; }
.audit-badge.badge-rejected { background: #fee2e2; color: #991b1b; }
.audit-reject-reason {
  font-size: 12px;
  color: #991b1b;
  background: #fef2f2;
  padding: 6px 10px;
  border-radius: 4px;
  margin: 8px 0;
  border-left: 3px solid #ef4444;
}
.btn-sm.btn-success { color: #059669; }
.btn-sm.btn-success:hover { background: #059669; color: #fff; }
.btn-sm.btn-warning { color: #d97706; }
.btn-sm.btn-warning:hover { background: #d97706; color: #fff; }
.audit-actions { margin-left: auto; display: inline-flex; gap: 4px; }

/* ============ 快速筛选 chip ============ */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.filter-chip:hover { background: #f8fafc; color: var(--text-dark); }
.filter-chip.active {
  background: var(--primary, #3b82f6);
  color: #fff;
  border-color: var(--primary, #3b82f6);
}

/* ============ 会员管理卡片 ============ */
.membership-card {
  background: #fafafa;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.membership-card h4 { margin: 0 0 12px; font-size: 15px; color: var(--text-dark); }
.membership-card .ms-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 13px;
}
.membership-card .ms-row .ms-label { color: var(--text-muted); }
.membership-card .ms-row .ms-value { color: var(--text-dark); font-weight: 500; }
.membership-edit-form {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 12px; margin-top: 10px;
}
.membership-edit-form .form-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.membership-edit-form label { font-size: 13px; min-width: 64px; color: var(--text-muted); }
.membership-edit-form select,
.membership-edit-form input[type="datetime-local"] {
  flex: 1; padding: 6px 10px; border: 1px solid #e2e8f0;
  border-radius: 6px; font-size: 13px;
}
.membership-edit-form .quick-buttons {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px;
}
.membership-edit-form .quick-buttons .btn-sm { padding: 4px 10px; font-size: 12px; }
.membership-edit-form .form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ============ 固定分页布局 ============ */
.page-with-fixed-pagination {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
}
.page-with-fixed-pagination .moments-grid { flex: 1; }
.page-with-fixed-pagination > .pagination { flex-shrink: 0; }

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
}
.pagination > span { font-size: 13px; color: var(--text-secondary); }
.pagination button {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--text);
  transition: all .15s;
  min-width: 36px;
}
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination button:not(:disabled):hover { background: var(--primary); color: #fff; }
.pagination button.page-btn { padding: 6px 10px; }
.pagination button.page-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(99,102,241,.3);
}
.page-dots { color: var(--text-muted); font-size: 14px; padding: 0 2px; user-select: none; }
.page-info { font-size: 13px; color: var(--text-secondary); margin-left: 8px; }
.pagination .page-size-select {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  margin-left: 8px;
}
.pagination .page-size-select:hover { border-color: var(--primary); }
.page-jump {
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-jump input {
  width: 52px;
  padding: 4px 8px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
  outline: none;
  transition: border-color .2s;
}
.page-jump input:focus { border-color: var(--primary); }
.page-jump input::-webkit-inner-spin-button,
.page-jump input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-content.modal-large { max-width: 680px; }
.modal-content.modal-publish { max-width: 640px; max-height: 90vh; }

/* 发布记录 */
.publish-log-list { display: flex; flex-direction: column; gap: 10px; }
.publish-log-item {
  background: #f8fafc; border-radius: 10px; padding: 14px 16px;
  border: 1px solid #e8ecf1; transition: background .15s;
}
.publish-log-item:hover { background: #f0f4f8; }
.publish-log-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.publish-log-title { font-weight: 600; font-size: 15px; color: var(--text); }
.publish-log-time { font-size: 12px; color: #999; }
.publish-log-meta { font-size: 13px; color: #666; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-muted);
  background: transparent;
  transition: all .15s;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 24px; }

/* ============ 详情页 ============ */
.detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.detail-info p { font-size: 13px; color: var(--text-secondary); margin-bottom: 3px; }
.tab-section { margin-bottom: 20px; }
.tab-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.member-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.mini-item:hover { background: #f8fafc; }
.role-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  margin-left: auto;
}
.role-tag.admin { background: #dbeafe; color: #1d4ed8; }

/* ============ 朋友圈 ============ */
.moments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  align-content: start;
}
.moment-card { display: flex; flex-direction: column; }
.moment-card .card-body { padding: 0; }
.moment-content { flex: 1; }
.moment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
}
.moment-author { flex: 1; }
.moment-name { font-size: 14px; font-weight: 600; display: block; }
.moment-time { font-size: 12px; color: var(--text-muted); }
.moment-content {
  padding: 0 20px 12px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 20px 12px;
}
.media-grid.media-count-1 { grid-template-columns: 1fr; max-width: 280px; }
.media-grid.media-count-2 { grid-template-columns: repeat(2, 1fr); max-width: 280px; }
.media-grid.media-count-4 { grid-template-columns: repeat(2, 1fr); max-width: 280px; }
.media-thumb {
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f5f9;
  position: relative;
  cursor: pointer;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.media-thumb img:hover { transform: scale(1.05); }
.media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb.media-error { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; }
.media-thumb.media-error::after { content: '加载失败'; }
.media-thumb.media-error img,
.media-thumb.media-error video { display: none; }
.video-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
}
/* 图片预览 */
.image-preview { cursor: zoom-out; user-select: none; }
.image-preview img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  cursor: default;
  transition: transform .15s ease;
}
.preview-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background .2s;
  z-index: 1001;
}
.preview-nav:hover { background: rgba(0,0,0,.8); }
.preview-nav.prev { left: 24px; }
.preview-nav.next { right: 24px; }
.preview-counter {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 14px;
  padding: 6px 18px;
  border-radius: 20px;
  z-index: 1001;
}
.moment-footer {
  display: flex;
  gap: 20px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all .15s;
}
.footer-btn:hover { background: #f1f5f9; color: var(--text); }
/* 评论列表 */
.comment-list { display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-body { flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.comment-name { font-size: 13px; font-weight: 600; color: var(--primary); }
.comment-reply { font-size: 12px; color: var(--text-muted); }
.comment-reply strong { color: var(--primary); font-weight: 500; }
.comment-text { font-size: 14px; line-height: 1.6; word-break: break-word; }
.comment-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============ 投诉管理 ============ */
.filter-select, .page-size-select {
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}
.filter-select:focus, .page-size-select:focus { border-color: var(--primary); }
.desc-cell { max-width: 200px; color: var(--text-secondary); font-size: 13px; }
.detail-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.detail-section:last-child { border-bottom: none; margin-bottom: 0; }
.detail-section h4 { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.report-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.badge-muted { background: #f1f5f9; color: var(--text-muted); }

/* ============ 系统账号管理 ============ */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.account-card {
  text-align: center;
  padding: 0;
  transition: transform .15s, box-shadow .15s;
}
.account-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.account-header {
  position: relative;
  padding: 28px 20px 16px;
  background: linear-gradient(135deg, #1e1b4b, #4338ca);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: center;
}
.account-header .avatar.large {
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.account-type-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  color: #fff;
}
.account-type-tag.type-1 { background: rgba(99,102,241,.8); }
.account-type-tag.type-2 { background: rgba(16,185,129,.8); }
.account-type-tag.type-3 { background: rgba(245,158,11,.8); }
.account-type-tag.type-4 { background: rgba(236,72,153,.8); }
.account-body { padding: 16px 20px; }
.account-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.account-uid { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.account-sig { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.account-time { font-size: 11px; color: var(--text-muted); }
.account-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.form-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.avatar-upload { display: flex; flex-direction: column; align-items: flex-start; }
.avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 2px dashed var(--border);
  transition: border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-preview:hover { border-color: var(--primary); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
}
.avatar-url-input input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.avatar-url-input input:focus { border-color: var(--primary); }

/* ============ 系统监控 ============ */
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-secondary); }
.info-row strong { color: var(--text); }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted); }
.empty-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
}

/* ============ 通话监控 ============ */
.turn-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.turn-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
}
@media (max-width: 1200px) {
  .turn-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .turn-info-grid { grid-template-columns: 1fr; }
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-title, .sidebar-nav a span, .sidebar-footer span, .nav-group { display: none; }
  .sidebar-nav a { justify-content: center; padding: 12px; }
  .main-content { margin-left: 60px; }
  .content-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: 1fr; }
}

/* 发布按钮 */
.btn-publish { background: #36bfb0; color: #fff; border-color: #36bfb0; }
.btn-publish:hover { background: #2ea89b; border-color: #2ea89b; }

/* 发布通知 - 图片上传 */
.publish-images { display: flex; flex-wrap: wrap; gap: 8px; }
.publish-img-item { position: relative; width: 80px; height: 80px; border-radius: 6px; overflow: hidden; }
.publish-img-item img { width: 100%; height: 100%; object-fit: cover; }
.publish-img-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 14px; line-height: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.publish-img-add { width: 80px; height: 80px; border: 2px dashed #d0d0d0; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .2s; }
.publish-img-add:hover { border-color: #36bfb0; }
.publish-img-add span { font-size: 28px; color: #bbb; }

/* 发布进度面板 */
.publish-progress-panel { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.publish-progress-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.publish-progress-title { font-size: 15px; font-weight: 600; color: #333; }
.publish-progress-bar-wrap { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.publish-progress-bar { height: 100%; background: linear-gradient(90deg, #36bfb0, #2ecc71); border-radius: 4px; transition: width .3s ease; }
.publish-progress-info { display: flex; align-items: center; font-size: 13px; color: #666; }

/* 预览用户列表 */
.preview-user-item { display: flex; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background .15s; }
.preview-user-item:last-child { border-bottom: none; }
.preview-user-item:hover { background: #f8f8f8; }

/* 发布通知弹窗加大 */
.modal-content.modal-publish { max-width: 640px; max-height: 90vh; overflow-y: auto; }

/* 发布记录列表 */
.publish-log-list { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; }
.publish-log-item { padding: 12px 14px; background: #fafafa; border-radius: 8px; border: 1px solid #eee; }
.publish-log-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.publish-log-title { font-weight: 600; font-size: 14px; color: #333; transition: color .15s; }
.publish-log-title:hover { color: #36bfb0; }
.publish-log-time { font-size: 12px; color: #999; }
.publish-log-meta { font-size: 13px; color: #666; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.publish-log-detail-section { background: #f8f9fa; border-radius: 8px; padding: 12px 16px; }
.publish-log-detail-row { display: flex; align-items: center; padding: 6px 0; font-size: 14px; }
.publish-log-detail-row .label { width: 80px; color: #999; flex-shrink: 0; }
.publish-log-detail-row span:last-child { color: #333; }

/* 群组邀请弹窗 */
.invite-search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.invite-search-row input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; }
.invite-search-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.invite-selected-bar { background: rgba(99,102,241,.08); color: var(--primary); padding: 6px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 10px; }
.invite-result-list { }
.invite-result-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid #f1f5f9; cursor: pointer; border-radius: 6px; transition: background .15s; }
.invite-result-item:last-child { border-bottom: none; }
.invite-result-item:hover { background: #f8fafc; }
.invite-result-item.invite-checked { background: rgba(99,102,241,.06); }
.invite-result-item.invite-disabled { opacity: 0.5; cursor: default; }
.invite-checkbox { flex-shrink: 0; }
.invite-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.invite-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.btn-primary.btn-sm { background: var(--primary); color: #fff; border: 1px solid var(--primary); padding: 4px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn-primary.btn-sm:hover { background: var(--primary-dark); }
.btn-primary.btn-sm:disabled { opacity: 0.6; cursor: not-allowed; }

/* 系统设置 */
.settings-layout { display: flex; gap: 0; min-height: calc(100vh - 160px); }
.settings-tabs { width: 160px; flex-shrink: 0; background: var(--card-bg); border-radius: 12px 0 0 12px; border-right: 1px solid var(--border); padding: 8px 0; }
.settings-tabs a { display: block; padding: 11px 20px; color: var(--text-secondary); text-decoration: none; font-size: 14px; border-left: 3px solid transparent; transition: all .15s; }
.settings-tabs a:hover { background: #f8fafc; color: var(--text); }
.settings-tabs a.active { color: var(--primary); background: rgba(99,102,241,.06); border-left-color: var(--primary); font-weight: 500; }
.settings-panel { flex: 1; background: var(--card-bg); border-radius: 0 12px 12px 0; padding: 0; display: flex; flex-direction: column; }
.settings-panel-header { padding: 20px 28px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 12px; }
.settings-panel-header h3 { margin: 0; font-size: 17px; }
.settings-form { flex: 1; padding: 20px 28px; overflow-y: auto; }
.settings-description { margin: 0 0 14px; padding: 12px 14px; color: #475569; background: #f8fafc; border: 1px solid #e2e8f0; border-left: 3px solid var(--primary); border-radius: 8px; font-size: 13px; line-height: 1.7; }
.settings-row { display: flex; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.settings-row:last-child { border-bottom: none; }
.settings-row label { width: 200px; flex-shrink: 0; font-size: 14px; color: var(--text); padding-top: 8px; font-weight: 500; }
.settings-input-wrap { flex: 1; max-width: 380px; }
.settings-input-wrap input, .settings-input-wrap select, .settings-input-wrap textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; background: #fff; box-sizing: border-box; }
.settings-input-wrap input:focus, .settings-input-wrap select:focus, .settings-input-wrap textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.settings-input-wrap textarea { resize: vertical; font-family: inherit; }
.settings-key { font-size: 11px; color: #b0b8c4; font-family: monospace; }
.settings-hint-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.settings-sync-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; line-height: 16px; }
.sync-map-sync { color: #0369a1; background: #e0f2fe; }
.sync-legacy { color: #9a3412; background: #ffedd5; }
.sync-app-sync { color: #15803d; background: #dcfce7; }
.sync-rebuild { color: #b45309; background: #fef3c7; }
.sync-server-manual { color: #9333ea; background: #f3e8ff; }
.sync-auto-reload { color: #1d4ed8; background: #dbeafe; }
.sync-restart { color: #6b7280; background: #f3f4f6; }
.settings-actions { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
