:root {
    color-scheme: light;
    --bg: #f6f8fa;
    --grid: rgba(31, 35, 40, .035);
    --surface: #ffffff;
    --surface-alt: #f6f8fa;
    --text: #1f2328;
    --muted: #656d76;
    --border: #d0d7de;
    --border-strong: #afb8c1;
    --accent: #1a7f37;
    --accent-hover: #116329;
    --accent-soft: #dafbe1;
    --blue: #0969da;
    --danger: #cf222e;
    --danger-soft: #ffebe9;
    --code-bg: #0d1117;
    --code-surface: #161b22;
    --code-border: #30363d;
    --code-text: #e6edf3;
    --code-muted: #8b949e;
    --code-green: #7ee787;
    --code-blue: #79c0ff;
    --code-orange: #ffa657;
    --focus: rgba(9, 105, 218, .24);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1117;
    --grid: rgba(255, 255, 255, .025);
    --surface: #161b22;
    --surface-alt: #0d1117;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --border-strong: #484f58;
    --accent: #3fb950;
    --accent-hover: #56d364;
    --accent-soft: rgba(46, 160, 67, .16);
    --blue: #58a6ff;
    --danger: #ff7b72;
    --danger-soft: rgba(248, 81, 73, .12);
    --focus: rgba(88, 166, 255, .28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-width: 320px;
    margin: 0;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 28px 28px;
    font-family: ui-monospace, SFMono-Regular, "Cascadia Code", "Roboto Mono", Consolas, monospace;
    line-height: 1.55;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header,
main,
footer {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.brand-prompt { margin-right: 9px; color: var(--accent); }
.brand-domain { color: var(--muted); font-weight: 500; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-link {
    color: var(--blue);
    font-size: 13px;
    text-decoration: none;
}

.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.status-badge,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 11px;
}

.theme-toggle { cursor: pointer; }
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

.status-dot {
    width: 7px;
    height: 7px;
    background: #bf8700;
    border-radius: 50%;
}

.status-badge.is-online .status-dot { background: #2da44e; }
.status-badge.is-offline .status-dot { background: #cf222e; }

.hero {
    min-height: 650px;
    padding: 92px 0 82px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 72px;
}

.code-comment,
.syntax-muted { color: var(--muted); }

.code-comment {
    margin: 0 0 18px;
    font-size: 13px;
}

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

h1 {
    margin-bottom: 24px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: clamp(44px, 5.6vw, 72px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

h1 span { color: var(--accent); }

.hero-description {
    max-width: 670px;
    margin-bottom: 30px;
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 17px;
}

.hero-actions,
.form-actions,
.inline-actions,
.token-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.button,
.submit-button,
.ghost-button,
.danger-button,
.icon-button {
    min-height: 42px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.button.primary,
.submit-button {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.button.primary:hover,
.submit-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary,
.ghost-button,
.icon-button { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.secondary:hover,
.ghost-button:hover,
.icon-button:hover { border-color: var(--border-strong); }
.submit-button:disabled,
.ghost-button:disabled,
.icon-button:disabled { opacity: .55; cursor: wait; }

.feature-line {
    margin: 34px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    color: var(--muted);
    list-style: none;
    font-size: 11px;
}

.feature-line span { color: var(--accent); }

.terminal {
    overflow: hidden;
    color: var(--code-text);
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 10px;
}

.terminal-bar,
.panel-title {
    min-height: 46px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.terminal-bar { color: var(--code-muted); border-color: var(--code-border); }
.terminal-dots { color: #6e7681; letter-spacing: 3px; font-size: 8px; }
.terminal pre { margin: 0; padding: 26px 24px; overflow: auto; font: 12px/1.8 inherit; }
.syntax-method, .syntax-key { color: var(--code-blue); }
.syntax-string { color: var(--code-orange); }

.terminal-result {
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--code-muted);
    background: var(--code-surface);
    border-top: 1px solid var(--code-border);
    font-size: 10px;
}

.terminal-result strong { color: var(--code-green); }
.terminal-result span:last-child { margin-left: auto; }

.workflow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}

.workflow div {
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 12px;
    border-right: 1px solid var(--border);
}

.workflow div:last-child { border-right: 0; }
.workflow span { grid-row: 1 / 3; color: var(--accent); font-size: 12px; }
.workflow strong { font-size: 12px; }
.workflow small { color: var(--muted); font-size: 10px; }

.practice-section,
.learn-section { padding: 104px 0; }

.section-heading {
    margin-bottom: 30px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 48px;
}

.section-heading h2,
.profile-card h2 {
    margin-bottom: 0;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -.04em;
}

.section-heading > p {
    max-width: 520px;
    margin-bottom: 3px;
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
}

.practice-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 18px; }

.panel {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.panel-title { color: var(--muted); background: var(--surface-alt); }
.panel-state { color: var(--accent); font-size: 10px; }

.tabs {
    padding: 0 14px;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 12px 14px 10px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 12px;
}

.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { padding: 24px; }
form { display: grid; gap: 16px; }

label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
label > span, legend { color: var(--blue); }
label small, fieldset small { color: var(--muted); font-size: 10px; }

input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--text);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    font-size: 13px;
}

input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--focus); }

.captcha-fieldset {
    margin: 0;
    padding: 13px;
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.captcha-fieldset legend { padding: 0 6px; font-size: 11px; }
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-image-wrap {
    position: relative;
    width: 176px;
    height: 58px;
    overflow: hidden;
    background: #f6f8fa;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.captcha-image-wrap img { display: block; width: 176px; height: 58px; }
.captcha-image-wrap span { position: absolute; inset: 0; display: grid; place-items: center; color: #57606a; font-size: 10px; }
.icon-button { width: 42px; padding: 0; font-size: 18px; }

.verification-box { padding: 8px 0 2px; }
.verification-box h3 { margin-bottom: 8px; font: 700 24px ui-sans-serif, system-ui, sans-serif; }
.verification-box > p:not(.verification-mark) { color: var(--muted); font: 14px/1.55 ui-sans-serif, system-ui, sans-serif; }
.verification-mark { margin-bottom: 14px; color: var(--accent); font-size: 34px; font-weight: 800; }
.verification-box form { margin: 22px 0 14px; }
.verification-box input[name="code"] { letter-spacing: .4em; font-size: 20px; text-align: center; }

.text-button {
    padding: 0;
    color: var(--blue);
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 11px;
}
.text-button:hover { text-decoration: underline; }

.result-card { color: var(--code-text); background: var(--code-bg); border-color: var(--code-border); }
.result-card .panel-title { color: var(--code-muted); background: var(--code-surface); border-color: var(--code-border); }
.result-header div { display: grid; }
.result-header small { margin-top: 2px; color: var(--code-muted); font-size: 9px; text-transform: uppercase; }
.http-status { color: var(--code-muted); font-size: 10px; }
.http-status.is-success { color: var(--code-green); }
.http-status.is-error { color: #ff7b72; }
.result-card pre {
    min-height: 474px;
    max-height: 620px;
    margin: 0;
    padding: 22px;
    overflow: auto;
    color: #c9d1d9;
    font: 12px/1.75 inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

.profile-card { margin-bottom: 90px; }
.profile-content { padding: 26px; }
.profile-content h2 { margin-bottom: 24px; }
.profile-data { margin: 0 0 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profile-data div { min-width: 0; padding: 13px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; }
.profile-data dt { margin-bottom: 4px; color: var(--blue); font-size: 9px; }
.profile-data dd { margin: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 700; }
.token-row code { flex: 1; min-width: 180px; overflow: hidden; padding: 11px; color: var(--code-green); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 6px; text-overflow: ellipsis; white-space: nowrap; }
.danger-button { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

.learn-section { border-top: 1px solid var(--border); }
.scenario-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.scenario-grid article { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.scenario-grid span { display: inline-block; margin-bottom: 26px; color: var(--accent); font-size: 12px; font-weight: 800; }
.scenario-grid h3 { margin-bottom: 8px; font: 700 15px ui-sans-serif, system-ui, sans-serif; }
.scenario-grid p { margin: 0; color: var(--muted); font: 12px/1.55 ui-sans-serif, system-ui, sans-serif; }

footer {
    padding: 28px 0 36px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 10px;
}

footer p { margin: 0; }

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    max-width: min(390px, calc(100% - 36px));
    padding: 11px 14px;
    color: var(--code-text);
    background: var(--code-surface);
    border: 1px solid var(--code-border);
    border-radius: 7px;
    font-size: 11px;
}

@media (max-width: 900px) {
    .hero { min-height: auto; padding-top: 70px; grid-template-columns: 1fr; gap: 50px; }
    .terminal { max-width: 680px; }
    .practice-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: start; flex-direction: column; gap: 8px; }
    .profile-data, .scenario-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .site-header, main, footer { width: min(100% - 24px, 1120px); }
    .site-header { min-height: 62px; }
    .status-badge, #theme-label { display: none; }
    .header-actions { gap: 10px; }
    .hero { padding: 58px 0 64px; }
    h1 { font-size: 43px; }
    .hero-description { font-size: 15px; }
    .feature-line { display: grid; gap: 8px; }
    .terminal pre { padding: 20px 16px; font-size: 10px; }
    .terminal-result { align-items: flex-start; flex-direction: column; gap: 4px; }
    .terminal-result span:last-child { margin-left: 0; }
    .workflow { grid-template-columns: 1fr; }
    .workflow div { border-right: 0; border-bottom: 1px solid var(--border); }
    .workflow div:last-child { border-bottom: 0; }
    .practice-section, .learn-section { padding: 76px 0; }
    .tab-panel { padding: 18px; }
    .profile-data, .scenario-grid { grid-template-columns: 1fr; }
    .token-row { align-items: stretch; flex-direction: column; }
    footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

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