:root {
    --bg-primary: #f6f8fc;
    --bg-secondary: #ffffff;
    --bg-soft: #edf4ff;
    --text-primary: #14233b;
    --text-secondary: #53627a;
    --text-muted: #7e8aa1;
    --accent: #2563eb;
    --accent-dark: #1e4fd1;
    --accent-soft: #dbeafe;
    --success: #22c55e;
    --success-dark: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e3e9f3;
    --border-strong: #cfd8e6;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --radius-pill: 999px;
    --font-heading: "Outfit", sans-serif;
    --font-body: "Manrope", sans-serif;
    --transition: 180ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.07), transparent 26%),
        linear-gradient(180deg, #fbfcff 0%, var(--bg-primary) 100%);
    line-height: 1.7;
}

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

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

button {
    font: inherit;
}

.hidden {
    display: none !important;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.section-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 252, 255, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(207, 216, 230, 0.65);
}

.nav-inner {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 700;
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-dark);
    background: rgba(37, 99, 235, 0.09);
}

.hero {
    padding: 42px 0 20px;
}

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

.paper-title {
    max-width: 940px;
    margin: 0 auto 18px;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.authors {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.author sup,
.affiliation sup {
    color: var(--accent);
    font-weight: 700;
}

.affiliations {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.author-sep {
    color: #b9c4d5;
}

.action-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    font-size: 0.93rem;
    font-weight: 700;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.page-content {
    padding: 30px 0 72px;
}

.section {
    margin-top: 52px;
}

.section-tight {
    margin-top: 34px;
}

.section-small {
    margin-top: 52px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading-center {
    text-align: center;
}

.section-heading h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.9rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-divider {
    display: inline-block;
    width: 78px;
    height: 3px;
    margin-top: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}

.section-text {
    max-width: 860px;
    margin: 18px auto 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.section-text-center {
    text-align: center;
}

.section-text p {
    margin: 0;
}

.figure-card,
.table-card {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.main-figure,
.pipeline-figure,
.stats-figure {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #ffffff;
}

.caption {
    max-width: 860px;
    margin: 12px auto 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.caption strong {
    color: var(--text-secondary);
}

.stats-panel {
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.stat-card {
    padding: 16px 14px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-card-wide {
    padding-left: 10px;
    padding-right: 10px;
}

.stat-value {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--accent-dark);
}

.stat-value-small {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 700;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

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

.task-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8f0ff 0%, #f6faff 100%);
    color: var(--accent-dark);
    font-size: 1.2rem;
}

.task-card h3 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1.3;
}

.task-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.leaderboard-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0 12px;
}

.leaderboard-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: var(--radius-pill);
    background: var(--bg-soft);
    color: var(--accent-dark);
    font-size: 0.8rem;
    font-weight: 800;
}

#sortStatus {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
}

.table-scroll {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    min-width: 1160px;
    border-collapse: collapse;
    background: #ffffff;
}

.results-table th,
.results-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #edf1f7;
    text-align: center;
    font-size: 0.9rem;
}

.results-table th {
    background: #f9fbff;
}

.results-table th:first-child,
.results-table td:first-child {
    width: 72px;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
    min-width: 250px;
    text-align: left;
}

.results-table tbody tr:hover {
    background: #fbfcff;
}

.results-table tbody tr.top-rank {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0.015));
}

.rank-col {
    text-align: center;
}

.rank-cell {
    font-weight: 800;
    color: var(--accent-dark);
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.sort-btn ion-icon {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.sort-btn.active {
    color: var(--accent-dark);
}

.sort-btn.active ion-icon {
    color: var(--accent-dark);
}

.model-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: #eef4ff;
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 800;
    vertical-align: middle;
}

.bibtex-box {
    position: relative;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #12203a 0%, #0b1325 100%);
    box-shadow: var(--shadow-md);
    overflow: auto;
}

.bibtex-box pre {
    margin: 0;
    color: #e9f0fb;
    font-size: 0.9rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #dbeafe;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.footer {
    padding: 0 0 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Human Assistance Demo */
.human-demo-shell {
    margin-top: 18px;
}

.demo-question-card {
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.demo-question-label {
    margin-bottom: 8px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.demo-question-text {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    line-height: 1.28;
    color: var(--text-primary);
}

.demo-hint-panel {
    margin-top: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #fff9ef;
    border: 1px solid #fde7bf;
    box-shadow: var(--shadow-sm);
}

.demo-hint-label {
    margin-bottom: 6px;
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.demo-hint-text {
    color: #6b4f16;
    font-size: 0.98rem;
    line-height: 1.75;
}

.demo-stage-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.demo-side-card,
.demo-main-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.demo-side-card {
    padding: 16px;
    cursor: pointer;
}

.demo-preview-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: var(--bg-soft);
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.demo-preview-wrap {
    margin-top: 12px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f4f7fc;
    aspect-ratio: 1 / 1;
}

.demo-preview-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-preview-name {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 700;
}

.demo-main-card {
    padding: 18px;
}

.demo-stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.demo-stage-counter {
    color: var(--accent-dark);
    font-size: 0.95rem;
    font-weight: 800;
}

.demo-stage-hint {
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 700;
}

.demo-main-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: #eaf0fb;
    min-height: 0;
}

.demo-main-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.demo-main-lock {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(20, 35, 59, 0.28) 0%, rgba(20, 35, 59, 0.62) 100%);
    backdrop-filter: blur(2px);
}

.demo-lock-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.demo-lock-subtitle {
    max-width: 420px;
    margin-top: 8px;
    font-size: 0.94rem;
    color: rgba(255, 255, 255, 0.92);
}

.demo-click-marker,
.demo-gt-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 4;
}

.demo-click-marker::before,
.demo-click-marker::after,
.demo-gt-marker::before,
.demo-gt-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    border-radius: 999px;
}

.demo-click-marker {
    color: #ff4b78;
    filter: drop-shadow(0 4px 12px rgba(255, 75, 120, 0.4));
}

.demo-click-marker::before,
.demo-gt-marker::before {
    width: 28px;
    height: 4px;
}

.demo-click-marker::after,
.demo-gt-marker::after {
    width: 4px;
    height: 28px;
}

.demo-gt-marker {
    color: #16a34a;
    filter: drop-shadow(0 4px 12px rgba(22, 163, 74, 0.35));
}

.demo-main-name {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
}

.demo-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 11px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform var(--transition), opacity var(--transition), background var(--transition), border-color var(--transition);
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

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

.button.secondary {
    background: #eff4ff;
    color: var(--accent-dark);
    border-color: #d9e5ff;
}

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

.button.ghost {
    background: #f3f6fb;
    color: var(--text-primary);
    border-color: var(--border);
}

.demo-results-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.demo-result-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #e7eefc;
}

.demo-result-item-wide {
    grid-column: span 1;
}

.demo-result-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.demo-result-value {
    display: block;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .stats-strip,
    .tasks-grid,
    .demo-results-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .demo-side-card {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .paper-title {
        font-size: 1.9rem;
    }

    .section-heading h2 {
        font-size: 1.55rem;
    }

    .stats-strip,
    .tasks-grid,
    .demo-results-panel {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

    .nav-inner {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .nav-link {
        white-space: nowrap;
    }

    .stats-panel {
        padding: 18px;
    }

    .section {
        margin-top: 42px;
    }

    .demo-question-text {
        font-size: 1.2rem;
    }

    .demo-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }
}
