/* ============================================================
   Roblox 审核工作台 —— 现代深色主题
   布局：固定侧边栏 + 顶栏 + 内容区；响应式断点 1024 / 768
   ============================================================ */
:root {
  --bg: #0d1220;
  --bg-soft: #111829;
  --panel: #161f35;
  --panel-2: #1b2540;
  --line: #263252;
  --text: #e8edf9;
  --text-dim: #8b97b5;
  --text-faint: #5d6a8a;
  --primary: #4f7cff;
  --primary-2: #3a63d8;
  --danger: #ff5d6c;
  --danger-2: #d8404f;
  --ok: #34d19c;
  --warn: #f5b445;
  --info: #59b8ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(3, 8, 22, .55);
  --side-w: 232px;
  --side-w-slim: 68px;
  font-size: 15px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: .16s; white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-2); }
.btn-ok { background: var(--ok); color: #06281c; }
.btn-ok:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: .82rem; border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn {
  background: none; border: none; color: var(--text-dim); font-size: 1.25rem;
  cursor: pointer; padding: 6px 10px; border-radius: 8px; display: none;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

input, select, textarea {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: .92rem;
  font-family: inherit; outline: none; transition: .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .84rem; color: var(--text-dim); margin-bottom: 6px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(79, 124, 255, .16), transparent 60%),
    radial-gradient(700px 420px at 0% 110%, rgba(255, 93, 108, .10), transparent 55%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: 400px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 34px 32px 26px;
}
.login-logo { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-logo h1 { font-size: 1.22rem; }
.login-logo p { font-size: .82rem; color: var(--text-dim); margin-top: 4px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--primary), #7a5cff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; color: #fff;
}
.logo-mark.small { width: 34px; height: 34px; font-size: 1rem; border-radius: 9px; }
.form-error {
  background: rgba(255, 93, 108, .12); border: 1px solid rgba(255, 93, 108, .4);
  color: #ff9aa4; border-radius: 8px; padding: 9px 12px; font-size: .84rem; margin-bottom: 14px;
}
.login-foot { margin-top: 18px; text-align: center; font-size: .76rem; color: var(--text-faint); }

/* ---------- 主框架 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--side-w); flex: none; display: flex; flex-direction: column;
  background: var(--bg-soft); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.brand-name { font-weight: 700; letter-spacing: .02em; }
.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; margin-bottom: 4px;
  border-radius: 10px; color: var(--text-dim); font-size: .93rem; font-weight: 500;
  cursor: pointer; transition: .14s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(79,124,255,.18), rgba(79,124,255,.05)); color: #fff; box-shadow: inset 2px 0 0 var(--primary); }
.nav-item .ico { width: 21px; text-align: center; font-size: 1.02rem; }
.side-foot { padding: 14px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #2c3a63, #43527f);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #cfd9f5;
}
.user-chip .meta { min-width: 0; }
.user-chip .uname { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .uid { font-size: .72rem; color: var(--text-faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 26px;
  border-bottom: 1px solid var(--line); background: rgba(13, 18, 32, .8);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 1.12rem; font-weight: 700; flex: 1; }
.role-badge {
  font-size: .76rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: rgba(79, 124, 255, .16); color: #9db7ff; border: 1px solid rgba(79, 124, 255, .4);
}
.role-badge.dev { background: rgba(245, 180, 69, .14); color: #ffd479; border-color: rgba(245, 180, 69, .45); }
.content { padding: 26px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- 卡片与统计 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.card h3 { font-size: 1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3 .hint { font-size: .78rem; color: var(--text-faint); font-weight: 400; margin-left: auto; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
.stat .num { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.stat .label { font-size: .82rem; color: var(--text-dim); }
.stat .trend { font-size: .76rem; color: var(--text-faint); }
.stat.accent .num { color: var(--primary); }
.stat.warn .num { color: var(--warn); }
.stat.danger .num { color: var(--danger); }
.stat.ok .num { color: var(--ok); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); color: var(--text-dim); font-size: .78rem; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(79, 124, 255, .05); }
td .mono { font-family: Consolas, monospace; font-size: .82rem; color: var(--text-dim); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: rgba(245,180,69,.13); color: var(--warn); }
.badge.approved { background: rgba(255,93,108,.13); color: var(--danger); }
.badge.rejected { background: rgba(52,209,156,.13); color: var(--ok); }
.badge.active { background: rgba(52,209,156,.13); color: var(--ok); }
.badge.suspended { background: rgba(139,151,181,.15); color: var(--text-dim); }
.badge.admin { background: rgba(89,184,255,.13); color: var(--info); }
.badge.developer { background: rgba(245,180,69,.13); color: var(--warn); }
.badge.level-L1, .badge.level-L2 { background: rgba(245,180,69,.13); color: var(--warn); }
.badge.level-L3, .badge.level-L4 { background: rgba(255,93,108,.13); color: var(--danger); }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .spacer { flex: 1; }

/* ---------- 审核卡片 ---------- */
.audit-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; display: flex; gap: 16px; flex-wrap: wrap;
}
.audit-card .pic {
  width: 108px; height: 108px; flex: none; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.audit-body { flex: 1; min-width: 260px; }
.audit-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.audit-summary {
  font-size: .92rem; line-height: 1.55; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin: 8px 0; word-break: break-all;
}
.audit-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--text-faint); }
.audit-meta b { color: var(--text-dim); font-weight: 600; }
.audit-actions { display: flex; flex-direction: column; gap: 9px; justify-content: center; min-width: 130px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; font-size: .84rem; color: var(--text-dim); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; right: 20px; top: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: .88rem; display: flex; gap: 9px; align-items: flex-start;
  animation: slide-in .22s ease;
}
.toast.ok { border-color: rgba(52,209,156,.5); }
.toast.err { border-color: rgba(255,93,108,.55); }
.toast .t-ico { font-size: 1rem; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5, 9, 20, .68); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 22px;
}
.modal {
  width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 24px; animation: pop .18s ease;
}
.modal.wide { width: 620px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 1.04rem; margin-bottom: 14px; }
.modal .modal-body { font-size: .9rem; color: var(--text-dim); line-height: 1.6; }
.modal .modal-body b { color: var(--text); }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 12px; font-size: .86rem; margin: 10px 0; }
.modal .kv .k { color: var(--text-faint); }
.modal .kv .v { color: var(--text); word-break: break-all; }
.warn-box {
  background: rgba(245,180,69,.1); border: 1px solid rgba(245,180,69,.4);
  border-radius: 8px; padding: 10px 12px; font-size: .82rem; color: #ffd479; margin-top: 12px;
}
.danger-box {
  background: rgba(255,93,108,.09); border: 1px solid rgba(255,93,108,.4);
  border-radius: 8px; padding: 10px 12px; font-size: .82rem; color: #ff9aa4; margin-top: 12px;
}

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--text-faint); font-size: .9rem; }
.empty .big { font-size: 2rem; margin-bottom: 10px; }
.loading { text-align: center; padding: 40px; color: var(--text-faint); }

/* ---------- 进度条（违规类型分布） ---------- */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: .82rem; }
.bar-row .bar-label { width: 150px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #7a5cff); }
.bar-row .bar-num { width: 40px; text-align: right; color: var(--text-dim); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: var(--side-w-slim); }
  .brand-name, .nav-item span.txt, .user-chip .meta { display: none; }
  .nav-item { justify-content: center; }
  .user-chip { justify-content: center; }
  .side-foot .btn span { display: none; }
}
@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .icon-btn { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%); transition: .2s; width: var(--side-w);
  }
  .sidebar.open { transform: none; }
  .brand-name, .nav-item span.txt, .user-chip .meta { display: block; }
  .nav-item { justify-content: flex-start; }
  .audit-actions { flex-direction: row; width: 100%; }
  .audit-actions .btn { flex: 1; }
}
