/* 用户管理后台样式（设计 Token 与主应用一致） */
:root {
  --bg: #eef1f6; --panel: #ffffff; --fill-soft: #f4f6fb;
  --border: #e6eaf2; --border-strong: #d6dce8;
  --text: #1f2733; --text-strong: #0f172a; --muted: #8a94a6;
  --primary: #3b6ef6; --primary-dark: #2f59d6; --primary-soft: #eaf0ff;
  --success: #1aa971; --success-dark: #15824f; --success-soft: #e6f7ef;
  --danger: #ef4444; --danger-soft: #fdecec;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(17, 28, 45, .06), 0 1px 2px rgba(17, 28, 45, .04);
  --shadow-md: 0 6px 18px rgba(17, 28, 45, .08);
  --shadow-lg: 0 12px 32px rgba(17, 28, 45, .12);
  --shadow-primary: 0 6px 16px rgba(59, 110, 246, .35);
}
[data-theme="dark"] {
  --bg: #0e1525; --panel: #182236; --fill-soft: #21304a;
  --border: #26344c; --border-strong: #344661;
  --text: #e7edf5; --text-strong: #ffffff; --muted: #93a0b4;
  --primary: #4f8bff; --primary-dark: #3b6ef6; --primary-soft: #1d2c4d;
  --success: #2ecc8f; --success-soft: #14302a;
  --danger: #ff5c5c; --danger-soft: #3a2128;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 26px; background: var(--panel);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 10;
}
.brand-title { font-size: 18px; font-weight: 800; color: var(--text-strong); }
.brand-icon { font-size: 20px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.chip {
  padding: 7px 13px; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary);
  font-size: 13px; font-weight: 700;
}
.btn {
  border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; white-space: nowrap; transition: all .14s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: var(--shadow-primary); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.mini { padding: 5px 10px; font-size: 12px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.stat-num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; font-weight: 800; color: var(--text-strong); }
.head-tools { display: flex; gap: 8px; align-items: center; }
.select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--fill-soft); color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.select:focus { border-color: var(--primary); }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; background: var(--fill-soft); }
.table tr:last-child td { border-bottom: none; }
.table td .row-actions { display: flex; gap: 6px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700;
}
.badge.admin { background: var(--primary-soft); color: var(--primary); }
.badge.user { background: var(--fill-soft); color: var(--muted); }
.badge.on { background: var(--success-soft); color: var(--success-dark); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.activity-list { max-height: 420px; overflow-y: auto; }
.act-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.act-item:last-child { border-bottom: none; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.act-body { flex: 1; min-width: 0; }
.act-line { color: var(--text); line-height: 1.5; }
.act-line b { color: var(--text-strong); }
.act-time { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.act-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px;
  border-radius: var(--radius-pill); background: var(--fill-soft); color: var(--muted); margin-right: 6px;
}
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; border-top: 1px solid var(--border); }
.page-label { font-size: 12.5px; color: var(--muted); }
.user-stats { padding: 16px 20px; }
.ustat-title { font-size: 14px; font-weight: 700; color: var(--text-strong); margin-bottom: 12px; }
.ustat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ustat-box { background: var(--fill-soft); border-radius: var(--radius-md); padding: 12px; }
.ustat-box .n { font-size: 20px; font-weight: 800; color: var(--primary); }
.ustat-box .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ustat-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.ustat-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.ustat-row span:last-child { font-weight: 700; color: var(--text-strong); }

.modal { position: fixed; inset: 0; background: rgba(10, 18, 32, .5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-card {
  width: 100%; max-width: 420px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 26px;
}
.modal-card h3 { font-size: 17px; font-weight: 800; color: var(--text-strong); margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--fill-soft); color: var(--text); font-size: 14px; outline: none; font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-hint { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.err { display: none; margin-top: 12px; padding: 9px 12px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; font-weight: 600; }
.err.show { display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }

@media (max-width: 900px) {
  .stats-row { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .wrap { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .brand-title { font-size: 15px; }
  .chip { display: none; }
}
