:root {
  --bg: #f6f7f9; --card: #fff; --fg: #1b1f24; --muted: #6b7280;
  --line: #e4e7eb; --ok: #167c4a; --ok-bg: #e7f6ee; --warn: #8a5a00;
  --warn-bg: #fdf3da; --err: #a32020; --err-bg: #fdeaea; --dim: #5b6572;
  --dim-bg: #eef0f3; --accent: #2b5fd9; --field: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --card: #1c2027; --fg: #e8eaed; --muted: #98a1ae;
    --line: #2c323b; --ok: #6ddba0; --ok-bg: #16311f; --warn: #e8c266;
    --warn-bg: #352b12; --err: #ff9b9b; --err-bg: #3a1c1c; --dim: #9aa4b2;
    --dim-bg: #24282f; --accent: #7aa2ff; --field: #161a20;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 22px 16px 56px; background: var(--bg); color: var(--fg);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
.wrap { max-width: 1180px; margin: 0 auto; }
header {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline;
  justify-content: space-between; margin-bottom: 16px;
}
h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
h1 a { color: inherit; text-decoration: none; }
h2 { font-size: 15px; margin: 0 0 12px; }
nav { display: flex; gap: 14px; align-items: center; }
nav a { color: var(--muted); text-decoration: none; font-size: 13px; padding-bottom: 2px; }
nav a:hover { color: var(--accent); }
nav a.on { color: var(--fg); font-weight: 600; border-bottom: 2px solid var(--accent); }
.meta { color: var(--muted); font-size: 12.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 900px; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; background: var(--bg);
}
tr:last-child td { border-bottom: none; }
.site { font-weight: 600; white-space: nowrap; }
.site a { color: var(--accent); text-decoration: none; }
.site a:hover { text-decoration: underline; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ok { color: var(--ok); background: var(--ok-bg); }
.warn, .locked { color: var(--warn); background: var(--warn-bg); }
.error { color: var(--err); background: var(--err-bg); }
.unknown, .disabled, .muted-badge { color: var(--dim); background: var(--dim-bg); }
.msg { color: var(--muted); font-size: 12.5px; max-width: 300px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
button, .btn {
  font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  text-decoration: none; display: inline-block; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .5; cursor: progress; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { opacity: .9; color: #fff; }
button.danger:hover { border-color: var(--err); color: var(--err); }
.toolbar { display: flex; gap: 9px; align-items: center; margin: 0 0 13px; flex-wrap: wrap; }
.note { margin-top: 16px; color: var(--muted); font-size: 12.5px; }
.note code, code {
  background: var(--dim-bg); padding: 1px 5px; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
}
#flash { margin: 0 0 13px; padding: 10px 14px; border-radius: 8px; display: none; font-size: 13px; white-space: pre-line; }

/* 表单 */
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--field); color: var(--fg);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 72px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } table { min-width: 620px; } }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg); }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 14px; margin: 0 0 14px; }
legend { font-size: 12.5px; color: var(--muted); padding: 0 6px; }
details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

/* 弹层 */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none;
  align-items: flex-start; justify-content: center; padding: 28px 14px; overflow-y: auto; z-index: 20;
}
.overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 12px; width: 100%; max-width: 720px; border: 1px solid var(--line); }
.modal-head, .modal-foot { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-foot { border-bottom: none; border-top: 1px solid var(--line); }
.modal-body { padding: 18px; }
.modal-head strong { font-size: 15px; }

/* 登录页 */
.center { min-height: 74vh; display: flex; align-items: center; justify-content: center; }
.center .card { padding: 26px; width: 100%; max-width: 360px; }
