html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #0b3d91;
    --accent-color: #06275e;
    --nav-project-title-color: #172033;
    --award-bg-soft: color-mix(in srgb, white 98%, var(--primary-color) 2%);
    --award-bg: color-mix(in srgb, white 90%, var(--primary-color) 10%);
    --award-border: color-mix(in srgb, white 60%, var(--primary-color) 40%);
    --award-shadow: color-mix(in srgb, transparent 88%, var(--primary-color) 12%);
    --bg-color: #ffffff;
    --text-color: #243044;
    --muted-color: #657083;
    --light-gray: #f7f9fc;
    --medium-gray: #e7edf6;
    --border-color: #d8e1ef;
    --soft-blue: #eef5ff;
    --ink-blue: #081a33;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.65;
    color: var(--text-color);
    background: var(--bg-color);
    margin: 0;
    padding: 52px 0 0;
    text-align: justify;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 22px;
}

header {
    background:
        linear-gradient(180deg, rgba(238, 245, 255, 0.78) 0%, rgba(255, 255, 255, 1) 48%),
        #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 48px 0 40px;
}

.hero-content {
    text-align: center;
}

h1 {
    max-width: 940px;
    margin: 0 auto 18px;
    color: var(--ink-blue);
    font-size: clamp(2.1rem, 5vw, 4.15rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0;
    text-align: center;
}

h1 span {
    display: block;
    color: var(--primary-color);
}

.hero-lead {
    max-width: 820px;
    margin: 0 auto 24px;
    color: #3f4c60;
    font-size: 1.12rem;
    line-height: 1.7;
    text-align: center;
}

.authors {
    margin: 0 auto 28px;
    font-size: 1.05rem;
    text-align: center;
}

.authors p {
    margin: 8px 0;
}

.affiliations {
    font-size: 0.92rem;
    color: var(--muted-color);
}

.authors a,
main a:not(.btn):not(.resource-card) {
    color: var(--primary-color);
    text-decoration: none;
}

.authors a:hover,
main a:not(.btn):not(.resource-card):hover {
    text-decoration: underline;
}

.links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 20px 0 36px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ink-blue);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
    border: none;
}

.btn:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
}

.btn-icon {
    height: 20px;
    width: auto;
}

.header-image-container {
    margin-top: 4px;
    text-align: center;
}

.header-image {
    width: 100%;
    display: block;
    border-radius: 8px;
    background: #ffffff;
}

main {
    padding: 40px 0;
}

section {
    margin-bottom: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    scroll-margin-top: 64px;
}

section:first-of-type {
    border-top: none;
}

h2 {
    margin: 0 0 14px;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
}

h3 {
    color: #344257;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    margin: 22px 0 12px;
    font-size: 1.36rem;
    line-height: 1.25;
}

h4.subsection-title {
    margin: 28px 0 8px;
    color: var(--ink-blue);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
}

p {
    margin: 12px 0;
}

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

.overview-content {
    display: block;
}

.overview-figure {
    margin: 0 0 26px;
    text-align: center;
}

.overview-figure img,
.method-image img {
    width: 100%;
    border-radius: 8px;
    background: #ffffff;
}

.key-points {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 22px;
}

.key-points div,
.card,
.metric-card,
.resource-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

.key-points div {
    padding: 16px;
}

.stat {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 800;
}

.key-points p {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.92rem;
    text-align: left;
}

.caption {
    margin-top: 10px;
    color: var(--muted-color);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

.math {
    white-space: nowrap;
    font-family: Georgia, 'Times New Roman', serif;
}

.formula {
    width: fit-content;
    margin: 20px auto 24px;
    padding: 14px 24px;
    border: 1px solid var(--award-border);
    border-radius: 8px;
    background: var(--soft-blue);
    color: var(--primary-color);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.method-image {
    margin: 24px 0;
    text-align: center;
}

#method .method-image {
    margin-top: 0;
}

.cards {
    display: grid;
    gap: 16px;
}

.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.card {
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.card h3 {
    border-left: none;
    padding-left: 0;
    margin: 0 0 8px;
    color: var(--primary-color);
    font-size: 1.08rem;
}

.card p {
    margin: 0;
    color: #4d5a6e;
    font-size: 0.95rem;
    text-align: left;
}

.table-container {
    overflow-x: auto;
    margin: 28px 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #ffffff;
}

.wide-table table {
    min-width: 980px;
}

th,
td {
    padding: 12px 14px;
    text-align: center;
    border: 1px solid var(--border-color);
}

th {
    background: var(--light-gray);
    color: var(--ink-blue);
    font-weight: 800;
}

tbody tr:first-child td {
    border-top: 1.5px solid var(--ink-blue);
}

.highlight-row {
    background: var(--soft-blue);
}

.metric-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 18px;
}

.metric-card {
    padding: 18px;
    background: #ffffff;
}

.metric-value {
    display: block;
    color: var(--primary-color);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
}

.metric-label {
    display: block;
    min-height: 46px;
    margin: 9px 0;
    color: var(--ink-blue);
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
}

.metric-card p {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.88rem;
    line-height: 1.55;
    text-align: left;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
    align-items: start;
}

.analysis-grid h3 {
    margin-top: 0;
}

.analysis-theory {
    grid-column: 1 / -1;
}

.analysis-stack {
    display: grid;
    gap: 26px;
}

.analysis-card {
    min-height: 100%;
}

.analysis-card p {
    margin-bottom: 0;
}

.analysis-figure {
    margin: 20px 0 0;
}

.analysis-figure img {
    display: block;
    width: 100%;
    border-radius: 8px;
}

.takeaway {
    margin-top: 20px;
    padding: 18px 20px;
    border-left: 4px solid var(--primary-color);
    background: var(--soft-blue);
    color: #334258;
    text-align: left;
}

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

.resource-card {
    display: block;
    padding: 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 24px rgba(8, 26, 51, 0.08);
    transform: translateY(-2px);
}

.resource-card i,
.resource-card img {
    display: block;
    height: 28px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.resource-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-blue);
    font-size: 1.08rem;
    font-weight: 800;
}

.resource-card p {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.92rem;
    text-align: left;
}

.citation-block {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(8, 26, 51, 0.08);
    border: none;
    border-radius: 6px;
    padding: 6px 9px;
    cursor: pointer;
    color: #4a5a70;
    font-size: 0.85rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
    background: rgba(11, 61, 145, 0.15);
    color: var(--primary-color);
}

pre {
    background: var(--light-gray);
    padding: 22px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    color: #162033;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    text-align: left;
}

footer {
    text-align: center;
    padding: 22px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 0.9rem;
    background: var(--light-gray);
}

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

footer a:hover {
    text-decoration: underline;
}

.nav-global,
.nav-sticky-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: rgba(251, 253, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(8, 26, 51, 0.1);
    z-index: 1001;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-global.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.nav-sticky-bar {
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.nav-sticky-bar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-global-content,
.nav-sticky-content {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.nav-global-content {
    justify-content: center;
}

.nav-sticky-content {
    justify-content: space-between;
}

.nav-global-links,
.nav-sticky-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-global-links a,
.nav-sticky-links a {
    color: #435066;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.nav-global-links a:hover,
.nav-sticky-links a:hover {
    background: rgba(8, 26, 51, 0.06);
    color: var(--ink-blue);
}

.nav-global-links a.active,
.nav-sticky-links a.active {
    background: rgba(11, 61, 145, 0.1);
    color: var(--primary-color);
    font-weight: 800;
}

.nav-title-wrapper {
    position: relative;
    flex-shrink: 0;
}

.nav-sticky-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-blue);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 6px;
}

.nav-sticky-title:hover {
    background: rgba(8, 26, 51, 0.06);
}

.nav-title-chevron {
    color: #8a96a7;
    font-size: 0.7rem;
    transition: transform 0.25s ease;
}

.nav-title-wrapper:hover .nav-title-chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 390px;
    padding: 12px 8px 8px;
    background: rgba(251, 253, 255, 0.98);
    border: 1px solid rgba(8, 26, 51, 0.12);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(8, 26, 51, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-title-wrapper:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-header {
    padding: 0 8px 8px;
    color: #929cac;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-project-card {
    display: block;
    padding: 8px 10px;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.nav-project-card:hover {
    background: rgba(8, 26, 51, 0.05);
}

.nav-project-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.nav-project-card-title {
    color: var(--nav-project-title-color);
    font-size: 0.82rem;
    font-weight: 800;
}

.nav-project-card-title.active-project {
    color: var(--primary-color);
}

.nav-project-card-venue {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, white 64%, var(--primary-color) 36%);
    border-radius: 999px;
    background: color-mix(in srgb, white 92%, var(--primary-color) 8%);
    color: var(--primary-color);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
}

.nav-project-card-desc {
    color: #6f7b8d;
    font-size: 0.75rem;
    line-height: 1.4;
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #435066;
    cursor: pointer;
    font-size: 20px;
    padding: 4px 8px;
    transition: transform 0.3s ease;
}

.nav-mobile-toggle.active {
    transform: rotate(90deg);
}

.scroll-top {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--ink-blue);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    box-shadow: 0 4px 12px rgba(8, 26, 51, 0.18);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-color);
    transform: translateY(-4px);
}

@media (max-width: 920px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .analysis-theory {
        grid-column: auto;
    }

    .analysis-figure {
        margin-top: 0;
    }

    .three-col,
    .metric-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .metric-label {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    body {
        text-align: left;
    }

    header {
        padding-top: 32px;
    }

    .nav-mobile-toggle {
        display: block;
    }

    .nav-sticky-links {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(251, 253, 255, 0.98);
        border-bottom: 1px solid rgba(8, 26, 51, 0.1);
        padding: 8px 0;
    }

    .nav-sticky-links.mobile-open {
        display: flex;
    }

    .nav-sticky-links a {
        padding: 10px 24px;
        border-radius: 0;
        font-size: 0.95rem;
    }

    .nav-global-links {
        overflow-x: auto;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-dropdown {
        width: min(360px, calc(100vw - 28px));
    }

    .key-points {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2.35rem;
    }

    .hero-lead {
        font-size: 1rem;
    }

    th,
    td {
        padding: 10px 12px;
    }

    pre {
        font-size: 0.8rem;
        padding-right: 48px;
    }
}
