:root {
  --bg: #12151c; --panel: #1a1f28; --line: #262c38; --fg: #dfe5ee;
  --dim: #7f8899; --accent: #5eb8ff; --ok: #7ddc9a; --bad: #ff7b7b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.5 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
code, pre { font-family: Consolas, "Cascadia Mono", monospace; }

.bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 600; font-size: 15px; }
.cfg { display: flex; gap: 8px; flex-wrap: wrap; }
.cfg input { width: 320px; }
input, select {
  background: #0f1218; color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font-size: 13px;
}
input:focus, select:focus { outline: 1px solid var(--accent); }
button {
  background: var(--accent); color: #08101a; border: 0; border-radius: 6px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; font-weight: 600;
}
button.ghost { background: #232a36; color: var(--fg); border: 1px solid var(--line); font-weight: 400; }
button.danger { color: var(--bad); }
button.link { background: none; color: var(--accent); padding: 0; border: 0; font-size: 13px; text-decoration: underline; }

.notice { padding: 8px 16px; background: #33240c; color: #ffd9a0; border-bottom: 1px solid #4a3413; }
.notice.ok { background: #10261a; color: var(--ok); border-color: #1d3a29; }
.notice.hidden { display: none; }

.grid { display: grid; grid-template-columns: 280px 1fr; gap: 16px; padding: 16px; align-items: start; }
.side, .content { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.side { padding: 12px; position: sticky; top: 62px; }
.side h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 8px 0; }
.content { padding: 0 16px 16px; }

.apps { list-style: none; margin: 0 0 10px; padding: 0; max-height: 46vh; overflow: auto; }
.apps li { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; cursor: pointer; }
.apps li:hover { border-color: var(--accent); }
.apps li.on { background: #14202c; border-color: var(--accent); }
.apps li.empty { cursor: default; color: var(--dim); border-style: dashed; }
.apps .pkg { font-weight: 600; }
.apps .pkg code { display: block; color: var(--dim); font-weight: 400; font-size: 12px; word-break: break-all; }
.apps .stat { font-size: 12px; color: var(--fg); }

.counts { font-size: 12px; margin: 6px 0 14px; }
.maint label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.maint input { width: 80px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: none; color: var(--dim); border-radius: 6px 6px 0 0; padding: 8px 14px; font-weight: 400; }
.tabs button.on { color: var(--fg); background: #141a23; font-weight: 600; }
.tab { display: none; }
.tab.on { display: block; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 8px; }
.card { background: #141a23; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.card b { display: block; font-size: 20px; }
.card span { font-size: 12px; color: var(--dim); }
.card.warn b { color: var(--bad); }

h3 { font-size: 13px; color: var(--dim); margin: 18px 0 8px; font-weight: 600; }
h4 { font-size: 12px; color: var(--dim); margin: 14px 0 6px; }
.chart { background: #10151d; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.legend { font-size: 12px; color: var(--dim); margin: 6px 0; }
.legend .k { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin: 0 4px 0 12px; }
.legend .k1 { background: var(--accent); }
.legend .k2 { background: var(--ok); }

.scroll { overflow: auto; max-height: 60vh; border: 1px solid var(--line); border-radius: 8px; }
.scroll.short { max-height: 180px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #141a23; position: sticky; top: 0; color: var(--dim); font-weight: 600; }
tbody tr:hover { background: #161d27; }
td code { color: var(--accent); }
td .aid { color: var(--fg); }
.bad { color: var(--bad); font-weight: 600; }

.dims { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dim-box { background: #141a23; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.dim-box h4 { margin: 0 0 8px; }
.hbar { display: grid; grid-template-columns: 90px 1fr 42px; align-items: center; gap: 6px; font-size: 12px; }
.bk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.bt { height: 8px; background: var(--accent); border-radius: 3px; display: block; }
.bn { text-align: right; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.row input[type="search"] { width: 320px; }
.detail { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.detail.hidden { display: none; }
.detail pre { background: #10151d; border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 260px; font-size: 12px; }

pre { background: #10151d; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12px; color: #cfd8e6; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.hidden { display: none; }

/* 登录页 */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px 22px 16px;
}
.login-card h1 { margin: 0 0 4px; font-size: 18px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.login-card label { font-size: 12px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }
.login-card input { width: 100%; font-size: 15px; padding: 9px 10px; }
.login-card button { padding: 9px 12px; font-size: 14px; }
.login-card code { color: var(--accent); }
.msg { min-height: 18px; margin: 10px 0 0; font-size: 13px; color: var(--dim); }
.msg.err { color: var(--bad); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .cfg input { width: 200px; }
}
