:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --ink: #1a2332;
  --muted: #5c6b7a;
  --line: #d8e0e8;
  --accent: #0f6e56;
  --accent-soft: #e6f4ef;
  --danger: #b42318;
  --warn: #b54708;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(26, 35, 50, 0.06);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #e8f2ee 0, transparent 28%),
    linear-gradient(180deg, #eef2f6 0%, var(--bg) 40%);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; gap: 16px;
}
.brand { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--muted); font-weight: 600; }
.nav a.active, .nav a:hover { color: var(--ink); text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat h3 { margin: 0; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.stat p { margin: 8px 0 0; font-size: 1.6rem; font-weight: 700; }

h1, h2 { margin: 0 0 14px; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  background: #edf1f5; border: 1px solid var(--line);
}
.preview {
  max-width: min(100%, 720px); max-height: 480px; object-fit: contain;
  border-radius: 8px; border: 1px solid var(--line); background: #edf1f5;
}

.btn, button, .button {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.secondary, button.secondary { background: #334155; }
.btn.danger, button.danger { background: var(--danger); }
.btn.ghost, button.ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.btn:hover, button:hover { filter: brightness(0.95); text-decoration: none; }

.form-row { margin-bottom: 14px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.92rem; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; max-width: 480px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
  background: #fff;
}
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.alert {
  padding: 12px 14px; border-radius: 8px; margin-bottom: 14px;
  background: #fff4ed; color: var(--warn); border: 1px solid #f9dbaf;
}
.alert.success {
  background: var(--accent-soft); color: var(--accent); border-color: #b7dfd0;
}
.alert.danger {
  background: #fef3f2; color: var(--danger); border-color: #fecdca;
}
.login-box {
  max-width: 420px; margin: 10vh auto; padding: 28px;
}
.mono { font-family: Consolas, "Courier New", monospace; font-size: 0.9rem; word-break: break-all; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .form-row { margin: 0; }
.filters input, .filters select { max-width: 180px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 700;
}
.badge.off { background: #f2f4f7; color: var(--muted); }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.hero h1 { margin-top: 8px; font-size: clamp(2rem, 6vw, 4rem); }
.status-list { display: grid; gap: 2px; }
.status-item {
  display: grid; grid-template-columns: 14px minmax(220px, 1fr) auto 50px;
  align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line);
}
.status-item:last-child { border-bottom: 0; }
.status-copy { display: flex; flex-direction: column; gap: 4px; }
.status-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); }
.status-dot.ok { background: #12b76a; box-shadow: 0 0 0 4px #d1fadf; }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 4px #fee4e2; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.docs-nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}
.docs-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}
.docs-nav a:hover { color: var(--ink); text-decoration: none; }
.docs-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
  width: 100%;
}
.docs-main { min-width: 0; }
.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.endpoint-head .path {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: 700;
}
.method {
  display: inline-block;
  min-width: 64px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}
.method.get { background: #2563eb; }
.method.post { background: #0f6e56; }
.method.delete { background: #b42318; }
.code {
  margin: 0 0 14px;
  padding: 14px 16px;
  overflow-x: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}
.code code { font: inherit; color: inherit; }
.endpoint h3 {
  margin: 18px 0 10px;
  font-size: 1rem;
}
.docs-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink);
  line-height: 1.7;
}
.docs-list li { margin-bottom: 6px; }

@media (max-width: 720px) {
  .kv { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero { align-items: flex-start; flex-direction: column; }
  .status-item { grid-template-columns: 14px 1fr auto; }
  .status-item > a { grid-column: 2; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; }
}
