:root {
    color-scheme: dark;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    --canvas: #0b1014;
    --panel: #10171d;
    --raised: #151e25;
    --line: #2a343b;
    --text: #eef2f3;
    --muted: #a6b2bb;
    --orange: #ff9a46;
    --green: #9ce2ba;
    --mono: ui-monospace, "SF Mono", Consolas, monospace;
    background: var(--canvas);
    color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
p { margin-top: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.container { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; left: 1rem; top: 1rem; padding: .5rem 1rem; background: var(--panel); transform: translateY(-200%); z-index: 1; }
.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid #20292f; }
.nav-row, .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; }
.brand img { object-fit: contain; flex: none; }
nav { display: flex; gap: 1.9rem; align-items: center; }
nav a, .footer a { font-size: .875rem; color: var(--muted); }
nav a:hover, .footer a:hover { color: var(--text); }
nav .nav-account { border: 1px solid var(--line); border-radius: 6px; padding: .42rem .95rem; color: var(--text); }

.hero { display: grid; grid-template-columns: 1fr 1.17fr; gap: clamp(2rem, 5vw, 4.4rem); align-items: center; padding-block: 104px 96px; }
.platforms { display: flex; align-items: center; gap: .6rem; color: #bcc8cd; font: .875rem var(--mono); margin-bottom: 1.15rem; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
h1, h2, h3 { margin-top: 0; line-height: 1.22; letter-spacing: -.035em; }
h1 { margin-bottom: 1.25rem; font-size: clamp(2.65rem, 5.1vw, 4.25rem); }
h1 em { color: var(--orange); font-style: normal; }
.intro { max-width: 28rem; color: var(--muted); font-size: 1.08rem; margin-bottom: 1.7rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .68rem 1.15rem; min-height: 44px; border: 1px solid transparent; border-radius: 7px; font-size: .94rem; font-weight: 700; }
.primary { background: var(--orange); color: #201004; }
.primary:hover { background: #ffac65; }
.secondary { color: var(--text); border-color: #3a4851; background: #11191e; }
.secondary:hover { background: var(--raised); }
.button:disabled { opacity: .56; cursor: default; }

.terminal-preview { margin: 0; min-width: 0; background: #0e171e; border: 1px solid #35434c; border-radius: 13px; overflow: hidden; box-shadow: 0 20px 65px #0006, 0 0 70px #2a725313; }
.window-bar { display: grid; grid-template-columns: 1fr auto 1fr; background: #172027; padding: .8rem 1rem; align-items: center; color: #c5cfd2; font-size: .875rem; border-bottom: 1px solid #2a363d; }
.window-dots { display: inline-flex; gap: .34rem; }
.window-dots i { width: 8px; height: 8px; border-radius: 50%; background: #5f707a; }
.window-dots i:first-child { background: #cf755d; }
.window-dots i:nth-child(2) { background: #c8a25f; }
.window-dots i:last-child { background: #8caa83; }
.window-body { display: grid; grid-template-columns: 29% 1fr; min-height: 241px; }
.window-sidebar { padding: .9rem .6rem; background: #111b22; border-right: 1px solid #293840; }
.window-sidebar > p { padding-left: .5rem; font-size: .82rem; color: var(--muted); margin-bottom: .45rem; }
.preview-profile { display: flex; gap: .42rem; align-items: flex-start; padding: .52rem .4rem; border: 1px solid transparent; border-radius: 6px; color: #c1cdd2; font-size: .8rem; line-height: 1.4; }
.preview-profile.active { background: #1c2a33; border-color: #374754; }
.preview-profile small { color: #abbac3; font: .7rem var(--mono); display: block; margin-top: .22rem; }
.mini-prompt, .prompt { color: var(--green); font-family: var(--mono); }
.window-content { min-width: 0; }
.window-tab { display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; background: #142028; border-bottom: 1px solid #26363e; font: .77rem var(--mono); color: #ccd5d8; }
.terminal-lines { font: clamp(.67rem, 1.08vw, .83rem)/1.7 var(--mono); padding: 1rem .9rem; overflow-wrap: anywhere; color: #d8e3e6; }
.terminal-lines p { margin: 0 0 .38rem; }
.terminal-muted { color: #a4b3bc; }
.cursor { display: inline-block; width: .45rem; height: .9rem; vertical-align: text-bottom; background: var(--green); }
figcaption { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .85rem; background: #172027; border-top: 1px solid #2a363d; font-size: .82rem; color: #ccdadc; }

.feature-section, .api-section { background: #10161b; border-block: 1px solid #202a31; }
.features { padding-block: 58px 64px; }
h2 { font-size: clamp(1.7rem, 3.15vw, 2.55rem); margin-bottom: 1.2rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.feature-grid article { padding: 1.15rem 1.2rem; background: #141d23; border: 1px solid #2b373f; border-radius: 9px; }
.feature-icon { display: inline-grid; place-items: center; width: 35px; height: 35px; margin-bottom: .75rem; color: var(--orange); border: 1px solid #473628; background: #27221d; border-radius: 7px; font: 700 .94rem var(--mono); }
.feature-grid h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.feature-grid p, .section-copy p, details > p { color: var(--muted); margin-bottom: 0; }

.account-section, .api-layout { display: grid; grid-template-columns: .82fr 1.18fr; align-items: start; gap: clamp(2rem, 6vw, 5rem); padding-block: 76px; }
.section-copy p { max-width: 30rem; }
.section-copy p + p { margin-top: .85rem; }
.section-copy code, details > p code { color: #f4be90; font-family: var(--mono); }
.account-card { max-width: 480px; background: var(--panel); border: 1px solid #324049; border-radius: 10px; overflow: hidden; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #324049; background: var(--raised); }
.account-tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; padding: .65rem; font-weight: 650; }
.account-tabs button[aria-pressed="true"] { color: var(--text); border-color: var(--orange); }
.account-tabs button:focus-visible { outline-offset: -4px; }
.account-card form { display: grid; gap: .5rem; padding: 1.35rem 1.45rem .8rem; }
.account-card label { font-size: .9rem; font-weight: 650; }
.account-card input { min-height: 43px; width: 100%; border: 1px solid #42515b; border-radius: 6px; color: var(--text); padding: .5rem .7rem; background: #0b1217; }
.account-card label:not(:first-child) { margin-top: .25rem; }
.account-card input[aria-invalid="true"] { border-color: #ffb2a2; }
.account-password { position: relative; }
.account-password input { padding-inline-end: 4.5rem; }
.password-toggle {
    position: absolute;
    inset: 4px 4px 4px auto;
    min-width: 3.25rem;
    padding: 0 .35rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .875rem;
    cursor: pointer;
}
.password-toggle:hover:not(:disabled), .password-toggle[aria-pressed="true"] { background: #263441; color: var(--text); }
.account-confirmation:not([hidden]) { display: grid; gap: .5rem; margin-top: .25rem; }
.account-card input::placeholder { color: #8c9ba5; }
.account-card .primary { margin-top: .4rem; }
.field-hint, #account-status { margin: 0; font-size: .875rem; color: var(--muted); }
#account-status:not(:empty) { min-height: 1.4rem; }
#account-status[data-state="error"] { color: #ffb2a2; }
#account-status[data-state="success"] { color: var(--green); }

.api-panel { min-width: 0; }
details { background: #121b21; border: 1px solid #34414a; border-radius: 8px; }
details + details { margin-top: .6rem; }
summary { display: flex; align-items: center; gap: .65rem; min-height: 53px; padding: .7rem .9rem; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; line-height: 1; color: var(--muted); font-size: 1.15rem; }
details[open] summary::after { content: '−'; }
summary code { font: .83rem var(--mono); overflow-wrap: anywhere; }
.http-method { padding: .18rem .42rem; border-radius: 4px; background: #22392d; color: #b9eac9; font: 700 .75rem var(--mono); }
.http-status { margin-left: auto; font: .78rem var(--mono); color: #a9cebf; }
details > p { padding-inline: .9rem; font-size: .94rem; }
.code-block { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; padding: .75rem .9rem .9rem; }
.code-block button { align-self: flex-end; padding: .21rem .57rem; border-radius: 4px; border: 1px solid #475660; background: #1f2c35; color: #e0e7eb; font-size: .81rem; }
.code-block pre { margin: 0; border-radius: 6px; background: #080f14; color: #d1e3e7; padding: .85rem; font: .79rem/1.65 var(--mono); max-width: 100%; overflow-x: auto; }
.footer { border-top: 1px solid #222d34; }
.footer .brand { color: var(--text); }

@media (max-width: 870px) {
    .hero { grid-template-columns: 1fr 1.1fr; gap: 1.4rem; padding-block: 64px; }
    .window-body { grid-template-columns: 32% 1fr; }
    .terminal-lines { font-size: .69rem; }
    .account-section, .api-layout { gap: 2rem; }
}

@media (max-width: 690px) {
    .container { width: calc(100% - 36px); }
    .nav-row, .footer-row { min-height: 63px; }
    nav { gap: .8rem; }
    nav .nav-account { padding-inline: .6rem; }
    .brand { gap: .35rem; font-size: .94rem; }
    .hero, .account-section, .api-layout { grid-template-columns: 1fr; gap: 1.6rem; padding-block: 44px; }
    .features { padding-block: 40px; }
    .feature-grid { grid-template-columns: 1fr; gap: .72rem; }
    .window-body { min-height: 210px; }
    .account-card { max-width: none; }
}

@media (max-width: 365px) {
    .container { width: calc(100% - 26px); }
    nav { gap: .55rem; }
    .masthead .brand img { width: 24px; height: 24px; }
    .window-body { grid-template-columns: 1fr; min-height: 165px; }
    .window-sidebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
