:root {
    --primary-color-dark: #1d75a5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-container {
    max-width: 800px;
    margin: 0 auto 80px;
}

.header-nav {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 0;
}

.home-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

.home-link:hover {
    color: var(--primary-color);
}

.home-link svg {
    width: 32px;
    height: 18px;
    margin-right: 8px;
}

.home-link-floating {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 1100;
    width: 46px;
    height: 46px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.home-link-floating svg {
    width: 24px;
    height: 14px;
    margin-right: 0;
}

.home-link-floating span {
    display: none;
}

.home-link-floating:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.teaser-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 24px;
    background: #fafafa;
    border-bottom: 1px solid #eaeaea;
}

.teaser-inner {
    width: min(980px, 100%);
}

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

.teaser-task,
.teaser-summary {
    min-height: 284px;
    border: 1px solid #707070;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

.task-default {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    transition: opacity 0.18s ease;
}

.task-name {
    font-family: "Times New Roman", Times, serif;
    font-size: 31px;
    font-size: clamp(23px, 2.2vw, 34px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.01em;
}

.task-name::after {
    content: "Hover to reveal case \2197";
    display: block;
    margin-top: 7px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.58);
}

.task-count {
    margin-top: auto;
    font-size: 35px;
    font-size: clamp(24px, 2.4vw, 37px);
    font-family: "Times New Roman", Times, serif;
    font-weight: 700;
    line-height: 1;
}

.task-case {
    position: absolute;
    inset: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.case-title {
    display: none;
}

.case-question {
    font-family: "Times New Roman", Times, serif;
    font-size: 13px;
    line-height: 1.25;
}

.case-answer {
    font-family: "Times New Roman", Times, serif;
    font-size: 15px;
    font-weight: 700;
    color: #157a19;
}

.case-media {
    margin-top: 6px;
    width: 100%;
    border: 1px solid #4d4d4d;
    background: rgba(255, 255, 255, 0.55);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.case-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.teaser-task:hover .task-default {
    opacity: 0;
}

.teaser-task:hover .task-case {
    opacity: 1;
    transform: translateY(0);
}

.color { background: #c7d8ee; }
.lowlight { background: #d9d9d9; }
.instrument { background: #c9d9c7; }
.jigsaw { background: #ead6bc; }
.math { background: #efe2bf; }
.maze { background: #efcbcb; }
.rotated-ocr { background: #d6cddd; }
.proportion { background: #bfd4ea; }
.rotation { background: #d7e7bd; }
.spot-diff { background: #e8efb2; }
.symbolic { background: #f1c992; }
.visual-search { background: #e9c1c1; }
.word-search { background: #dedede; }

.teaser-summary {
    grid-column: 4 / 6;
    background: #f4f4f4;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.summary-title {
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(42px, 5vw, 70px);
    line-height: 0.88;
    font-weight: 700;
}

.summary-fulltitle {
    margin-top: 10px;
    max-width: 500px;
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(24px, 1.35vw, 23px);
    line-height: 1.2;
    font-weight: 400;
}

.summary-subtitle {
    margin-top: auto;
    align-self: flex-end;
    text-align: right;
    font-size: 28px;
    font-size: clamp(20px, 2.4vw, 34px);
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-weight: 700;
}

.scroll-cue {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
}

.scroll-cue:hover {
    color: var(--primary-color);
}

.article-header {
    text-align: center;
    margin-bottom: 36px;
    padding-top: 40px;
}

.date-tag {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.date {
    font-size: 14px;
    color: var(--secondary-text-color);
}

.tag {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 14px;
}

.article-subtitle {
    font-size: 18px;
    color: var(--secondary-text-color);
    margin: 0 auto 22px;
    max-width: 700px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
}

.project-link i {
    margin-right: 8px;
}

.project-link.github {
    background-color: #24292e;
}

.project-link.github:hover {
    background-color: #1a1e22;
}

.project-link.huggingface {
    background-color: #ee9a1b;
}

.project-link.huggingface:hover {
    background-color: #ce8f32;
}

.project-link.paper {
    background-color: #b31b1b;
}

.project-link.paper:hover {
    background-color: #9c1717;
}

.authors-section {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    text-align: left;
    border-top: 1px solid #eaeaea;
    padding-top: 20px;
}

.authors-left {
    flex: 1;
}

.authors-right {
    width: 300px;
    flex-shrink: 0;
}

.authors-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #6b6b6b;
    margin-bottom: 8px;
}

.authors-list {
    font-size: 16px;
    line-height: 1.75;
    color: #1d1d1d;
}

.author-note {
    margin-top: 8px;
    font-size: 13px;
    color: var(--secondary-text-color);
}

.affiliations-list {
    font-size: 16px;
    line-height: 1.8;
    color: #1d1d1d;
}

.article-content {
    font-size: 17px;
    line-height: 1.75;
}

.article-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 40px 0 16px;
}

.article-content p {
    margin: 0 0 18px;
}

.article-note {
    border-left: 3px solid var(--primary-color);
    background: #f6fbfe;
    padding: 14px 16px;
    border-radius: 6px;
    margin-top: 8px;
    color: #2b4c5f;
}

.leaderboard-panel {
    margin: 14px 0 26px;
    padding: 18px;
    border: 1px solid #d9e1e7;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
}

.leaderboard-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.lb-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #385265;
}

.lb-control select {
    min-width: 210px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #bfd0de;
    background: #fff;
    padding: 0 10px;
    font-size: 14px;
    color: #1f2f3d;
}

.leaderboard-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.lb-note {
    margin: 2px 0 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed #c7d6e4;
    background: #f8fbfe;
    font-size: 12px;
    line-height: 1.45;
    color: #4b677a;
}

.lb-highlight-card {
    border: 1px solid #d0deea;
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
}

.lb-highlight-top {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #1d75a5;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.lb-highlight-model {
    margin-top: 5px;
    font-size: 17px;
    font-weight: 700;
    color: #1e2f3b;
}

.lb-highlight-meta {
    margin-top: 2px;
    font-size: 13px;
    color: #5b7487;
}

.leaderboard-list-wrap {
    border: 1px solid #d0deea;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.leaderboard-list-header,
.leaderboard-row {
    display: grid;
    grid-template-columns: 70px 1.4fr 110px 1.8fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
}

.leaderboard-list-header {
    background: #edf5fb;
    color: #4c6679;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.leaderboard-row {
    border-top: 1px solid #edf2f6;
}

.leaderboard-row:first-child {
    border-top: none;
}

.lb-rank {
    font-weight: 700;
    color: #1d75a5;
}

.lb-model {
    font-weight: 600;
    color: #1d2d39;
}

.lb-group-tag {
    display: inline-flex;
    justify-content: center;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #d2dce5;
    font-size: 11px;
    color: #4f6475;
    background: #f7fafc;
}

.lb-score-wrap {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 8px;
    align-items: center;
}

.lb-score {
    font-weight: 700;
    font-size: 14px;
    color: #1d2d39;
}

.lb-score-bar {
    height: 8px;
    background: #edf3f8;
    border-radius: 999px;
    overflow: hidden;
}

.lb-score-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #5ba7d1 0%, #1d75a5 100%);
}

.bibtex-panel {
    margin-top: 14px;
    border: 1px solid #d0deea;
    border-radius: 12px;
    background: #f8fbff;
    overflow: hidden;
}

.bibtex-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #dce7f0;
    background: #edf5fb;
}

.bibtex-title {
    font-size: 13px;
    font-weight: 700;
    color: #3f5a6d;
    letter-spacing: 0.02em;
}

.bibtex-copy-btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    border: 1px solid #b9cad9;
    background: #fff;
    color: #29465a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.bibtex-copy-btn:hover {
    background: #f4f9fe;
}

.bibtex-code {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    background: #f8fbff;
    font-size: 13px;
    line-height: 1.5;
    color: #203342;
}

@media (max-width: 768px) {
    .home-link-floating {
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
    }

    .teaser-section {
        min-height: auto;
        padding: 70px 14px 18px;
    }

    .teaser-inner {
        width: 100%;
    }

    .teaser-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .teaser-summary {
        grid-column: span 2;
        min-height: 200px;
        padding: 10px;
    }

    .teaser-task,
    .teaser-summary {
        min-height: 200px;
        padding: 10px;
    }

    .task-name {
        font-size: 28px;
        line-height: 0.92;
    }

    .task-name::after {
        content: "Tap to reveal case";
        margin-top: 5px;
        font-size: 9px;
    }

    .task-count {
        font-size: 22px;
    }

    .summary-title {
        font-size: 42px;
        line-height: 0.9;
    }

    .summary-fulltitle {
        margin-top: 6px;
        max-width: none;
        font-size: 20px;
        line-height: 1.12;
    }

    .summary-subtitle {
        margin-top: auto;
        font-size: 26px;
    }

    .scroll-cue {
        margin-top: 10px;
        font-size: 13px;
    }

    .article-container {
        margin: 0 auto 56px;
        padding: 0 14px;
    }

    .article-header {
        margin-bottom: 28px;
        padding-top: 28px;
    }

    .date-tag {
        gap: 8px;
        margin-bottom: 12px;
    }

    .article-title {
        font-size: 28px;
    }

    .article-subtitle {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .project-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 20px;
    }

    .project-link {
        width: auto;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
        min-width: 0;
    }

    .project-link i {
        margin-right: 6px;
    }

    .article-content {
        font-size: 16px;
    }

    .article-content h2 {
        font-size: 24px;
        margin: 28px 0 12px;
    }

    .leaderboard-panel {
        padding: 12px;
        margin-bottom: 18px;
    }

    .leaderboard-controls {
        flex-direction: column;
        gap: 10px;
    }

    .lb-control {
        width: 100%;
    }

    .lb-control select {
        min-width: 100%;
    }

    .leaderboard-highlights {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bibtex-code {
        font-size: 12px;
    }

    .leaderboard-list-header {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: 58px 1fr;
        grid-template-areas:
            "rank model"
            "group group"
            "score score";
        gap: 6px;
    }

    .lb-rank { grid-area: rank; }
    .lb-model { grid-area: model; }
    .lb-group-tag { grid-area: group; }
    .lb-score-wrap { grid-area: score; }

    .authors-section {
        flex-direction: column;
        gap: 14px;
    }

    .authors-right {
        width: 100%;
    }

    .authors-list,
    .affiliations-list {
        font-size: 15px;
    }
}

@media (max-width: 560px) {
    .teaser-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teaser-summary {
        grid-column: span 2;
        min-height: 180px;
    }

    .teaser-task,
    .teaser-summary {
        min-height: 190px;
    }

    .task-default {
        min-height: 120px;
    }

    .summary-title {
        font-size: 22px;
    }

    .summary-fulltitle {
        font-size: 13px;
    }

    .summary-subtitle {
        font-size: 24px;
    }

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

    .project-link {
        padding: 9px 6px;
        font-size: 11px;
    }

    .authors-list,
    .affiliations-list,
    .author-note {
        font-size: 14px;
    }

    .leaderboard-row {
        padding: 10px;
    }

    .bibtex-head {
        padding: 10px;
    }

    .bibtex-copy-btn {
        padding: 0 10px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .task-name::after {
        content: "Tap and hold to inspect case";
    }
}
