/* ─── Variables ─── */
:root {
    --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
    --font-serif: 'Source Serif 4', 'Georgia', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --bg: #fdfdfe;
    --bg-card: #ffffff;
    --bg-subtle: #f5f7fb;

    --text: #0f1729;
    --text-secondary: #374263;
    --text-muted: #6b7a99;

    --accent: #1e3a5f;
    --accent-light: #2b547e;
    --accent-hover: #15294a;
    --accent-bg: rgba(30, 58, 95, 0.04);
    --link: #1d5296;

    --green: #0e7a56;
    --gold: #9a6e1f;
    --red-subtle: #dc3545;

    --border: #d0d7e3;
    --border-light: #e5e9f0;
    --border-card: #dce1ec;

    --shadow-sm: 0 1px 3px rgba(30, 58, 95, 0.06);
    --shadow-md: 0 4px 16px rgba(30, 58, 95, 0.08);
    --shadow-lg: 0 8px 32px rgba(30, 58, 95, 0.10);

    --container: 960px;
    --radius: 10px;
    --radius-sm: 6px;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(180deg, #fdfdfe 0%, #f0f3f9 15%, #eaeff7 30%, #f0f3f9 50%, #eaeff7 70%, #f0f3f9 85%, #fdfdfe 100%);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-align: justify;
}

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

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

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

/* ─── Layout ─── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.content-narrow {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section {
    padding: 72px 0;
    position: relative;
}

.section+.section::before {
    content: '';
    display: block;
    width: 100px;
    height: 1px;
    background: var(--border);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.section-heading {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 32px;
    letter-spacing: -0.02em;
    text-align: left;
}

/* ─── Navigation ─── */
#navbar {
    position: sticky;
    top: 0;
    height: 48px;
    background: rgba(253, 253, 254, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(30, 58, 95, 0.06);
    z-index: 100;
    box-shadow: 0 1px 8px rgba(30, 58, 95, 0.04);
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-back:hover {
    color: var(--accent);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-logo:hover {
    color: var(--accent);
    text-decoration: none;
}

.nav-sep {
    color: var(--border);
    font-size: 0.8rem;
    user-select: none;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none !important;
    padding: 5px 12px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
    background: rgba(30, 58, 95, 0.05);
}

/* ─── Hero ─── */
#hero {
    padding: 72px 0 56px;
    background: linear-gradient(175deg, var(--bg) 0%, #eef2f8 60%, #e5ebf5 100%);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.paper-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 100px;
    padding: 4px 16px;
    margin-bottom: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#hero h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.02em;
    max-width: 800px;
    margin: 0 auto 12px;
}

.subtitle {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent-light);
    margin-bottom: 28px;
}

.authors {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.author {
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.author.highlight {
    font-weight: 600;
    color: var(--text);
}

.author sup {
    font-size: 0.65em;
    color: var(--text-muted);
}

.affiliations {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.affiliations span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.affiliations sup {
    font-size: 0.65em;
}

.hero-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-card);
}

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

/* ─── Abstract ─── */
.abstract-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.keywords {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.keywords span {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(30, 58, 95, 0.08);
}

/* ─── Method ─── */
.method-intro {
    margin-bottom: 48px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.method-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 56px;
}

.method-block h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.method-block p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.method-block ul {
    list-style: none;
    padding: 0;
}

.method-block ul li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.method-block ul li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    left: 0;
    top: 14px;
}

.method-block-image img {
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

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

/* ─── Architecture ─── */
.architecture-block {
    margin-bottom: 56px;
}

.architecture-block h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.architecture-block p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.architecture-img {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.architecture-img img {
    border-radius: var(--radius-sm);
    min-width: 900px;
    width: 100%;
}

/* ─── Behaviors ─── */
.behaviors-block h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.behaviors-block>p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.behavior-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.behavior-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.behavior-card img {
    border-radius: var(--radius-sm);
    max-height: 300px;
    object-fit: contain;
}

/* ─── Results ─── */
.results-intro {
    margin-bottom: 40px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 40px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
}

thead {
    background: var(--bg-subtle);
}

th {
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
}

th:first-child {
    text-align: left;
}

td {
    padding: 10px 14px;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

td:first-child {
    text-align: left;
    font-family: var(--font-sans);
}

/* Metric Highlights */
.metric-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 56px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}

.metric-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* FID */
.fid-block {
    margin-bottom: 56px;
}

.fid-block h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}

.fid-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.fid-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.fid-card img {
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.fid-label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
}

.fid-card.bad .fid-label {
    color: var(--red-subtle);
}

.fid-card.good .fid-label {
    color: var(--green);
}

/* APE */
.ape-block {
    margin-bottom: 56px;
}

.ape-block h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.ape-block>p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.ape-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ape-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.ape-card img {
    border-radius: var(--radius-sm);
}

/* Examples */
.examples-block h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.example-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.example-card img {
    border-radius: var(--radius-sm);
}

/* ─── Resources ─── */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.resource-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    text-decoration: none !important;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    color: var(--text-secondary);
}

.resource-card svg {
    color: var(--accent);
    margin-bottom: 4px;
}

.resource-emoji {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.resource-card h4 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.resource-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Citation ─── */
.citation-block {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.citation-block pre {
    padding: 24px;
    overflow-x: auto;
    margin: 0;
}

.citation-block code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Footer ─── */
footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border-light);
}

footer p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

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

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 1.5rem;
    }

    .method-block {
        grid-template-columns: 1fr;
    }

    .behavior-grid,
    .fid-grid,
    .ape-grid,
    .examples-grid {
        grid-template-columns: 1fr;
    }

    .metric-highlights {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .authors {
        gap: 12px;
    }

    .hero-links {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .metric-highlights {
        grid-template-columns: 1fr;
    }

    #hero h1 {
        font-size: 1.3rem;
    }
}