:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e4e7ef;
  --text: #1a1d26;
  --muted: #5c6478;
  --accent: #f97316;
  --accent-soft: #fff7ed;
  --code-bg: #111827;
  --code-text: #e5e7eb;
  --get: #059669;
  --post: #2563eb;
  --put: #d97706;
  --patch: #7c3aed;
  --delete: #dc2626;
  --sidebar-width: 280px;
  --topbar-height: 56px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background: #eef1f6;
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--topbar-height);
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.92rem;
}

.topnav a {
  color: var(--muted);
}

.topnav a:hover {
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  max-height: calc(100vh - var(--topbar-height));
  overflow: auto;
  padding: 1.25rem 1rem 2rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar-section + .sidebar-section {
  margin-top: 1.75rem;
}

.sidebar h2 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-meta {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.anchor-list,
.endpoint-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.anchor-list a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.92rem;
}

.anchor-list a:hover,
.endpoint-link:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.category-block + .category-block {
  margin-top: 1rem;
}

.category-title {
  margin: 0 0 0.35rem;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.group-title {
  margin: 0.5rem 0 0.25rem;
  padding: 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.endpoint-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.endpoint-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.method-dot {
  flex-shrink: 0;
  width: 2.1rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0.15rem 0;
  border-radius: 4px;
  color: #fff;
}

.method-dot.GET { background: var(--get); }
.method-dot.POST { background: var(--post); }
.method-dot.PUT { background: var(--put); }
.method-dot.PATCH { background: var(--patch); }
.method-dot.DELETE { background: var(--delete); }

.content {
  padding: 2rem 2.5rem 3rem;
  max-width: 920px;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.doc-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.doc-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.doc-section ol,
.doc-section p {
  color: var(--text);
}

.code-block {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}

.code-block code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.error-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.error-table th,
.error-table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.error-table th {
  background: #f0f2f7;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.endpoint-detail {
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.back-link {
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.back-link:hover {
  text-decoration: underline;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.endpoint-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.method-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.method-badge.GET { background: var(--get); }
.method-badge.POST { background: var(--post); }
.method-badge.PUT { background: var(--put); }
.method-badge.PATCH { background: var(--patch); }
.method-badge.DELETE { background: var(--delete); }

.detail-summary {
  color: var(--muted);
  font-size: 1.02rem;
}

.detail-meta {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detail-meta dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.detail-meta dd {
  margin: 0.15rem 0 0;
}

.swagger-hint {
  color: var(--muted);
}

.detail-section {
  margin: 2rem 0;
}

.detail-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.param-table th,
.param-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.param-table th {
  background: #f0f2f7;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.param-table tr:last-child td {
  border-bottom: 0;
}

.required-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.required-pill.yes {
  background: #fee2e2;
  color: #b91c1c;
}

.required-pill.no {
  background: #ecfdf5;
  color: #047857;
}

.response-list {
  display: grid;
  gap: 1rem;
}

.response-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.response-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.88rem;
}

.status-pill .code {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  text-align: center;
  color: #fff;
  font-size: 0.78rem;
}

.status-pill .code.s2xx { background: var(--get); }
.status-pill .code.s4xx { background: #d97706; }
.status-pill .code.s5xx { background: var(--delete); }

.response-card p {
  margin: 0;
  padding: 0 1rem 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.response-card pre {
  margin: 0;
  border-radius: 0;
  border-top: 1px solid var(--border);
}

.curl-block {
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.loading,
.error {
  font-size: 0.9rem;
  color: var(--muted);
}

.error {
  color: #b91c1c;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: 1.5rem 1.25rem 2.5rem;
  }
}
