* { box-sizing: border-box; }
body {
  margin: 0; font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: #f4f6f9; color: #24292f; font-size: 14px;
}
nav {
  display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 48px;
  background: #1f2d3d; color: #cfd8e3; position: sticky; top: 0; z-index: 10;
}
nav .brand { font-weight: 700; color: #fff; margin-right: 10px; }
nav a { color: #cfd8e3; text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
nav a:hover { color: #fff; }
nav a.active { color: #fff; font-weight: 600; border-bottom-color: #4d9fff; }
nav .spacer, .spacer { flex: 1; }
main { max-width: 1200px; margin: 24px auto; padding: 0 24px; }
h1 { font-size: 20px; margin: 8px 0 16px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: #7a8699; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.cards { display: flex; gap: 14px; margin-bottom: 18px; }
.card {
  flex: 1; background: #fff; border-radius: 8px; padding: 16px 20px;
  border: 1px solid #e4e9f0; display: flex; flex-direction: column;
}
.card b { font-size: 24px; }
.card span { color: #7a8699; margin-top: 4px; }

.panel {
  background: #fff; border: 1px solid #e4e9f0; border-radius: 8px;
  padding: 16px 20px; margin-bottom: 18px;
}

table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e4e9f0; border-radius: 8px; overflow: hidden;
}
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
th { background: #f8fafc; font-weight: 600; color: #556; }
tr:last-child td { border-bottom: none; }
td a { color: #2160c4; text-decoration: none; }
td a:hover { text-decoration: underline; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: #eef1f5; color: #556; font-size: 12px;
}
.badge.ok { background: #e5f6ec; color: #1a7f4b; }
.badge.warn { background: #fdf3e0; color: #a06a00; }
.badge.bad { background: #fdecec; color: #c0392b; }

button {
  background: #2160c4; color: #fff; border: none; border-radius: 6px;
  padding: 7px 14px; cursor: pointer; font-size: 13px;
}
button:hover { background: #1a4fa5; }
button.ghost { background: #fff; color: #45506a; border: 1px solid #ccd4e0; }
button.ghost:hover { background: #f2f5f9; }
form.inline { display: inline; }

input, select {
  padding: 7px 10px; border: 1px solid #ccd4e0; border-radius: 6px; font-size: 13px;
  background: #fff;
}
.filter { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filter input { width: 200px; }
.inline-actions { margin-bottom: 12px; display: flex; gap: 8px; }

.notice {
  background: #e5f6ec; color: #1a7f4b; border: 1px solid #bfe8d0;
  border-radius: 6px; padding: 8px 12px;
}
.alert { background: #fdecec; color: #c0392b; border-radius: 6px; padding: 8px 12px; }

.login-box {
  max-width: 360px; margin: 12vh auto; background: #fff; padding: 32px;
  border-radius: 10px; border: 1px solid #e4e9f0; text-align: center;
}
.login-box h1 { font-size: 18px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login-box input { padding: 10px; }

.actions { display: flex; gap: 6px; }
.pager { display: flex; gap: 12px; margin: 14px 0; align-items: center; flex-wrap: wrap; }
.pager a { color: #2160c4; text-decoration: none; padding: 2px 6px; }
.pager a:hover { text-decoration: underline; }
.pager .cur-page { background: #2160c4; color: #fff; border-radius: 4px; padding: 2px 8px; }
.jump-form { display: flex; gap: 6px; align-items: center; margin-left: 8px; }

details.site-tree { display: inline-block; position: relative; }
details.site-tree > summary {
  list-style: none; cursor: pointer; padding: 7px 14px; background: #fff;
  border: 1px solid #ccd4e0; border-radius: 6px; font-size: 13px;
}
details.site-tree > summary::-webkit-details-marker { display: none; }
details.site-tree[open] > summary { border-color: #2160c4; box-shadow: 0 0 0 2px rgba(33,96,196,.12); }
.tree-body {
  position: absolute; z-index: 30; margin-top: 4px;
  width: max-content; min-width: 320px; max-width: 70vw; max-height: 420px;
  overflow: auto; background: #fff; border: 1px solid #d7dfeb; border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(20, 40, 80, .14);
}
.tree-body label {
  display: flex; align-items: center; gap: 6px; padding: 3px 6px;
  font-size: 13px; cursor: pointer; border-radius: 5px; white-space: nowrap;
}
.tree-body label:hover { background: #eaf1fb; }
.tree-body input[type="checkbox"] { accent-color: #2160c4; }
.tree-body details { margin-left: 8px; padding-left: 10px; border-left: 1px solid #e3e9f2; }
.tree-body summary {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 13px; color: #2c3a4e; padding: 3px 4px; border-radius: 5px; list-style: none;
}
.tree-body summary::-webkit-details-marker { display: none; }
.tree-body summary::before { content: "▸"; color: #9aa7b8; font-size: 11px; }
.tree-body details[open] > summary::before { content: "▾"; }
.tree-body details.grp > summary { font-weight: 600; color: #1f2d3d; }
.tree-body .cnt {
  background: #eef1f6; color: #68758a; border-radius: 9px;
  padding: 0 7px; font-size: 11px; font-weight: 500;
}
.tree-body details[open] > summary .cnt { background: #e2ecfb; color: #2160c4; }

details.sum { font-size: 12px; color: #7a8699; max-width: 560px; margin-top: 3px; }
details.sum summary { cursor: pointer; list-style: none; }
details.sum summary::-webkit-details-marker { display: none; }
details.sum summary::before { content: "▸ "; color: #9aa7b8; }
details.sum[open] summary::before { content: "▾ "; }
details.sum[open] summary { color: #45506a; }
details.sum .sum-full { margin-top: 4px; padding: 6px 8px; background: #f6f8fb; border-left: 3px solid #c8d4e4; border-radius: 4px; line-height: 1.6; }

.stats {
  background: #0f1720; color: #cfe3d8; padding: 14px; border-radius: 8px;
  overflow: auto; max-height: 60vh; font-size: 12px; line-height: 1.5;
}

.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 14px 0; }
.prov { background: #fff; border: 1px solid #e4e9f0; border-radius: 6px; padding: 8px 10px; display: flex; gap: 6px; align-items: center; cursor: pointer; }

.settings-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; background: #fff; border: 1px solid #e4e9f0; border-radius: 8px; padding: 18px 20px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; color: #45506a; }

.kw-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.kw { display: inline-flex; align-items: center; gap: 4px; background: #eef3fa; border: 1px solid #d5e2f2; color: #2c3a4e; border-radius: 14px; padding: 3px 6px 3px 10px; font-size: 13px; }
.kw-del { background: none; border: none; color: #98a5b8; cursor: pointer; font-size: 14px; padding: 0 4px; line-height: 1; }
.kw-del:hover { color: #c0392b; }
