* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --blue: #1d6fe5; --blue-bg: #eef4ff; --green: #00a03e; --green-bg: #e8f7ee; --orange: #e36a00; --orange-bg: #fff3e6;
  --red: #cb272d; --red-bg: #fdecec; --text: #1f2329; --muted: #86909c; --line: #e5e6eb; --bg: #f5f6f8;
}
body { margin: 0; font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 20px; position: sticky; top: 0; z-index: 10; }
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar .brand small { color: var(--muted); font-weight: normal; margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: var(--text); }
.topbar nav a.on { background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.topbar nav a:hover { text-decoration: none; background: #f2f3f5; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 20px 24px 60px; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.card h2 .right { margin-left: auto; font-weight: normal; display: flex; gap: 8px; align-items: center; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: normal; margin-left: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; }
.bar { height: 6px; background: #f2f3f5; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.bar i.warn { background: var(--orange); } .bar i.over { background: var(--red); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; background: #fafbfc; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:hover td { background: #fafbfc; }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
td.actions { white-space: nowrap; text-align: right; }
td.wrap-text { max-width: 420px; word-break: break-all; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; margin-right: 4px; background: #f2f3f5; color: #4e5969; }
.tag.blue { background: var(--blue-bg); color: var(--blue); } .tag.green { background: var(--green-bg); color: var(--green); }
.tag.orange { background: var(--orange-bg); color: var(--orange); } .tag.red { background: var(--red-bg); color: var(--red); }
button, .btn { font: inherit; padding: 6px 14px; border: 1px solid #c9cdd4; border-radius: 6px; background: #fff; cursor: pointer; color: var(--text); }
button:hover { border-color: var(--blue); color: var(--blue); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #175fc7; color: #fff; }
button.danger { color: var(--red); } button.danger:hover { border-color: var(--red); }
button.primary.danger-bg { background: var(--red); border-color: var(--red); }
button.link { border: 0; background: none; padding: 2px 6px; color: var(--blue); }
button.link.danger { color: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid #c9cdd4; border-radius: 6px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(29,111,229,.12); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; }
.form label small { color: var(--muted); font-weight: normal; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.muted { color: var(--muted); }
.err { color: var(--red); } .ok { color: var(--green); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-size: 11px; fill: var(--muted); }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding-top: 10vh; z-index: 100; }
.dialog { background: #fff; border-radius: 12px; width: 520px; max-width: calc(100vw - 32px); max-height: 80vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.dialog.wide { width: 860px; }
.dialog header { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; display: flex; }
.dialog header .x { margin-left: auto; border: 0; padding: 0 4px; font-size: 18px; color: var(--muted); }
.dialog .body { padding: 18px 20px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; background: #f7f8fa; border: 1px dashed #c9cdd4; padding: 10px 14px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.secret span { flex: 1; user-select: all; }
#toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); padding: 9px 18px; border-radius: 8px; background: #1f2329; color: #fff; z-index: 200; display: none; }
#toast.err { background: var(--red); }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef4ff, #f5f6f8 60%); }
.login-box { width: 380px; background: #fff; border-radius: 14px; padding: 32px 30px; box-shadow: 0 10px 40px rgba(29,111,229,.10); }
.login-box h1 { margin: 0 0 4px; font-size: 22px; }
.login-box .sub { color: var(--muted); margin-bottom: 22px; }
.login-box button.primary { width: 100%; padding: 9px; font-size: 15px; }
.hint { background: #f7f8fa; border-radius: 8px; padding: 12px 14px; line-height: 1.8; color: #4e5969; }
.hint code { background: #fff; border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }
