:root {
    --bg: #edf2ff;
    --bg-soft: #f8faff;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-soft: #425466;
    --line: #dbe4ff;
    --brand: #1d4ed8;
    --brand-strong: #1e3a8a;
    --accent: #ef4444;
    --accent-2: #06b6d4;
    --ok: #10b981;
    --radius-lg: 22px;
    --radius-md: 14px;
    --shadow: 0 18px 40px rgba(30, 58, 138, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% -10%, rgba(29, 78, 216, 0.2), transparent 40%),
        radial-gradient(circle at 95% 0%, rgba(239, 68, 68, 0.14), transparent 36%),
        var(--bg);
    line-height: 1.72;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.45);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 10px;
    z-index: 120;
    background: #0f172a;
    color: #fff;
    padding: 7px 11px;
    border-radius: 8px;
}

.skip-link:focus {
    left: 12px;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transform-origin: left;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--brand), var(--accent-2), var(--accent));
    z-index: 120;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(248, 250, 255, 0.87);
    border-bottom: 1px solid rgba(219, 228, 255, 0.95);
    backdrop-filter: blur(10px);
}

.header-accent {
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent-2), var(--accent));
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 0;
}

.site-branding {
    min-width: 240px;
}

.site-title {
    display: inline-block;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #0b1324;
}

.site-title:hover {
    color: var(--brand);
}

.site-tagline {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0;
    display: none;
}

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    color: #1e293b;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
}

.site-nav a:hover {
    border-color: #bfdbfe;
    color: var(--brand);
}

.site-nav li.is-active a {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--accent-2));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.header-cta:hover {
    color: #fff;
    filter: brightness(1.06);
}

.content {
    padding: 42px 0 62px;
}

.breadcrumbs {
    margin: 0 0 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--ink-soft);
}

.breadcrumbs a {
    color: var(--ink-soft);
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.breadcrumbs .sep {
    color: #94a3b8;
}

.home-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    background:
        linear-gradient(150deg, rgba(29, 78, 216, 0.08), rgba(6, 182, 212, 0.06)),
        var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid #d7e3ff;
    padding: 34px;
    box-shadow: var(--shadow);
}

.hero-kicker,
.page-kicker,
.card-kicker,
.step-no,
.topic-label {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 800;
    color: var(--accent);
}

.home-hero h1 {
    margin: 10px 0 12px;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 46px;
    line-height: 1.15;
    color: #0f172a;
}

.hero-subtitle {
    margin: 0 0 18px;
    max-width: 630px;
    color: var(--ink-soft);
    font-size: 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #fff;
}

.btn-primary:hover {
    color: #fff;
    filter: brightness(1.05);
}

.btn-outline {
    background: #fff;
    color: var(--brand);
    border: 1px solid #bfdbfe;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-panel {
    background:
        linear-gradient(165deg, rgba(29, 78, 216, 0.95), rgba(15, 23, 42, 0.97));
    color: #dbeafe;
    border-radius: var(--radius-md);
    padding: 20px;
}

.hero-panel h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 17px;
}

.hero-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 11px;
}

.hero-panel li {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.hero-panel span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #1e3a8a;
    font-weight: 800;
    font-size: 11px;
}

.home-track {
    margin-top: 24px;
}

.home-track h2,
.home-sections h2 {
    margin: 0 0 14px;
    font-size: 29px;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    color: #0f172a;
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.track-grid article,
.topic-card,
.article-card {
    background: var(--surface);
    border: 1px solid #dbe4ff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.track-grid article {
    padding: 18px;
}

.track-grid article:nth-child(1) {
    border-top: 4px solid var(--brand);
}

.track-grid article:nth-child(2) {
    border-top: 4px solid var(--ok);
}

.track-grid article:nth-child(3) {
    border-top: 4px solid var(--accent);
}

.track-grid h3 {
    margin: 8px 0 8px;
    font-size: 21px;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.track-grid p {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.home-sections {
    margin-top: 26px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.topic-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.topic-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    right: -32px;
    bottom: -36px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
}

.topic-card:nth-child(2)::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16), transparent 70%);
}

.topic-card:nth-child(3)::after {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.16), transparent 70%);
}

.topic-card:nth-child(4)::after {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.16), transparent 70%);
}

.topic-card h3 {
    margin: 8px 0 10px;
    font-size: 24px;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    color: #0f172a;
    position: relative;
    z-index: 1;
}

.topic-card h3 a {
    color: #0f172a;
}

.topic-card h3 a:hover {
    color: var(--brand);
}

.topic-card p {
    margin: 0;
    color: var(--ink-soft);
    position: relative;
    z-index: 1;
}

.doc-page,
.doc-article {
    max-width: 920px;
    margin: 0 auto;
}

.page-hero,
.article-hero {
    margin-bottom: 18px;
}

.page-title,
.article-title {
    margin: 10px 0 8px;
    line-height: 1.2;
    font-size: 42px;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    color: #0f172a;
}

.page-description,
.article-description {
    margin: 0;
    color: var(--ink-soft);
    max-width: 780px;
    font-size: 16px;
}

.reading-meta {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 18px;
    align-items: start;
}

.page-body,
.article-body {
    background: var(--surface);
    border: 1px solid #dbe4ff;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
}

.toc-wrap {
    position: sticky;
    top: 74px;
    background: var(--surface);
    border: 1px solid #dbe4ff;
    border-radius: var(--radius-md);
    padding: 14px 12px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 90px);
    overflow: auto;
}

.toc-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
}

.toc-wrap #TableOfContents > ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.toc-wrap li {
    margin: 3px 0;
    font-size: 13px;
}

.toc-wrap ul ul {
    padding-left: 14px;
}

.toc-wrap a {
    color: #334155;
}

.toc-wrap a:hover {
    color: var(--brand);
}

.article-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.article-card {
    padding: 16px;
}

.card-title {
    display: block;
    margin-top: 7px;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
    font-size: 27px;
    color: #0f172a;
}

.card-title:hover {
    color: var(--brand);
}

.excerpt {
    margin: 8px 0 10px;
    color: var(--ink-soft);
}

.card-more {
    font-weight: 700;
}

.prose h2,
.prose h3,
.prose h4 {
    margin-top: 30px;
    margin-bottom: 10px;
    color: #0f172a;
    font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.prose h2 {
    font-size: 32px;
    border-bottom: 1px solid #dbe4ff;
    padding-bottom: 7px;
}

.prose h3 {
    font-size: 25px;
}

.prose h4 {
    font-size: 21px;
}

.prose p,
.prose li {
    font-size: 16px;
}

.prose p {
    max-width: 74ch;
}

.prose ul,
.prose ol {
    padding-left: 1.2rem;
}

.prose pre,
.prose code {
    font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.prose pre {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 14px 15px;
    overflow-x: auto;
}

.prose p code,
.prose li code {
    background: #eff6ff;
    border: 1px solid #cfe1ff;
    padding: 1px 5px;
    border-radius: 5px;
}

.prose blockquote {
    margin: 20px 0;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    background: #fff5f5;
    color: #475569;
}

.prose img {
    width: 100%;
    height: auto;
    display: block;
    margin: 18px 0;
    border-radius: 10px;
    border: 1px solid #dbe4ff;
}

.doc-image {
    margin: 18px 0;
}

.doc-image figcaption {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
}

.related-core {
    margin-top: 18px;
    background: var(--surface);
    border: 1px solid #dbe4ff;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.related-core h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.related-core ul {
    margin: 0;
    padding-left: 18px;
}

.related-core li {
    margin: 5px 0;
}

.site-footer {
    margin-top: 34px;
    border-top: 1px solid rgba(219, 228, 255, 0.95);
    background: rgba(248, 250, 255, 0.8);
}

.footer-inner {
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--ink-soft);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.back-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.32);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.back-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.reveal {
    animation: fade-up 0.62s ease both;
}

.delay-1 {
    animation-delay: 0.11s;
}

.delay-2 {
    animation-delay: 0.22s;
}

@keyframes fade-up {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 980px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .home-hero h1 {
        font-size: 38px;
    }

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

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

    .doc-layout {
        grid-template-columns: 1fr;
    }

    .toc-wrap {
        position: static;
        max-height: none;
    }
}

@media (max-width: 820px) {
    .header-inner {
        flex-direction: row;
        align-items: center;
    }

    .site-nav {
        width: auto;
    }

    .site-nav ul {
        gap: 6px;
    }

    .site-nav a {
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .site-title {
        font-size: 20px;
    }

    .site-tagline,
    .header-cta {
        display: none;
    }

    .home-hero,
    .page-body,
    .article-body {
        padding: 18px;
    }

    .home-hero h1,
    .page-title,
    .article-title {
        font-size: 32px;
    }

    .prose h2 {
        font-size: 27px;
    }

    .back-top {
        right: 12px;
        bottom: 12px;
    }
}
