:root {
    --color-primary: #2563eb;
    --color-primary-strong: #1d4ed8;
    --color-foreground: #172033;
    --color-background: #ffffff;
    --color-border: #dde4f3;
    --color-muted: #6b7382;
    --color-muted-bg: #f4f7fc;
    --color-progress: #f7b733;
    --color-note: #0f6feb;
    --color-note-bg: #eef6ff;
    --color-warning: #9a6700;
    --color-warning-bg: #fff8e8;
    --shadow-soft: 0 18px 40px rgba(23, 32, 51, 0.08);
    --radius: 18px;
    --nav-height: 4rem;
    --max-width: 1040px;
    --home-content-width: 56rem;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

body {
    margin: 0;
    color: var(--color-foreground);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    font-family: "Manrope", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body.menu-open {
    overflow: hidden;
}

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

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

code {
    padding: 0.12rem 0.45rem;
    border-radius: 0.35rem;
    background: #edf2ff;
    color: var(--color-primary-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
}

.nav-shell,
.site-main,
.footer-shell {
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
}

.nav-shell {
    display: flex;
    align-items: center;
    min-height: var(--nav-height);
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: "Space Grotesk", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-panel a {
    display: block;
    padding: 0.7rem 0.9rem;
    border-bottom: 2px solid transparent;
    color: var(--color-muted);
    font-size: 0.96rem;
    font-weight: 700;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.nav-panel a:hover,
.nav-panel a:focus-visible,
.nav-panel a.active {
    color: var(--color-primary);
    border-color: currentColor;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.35rem;
    padding: 0.28rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(244, 247, 252, 0.96);
    color: var(--color-muted);
    cursor: pointer;
    font: inherit;
}

.language-toggle span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0.38rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.language-toggle:hover,
.language-toggle:focus-visible {
    border-color: rgba(37, 99, 235, 0.3);
}

html[lang="zh-CN"] .language-toggle [data-lang-option="zh"],
html[lang="en"] .language-toggle [data-lang-option="en"] {
    background: var(--color-background);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: var(--color-foreground);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

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

.page-home .project-info,
.page-home .hero-actions,
.page-home .preview-panel,
.page-home .article-shell {
    max-width: var(--home-content-width);
    margin-left: auto;
    margin-right: auto;
}

.project-info {
    text-align: center;
}

.project-icon {
    display: block;
    width: 92px;
    height: 92px;
    margin: 0 auto 1.1rem;
}

.project-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-info h1,
.article-shell h1,
.article-shell h2,
.article-shell h3,
.preview-copy h2 {
    font-family: "Space Grotesk", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.03em;
}

.project-info h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 3.4rem);
}

.project-subtitle {
    margin: 1rem auto 0;
    max-width: 40rem;
    color: var(--color-muted);
    font-size: 1.35rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0 3rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.62rem 1.35rem;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    background: var(--color-background);
    color: var(--color-primary);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.button-secondary {
    background: var(--color-background);
}

.preview-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 1.5rem;
    margin: 0 auto 3rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

.preview-panel img {
    border-radius: 1rem;
    border: 1px solid var(--color-border);
}

.preview-copy h2 {
    margin: 0.35rem 0 0.9rem;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.preview-copy p {
    margin: 0;
    color: var(--color-muted);
}

.eyebrow {
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.article-shell {
    max-width: 52rem;
    margin: 0 auto;
}

.article-shell > :first-child {
    margin-top: 0;
}

.article-shell h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.1rem, 4vw, 2.8rem);
}

.article-shell h2 {
    margin: 3rem 0 1rem;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    scroll-margin-top: 5.25rem;
}

.article-shell h3 {
    margin: 2rem 0 0.6rem;
    font-size: 1.35rem;
}

.article-shell p,
.article-shell li {
    color: #293142;
}

.article-shell p {
    margin: 0 0 1rem;
}

.article-shell ul,
.article-shell ol {
    margin: 0 0 1.5rem;
    padding-left: 1.35rem;
}

.article-shell li + li {
    margin-top: 0.45rem;
}

.article-shell a,
.footer-links a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.home-features ul {
    padding: 0;
    list-style: none;
}

.home-features > ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
    margin: 0;
}

.home-features > ul > li {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;
    margin: 0;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-background);
    font-family: "Space Grotesk", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.home-features > ul > li + li {
    margin-top: 0;
}

.feature-title {
    display: flex;
    align-items: flex-start;
    min-height: 2.6rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.home-features > ul > li > ul {
    flex: 1 1 auto;
    margin-top: 0.8rem;
    padding-left: 1.1rem;
    list-style: disc;
}

.home-features > ul > li > ul li {
    color: var(--color-muted);
    font-family: "Manrope", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.98rem;
    font-weight: 500;
}

.markdown-alert {
    margin: 1.5rem 0;
    padding: 0.9rem 1rem;
    border-left: 0.25rem solid;
    border-radius: 0 0.75rem 0.75rem 0;
}

.markdown-alert-title {
    margin: 0 0 0.35rem;
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.markdown-alert-note {
    border-left-color: var(--color-note);
    background: var(--color-note-bg);
}

.markdown-alert-note .markdown-alert-title {
    color: var(--color-note);
}

.markdown-alert-warning {
    border-left-color: var(--color-warning);
    background: var(--color-warning-bg);
}

.markdown-alert-warning .markdown-alert-title {
    color: var(--color-warning);
}

.button-list ul {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.button-list li {
    display: flex;
    flex: 1 1 220px;
    min-height: 4.5rem;
    margin: 0;
}

.button-list li + li {
    margin-top: 0;
}

.button-list a {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    align-items: center;
    gap: 0.9rem;
    min-height: 4.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(23, 32, 51, 0.84);
    text-decoration: none;
    box-shadow: none;
    line-height: 1.2;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.button-list a:hover,
.button-list a:focus-visible {
    color: var(--color-primary);
}

.button-logo-slot {
    display: inline-flex;
    flex: 0 0 3.15rem;
    align-items: center;
    justify-content: center;
    width: 3.15rem;
    min-width: 3.15rem;
    height: 100%;
}

.button-label {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-height: 4.5rem;
    line-height: 1.15;
}

.button-logo {
    width: 2.1rem;
    height: 2.1rem;
    display: block;
    object-fit: contain;
}

.button-logo-github {
    width: 2.1rem;
    height: 2.1rem;
}

.button-logo-ccfddl {
    width: 2.7rem;
    height: 2.7rem;
}

.panel {
    margin: 1.5rem 0;
    padding: 1.2rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-background);
    box-shadow: var(--shadow-soft);
}

.panel > :last-child {
    margin-bottom: 0;
}

.site-footer {
    border-top: 1px solid var(--color-border);
}

.footer-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0 3rem;
    color: var(--color-muted);
}

.footer-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 880px) {
    .preview-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .site-main,
    .nav-shell,
    .footer-shell {
        width: min(calc(100% - 1.2rem), var(--max-width));
    }

    .menu-toggle {
        display: block;
    }

    .nav-panel {
        position: fixed;
        top: calc(var(--nav-height) + 0.35rem);
        left: 0.6rem;
        right: 0.6rem;
        display: grid;
        gap: 0.2rem;
        padding: 0.85rem;
        border: 1px solid var(--color-border);
        border-radius: 1rem;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow-soft);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    .menu-open .nav-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-panel a {
        padding: 0.75rem;
        text-align: center;
    }

    .language-toggle {
        justify-content: center;
        width: 100%;
        margin-left: 0;
        margin-top: 0.2rem;
        padding: 0.42rem;
    }

    .hero-actions,
    .button-list ul,
    .footer-shell {
        flex-direction: column;
        align-items: stretch;
    }

    .project-subtitle {
        font-size: 1.15rem;
    }

    .project-icon {
        width: 76px;
        height: 76px;
    }

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

    .home-features > ul > li {
        padding: 1rem;
    }

    .feature-title {
        min-height: 0;
    }
}
