:root {
    --page: #f7f8fb;
    --paper: #ffffff;
    --ink: #172033;
    --muted: #657083;
    --soft: #eef2f7;
    --line: #d8e0eb;
    --blue: #2563eb;
    --blue-soft: #eaf1ff;
    --green: #059669;
    --green-soft: #e8f7f1;
    --rose: #e11d48;
    --rose-soft: #fff0f3;
    --gold: #c47a16;
    --gold-soft: #fff6e6;
    --shadow: 0 22px 60px rgba(32, 42, 68, 0.10);
    --radius: 8px;
    --font: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[lang="en"] [lang="zh-CN"] { display: none; }
html[lang="zh-CN"] [lang="en"] { display: none; }

body.project-page {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--font);
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(5, 150, 105, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, #fbfcff 0%, var(--page) 44%, #ffffff 100%);
    background-size: 44px 44px, 44px 44px, auto;
    line-height: 1.7;
}

.project-page * { box-sizing: border-box; }
.project-page a { color: inherit; }

.project-page .site-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.project-page .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0 18px;
}

.project-page .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.project-page .brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--blue);
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(32, 42, 68, 0.08);
}

.project-page .brand-text {
    display: grid;
    gap: 1px;
}

.project-page .brand-text strong {
    font-size: 1rem;
    line-height: 1.1;
}

.project-page .brand-text span {
    color: var(--muted);
    font-size: 0.82rem;
}

.project-page .header-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.project-page .nav-link,
.project-page .lang-switcher {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    font: 600 0.84rem/1 var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.project-page .nav-link:hover,
.project-page .lang-switcher:hover {
    transform: translateY(-1px);
    border-color: #b9c6d8;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(32, 42, 68, 0.08);
}

.project-page .nav-link[aria-current="page"] {
    color: #ffffff;
    border-color: var(--ink);
    background: var(--ink);
}

.project-hero {
    padding: 28px 0 46px;
}

.project-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
    gap: 30px;
    align-items: stretch;
}

.project-copy,
.project-visual,
.project-section,
.resource-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.90);
    box-shadow: var(--shadow);
}

.project-copy {
    display: grid;
    align-content: center;
    padding: 34px;
}

.project-copy h1 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(1.61rem, 2.55vw, 2.29rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.paper-authors {
    margin: 14px 0 0;
    color: #42506a;
    font-size: 0.95rem;
    line-height: 1.55;
}

.paper-authors b {
    color: var(--ink);
    font-weight: 800;
}

.project-copy p {
    max-width: 720px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.72;
}

.project-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.project-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.project-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

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

.project-button:hover {
    transform: translateY(-2px);
    border-color: #b9c6d8;
    box-shadow: 0 12px 28px rgba(32, 42, 68, 0.12);
}

.project-visual {
    position: relative;
    display: grid;
    gap: 18px;
    align-content: start;
    padding: 24px;
    overflow: hidden;
}

.visual-title {
    margin: 0;
    color: #485469;
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
}

.method-flow {
    display: grid;
    gap: 12px;
}

.flow-node {
    position: relative;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.flow-node::after {
    content: "";
    position: absolute;
    left: 22px;
    bottom: -13px;
    width: 2px;
    height: 12px;
    background: var(--line);
}

.flow-node:last-child::after { display: none; }

.flow-node strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.25;
}

.flow-node span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.48;
}

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

.metric {
    min-height: 92px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.metric strong {
    display: block;
    font-size: 1.42rem;
    line-height: 1.1;
}

.metric span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.38;
}

.project-section {
    margin: 18px 0;
    padding: 28px;
}

.project-section h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.06;
    letter-spacing: 0;
}

.project-section > p {
    max-width: 800px;
    margin: 12px 0 0;
    color: var(--muted);
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.section-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.section-card i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin-bottom: 13px;
}

.section-card h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}

.section-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.62;
}

.paper-figure {
    margin: 24px 0 0;
}

.paper-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.paper-figure figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.method-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.method-note {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.method-note h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}

.method-note p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.62;
}

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.keyword-cloud span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: #42506a;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
}

.paper-detail-list {
    display: grid;
    gap: 12px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.paper-detail-list li {
    position: relative;
    padding: 15px 18px 15px 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
}

.paper-detail-list li::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 5px var(--blue-soft);
}

.blog-page .project-hero-grid {
    grid-template-columns: 1fr;
}

.blog-page .project-hero {
    padding-bottom: 18px;
}

.blog-page .project-copy h1 {
    font-size: clamp(2rem, 5vw, 3.35rem);
}

.blog-list {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.blog-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcff;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.blog-card:hover {
    transform: translateY(-2px);
    border-color: #b9c6d8;
    box-shadow: 0 12px 28px rgba(32, 42, 68, 0.10);
}

.blog-kicker {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.blog-card h3 {
    margin: 8px 0 0;
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    line-height: 1.22;
}

.blog-card p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.62;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.blog-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: #42506a;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}

.blog-card .project-button {
    margin: 0;
    white-space: nowrap;
}

.resource-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin: 18px 0 48px;
    padding: 26px;
}

.resource-panel h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    line-height: 1.2;
}

.resource-panel p {
    margin: 0;
    color: var(--muted);
}

.theme-efficiency .project-copy,
.theme-efficiency .project-visual {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.10), transparent 32%),
        rgba(255, 255, 255, 0.92);
}

.theme-distill .project-copy,
.theme-distill .project-visual {
    background:
        linear-gradient(135deg, rgba(196, 122, 22, 0.12), transparent 34%),
        rgba(255, 255, 255, 0.92);
}

.theme-multimodal .project-copy,
.theme-multimodal .project-visual {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.11), transparent 34%),
        rgba(255, 255, 255, 0.92);
}

.theme-efficiency .project-pill i,
.theme-efficiency .section-card i {
    color: var(--green);
    background: var(--green-soft);
}

.theme-distill .project-pill i,
.theme-distill .section-card i {
    color: var(--gold);
    background: var(--gold-soft);
}

.theme-multimodal .project-pill i,
.theme-multimodal .section-card i {
    color: var(--blue);
    background: var(--blue-soft);
}

.theme-efficiency .paper-detail-list li::before {
    background: var(--green);
    box-shadow: 0 0 0 5px var(--green-soft);
}

.theme-distill .paper-detail-list li::before {
    background: var(--gold);
    box-shadow: 0 0 0 5px var(--gold-soft);
}

.theme-multimodal .paper-detail-list li::before {
    background: var(--blue);
    box-shadow: 0 0 0 5px var(--blue-soft);
}

.project-page .section-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.project-page .section-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 980px) {
    .project-hero-grid,
    .section-grid,
    .method-notes,
    .resource-panel {
        grid-template-columns: 1fr;
    }

    .project-page .site-shell { width: min(100% - 28px, 760px); }
    .project-page .site-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .project-page .header-links { justify-content: flex-start; }
}

@media (max-width: 720px) {
    .blog-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .project-copy,
    .project-visual,
    .project-section,
    .resource-panel {
        padding: 18px;
    }

    .project-copy h1 {
        font-size: clamp(1.5rem, 7.5vw, 2.1rem);
        line-height: 1.03;
    }

    .project-metrics {
        grid-template-columns: 1fr;
    }

    .project-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .project-button {
        width: 100%;
    }
}
