:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --orange: #f97316;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --green: #18ba7d;
  --red: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部栏 ---------- */
.topbar {
  background: linear-gradient(120deg, var(--blue-dark), var(--blue) 55%, var(--orange));
  color: #fff;
  padding: 0 22px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.topbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.topbar .meta { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.topbar .meta a { color: #fff; opacity: .9; }
.topbar .meta a:hover { opacity: 1; text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 22px 18px 60px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .num { font-size: 26px; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.ok .num { color: var(--green); }
.stat.off .num { color: var(--red); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer; transition: all .15s; text-decoration: none;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; font-size: 14px; color: var(--text);
}
.field textarea { height: 72px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table td .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.on { background: #ecfdf3; color: var(--green); }
.badge.off { background: #fef2f2; color: var(--red); }

/* ---------- 提示条 ---------- */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.alert-success { background: #ecfdf3; color: #067647; }
.alert-error { background: #fef2f2; color: #b42318; }
.alert-info { background: #eff6ff; color: #1d4ed8; }

/* ---------- 凭据块 ---------- */
.cred { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; }
.cred .k { color: var(--muted); font-size: 13px; }
.cred .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.copy-btn { cursor: pointer; color: var(--blue); font-size: 12px; margin-left: 6px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .48);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25); overflow: hidden;
}
.modal-head { padding: 18px 20px 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.modal .close-x { float: right; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1d4ed8, #2563eb 50%, #f97316); }
.login-card { background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .3); padding: 32px 30px; width: 100%; max-width: 380px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
}
