* { box-sizing: border-box; }
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1d212b;
  --border: #2a2f3a;
  --text: #e6e9ef;
  --muted: #9aa3b2;
  --accent: #4f9cf0;
  --accent-2: #6c7cff;
  --ok: #34c98e;
  --err: #ef5f6b;
  --code-bg: #0b0d11;
}
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand .logo { color: var(--accent-2); font-size: 18px; }
.brand .name { font-size: 17px; letter-spacing: .3px; }
.brand .tag { color: var(--muted); font-size: 13px; font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px; font-size: 13px; color: var(--ok);
}
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 14px; padding: 4px 6px; }
.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.hidden { display: none !important; }

.layout { display: flex; min-height: calc(100vh - 55px); }
.sidebar { width: 260px; background: var(--panel); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 55px; height: calc(100vh - 55px); overflow-y: auto; }
.nav-group { margin-bottom: 22px; }
.nav-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 6px 10px; }
.nav-item { display: block; padding: 7px 12px; border-radius: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.nav-item:hover { background: var(--panel-2); text-decoration: none; }
.nav-item.active { background: linear-gradient(90deg, rgba(79,156,240,.22), rgba(108,124,255,.14)); color: #fff; }

.content { flex: 1; padding: 30px 48px; max-width: 980px; overflow: auto; }
.content h1 { font-size: 26px; margin: 0 0 8px; }
.content h2 { font-size: 19px; margin: 30px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.content h3 { font-size: 15px; color: var(--accent); margin: 18px 0 6px; }
.content p.lead { color: var(--muted); font-size: 15px; }
.content .muted { color: var(--muted); }

.method { display: inline-block; padding: 3px 10px; border-radius: 6px; font-weight: 700; font-size: 12px; letter-spacing: .5px; margin-right: 10px; }
.method.GET { background: rgba(52,201,142,.18); color: var(--ok); }
.method.POST { background: rgba(79,156,240,.2); color: var(--accent); }
.method.DELETE { background: rgba(239,95,107,.2); color: var(--err); }
.method.PATCH { background: rgba(220,176,60,.2); color: #dcb03c; }

.path { font-family: "SFMono-Regular", Consolas, monospace; color: #fff; }
table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td code, .code-inline { font-family: "SFMono-Regular", Consolas, monospace; color: var(--accent); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 5px; }
.badge.req { background: rgba(239,95,107,.18); color: var(--err); }
.badge.opt { background: rgba(154,163,178,.18); color: var(--muted); }

pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px;
}
pre code { color: #d6dde9; }
pre .c { color: #6b7488; }
pre .k { color: #7aa2f7; }
pre .s { color: #9ece6a; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin: 18px 0; }
.card.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; color: var(--accent); }

.try { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 14px; }
.try .row { display: flex; gap: 12px; align-items: flex-start; }
.try textarea { flex: 1; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 10px; font-family: Consolas, monospace; font-size: 13px; min-height: 120px; resize: vertical; }
.try button { margin-top: 8px; }
.resp { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; font-family: Consolas, monospace; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.resp.ok { border-color: rgba(52,201,142,.5); }
.resp.err { border-color: rgba(239,95,107,.6); }

.note { border-left: 3px solid var(--accent); background: rgba(79,156,240,.08); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 14px; }
.note.warn { border-color: #dcb03c; background: rgba(220,176,60,.08); }
.note.err { border-color: var(--err); background: rgba(239,95,107,.08); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px 28px; width: 360px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-box label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.modal-box input { width: 100%; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 9px 11px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
