:root {
  --bg: #0f1216;
  --panel: #161b22;
  --panel2: #1c2430;
  --line: #263141;
  --text: #d7e0ea;
  --muted: #7d8da1;
  --green: #35c07a;
  --yellow: #e0b33a;
  --orange: #e08a3a;
  --red: #e05252;
  --blue: #4aa3e0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.error { color: var(--red); min-height: 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; letter-spacing: .5px; }
header nav { display: flex; gap: 6px; }
header button, .btn, .modal button, .detail button {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; text-decoration: none;
}
header button.active { background: #24344a; border-color: #3a5372; color: #fff; }
header .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

main { padding: 16px 18px 60px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 6px 8px; font-size: 13px;
}
#f-q { min-width: 220px; }
.auto { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--panel2); color: #a8b7c9; font-weight: 500; text-align: left; }
tbody tr:hover { background: #1a2430; cursor: pointer; }
td.name { font-weight: 500; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.s-up { background: var(--green); }
.s-degraded { background: var(--yellow); }
.s-unreachable { background: var(--orange); }
.s-down { background: var(--red); }
.s-unknown { background: var(--muted); }

.bar { position: relative; height: 6px; background: #223; border-radius: 3px; width: 110px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--blue); }

.detail {
  position: fixed; right: 0; top: 0; bottom: 0; width: 960px; max-width: 96vw;
  background: var(--panel); border-left: 1px solid var(--line); padding: 16px 20px 40px;
  overflow: auto; box-shadow: -20px 0 40px rgba(0,0,0,.4); z-index: 20;
}
.detail-head { display: flex; align-items: center; justify-content: space-between; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.meta div { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.meta b { display: block; font-size: 16px; font-weight: 600; margin-top: 2px; color: var(--text); }
.code { background: #0c1014; border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; color: var(--muted); }
.card b { display: block; font-size: 19px; margin-top: 4px; color: var(--text); }
.card .item { background: var(--panel2); border-color: #202a36; }

.list { display: flex; flex-direction: column; gap: 6px; }
.list .item { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.list.compact .item { font-size: 12px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #23324a; color: #9fc2e8; margin: 0 4px; }
.tag.crit { background: #4a2323; color: #f0a0a0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 760px; max-width: 94vw; max-height: 88vh; overflow: auto; padding: 16px 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
.modal input, .modal select, .modal textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 7px 9px; font-size: 13px; margin-top: 4px;
}
.modal textarea { min-height: 150px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; width: 320px; }
.login h1 { font-size: 18px; margin: 0 0 18px; }
.login label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.login input { width: 100%; margin-top: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 8px 10px; }
.login button { width: 100%; padding: 9px; background: #24405f; border: 1px solid #345a80; color: #fff; border-radius: 6px; cursor: pointer; }

