:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1f2733;
  --muted: #70809a;
  --line: #e4e9f2;
  --brand: #ff5b3a;
  --brand-d: #e8482a;
  --accent: #2f7cf6;
  --ok: #1faa6b;
  --warn: #e0a106;
  --bad: #e0453a;
  --shadow: 0 1px 3px rgba(20,30,50,.08), 0 6px 24px rgba(20,30,50,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: 0 0 220px; background: #1c2433; color: #cdd6e6;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo { font-size: 17px; font-weight: 700; color: #fff; padding: 8px 10px 18px; }
.sidebar .logo span { color: var(--brand); }
.sidebar .group-title { font-size: 11px; color: #6b7891; padding: 14px 12px 6px; letter-spacing: .08em; }
.sidebar a {
  display: block; padding: 10px 12px; border-radius: 8px; color: #cdd6e6; margin: 2px 0;
}
.sidebar a:hover { background: #2a3447; text-decoration: none; }
.sidebar a.active { background: var(--brand); color: #fff; }
.sidebar a .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4a5874; margin-right: 8px; }
.sidebar a.active .dot { background: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 5;
}
.topbar .site { font-weight: 700; }
.topbar .site b { color: var(--brand); }
.topbar .uid { color: var(--muted); font-size: 13px; }
.topbar .uid code { background: #eef2f9; padding: 2px 8px; border-radius: 6px; color: var(--ink); }
.topbar .me { display: flex; align-items: center; gap: 14px; }
.content { padding: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=password], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 14px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; background: var(--accent); color: #fff;
}
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn.primary { background: var(--brand); }
.btn.primary:hover { background: var(--brand-d); }
.btn.ghost { background: #eef2f9; color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; background: #fafbfe; }
tr:hover td { background: #fafbff; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #eef2f9; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.s0 { background: #eef2f9; color: #8a97ad; }
.badge.s1 { background: #e3f6ec; color: var(--ok); }
.badge.s2 { background: #fde7e5; color: var(--bad); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.msg.ok { background: #e3f6ec; color: #1c7a4f; }
.msg.err { background: #fde7e5; color: #b23026; }
.muted { color: var(--muted); }
.right { text-align: right; }
.pagination { margin-top: 12px; display: flex; gap: 6px; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; }
.pagination .cur { background: var(--accent); color: #fff; border-color: var(--accent); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#23304a,#101725); }
.login-card { width: 360px; background: #fff; border-radius: 14px; padding: 30px 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); margin-bottom: 20px; }
.login-card .brand { color: var(--brand); font-weight: 700; }

/* 仪表盘统计卡片 */
.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { display: block; text-decoration: none; transition: transform .08s ease, box-shadow .12s ease; }
.stat:hover { transform: translateY(-2px); text-decoration: none; }
.stat .num { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat.ok .num { color: var(--ok); }
.stat.warn .num { color: var(--warn); }
.stat.accent .num { color: var(--accent); }
.stat.muted-stat .num { color: var(--muted); }

/* 表单网格补全 */
.field.full { grid-column: 1 / -1; }

/* 键值表 / 详情 */
.kv { width: 100%; border-collapse: collapse; }
.kv th { width: 140px; text-align: left; color: var(--muted); font-weight: 600; background: #fafbfe; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.kv td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.overlay-card { border-left: 4px solid var(--brand); }
.cut { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
pre.json { background: #0f1626; color: #cfe3ff; padding: 14px; border-radius: 8px; overflow: auto; max-height: 360px; font-size: 12px; }
details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }
.instructions { line-height: 1.7; }
.instructions code { background: #eef2f9; padding: 1px 6px; border-radius: 5px; }
.steps { margin: 0; padding-left: 20px; line-height: 2; }
.badge.s3 { background: #e7efff; color: var(--accent); }
@media (max-width: 900px) {
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
