:root {
    --porcelain: #edf3f2;
    --white: #f9fbfa;
    --navy: #142d37;
    --navy-2: #0b2029;
    --teal: #24717a;
    --signal: #42b7ad;
    --amber: #e8953f;
    --red: #d55345;
    --muted: #64767b;
    --line: #bed0ce;
    --dark-line: rgba(217, 237, 233, .19);
    --display: Bahnschrift, "Arial Narrow", "Microsoft YaHei", sans-serif;
    --body: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    --shadow: 0 24px 70px rgba(14, 40, 49, .13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--navy);
    background: var(--porcelain);
    font: 14px/1.55 var(--body);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.skip { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 9px 13px; color: white; background: var(--navy); transform: translateY(-150%); }
.skip:focus { transform: none; }

.site-header {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 11px clamp(18px, 4.2vw, 72px);
    border-bottom: 1px solid var(--line);
    background: rgba(237, 243, 242, .94);
    backdrop-filter: blur(14px);
}
.api-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.api-brand b, .api-brand small { display: block; }
.api-brand b { font: 700 15px/1.1 var(--mono); letter-spacing: .07em; }
.api-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.brand-node { position: relative; display: grid; width: 42px; height: 42px; place-items: center; border: 2px solid var(--navy); }
.brand-node::before { content: ""; position: absolute; width: 17px; height: 2px; background: var(--navy); }
.brand-node i { position: absolute; width: 7px; height: 7px; border: 2px solid var(--navy); border-radius: 50%; background: var(--porcelain); }
.brand-node i:first-child { left: 4px; }
.brand-node i:nth-child(2) { z-index: 1; }
.brand-node i:last-child { right: 4px; background: var(--amber); }
.site-header nav { display: flex; align-items: center; gap: clamp(10px, 2vw, 28px); }
.site-header nav a { color: var(--muted); font-size: 12px; text-decoration: none; }
.site-header nav a:hover { color: var(--navy); }

main { overflow: hidden; }
.portal-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
    gap: clamp(40px, 8vw, 130px);
    align-items: center;
    max-width: 1600px;
    min-height: 620px;
    margin: auto;
    padding: clamp(64px, 9vw, 130px) clamp(20px, 5vw, 84px);
}
.overline, .section-heading span, .route-overview header span, .curl-block header span, .response-contract header span, .response-panel > header span {
    color: var(--teal);
    font: 700 10px/1.2 var(--mono);
    letter-spacing: .17em;
}
.hero-main h1 { margin: 16px 0 22px; font: 700 clamp(52px, 7.4vw, 112px)/.9 var(--display); letter-spacing: -.065em; }
.hero-main h1 em { display: inline-block; color: var(--teal); font-style: normal; white-space: nowrap; }
.hero-copy { max-width: 700px; margin: 0; color: var(--muted); font-size: clamp(14px, 1.3vw, 18px); }
.base-address { display: grid; grid-template-columns: auto 1fr auto; align-items: center; max-width: 760px; margin-top: 42px; border: 1px solid var(--navy); background: var(--white); box-shadow: 8px 8px 0 var(--signal); }
.base-address + .base-address { margin-top: 14px; box-shadow: 8px 8px 0 var(--amber); }
.base-address > span { padding: 15px; border-right: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); letter-spacing: .14em; }
.base-address code { min-width: 0; overflow: hidden; padding: 15px; color: var(--navy); font: 12px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.base-address button { align-self: stretch; padding: 0 18px; border: 0; color: white; background: var(--navy); font-size: 12px; }

.route-overview { position: relative; padding: 24px; color: white; background: var(--navy); box-shadow: var(--shadow); }
.route-overview::after { content: "ROUTE"; position: absolute; right: -24px; bottom: -19px; color: rgba(20, 45, 55, .09); font: 800 76px var(--mono); letter-spacing: -.09em; pointer-events: none; }
.route-overview header { display: flex; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--dark-line); }
.route-overview header span { color: var(--signal); }
.route-overview header b { font: 10px var(--mono); }
.route-overview ol { position: relative; display: grid; gap: 0; margin: 18px 0; padding: 0; list-style: none; }
.route-overview ol::before { content: ""; position: absolute; top: 27px; bottom: 27px; left: 18px; width: 2px; background: var(--dark-line); }
.route-step { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 16px; align-items: center; min-height: 82px; }
.route-step i { z-index: 1; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: var(--signal); background: var(--navy); font: normal 11px var(--mono); }
.route-step.active i { color: var(--navy); border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 7px rgba(66, 183, 173, .1); }
.route-step strong, .route-step small { display: block; }
.route-step strong { font: 650 17px var(--display); }
.route-step small { margin-top: 3px; color: rgba(255,255,255,.55); font: 9px var(--mono); letter-spacing: .08em; }
.route-overview footer { display: flex; align-items: center; gap: 11px; padding-top: 17px; border-top: 1px solid var(--dark-line); }
.route-overview footer small, .route-overview footer strong { display: block; }
.route-overview footer small { color: rgba(255,255,255,.55); font-size: 9px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(232,149,63,.12); }
.health-dot.online { background: var(--signal); box-shadow: 0 0 0 5px rgba(66,183,173,.12); animation: beacon 1.8s ease-in-out infinite; }
.health-dot.offline { background: var(--red); }

.onboarding { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.onboarding article { display: grid; grid-template-columns: 42px 1fr; gap: 20px; min-height: 150px; align-items: center; padding: 30px clamp(20px, 4vw, 64px); border-right: 1px solid var(--line); }
.onboarding article:last-child { border-right: 0; }
.onboarding article > b { color: var(--amber); font: 12px var(--mono); }
.onboarding strong { font: 650 18px var(--display); }
.onboarding p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.onboarding code { color: var(--teal); font: 11px var(--mono); }

.console-section { padding: clamp(64px, 8vw, 112px) clamp(18px, 4.2vw, 72px); }
.console-section { background: #dce8e6; }
.section-heading { display: flex; justify-content: space-between; gap: 30px; max-width: 1600px; margin: 0 auto 28px; }
.section-heading h2 { margin: 7px 0 0; font: 700 clamp(31px, 4vw, 52px)/1 var(--display); letter-spacing: -.035em; }
.section-heading p { max-width: 480px; align-self: end; margin: 0; color: var(--muted); text-align: right; }

.api-console { display: grid; grid-template-columns: 250px minmax(390px, .9fr) minmax(390px, 1.1fr); width: 100%; max-width: 1600px; height: 860px; min-height: 0; margin: auto; border: 1px solid #809a9c; background: var(--white); box-shadow: var(--shadow); }
.endpoint-nav { min-width: 0; padding: 20px 14px; border-right: 1px solid var(--line); }
.endpoint-search span { display: block; margin: 0 6px 7px; color: var(--muted); font: 9px var(--mono); letter-spacing: .12em; }
.endpoint-search input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); color: var(--navy); background: transparent; outline: 0; }
.endpoint-list { display: grid; gap: 4px; max-height: 640px; margin-top: 18px; overflow: auto; }
.endpoint-group { margin: 16px 7px 4px; color: var(--muted); font: 9px var(--mono); letter-spacing: .14em; }
.endpoint-button { display: grid; grid-template-columns: 40px 1fr; gap: 7px; align-items: center; width: 100%; padding: 10px 8px; border: 0; color: var(--navy); background: transparent; text-align: left; }
.endpoint-button:hover { background: #e5efed; }
.endpoint-button.active { color: white; background: var(--teal); }
.endpoint-button b { color: var(--teal); font: 700 9px var(--mono); }
.endpoint-button.active b { color: #b9fff7; }
.endpoint-button span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.request-panel { min-width: 0; padding: clamp(24px, 3vw, 42px); overflow-y: auto; border-right: 1px solid var(--line); scrollbar-color: var(--line) transparent; }
.request-title { display: flex; align-items: center; gap: 14px; }
.method-badge { padding: 6px 9px; color: var(--navy); background: var(--signal); font: 800 10px var(--mono); }
.request-title h3 { margin: 0; font: 650 24px var(--display); }
.request-title code { display: block; margin-top: 2px; color: var(--teal); font: 11px var(--mono); }
.endpoint-description { min-height: 43px; margin: 14px 0 25px; color: var(--muted); }
#parameter-fields legend { color: var(--muted); font: 9px var(--mono); letter-spacing: .1em; }
#parameter-fields { display: grid; gap: 13px; margin: 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); }
#parameter-fields legend { padding: 0 10px 0 0; }
.param-field { display: grid; grid-template-columns: minmax(110px, .65fr) minmax(150px, 1fr); gap: 13px; align-items: center; }
.param-field label { min-width: 0; }
.param-field label strong { font: 600 12px var(--mono); }
.param-field .param-type { margin-left: 7px; padding: 2px 5px; color: var(--teal); background: #dfecea; font: 8px var(--mono); }
.param-field label i { margin-left: 5px; color: var(--red); font-style: normal; }
.param-field label small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.param-field input, .param-field select { min-width: 0; width: 100%; padding: 10px 11px; border: 1px solid var(--line); color: var(--navy); background: white; font: 11px var(--mono); }
.empty-params { padding: 20px; color: var(--muted); border: 1px dashed var(--line); text-align: center; font-size: 11px; }
.request-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 24px; }
.send-request { display: flex; min-width: 170px; align-items: center; justify-content: space-between; padding: 13px 15px; border: 0; color: white; background: var(--teal); font-weight: 700; }
.send-request i { font: normal 19px var(--mono); }
.send-request[disabled] { cursor: wait; opacity: .6; }
#request-hint { color: var(--muted); font: 9px var(--mono); }
.curl-block { margin-top: 32px; overflow: hidden; border: 1px solid var(--line); }
.curl-block header { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--porcelain); }
.curl-block header span { color: var(--teal); }
.curl-block button, .response-panel > header button { padding: 0; border: 0; color: var(--teal); background: transparent; font-size: 10px; }
.curl-block pre { min-height: 95px; max-height: 170px; margin: 0; padding: 14px; overflow: auto; color: #c9f0e9; background: var(--navy-2); font: 10px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.response-contract { margin-top: 24px; border-top: 3px solid var(--teal); background: #f2f7f6; }
.response-contract > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 15px 16px 13px; border: 1px solid var(--line); border-top: 0; }
.response-contract header span, .response-contract header h4 { display: block; }
.response-contract header h4 { margin: 4px 0 0; font: 650 16px var(--display); }
.response-contract header small { color: var(--muted); font: 8px var(--mono); letter-spacing: .08em; }
.response-fields { border-inline: 1px solid var(--line); }
.response-field { display: grid; grid-template-columns: minmax(125px, .72fr) 66px minmax(160px, 1.28fr); gap: 12px; align-items: start; min-height: 47px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.response-field code { color: var(--teal); font: 10px/1.45 var(--mono); overflow-wrap: anywhere; }
.response-field b { width: max-content; max-width: 66px; padding: 3px 6px; color: var(--navy); background: #d7e7e4; font: 8px/1.2 var(--mono); overflow-wrap: anywhere; }
.response-field p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.empty-response-fields { margin: 0; padding: 16px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; font-size: 11px; }

.response-panel { display: flex; min-width: 0; flex-direction: column; color: #d9ede9; background: var(--navy-2); }
.response-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--dark-line); }
.response-panel > header div { display: flex; align-items: center; gap: 12px; }
.response-panel > header span { color: var(--signal); }
.response-panel > header b { padding: 3px 7px; color: var(--navy-2); background: var(--amber); font: 800 9px var(--mono); }
.response-panel > header b.success { background: var(--signal); }
.response-panel > header b.error { color: white; background: var(--red); }
.response-panel > header button { color: #9acbc5; }
.response-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--dark-line); }
.response-metrics span { padding: 14px 18px; border-right: 1px solid var(--dark-line); }
.response-metrics span:last-child { border-right: 0; }
.response-metrics small, .response-metrics b { display: block; }
.response-metrics small { color: rgba(217,237,233,.48); font: 8px var(--mono); letter-spacing: .09em; }
.response-metrics b { margin-top: 4px; font: 12px var(--mono); }
#response-output { min-height: 0; flex: 1; max-width: 100%; margin: 0; padding: 24px; overflow: auto; font: 11px/1.68 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px clamp(18px,4.2vw,72px); color: var(--muted); background: var(--white); font: 9px var(--mono); }
.site-footer p { margin: 0; text-align: center; }
.site-footer a { color: var(--teal); }

.toast { position: fixed; z-index: 60; right: 22px; bottom: 22px; max-width: min(400px, calc(100vw - 44px)); padding: 13px 17px; color: white; background: var(--teal); box-shadow: var(--shadow); }
.toast.error { background: var(--red); }

@keyframes beacon { 50% { box-shadow: 0 0 0 9px rgba(66,183,173,0); } }

@media (max-width: 1160px) {
    .portal-hero { grid-template-columns: 1fr 340px; gap: 50px; }
    .api-console { grid-template-columns: 220px 1fr; height: auto; }
    .response-panel { grid-column: 1/-1; height: 500px; min-height: 0; border-top: 1px solid var(--line); }
    .request-panel { border-right: 0; }
}

@media (max-width: 820px) {
    .site-header nav a:first-child { display: none; }
    .portal-hero { grid-template-columns: 1fr; min-height: auto; }
    .route-overview { max-width: 520px; }
    .onboarding { grid-template-columns: 1fr; }
    .onboarding article { min-height: 110px; border-right: 0; border-bottom: 1px solid var(--line); }
    .section-heading { display: block; }
    .section-heading p { margin-top: 12px; text-align: left; }
    .api-console { display: block; }
    .endpoint-nav { border-right: 0; border-bottom: 1px solid var(--line); }
    .endpoint-list { display: flex; max-height: none; overflow-x: auto; }
    .endpoint-group { display: none; }
    .endpoint-button { min-width: 150px; }
    .site-footer { flex-direction: column; align-items: center; gap: 4px; }
}

@media (max-width: 520px) {
    .site-header { padding: 10px 14px; }
    .api-brand small { display: none; }
    .portal-hero { padding-inline: 16px; }
    .hero-main h1 { font-size: clamp(42px, 13vw, 58px); }
    .base-address { grid-template-columns: 1fr auto; }
    .base-address > span { grid-column: 1/-1; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .base-address code { padding: 12px; }
    .console-section { padding-inline: 12px; }
    .request-panel { padding: 22px 17px; }
    .param-field { grid-template-columns: 1fr; gap: 5px; }
    .param-field label small { white-space: normal; }
    .response-contract > header { align-items: start; }
    .response-contract header small { display: none; }
    .response-field { grid-template-columns: 1fr auto; }
    .response-field p { grid-column: 1/-1; }
    .response-metrics span { padding: 12px 10px; }
    #response-output { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
