* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6fb; --side: #1f2a44; --side2: #16203a; --primary: #2f6bff;
  --primary-d: #1f50d6; --text: #1f2733; --muted: #8a94a6; --line: #e6eaf2;
  --danger: #e23b3b; --ok: #1f9d55;
}
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
button { font-family: inherit; cursor: pointer; }
a { cursor: pointer; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2a44, #2f6bff); }
.login-card { width: 360px; background: #fff; border-radius: 14px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .logo { width: 56px; height: 56px; border-radius: 12px; background: var(--primary);
  color: #fff; font-weight: 700; font-size: 22px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-brand h1 { font-size: 22px; }
.login-brand .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 14px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--primary); }
.err { color: var(--danger); font-size: 13px; margin-bottom: 12px; }
.btn { height: 38px; padding: 0 16px; border: none; border-radius: 8px; font-size: 14px; background: #eef1f7; color: var(--text); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; height: 42px; margin-top: 4px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 骨架 */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--side); color: #cdd6ea; flex-shrink: 0; }
.side-brand { padding: 20px 18px; font-weight: 700; color: #fff; border-bottom: 1px solid var(--side2); }
.sidebar nav { padding: 10px 0; }
.sidebar nav a { display: block; padding: 12px 20px; color: #cdd6ea; font-size: 14px; }
.sidebar nav a:hover { background: var(--side2); }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; padding: 0 24px; }
.crumb { font-weight: 600; }
.user { display: flex; align-items: center; gap: 12px; }
.role-badge { background: #eef3ff; color: var(--primary); font-size: 12px; padding: 3px 10px; border-radius: 20px; }
.content { padding: 24px; }
.toast { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.toast.err { background: #fdeaea; color: var(--danger); }
.toast.ok { background: #eafaf0; color: var(--ok); }

.welcome { font-size: 16px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; text-align: center; }
.stat .num { font-size: 30px; font-weight: 700; color: var(--primary); }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }

.toolbar { margin-bottom: 16px; }
.tbl { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.tbl th { background: #fafbfe; color: var(--muted); font-weight: 600; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .empty { text-align: center; color: var(--muted); padding: 28px; }
.tbl .ops a { color: var(--primary); margin-right: 12px; font-size: 13px; }
.tbl .ops a.danger { color: var(--danger); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 420px; background: #fff; border-radius: 12px; padding: 24px; }
.modal h3 { margin-bottom: 18px; }
.modal-ops { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
