/* ---------- 左右布局 ---------- */
.admin-layout { display: flex; align-items: stretch; min-height: calc(100vh - 61px); }

.admin-sidebar {
  width: 220px; flex: 0 0 auto; background: #fff;
  border-right: 1px solid var(--border); padding: 20px 12px;
}
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  text-align: left; border: none; background: transparent; padding: 11px 14px;
  border-radius: 9px; font-size: 14px; color: var(--text-secondary); font-weight: 500;
  cursor: pointer; transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: #f1f5f9; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.admin-content { flex: 1; min-width: 0; padding: 24px 28px 60px; }

.page { display: none; }
.page.active { display: block; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.page-head h2 {
  margin: 0; font-size: 20px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.page-head h2::before { content: ''; width: 5px; height: 20px; border-radius: 2px; background: var(--primary); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 数据看板（卡片网格） ---------- */
.stat-group { margin-bottom: 16px; }
.stat-group:last-child { margin-bottom: 0; }
.stat-group-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.stat-group-title::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--muted); }
.stat .num { font-size: 18px; font-weight: 800; color: var(--primary); }
.stat .num .pct { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 3px; }

/* ---------- 数据分析汇总表 ---------- */
.analysis-block { margin-top: 20px; }
.analysis-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analysis-table th, .analysis-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.analysis-table thead th { background: #f8fafc; font-weight: 700; color: var(--muted); }
.analysis-table tbody tr:nth-child(even) { background: #fafafa; }
.analysis-table td:first-child { color: var(--muted); white-space: nowrap; }
.analysis-table .cat-cell { vertical-align: middle; font-weight: 700; color: var(--text); background: #f8fafc; text-align: center; }
.analysis-table td:nth-child(3) { font-weight: 700; color: var(--primary); }

/* ---------- 渠道分块 ---------- */
.channel-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.channel-cols .channel-block { margin-bottom: 0; }
.channel-cols .admin-table-head,
.channel-cols .admin-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 170px; gap: 8px; padding: 10px 12px; }
.channel-cols .admin-table-head span:nth-child(3),
.channel-cols .admin-table-head span:nth-child(4),
.channel-cols .admin-row .o,
.channel-cols .admin-row .time { display: none; }
.channel-cols .admin-row .actions { gap: 8px; flex-wrap: nowrap; }
.channel-cols .admin-row .actions .ghost,
.channel-cols .admin-row .actions .del-btn { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.channel-block { margin-bottom: 22px; }
.channel-block:last-child { margin-bottom: 0; }
.channel-block-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; white-space: nowrap; }
.channel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }
.channel-dot.xiejun { background: #d97706; }
.channel-count { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.channel-count.xiejun { background: #fff1e6; color: #d97706; }

/* ---------- 信息条状列表 ---------- */
.admin-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.admin-table-head, .admin-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) 1.5fr 110px 130px 120px;
  gap: 12px; align-items: center; padding: 12px 16px;
}
.admin-table-head {
  background: #f8fafc; font-size: 12px; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--border); letter-spacing: .4px;
}
.admin-row { border-bottom: 1px solid #f1f5f9; font-size: 13px; transition: background .12s ease; }
.admin-row:last-child { border-bottom: none; }
.admin-row:hover { background: #f8fafc; }
.admin-row .t {
  font-weight: 600; color: var(--text); min-width: 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.admin-row .m { color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row .o { color: var(--text-secondary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row .time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.admin-row .actions { display: flex; gap: 6px; }

/* ---------- 用户管理 ---------- */
.user-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.user-cols .user-group { margin-bottom: 0; }
.user-group { margin-bottom: 20px; }
.user-group:last-child { margin-bottom: 0; }
.user-group-title {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.user-group-title::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }
.user-count { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; margin-left: 8px; }
.user-count em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 6px; border-bottom: 1px solid #f1f5f9;
}
.user-row:last-child { border-bottom: none; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--primary);
}
.user-avatar.seeker { background: var(--ok); }
.user-main { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.user-phone { font-size: 12px; color: var(--muted); margin-top: 1px; }
.user-tags { flex: 0 0 auto; }
.tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.tag-ok { background: #f0f9ff; color: var(--ok); }
.tag-none { background: #f1f5f9; color: var(--muted); }
.user-actions { display: flex; gap: 10px; flex: 0 0 auto; align-items: center; }

/* ---------- 撮合匹配台 ---------- */
.match-rule { font-size: 12px; color: var(--muted); background: #f8fafc; border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
.match-select { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.match-select select { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.match-sub { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.match-item {
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; background: #fff;
  box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease;
}
.match-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.match-score {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px;
  background: #eff6ff; color: var(--primary); font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.match-info { flex: 1; min-width: 0; }
.match-t { font-size: 14px; font-weight: 700; }
.match-company { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.match-s { font-size: 12px; color: var(--muted); }
.match-reason { font-size: 12px; color: #475569; }

/* ---------- 运营设置 ---------- */
.admin-block { margin-bottom: 24px; }
.admin-block h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.admin-search { display: flex; gap: 8px; margin-bottom: 12px; }
.admin-search input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.admin-result {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: #f9fafb;
}
.ar-info { min-width: 0; }
.ar-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ar-role { font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.ar-phone { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 二维码 ---------- */
.qr-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.qr-row img, .qr-row .qr-fallback { width: 120px; height: 120px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); }
.qr-upload { display: flex; flex-direction: column; gap: 10px; }
.qr-upload input { font-size: 13px; }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { flex: 1 1 auto; text-align: center; }
  .admin-content { padding: 18px 16px 60px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .user-cols { grid-template-columns: 1fr; }
  .channel-cols { grid-template-columns: 1fr; }
  .admin-table-head, .admin-row { grid-template-columns: 1fr 90px 120px; }
  .admin-table-head span:nth-child(2),
  .admin-table-head span:nth-child(4),
  .admin-row .m,
  .admin-row .time { display: none; }
}
