:root {
  color-scheme: dark;
  --bg: #0b0c12;
  --panel: #11131d;
  --panel-2: #171a26;
  --panel-3: #1f2332;
  --text: #f6f7fb;
  --muted: #a9adba;
  --subtle: #777d90;
  --line: #2a2f42;
  --line-strong: #3b4158;
  --accent: #74d8cc;
  --accent-2: #f0b35a;
  --danger: #ff8a73;
  --green: #77d799;
  --blue: #8eb7ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Source Sans Pro", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.product-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 260px auto auto minmax(320px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 0 22px;
  background: rgba(11, 12, 18, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
}

.brand small,
.muted,
.hero-text,
.doc-section p,
.response-block p {
  color: var(--muted);
  line-height: 1.65;
}

.brand small {
  display: block;
  font-size: 12px;
}

.product-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-nav a,
.toc a {
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
}

.product-nav a:hover,
.toc a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.language-option {
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
}

.language-option[aria-pressed="true"] {
  color: #06100f;
  background: var(--accent);
}

.language-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px;
  gap: 10px;
}

.search-box,
.method-box {
  display: grid;
  gap: 4px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.search-box input,
.method-box select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.load-status {
  max-width: 220px;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.load-status[data-tone="success"] {
  color: var(--green);
  border-color: rgba(119, 215, 153, 0.35);
}

.load-status[data-tone="danger"] {
  color: var(--danger);
  border-color: rgba(255, 138, 115, 0.35);
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 250px;
  gap: 0;
  min-height: calc(100vh - 72px);
}

.left-rail,
.right-rail {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow: auto;
  background: var(--panel);
}

.left-rail {
  border-right: 1px solid var(--line);
}

.right-rail {
  padding: 22px 18px;
  border-left: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 14px;
  font-size: 25px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.fact-card,
.server-row,
.response-block,
.loading-panel,
.empty-state {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.doc-nav {
  padding: 14px;
}

.nav-group {
  margin-top: 16px;
}

.nav-group-title {
  margin: 0 0 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-item {
  display: grid;
  width: 100%;
  gap: 3px;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}

.nav-item small {
  overflow-wrap: anywhere;
  color: var(--subtle);
  font-size: 12px;
}

.main-content {
  min-width: 0;
  padding: 34px min(5vw, 72px);
}

.doc-hero,
.operation-hero,
.doc-section {
  max-width: 1050px;
  margin: 0 auto 22px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.doc-hero {
  padding: 38px;
}

.doc-hero.compact {
  padding: 30px;
}

.hero-text {
  max-width: 820px;
  font-size: 17px;
  white-space: pre-line;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.fact-card {
  padding: 15px;
}

.fact-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--subtle);
}

.fact-card strong {
  overflow-wrap: anywhere;
}

.step-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 12px 0;
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #06100f;
  background: var(--accent);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.server-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.server-row {
  display: grid;
  gap: 6px;
  padding: 12px;
}

code,
.field-path {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.server-row code,
.operation-path {
  overflow-wrap: anywhere;
  color: var(--accent);
}

.operation-hero {
  position: relative;
}

.method {
  display: inline-grid;
  min-width: 58px;
  min-height: 28px;
  margin-bottom: 14px;
  place-items: center;
  color: #07100e;
  font-size: 12px;
  font-weight: 900;
  border-radius: 5px;
}

.method-post {
  background: var(--accent);
}

.method-get {
  background: var(--green);
}

.method-put,
.method-patch {
  background: var(--accent-2);
}

.method-delete {
  background: var(--danger);
}

.security-note {
  display: inline-block;
  padding: 7px 10px;
  margin: 8px 0 0;
  border-radius: 999px;
  font-weight: 700;
}

.security-note.signed {
  color: var(--accent);
  background: rgba(116, 216, 204, 0.1);
}

.security-note.public {
  color: var(--blue);
  background: rgba(142, 183, 255, 0.1);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-table,
.catalog-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 14px;
}

.field-table th,
.field-table td,
.catalog-table th,
.catalog-table td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.field-table th,
.catalog-table th {
  color: var(--subtle);
  background: var(--panel-2);
  font-size: 12px;
  text-transform: uppercase;
}

.field-table td,
.catalog-table td {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.field-table tr:last-child td,
.catalog-table tr:last-child td {
  border-bottom: 0;
}

.field-path {
  color: var(--text);
}

.field-name {
  display: inline-flex;
  min-height: 24px;
  max-width: 100%;
  gap: 7px;
  align-items: center;
  padding-left: calc(var(--field-depth, 0) * 22px);
  color: var(--text);
  font-weight: 700;
  position: relative;
}

.field-name::before {
  position: absolute;
  left: calc((var(--field-depth, 0) * 22px) - 14px);
  color: var(--line-strong);
  content: "";
}

.field-path[style*="--field-depth: 1"] .field-name::before,
.field-path[style*="--field-depth: 2"] .field-name::before,
.field-path[style*="--field-depth: 3"] .field-name::before,
.field-path[style*="--field-depth: 4"] .field-name::before,
.field-path[style*="--field-depth: 5"] .field-name::before {
  content: "└";
}

.field-toggle,
.field-toggle-spacer {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.field-toggle {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  background: rgba(116, 216, 204, 0.08);
  border: 1px solid rgba(116, 216, 204, 0.34);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.field-toggle:hover,
.field-toggle:focus-visible {
  color: #06100f;
  background: var(--accent);
  outline: 0;
}

.field-toggle-spacer {
  display: inline-block;
}

.field-parent {
  display: block;
  padding-left: calc(var(--field-depth, 0) * 22px);
  margin-top: 3px;
  color: var(--subtle);
  font-size: 12px;
}

.catalog-table {
  min-width: 980px;
}

.catalog-path {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.catalog-description {
  min-width: 320px;
  white-space: normal;
  line-height: 1.6;
}

.code-wrap {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.code-label {
  padding: 8px 12px;
  color: var(--subtle);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.code-block {
  max-height: 420px;
  padding: 16px;
  margin: 0;
  overflow: auto;
  color: #f6f7fb;
  background: #07080d;
}

.code-block code {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

.response-block {
  padding: 18px;
  margin: 14px 0;
}

.tool-steps {
  margin-bottom: 22px;
}

.doc-section h3 {
  margin-top: 24px;
}

.empty-inline {
  color: var(--subtle);
}

.rule-line {
  padding-left: 14px;
  border-left: 3px solid var(--line-strong);
}

.toc {
  display: grid;
  gap: 4px;
  margin-bottom: 24px;
}

.download-panel {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.loading-panel,
.empty-state {
  max-width: 860px;
  padding: 28px;
  margin: 0 auto;
}

@media (max-width: 1180px) {
  .product-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px 18px;
  }

  .toolbar {
    grid-template-columns: 1fr 130px;
  }

  .shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .left-rail,
  .right-rail {
    position: static;
    height: auto;
  }

  .left-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .doc-nav {
    max-height: 360px;
    overflow: auto;
  }

  .main-content {
    padding: 18px;
  }

  .doc-hero,
  .operation-hero,
  .doc-section {
    padding: 20px;
  }

  .fact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .toolbar,
  .fact-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
