:root {
  --bg: #f5f7fa;
  --panel: #fff;
  --ink: #1a1d23;
  --muted: #6b7280;
  --line: #e6e9ef;
  --brand: #2563eb;
  --ok: #12a150;
  --warn: #d97706;
  --bad: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.hidden { display: none !important; }
a { color: var(--brand); }

/* 登录 */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #2563eb 60%, #0ea5e9); }
.login-card { width: 360px; padding: 36px 32px; background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h1 { margin: 0; font-size: 19px; }
.login-card .sub { margin: 4px 0 24px; color: var(--muted); font-size: 13px; }
.login-card input { width: 100%; padding: 11px 13px; margin-bottom: 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card button { width: 100%; padding: 11px; background: var(--brand); color: #fff; border: 0;
  border-radius: 9px; font-size: 15px; letter-spacing: 4px; cursor: pointer; }
.login-card .hint { margin: 16px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.login-card .err { color: var(--bad); font-size: 13px; margin: 10px 0 0; }

/* 布局 */
#app { display: flex; min-height: 100vh; }
aside { width: 210px; flex: none; background: #131722; color: #c9d1d9; display: flex; flex-direction: column; }
.logo { padding: 22px 20px; font-weight: 700; letter-spacing: 1px; font-size: 17px; color: #fff; }
.logo span { color: #58a6ff; font-weight: 400; margin-left: 4px; font-size: 13px; }
nav { flex: 1; padding: 8px 10px; }
nav a { display: block; padding: 10px 14px; margin-bottom: 2px; border-radius: 8px;
  color: #adb6c2; text-decoration: none; font-size: 14px; }
nav a:hover { background: #1d2331; color: #fff; }
nav a.on { background: var(--brand); color: #fff; }
.who { padding: 16px 20px; border-top: 1px solid #232936; font-size: 13px; }
.who .role { color: #7d8794; font-size: 12px; margin: 2px 0 8px; }
.who a { color: #7d8794; font-size: 12px; text-decoration: none; }

main { flex: 1; min-width: 0; }
header { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--line); }
header h2 { margin: 0; font-size: 18px; }
.tools { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
#view { padding: 24px 28px 48px; }

/* 组件 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .t { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); } .stat.bad .n { color: var(--bad); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.panel > h3 { margin: 0; padding: 14px 18px; font-size: 14px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; }
.panel-body { padding: 16px 18px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; }
tbody tr:hover { background: #fafbfd; }
td.wrap { white-space: normal; min-width: 260px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

button, .btn { padding: 7px 13px; border: 1px solid var(--line); background: #fff; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: var(--ink); }
button:hover { border-color: #c9cfd8; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.ghost { background: transparent; }
button.mini { padding: 4px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #eef1f5; color: #4b5563; }
.tag.ok { background: #e6f6ed; color: #12703c; }
.tag.warn { background: #fff4e5; color: #9a5b00; }
.tag.bad { background: #fdeaea; color: #a81f1f; }
.tag.info { background: #e8f0fe; color: #1a4fba; }

form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; min-width: 150px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bars .fill { width: 100%; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 5px 5px 0 0; min-height: 3px; }
.bars .lb { font-size: 11px; color: var(--muted); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
code { background: #f1f3f7; padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.modal { position: fixed; inset: 0; background: rgba(15,20,30,.5); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: min(720px, 92vw); max-height: 84vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head button { border: 0; background: transparent; font-size: 16px; }
#modal-body { padding: 18px 20px 24px; }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #1a1d23; color: #fff; padding: 11px 20px; border-radius: 9px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 99; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #b91c1c; }
