:root {
    --bg: #f4f7fb;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-muted: #eef3fb;
    --border: rgba(43, 64, 98, 0.14);
    --text: #11203a;
    --text-muted: #4d607f;
    --accent: #0f6cbd;
    --accent-strong: #0b4f91;
    --accent-soft: rgba(15, 108, 189, 0.12);
    --success: #087f5b;
    --shadow: 0 18px 40px rgba(17, 32, 58, 0.09);
    --radius: 20px;
    --container: 1120px;
}

[data-theme="dark"] {
    --bg: #09111f;
    --surface: rgba(12, 23, 40, 0.88);
    --surface-strong: #101d33;
    --surface-muted: #0d1729;
    --border: rgba(151, 174, 211, 0.16);
    --text: #edf4ff;
    --text-muted: #adc0df;
    --accent: #63b3ed;
    --accent-strong: #90cdf4;
    --accent-soft: rgba(99, 179, 237, 0.14);
    --success: #4ade80;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

[data-theme="dark"] html,
html[data-theme="dark"] {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 108, 189, 0.18), transparent 36%),
        radial-gradient(circle at top right, rgba(26, 163, 122, 0.12), transparent 28%),
        linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, white) 100%);
}

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

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

.site-shell {
    min-height: 100vh;
}

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(20px);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 76px;
}

.site-header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.site-header__feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.site-header__right {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.site-header__feature-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.site-brand__text {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.site-header__page {
    color: var(--text);
    font-weight: 900;
    font-size: 1.18rem;
    white-space: nowrap;
    padding-left: 0.9rem;
    letter-spacing: 0.01em;
}

.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;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
    padding: 0.15rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.breadcrumbs__link:hover,
.breadcrumbs__link:focus-visible {
    color: var(--accent);
}

.breadcrumbs__current {
    color: var(--text);
    font-weight: 700;
}

.breadcrumbs__separator {
    color: var(--text-muted);
}

.theme-toggle,
.button,
.copy-button,
.api-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.theme-toggle,
.button--secondary,
.copy-button {
    color: var(--text);
    background: var(--surface-muted);
    border-color: var(--border);
}

.button,
.button--primary,
.api-link {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: var(--shadow);
}

.theme-toggle:hover,
.button:hover,
.copy-button:hover,
.api-link:hover {
    transform: translateY(-1px);
}

.site-main {
    padding: 2.5rem 0 4rem;
}

.site-footer {
    padding: 2rem 0 3rem;
}

.site-footer__inner {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.site-footer__brand {
    margin: 0 0 0.35rem;
    font-weight: 800;
}

.site-footer__text,
.site-footer__meta {
    margin: 0;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: rgba(12, 20, 34, 0.92);
    color: #fff;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

@media (max-width: 820px) {
    .site-header__inner {
        flex-wrap: wrap;
        justify-content: center;
        padding: 1rem 0;
    }

    .site-header__left {
        justify-content: center;
    }

    .site-header__feature {
        justify-content: center;
    }

    .site-header__right {
        justify-content: center;
    }

    .site-header__page {
        padding-left: 0;
        border-left: 0;
    }
}
