:root {
  --brand: #3478f6; --brand-soft: #eaf1ff; --brand-ink: #1f5fd6;
  --text: #14161a; --text-2: #4b5260; --text-3: #8a919e; --text-4: #c5cad3;
  --line: #e7e9ee; --line-2: #f2f3f6; --bg: #f4f5f8; --panel: #fff;
  --ok: #1f9d55; --ok-soft: #e7f6ee; --danger: #e5484d; --danger-soft: #fdecec; --warn: #d9860b; --warn-soft: #fdf3e2;
  --side: #161a22; --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-3); }
.sm { font-size: 12px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; flex: none; background: var(--side); color: #c9cfdb; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 22px; color: #fff; font-weight: 700; font-size: 16px; }
.brand i { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #5b8cff, #3b5bfd); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 15px; }
.nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: #aab2c2; }
.nav a:hover { background: rgba(255,255,255,.05); color: #e6eaf2; }
.nav a.on { background: rgba(91,124,255,.2); color: #fff; }
.nav a .n { margin-left: auto; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .role { color: #8a93a6; font-size: 12px; }
.side-foot .links { display: flex; gap: 12px; margin-top: 8px; }
.side-foot .links a { color: #8a93a6; }
.side-foot .links a:hover { color: #fff; }
.main { flex: 1; min-width: 0; padding: 22px 28px 40px; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 20px; }
.head .grow { flex: 1; }
.back { color: var(--text-3); }

/* ---------- 卡片 / 表格 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.card-b { padding: 16px 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--text-3); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--text-3); font-size: 12px; }
.stat.warn .v { color: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { color: var(--text-3); font-weight: 500; font-size: 13px; background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8faff; }
.empty { padding: 36px; text-align: center; color: var(--text-3); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; }
.kv .k { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 控件 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: #cfd4dd; background: #fafbfc; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-ink); }
.btn.danger { color: var(--danger); border-color: #f3c4c6; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.inp { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; min-width: 0; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(52,120,246,.12); }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; width: 100%; }
select.inp { padding-right: 28px; }
.tabs { display: flex; gap: 4px; }
.tab { height: 32px; padding: 0 12px; border-radius: 8px; border: none; background: transparent; color: var(--text-2); }
.tab.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: var(--line-2); color: var(--text-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); margin-right: 6px; }
.dot.on { background: var(--ok); }
.av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-cell .t { min-width: 0; }
.user-cell .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-2); }
.ferr { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.bar { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bar .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar .b { width: 100%; max-width: 38px; background: var(--brand); border-radius: 5px 5px 0 0; min-height: 2px; }
.bar .b.alt { background: #9fbcf9; }
.bar .l { font-size: 11px; color: var(--text-3); }
.bar .vv { font-size: 11px; color: var(--text-2); }

/* 举报 */
.rp { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; }
.rp:last-child { border-bottom: none; }
.rp .snap { grid-column: 1 / -1; background: #fafbfc; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.rp .meta { color: var(--text-3); font-size: 12px; }
.rp .acts { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.ctx { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.ctx .m { padding: 8px 12px; border-radius: 8px; background: #f6f7f9; }
.ctx .m.t { background: var(--danger-soft); border: 1px solid #f3c4c6; }
.ctx .m .w { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.ctx img, .ctx video { max-width: 280px; max-height: 220px; border-radius: 8px; display: block; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, #e3ebff 0, transparent 60%), var(--bg); }
.login .box { width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 28px 24px; box-shadow: 0 12px 40px rgba(16,24,40,.06); }
.login h2 { margin: 0 0 4px; font-size: 20px; }
.login p { margin: 0 0 18px; color: var(--text-3); }
.login label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 6px; }
.login .inp { width: 100%; height: 42px; }
.login .btn.pri { width: 100%; height: 42px; justify-content: center; margin-top: 18px; font-size: 15px; }
.login .qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 4px; }
.login .qr img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; }
.login .secret { font-family: var(--mono); font-size: 12px; letter-spacing: .5px; word-break: break-all; text-align: center; color: var(--text-2); user-select: all; }
.code { letter-spacing: 8px; text-align: center; font-family: var(--mono); font-size: 20px !important; }

/* ---------- 弹窗 / 提示 ---------- */
.mask { position: fixed; inset: 0; background: rgba(16,24,40,.38); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.dlg { width: 480px; max-width: 100%; max-height: 90vh; overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(16,24,40,.2); }
.dlg.wide { width: 720px; }
.dlg-h { display: flex; align-items: center; padding: 16px 20px 6px; }
.dlg-h h3 { margin: 0; font-size: 16px; flex: 1; }
.dlg-h .x { border: none; background: none; font-size: 20px; color: var(--text-3); line-height: 1; }
.dlg-b { padding: 10px 20px 4px; }
.dlg-b label { display: block; font-size: 13px; color: var(--text-2); margin: 10px 0 6px; }
.dlg-b .inp { width: 100%; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.secret-box { background: #fafbfc; border: 1px dashed var(--line); border-radius: 8px; padding: 12px; font-family: var(--mono); font-size: 16px; text-align: center; user-select: all; word-break: break-all; }
#toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-20px); background: #1f2430; color: #fff; padding: 9px 16px; border-radius: 9px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; font-size: 13px; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; }
  .nav { flex-direction: row; flex-wrap: wrap; padding-bottom: 10px; }
  .main { padding: 16px; }
  .hide-sm { display: none; }
}
.grid2 > .card + .card { margin-top: 0; }
.grid2 { margin-bottom: 16px; }
.grid2 + .card { margin-top: 0; }
