
:root {
  --bg: #f1f5f9;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --accent: #0d9488;
  --accent-2: #14b8a6;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --card: #ffffff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --info: #2563eb;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  background: var(--sidebar);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  padding: 20px 18px 16px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  color: #fff;
  border-bottom: 1px solid #1e293b;
}
.brand small { display: block; font-weight: 400; color: #94a3b8; margin-top: 4px; font-size: 12px; }
.nav-group { padding: 14px 12px 4px; }
.nav-label {
  font-size: 11px;
  text-transform: none;
  color: #64748b;
  padding: 0 8px 6px;
  letter-spacing: .06em;
}
.sidebar a.nav-item {
  display: block;
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  text-decoration: none;
  margin: 1px 0;
}
.sidebar a.nav-item:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.sidebar a.nav-item.active { background: #134e4a; color: #ccfbf1; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.sidebar-backdrop { display: none; }
.topbar .crumb { font-size: 14px; color: var(--muted); }
.topbar .who { font-size: 13px; color: var(--muted); }
.topbar .who a { margin-left: 12px; }
.content { padding: 24px; max-width: 1280px; }
h1 { font-size: 22px; margin: 0 0 8px; }
.page-desc { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; line-height: 1.6; }
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.card .metric { font-size: 22px; font-weight: 700; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.card a { font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.data th, table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.data th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f8fafc; }
table.data tr:hover td { background: #f8fafc; }
table.data .mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.empty { text-align: center; color: var(--muted); padding: 28px !important; }
.tabs { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.tabs a, .tabs span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.tabs a.active, .tabs a:hover { background: #0f172a; color: #fff; border-color: #0f172a; text-decoration: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e2e8f0; }
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.err { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.field { margin-bottom: 16px; }
.field label.lbl { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number],
select, textarea {
  width: 100%;
  max-width: 640px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
textarea { min-height: 140px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--accent); }
.switch { display: flex; align-items: center; gap: 8px; }
.actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent); }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { max-width: 280px; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0f172a, #134e4a 60%, #0f172a);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card h1 { margin-bottom: 6px; }
.pager { margin-top: 14px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.hint-box { background: #f0fdfa; border: 1px solid #99f6e4; color: #115e59; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.row-actions { display: flex; gap: 8px; white-space: nowrap; }
.row-actions form { display: inline; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: none;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 8px 0 24px rgba(15, 23, 42, .25); }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 30;
  }
  body.nav-open .sidebar-backdrop { display: block; }
  .topbar { padding: 10px 16px; }
  .two-col { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
