:root {
  color-scheme: light;
  --page: #f5f7fa;
  --surface: #ffffff;
  --text: #171c27;
  --muted: #687386;
  --faint: #8c96a8;
  --border: #dce2ea;
  --border-strong: #cbd3df;
  --blue: #145df5;
  --blue-dark: #0c4bd5;
  --blue-soft: #edf3ff;
  --green: #12a85a;
  --green-soft: #ecf9f1;
  --red: #d92d20;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.035);
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(20, 93, 245, 0.2);
  outline-offset: 2px;
}

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

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

.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;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.topnav {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #3d4655;
  cursor: pointer;
  font-size: 15px;
  font-weight: 620;
}

.nav-link::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: "";
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--blue);
}

.nav-link.is-active::after {
  background: var(--blue);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  align-self: center;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.menu-button svg {
  width: 27px;
  height: 27px;
}

.shell {
  width: min(1480px, calc(100% - 48px));
  margin: 28px auto 34px;
}

.surface {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.connection-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.15fr) minmax(310px, 0.9fr);
  gap: 26px;
  align-items: end;
  padding: 22px 24px;
}

.connection-fields-group {
  display: contents;
}

.connection-fields-group > h2 {
  display: none;
}

.connection-field label {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 14px;
  font-weight: 570;
}

.connection-field label span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 450;
}

.input-shell {
  display: flex;
  min-height: 48px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(20, 93, 245, 0.1);
}

.input-shell input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.input-shell input::placeholder {
  color: #9aa4b3;
  font-family: var(--font-sans);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #596478;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--blue);
}

.copy-button {
  height: 38px;
  margin-right: 5px;
  padding: 0 15px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.copy-button:hover {
  background: var(--blue-soft);
}

.service-health {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-left: 26px;
  border-left: 1px solid var(--border);
}

.health-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 17px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #a2aab7;
  box-shadow: 0 0 0 4px rgba(162, 170, 183, 0.12);
}

.status-dot.is-online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(18, 168, 90, 0.11);
}

.status-dot.is-offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.1);
}

.service-health p {
  margin: 7px 0 1px;
  color: var(--muted);
  font-size: 13px;
}

.service-health small {
  color: var(--faint);
  font-size: 12px;
}

.outline-button,
.primary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.outline-button {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: #4a5568;
}

.outline-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 7px rgba(20, 93, 245, 0.18);
}

.primary-button:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 18px;
  margin-top: 18px;
}

.workspace-grid > *,
.examples-panel,
.code-frame {
  min-width: 0;
  max-width: 100%;
}

.accounts-panel,
.examples-panel {
  min-height: 486px;
  padding: 20px 22px 22px;
}

.section-heading {
  display: flex;
  min-height: 76px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2,
.endpoints-panel h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.section-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.section-actions .primary-button,
.section-actions .outline-button {
  width: 100%;
}

.section-actions svg,
.examples-heading svg {
  width: 18px;
  height: 18px;
}

.account-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.account-table-head {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.9fr 0.5fr;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  color: #566174;
  font-size: 12px;
  font-weight: 650;
}

.empty-state {
  display: flex;
  min-height: 276px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: #f2f4f7;
  color: #8b95a6;
}

.empty-icon svg {
  width: 29px;
  height: 29px;
}

.empty-state strong {
  font-size: 17px;
}

.empty-state p {
  max-width: 390px;
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state.is-ready .empty-icon {
  background: var(--green-soft);
  color: var(--green);
}

.management-note {
  margin: 13px 2px 0;
  color: var(--faint);
  font-size: 12px;
}

.examples-heading {
  min-height: 54px;
  align-items: flex-start;
}

.code-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 7px 7px 0 0;
  scrollbar-width: none;
}

.code-tabs::-webkit-scrollbar {
  display: none;
}

.code-tab {
  position: relative;
  min-width: 82px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #fafbfc;
  color: #596478;
  cursor: pointer;
  font-size: 13px;
  font-weight: 580;
  white-space: nowrap;
}

.code-tab:last-child {
  border-right: 0;
}

.code-tab.is-active {
  background: #fff;
  color: var(--blue);
  font-weight: 690;
}

.code-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--blue);
  content: "";
}

.code-frame {
  height: 322px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  background: #fbfcfe;
}

.code-frame pre {
  min-width: 570px;
  margin: 0;
  padding: 20px 22px;
  color: #222a36;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
}

.code-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

code {
  font-family: var(--font-mono);
}

.code-note code,
.endpoint-details code {
  color: var(--blue-dark);
  font-size: 0.95em;
}

.endpoints-panel {
  margin-top: 18px;
  padding: 16px 22px 18px;
}

.endpoints-panel h2 {
  margin-bottom: 12px;
}

.endpoint-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.endpoint-item + .endpoint-item {
  border-top: 1px solid var(--border);
}

.endpoint-summary {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: 82px minmax(190px, 0.72fr) minmax(200px, 0.92fr) minmax(250px, 1.2fr) 24px;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border: 0;
  background: white;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.endpoint-summary:hover {
  background: #fafcff;
}

.endpoint-summary > code {
  color: #283246;
  font-size: 13px;
}

.endpoint-summary > svg {
  width: 17px;
  height: 17px;
  justify-self: end;
  color: #667085;
  transition: transform 180ms ease;
}

.endpoint-summary[aria-expanded="true"] > svg {
  transform: rotate(90deg);
}

.method {
  display: inline-flex;
  width: 58px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 720;
}

.method-get {
  background: var(--green-soft);
  color: #078242;
}

.method-post {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.endpoint-name {
  color: #485366;
  font-size: 13px;
  font-weight: 580;
}

.endpoint-description {
  color: var(--muted);
  font-size: 12px;
}

.endpoint-details {
  display: none;
  padding: 12px 28px 18px 110px;
  border-top: 1px solid #edf0f4;
  background: #fafcff;
  color: var(--muted);
  font-size: 13px;
}

.endpoint-summary[aria-expanded="true"] + .endpoint-details {
  display: block;
}

.endpoint-details p {
  margin: 0;
}

.endpoint-details dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.endpoint-details dl div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
}

.endpoint-details dt,
.endpoint-details dd {
  margin: 0;
}

.footer {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(30px, calc((100% - 1480px) / 2 + 24px));
  border-top: 1px solid var(--border);
  background: white;
  color: var(--faint);
  font-size: 12px;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-status .status-dot {
  width: 7px;
  height: 7px;
  flex-basis: 7px;
  box-shadow: none;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  transform: translateY(16px);
  padding: 11px 15px;
  border: 1px solid #c7ead5;
  border-radius: 8px;
  background: #f0fbf4;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.13);
  color: #08783e;
  font-size: 13px;
  font-weight: 620;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .connection-panel {
    grid-template-columns: 1fr 1fr;
  }

  .service-health {
    grid-column: 1 / -1;
    min-height: 64px;
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

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

  .accounts-panel,
  .examples-panel {
    min-height: auto;
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 70px;
    padding: 0 18px;
  }

  .brand {
    font-size: 19px;
  }

  .menu-button {
    display: grid;
  }

  .topnav {
    position: absolute;
    top: 70px;
    right: 12px;
    left: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.14);
  }

  .topnav.is-open {
    display: flex;
  }

  .nav-link {
    min-height: 46px;
    justify-content: flex-start;
    border-radius: 7px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link.is-active {
    background: var(--blue-soft);
  }

  .shell {
    width: min(100% - 24px, 720px);
    margin-top: 16px;
  }

  .connection-panel {
    display: flex;
    grid-template-columns: none;
    flex-direction: column;
    gap: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .connection-fields-group {
    display: flex;
    flex-direction: column;
    order: 2;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .connection-fields-group > h2 {
    display: block;
    margin: 0;
    font-size: 20px;
    font-weight: 720;
    letter-spacing: -0.025em;
  }

  .service-health {
    order: 1;
    grid-column: auto;
    min-height: 82px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .section-heading {
    min-height: auto;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .section-actions {
    width: 100%;
    flex-direction: column;
  }

  .section-actions .primary-button,
  .section-actions .outline-button {
    width: 100%;
  }

  .accounts-panel,
  .examples-panel,
  .endpoints-panel {
    padding: 18px;
  }

  .account-table-head {
    display: none;
  }

  .accounts-panel {
    display: flex;
    flex-direction: column;
  }

  .accounts-panel .section-heading {
    display: contents;
  }

  .accounts-panel .section-heading h2 {
    order: 1;
    margin-bottom: 10px;
  }

  .accounts-panel .account-table {
    order: 2;
    border: 0;
  }

  .accounts-panel .section-actions {
    order: 3;
    margin-top: 14px;
  }

  .accounts-panel .management-note {
    order: 4;
  }

  .accounts-panel .empty-state {
    min-height: auto;
    align-items: flex-start;
    padding: 0;
    text-align: left;
  }

  .accounts-panel .empty-icon,
  .accounts-panel .empty-state .primary-button {
    display: none;
  }

  .accounts-panel .empty-state p {
    margin: 5px 0 0;
  }

  .examples-panel {
    display: flex;
    flex-direction: column;
  }

  .examples-panel .examples-heading {
    display: contents;
  }

  .examples-panel .examples-heading h2 {
    order: 1;
    margin-bottom: 14px;
  }

  .examples-panel .code-tabs {
    order: 2;
  }

  .examples-panel .code-frame {
    order: 3;
  }

  .examples-panel #copy-code {
    order: 4;
    width: 100%;
    margin-top: 10px;
  }

  .examples-panel .code-note {
    order: 5;
  }

  .endpoint-summary {
    grid-template-columns: 66px minmax(0, 1fr) 20px;
    gap: 10px;
    min-height: 62px;
  }

  .endpoint-name,
  .endpoint-description {
    display: none;
  }

  .endpoint-details {
    padding: 14px 16px 18px;
  }

  .endpoint-details dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .footer {
    padding: 0 18px;
  }
}

@media (max-width: 520px) {
  .connection-field label span {
    display: none;
  }

  .service-health {
    align-items: flex-start;
  }

  .service-health .outline-button {
    min-width: 44px;
    padding: 0 11px;
    font-size: 0;
  }

  .service-health .outline-button svg {
    width: 20px;
    height: 20px;
  }

  .code-frame {
    height: 312px;
  }

  .code-frame pre {
    padding: 17px;
  }

  .footer > span:first-child {
    display: none;
  }

  .footer {
    justify-content: center;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
