:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef5f0;
  --ink: #101712;
  --muted: #5f6b63;
  --line: #d9e1dc;
  --line-strong: #b8c7bf;
  --green: #067a46;
  --green-dark: #045d36;
  --blue: #1957b8;
  --amber: #a86400;
  --red: #b42318;
  --shadow: 0 18px 45px rgba(16, 24, 18, 0.08);
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfcf8 0%, var(--bg) 52%, #eef2ef 100%);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

code,
pre,
.brand-mark,
.eyebrow,
.section-label,
.status-pill,
.field-label,
.summary-label,
.client-ip,
.chip {
  font-family: var(--mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green);
  color: var(--green);
  background: #f0faf4;
  font-size: 13px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 10px;
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-2);
}

.lookup-band,
.result-band,
.docs-band,
.database-band {
  padding: 32px max(18px, calc((100vw - 1180px) / 2));
}

.lookup-band {
  padding-top: 42px;
  border-bottom: 1px solid var(--line);
}

.lookup-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.intro {
  max-width: 900px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: 0;
}

.lead {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
  width: min(100%, 840px);
}

.lookup-form input {
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  outline: none;
}

.lookup-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 122, 70, 0.14);
}

.icon-button,
.line-button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.icon-button:hover,
.line-button:hover,
.chip:hover {
  border-color: var(--green);
  background: #f3faf6;
}

.icon-button:active,
.line-button:active,
.chip:active {
  transform: translateY(1px);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
}

.lookup-form .icon-button {
  width: 54px;
  height: 54px;
}

.icon-button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.icon-button.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.result-panel,
.side-panel,
.endpoint-row,
.code-sample,
.meta-grid > div {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-panel,
.side-panel,
.code-sample {
  border-radius: 8px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.section-heading h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f5;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.status-pill.ready {
  color: var(--green);
  border-color: #b7d9c5;
  background: #ecf8f0;
}

.status-pill.error {
  color: var(--red);
  border-color: #f1bbb6;
  background: #fff2f0;
}

.status-pill.loading {
  color: var(--amber);
  border-color: #e7cf9d;
  background: #fff8e8;
}

.result-root {
  min-height: 220px;
  padding: 20px;
}

.result-block + .result-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.summary-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.result-summary h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.result-summary h3 span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: #f1f6ff;
  font-size: 11px;
}

.field-grid,
.raw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-bottom: 0;
}

.field-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.field-row:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.field-label {
  color: var(--muted);
  font-size: 12px;
}

.field-value {
  min-width: 0;
  font-family: var(--mono);
  word-break: break-word;
}

.muted {
  color: #9aa59d;
}

.raw-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.raw-details summary {
  padding: 12px 14px;
  color: var(--blue);
  cursor: pointer;
}

.raw-details .raw-grid {
  border-left: 0;
  border-right: 0;
}

.error-box {
  padding: 16px;
  border: 1px solid #f1bbb6;
  border-radius: 6px;
  background: #fff2f0;
  color: var(--red);
}

.loading-line {
  height: 16px;
  width: 80%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e7eee9, #f8fbf9, #e7eee9);
  background-size: 200% 100%;
  animation: loading 1.1s linear infinite;
}

.loading-line.short {
  width: 46%;
  margin-top: 12px;
}

@keyframes loading {
  to {
    background-position: -200% 0;
  }
}

.side-panel {
  padding: 20px;
}

.client-ip {
  margin: 10px 0 14px;
  font-size: 22px;
  line-height: 1.2;
  word-break: break-word;
}

.line-button {
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
}

.line-button svg {
  width: 17px;
  height: 17px;
}

.mini-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.side-copy,
.database-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.docs-band,
.database-band {
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 18px;
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px 10px 8px 16px;
  border-radius: 6px;
}

.endpoint-row code {
  min-width: 0;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.code-sample {
  margin: 16px 0 0;
  padding: 18px;
  overflow-x: auto;
  color: #d9f7e7;
  background: #102017;
}

.code-sample code {
  font-size: 13px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.meta-grid > div {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border-radius: 6px;
}

.meta-grid span {
  color: var(--muted);
  font-size: 13px;
}

.meta-grid strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px max(18px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.copied {
  color: var(--green);
  border-color: var(--green);
  background: #ecf8f0;
}

@media (max-width: 900px) {
  .topbar {
    position: static;
  }

  .nav {
    display: none;
  }

  h1 {
    font-size: 38px;
  }

  .lead {
    font-size: 16px;
  }

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

  .field-grid,
  .raw-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .field-row:nth-child(odd) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .lookup-band,
  .result-band,
  .docs-band,
  .database-band {
    padding-left: 14px;
    padding-right: 14px;
  }

  .lookup-form {
    grid-template-columns: minmax(0, 1fr) 50px;
  }

  .lookup-form input,
  .lookup-form .icon-button {
    height: 50px;
  }

  .lookup-form .icon-button {
    width: 50px;
  }

  .panel-head,
  .result-summary,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
