:root {
    --paper: #ffffff;
    --paper-soft: #f5faff;
    --ice: #eaf5ff;
    --ice-deep: #d9edff;
    --ink: #1f344b;
    --muted: #667b92;
    --faint: #8da2b8;
    --line: #d6e7f5;
    --accent: #1871c9;
    --accent-dark: #0c4d8d;
    --accent-soft: #e5f2ff;
    --warm: #ec9a43;
    --shadow: 0 18px 52px rgba(28, 88, 142, .11);
    --radius: 18px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--paper-soft);
}

body {
    position: relative;
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 88% 2%, rgba(160, 216, 255, .40), transparent 25rem),
        radial-gradient(circle at 5% 38%, rgba(214, 239, 255, .45), transparent 28rem),
        linear-gradient(180deg, #f7fcff 0%, #ffffff 36rem, #f7fbff 100%);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: .22;
    background-image: linear-gradient(rgba(35, 108, 169, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(35, 108, 169, .05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 72%);
}

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

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(24, 113, 201, .38);
    outline-offset: 4px;
}

button {
    font: inherit;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 1rem;
    left: 1rem;
    padding: .55rem .8rem;
    color: #fff;
    background: var(--accent-dark);
    border-radius: 8px;
    transform: translateY(-180%);
    transition: transform .2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header,
.page,
.site-footer {
    position: relative;
    z-index: 1;
    width: min(100% - 3rem, 1120px);
    margin-inline: auto;
}

.site-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    min-height: 76px;
    border-bottom: 1px solid rgba(170, 202, 226, .72);
}

.brand {
    color: var(--ink);
    font-family: Newsreader, Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.035em;
    white-space: nowrap;
}

.brand span {
    margin-left: .18rem;
    color: var(--accent);
    font-family: "DM Sans", sans-serif;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
}

.top-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(.85rem, 2vw, 1.7rem);
}

.nav-link {
    position: relative;
    padding: .45rem 0;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    transition: color .2s ease;
}

.nav-link::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    content: "";
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--accent-dark);
}

.nav-link.is-active::after,
.nav-link:hover::after {
    transform: scaleX(1);
}

.header-tools {
    display: flex;
    justify-content: flex-end;
}

.language-switcher {
    display: inline-flex;
    padding: .2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
}

.language-option {
    min-width: 2rem;
    padding: .25rem .42rem;
    color: var(--faint);
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-family: "DM Mono", monospace;
    font-size: .68rem;
    font-weight: 500;
    transition: color .2s ease, background .2s ease;
}

.language-option.is-active,
.language-option:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.content-section {
    padding: 5.5rem 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 4.8rem;
}

.profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: center;
    gap: clamp(3rem, 8vw, 7.5rem);
    min-height: 570px;
    padding-top: 6.8rem;
}

.profile-copy {
    max-width: 680px;
}

.eyebrow {
    margin: 0 0 .9rem;
    color: var(--accent);
    font-family: "DM Mono", monospace;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.profile-copy h1 {
    margin: 0;
    color: var(--ink);
    font-family: Newsreader, Georgia, serif;
    font-size: clamp(2.25rem, 4.4vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -.065em;
    line-height: .96;
    white-space: nowrap;
}

.profile-copy h1 span {
    display: inline-block;
    margin-left: .4rem;
    color: var(--accent);
    font-family: "DM Sans", sans-serif;
    font-size: .4em;
    font-weight: 600;
    letter-spacing: .03em;
    vertical-align: middle;
}

.profile-role {
    margin: 1.35rem 0 1rem;
    color: var(--accent-dark);
    font-size: 1.02rem;
    font-weight: 700;
}

.profile-bio {
    max-width: 650px;
    color: var(--muted);
    font-size: 1rem;
}

.profile-bio p {
    margin: 0;
}

.profile-bio a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(24, 113, 201, .28);
    text-underline-offset: 3px;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem .7rem;
    margin-top: 1.6rem;
}

.profile-links a {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .46rem .76rem;
    color: var(--accent-dark);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    font-size: .78rem;
    font-weight: 700;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.profile-links a:hover {
    border-color: #9bc7e9;
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.link-icon {
    display: inline-grid;
    width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    color: var(--accent);
    border-radius: 50%;
    background: var(--ice);
    font-family: "DM Mono", monospace;
    font-size: .64rem;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 2.2rem;
}

.research-tags span {
    padding: .32rem .62rem;
    color: var(--muted);
    border-left: 2px solid #a9d5f4;
    font-size: .74rem;
}

.profile-portrait {
    position: relative;
    width: 100%;
    max-width: 290px;
    margin: 0;
    padding: .8rem;
    border: 1px solid #b9d8ee;
    border-radius: 50% 50% 44% 56% / 54% 45% 55% 46%;
    background: linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(221, 241, 255, .9));
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}

.profile-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50% 50% 44% 56% / 54% 45% 55% 46%;
    filter: saturate(.9) contrast(1.02);
    transform: rotate(-2deg);
}

.profile-portrait figcaption {
    position: absolute;
    right: 1.1rem;
    bottom: .8rem;
    left: 1.1rem;
    display: flex;
    justify-content: space-between;
    padding: .35rem .55rem;
    color: var(--accent-dark);
    border: 1px solid rgba(181, 215, 239, .8);
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    font-family: "DM Mono", monospace;
    font-size: .62rem;
    transform: rotate(-2deg);
}

.profile-portrait figcaption span:last-child {
    color: var(--warm);
}

.section-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.4rem;
}

.section-heading-row h2 {
    margin: 0;
    color: var(--ink);
    font-family: Newsreader, Georgia, serif;
    font-size: clamp(2.2rem, 5vw, 3.35rem);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1;
}

.section-lede {
    max-width: 320px;
    margin: 0 0 .15rem;
    color: var(--muted);
    font-size: .9rem;
}

.news-list {
    max-width: 920px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-list li {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 1.4rem;
    padding: 1.15rem 0;
    border-top: 1px solid var(--line);
}

.news-list li:last-child {
    border-bottom: 1px solid var(--line);
}

.news-list time {
    color: var(--accent);
    font-family: "DM Mono", monospace;
    font-size: .73rem;
    letter-spacing: .1em;
}

.news-list strong {
    display: block;
    margin-bottom: .22rem;
    color: var(--accent-dark);
    font-size: .9rem;
}

.news-list p {
    max-width: 730px;
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}

.research-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 2.2rem;
}

.research-filter {
    padding: .42rem .75rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
    font-size: .76rem;
    font-weight: 700;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.research-filter:hover,
.research-filter[aria-pressed="true"] {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
}

.paper-stream-label {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 2rem 0 .5rem;
    color: var(--accent-dark);
    font-family: "DM Mono", monospace;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.paper-stream-label::after {
    flex: 1;
    height: 1px;
    content: "";
    background: var(--line);
}

.paper-subsection {
    margin-top: 3.2rem;
}

.markdown-body {
    color: var(--muted);
    font-size: .91rem;
}

.markdown-body a {
    color: var(--accent);
}

.markdown-body a:hover {
    color: var(--accent-dark);
}

.paper-category-heading {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 2rem 0 .15rem;
    color: var(--ink);
    font-family: "DM Sans", sans-serif;
    font-size: .87rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.paper-category-icon {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    color: var(--accent);
    border: 1px solid #abd2ef;
    border-radius: 50%;
    background: var(--accent-soft);
}

.paper-category-count {
    margin-left: .2rem;
    color: var(--faint);
    font-family: "DM Mono", monospace;
    font-size: .65rem;
    font-weight: 400;
}

.paper-stream ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.paper-stream li {
    position: relative;
    min-height: 106px;
    padding: 1.35rem 0 1.45rem 7.2rem;
    border-top: 1px solid var(--line);
}

.paper-stream li:last-child {
    border-bottom: 1px solid var(--line);
}

.paper-stream li::before {
    position: absolute;
    top: 1.35rem;
    left: 0;
    display: grid;
    width: 5.7rem;
    height: 4.45rem;
    place-items: center;
    color: rgba(24, 113, 201, .72);
    border: 1px solid #b5d9f1;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(218,240,255,.9)),
        repeating-linear-gradient(-45deg, transparent 0 8px, rgba(24,113,201,.06) 8px 10px);
    content: "PAPER";
    font-family: "DM Mono", monospace;
    font-size: .6rem;
    letter-spacing: .12em;
}

.paper-stream li::before {
    display: none;
    content: none;
}

.paper-thumb {
    position: absolute;
    top: 1.35rem;
    left: 0;
    display: grid;
    width: 5.7rem;
    height: 4.45rem;
    overflow: hidden;
    place-items: center;
    border: 1px solid #b5d9f1;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff, #d9efff);
}

.paper-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    padding: .25rem;
    object-fit: contain;
    background: #fff;
}

.paper-thumb-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(24, 113, 201, .72);
    font-family: "DM Mono", monospace;
    font-size: .6rem;
    letter-spacing: .12em;
}

.paper-thumb img + .paper-thumb-fallback {
    display: none;
}

.paper-thumb.is-fallback img {
    display: none;
}

.paper-thumb.is-fallback .paper-thumb-fallback {
    display: grid;
}

.paper-stream li > strong,
.paper-stream li > .paper-title-link {
    display: block;
    margin-bottom: .35rem;
    color: var(--ink);
    font-family: Newsreader, Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.2;
}

.paper-stream li > .paper-title-link strong {
    color: inherit;
}

.paper-stream li > em {
    display: inline-block;
    margin-top: .28rem;
    color: var(--accent-dark);
    font-size: .82rem;
    font-style: normal;
    font-weight: 700;
}

.paper-stream li > br {
    line-height: .7;
}

.paper-stream .self-author {
    color: var(--accent-dark);
    font-weight: 700;
}

.paper-stream .action-link,
.project-links .action-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin: .7rem .38rem 0 0;
    padding: .28rem .52rem;
    color: var(--accent-dark);
    border: 1px solid #c3dfef;
    border-radius: 6px;
    background: rgba(245, 251, 255, .95);
    font-family: "DM Mono", monospace;
    font-size: .66rem;
    font-weight: 500;
    line-height: 1.2;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.paper-stream .action-link:hover,
.project-links .action-link:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
    transform: translateY(-1px);
}

.action-icon {
    width: .88rem;
    height: .88rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.contribution-note {
    margin-top: 1rem;
    color: var(--faint);
    font-size: .75rem;
}

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

.project-card {
    display: flex;
    min-height: 330px;
    flex-direction: column;
    padding: 1.3rem;
    border: 1px solid #cfe3f2;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .75);
    box-shadow: 0 8px 25px rgba(33, 101, 152, .05);
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.project-card:hover {
    border-color: #9fc8e7;
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.project-card-featured {
    border-color: #9bc9ed;
    background: linear-gradient(160deg, #edf8ff 0%, #fff 72%);
}

.project-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--faint);
    font-family: "DM Mono", monospace;
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.project-status {
    color: var(--accent);
}

.project-card h3 {
    margin: 2.25rem 0 .75rem;
    color: var(--ink);
    font-family: Newsreader, Georgia, serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -.04em;
}

.project-card p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: .32rem;
    margin-top: auto;
    padding-top: 1.45rem;
}

.project-links .action-link {
    margin: 0;
}

.open-source-note {
    margin: 1rem 0 0;
    color: var(--faint);
    font-size: .75rem;
}

.internship-entry {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 2rem;
    padding: 1.2rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.internship-logo {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

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

.internship-details h4 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
}

.internship-details h4 a {
    color: var(--accent-dark);
}

.internship-details p {
    margin: .35rem 0 0;
}

.internship-date {
    color: var(--accent);
    font-family: "DM Mono", monospace;
    font-size: .72rem;
}

#awards-md ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#awards-md li {
    position: relative;
    padding: 1rem 0 1rem 1.4rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

#awards-md li::before {
    position: absolute;
    margin-left: -1.25rem;
    color: var(--warm);
    content: "✦";
}

.site-footer {
    padding: 2.2rem 0 3.5rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--faint);
    font-family: "DM Mono", monospace;
    font-size: .7rem;
}

.footer-inner strong {
    color: var(--accent-dark);
    font-family: "DM Sans", sans-serif;
    font-size: .8rem;
}

.snowfall {
    position: fixed;
    z-index: 0;
    inset: -2rem 0 0;
    overflow: hidden;
    pointer-events: none;
}

.snowflake {
    position: absolute;
    top: -2rem;
    color: rgba(91, 166, 219, .55);
    font-family: Georgia, serif;
    text-shadow: 0 0 12px rgba(142, 210, 251, .7);
    animation-name: snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.snowflake-a { left: 4%; font-size: 1rem; animation-delay: -3s; animation-duration: 15s; }
.snowflake-b { left: 12%; font-size: 1.35rem; animation-delay: -11s; animation-duration: 21s; opacity: .5; }
.snowflake-c { left: 20%; font-size: 1.6rem; animation-delay: -6s; animation-duration: 18s; opacity: .35; }
.snowflake-d { left: 29%; font-size: .9rem; animation-delay: -15s; animation-duration: 24s; }
.snowflake-e { left: 38%; font-size: 1.3rem; animation-delay: -8s; animation-duration: 17s; opacity: .45; }
.snowflake-f { left: 47%; font-size: 1.7rem; animation-delay: -20s; animation-duration: 26s; opacity: .3; }
.snowflake-g { left: 56%; font-size: .95rem; animation-delay: -2s; animation-duration: 19s; }
.snowflake-h { left: 64%; font-size: 1.4rem; animation-delay: -12s; animation-duration: 22s; opacity: .5; }
.snowflake-i { left: 71%; font-size: 1.8rem; animation-delay: -18s; animation-duration: 27s; opacity: .3; }
.snowflake-j { left: 78%; font-size: .85rem; animation-delay: -4s; animation-duration: 16s; }
.snowflake-k { left: 84%; font-size: 1.25rem; animation-delay: -10s; animation-duration: 23s; opacity: .5; }
.snowflake-l { left: 90%; font-size: 1.8rem; animation-delay: -21s; animation-duration: 25s; opacity: .28; }
.snowflake-m { left: 94%; font-size: .9rem; animation-delay: -7s; animation-duration: 20s; }
.snowflake-n { left: 27%; font-size: .7rem; animation-delay: -16s; animation-duration: 29s; opacity: .45; }

@keyframes snowfall {
    0% { transform: translate3d(0, -8vh, 0) rotate(0deg); }
    35% { transform: translate3d(22px, 34vh, 0) rotate(110deg); }
    70% { transform: translate3d(-18px, 70vh, 0) rotate(240deg); }
    100% { transform: translate3d(26px, 112vh, 0) rotate(360deg); }
}

@media (max-width: 900px) {
    .site-header {
        grid-template-columns: auto auto;
    }

    .top-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        order: 3;
        overflow-x: auto;
        width: 100%;
        padding-bottom: .8rem;
    }

    .header-tools {
        grid-column: 2;
    }

    .profile-hero {
        grid-template-columns: minmax(0, 1fr) 225px;
        gap: 2rem;
    }

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

    .project-card-featured {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .site-header,
    .page,
    .site-footer {
        width: min(100% - 2rem, 1120px);
    }

    .site-header {
        min-height: 68px;
        gap: 1rem;
    }

    .brand {
        font-size: 1.3rem;
    }

    .top-nav {
        gap: 1rem;
    }

    .nav-link {
        font-size: .67rem;
        letter-spacing: .08em;
    }

    .content-section {
        padding: 3.8rem 0;
    }

    .profile-hero {
        display: flex;
        min-height: auto;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 2.4rem;
        padding-top: 4rem;
    }

    .profile-portrait {
        width: 190px;
        align-self: center;
    }

    .profile-copy h1 {
        font-size: clamp(2.2rem, 11vw, 2.9rem);
    }

    .section-heading-row {
        display: block;
        margin-bottom: 1.8rem;
    }

    .section-lede {
        max-width: none;
        margin-top: 1rem;
    }

    .news-list li {
        grid-template-columns: 60px 1fr;
        gap: .75rem;
    }

    .paper-stream li {
        padding-left: 0;
        padding-top: 5.9rem;
    }

    .paper-stream li::before {
        top: 1rem;
        width: 4.8rem;
        height: 3.8rem;
    }

    .paper-thumb {
        top: 1rem;
        width: 4.8rem;
        height: 3.8rem;
    }

    .paper-stream li > strong,
    .paper-stream li > .paper-title-link {
        font-size: 1.1rem;
    }

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

    .project-card-featured {
        grid-column: auto;
    }

    .project-card {
        min-height: 285px;
    }

    .internship-entry {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .internship-logo {
        justify-content: flex-start;
    }

    .footer-inner {
        flex-wrap: wrap;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Screenshot-inspired academic layout.  This block intentionally lives at the
   end so the presentation stays easy to tune without changing the content
   renderer above.  The rules use widely supported grid/flex primitives so the
   page keeps the same shape in Safari and Chromium. */
:root {
    --paper: #fffaff;
    --paper-soft: #fffaff;
    --ink: #111016;
    --muted: #222127;
    --faint: #77727d;
    --line: #eee8f2;
    --accent: #7042b6;
    --accent-dark: #5c329d;
    --accent-soft: #f1eafb;
    --warm: #c784b4;
}

html {
    background: var(--paper);
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 12%, rgba(241, 220, 242, .42), transparent 24rem),
        radial-gradient(circle at 92% 46%, rgba(255, 232, 244, .48), transparent 28rem),
        linear-gradient(180deg, #fffaff 0%, #fff 42rem, #fffaff 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    opacity: .45;
    background-image: radial-gradient(circle, rgba(124, 76, 171, .16) 1.1px, transparent 1.2px);
    background-size: 27px 27px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .72), transparent 88%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .72), transparent 88%);
}

.site-header,
.page,
.site-footer {
    width: min(calc(100% - 8rem), 1620px);
}

.page {
    width: min(calc(100% - 8rem), 1540px);
}

.site-header {
    min-height: 98px;
    gap: 2.8rem;
    border-bottom-color: #f0ebf4;
    background: rgba(255, 255, 255, .84);
}

.brand {
    color: var(--accent);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.35rem;
    letter-spacing: -.03em;
}

.brand span {
    color: var(--accent);
}

.top-nav {
    justify-content: flex-end;
    gap: clamp(1.2rem, 2.2vw, 2.4rem);
}

.nav-link {
    padding: .35rem 0;
    color: #514e53;
    font-size: 1.03rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.nav-link::after {
    height: 2px;
    background: var(--accent);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--accent);
}

.header-tools {
    align-items: center;
    gap: .55rem;
}

.day-toggle {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .95rem;
    color: var(--accent);
    border: 1px solid #e2d7f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

.day-toggle:hover {
    background: var(--accent-soft);
}

.day-toggle-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.language-switcher {
    border-color: #eadff3;
    background: rgba(255, 255, 255, .78);
}

.language-option {
    color: #8a8490;
}

.language-option.is-active,
.language-option:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 2rem 4.5rem;
    min-height: 0;
    padding: 3.7rem 0 4.5rem;
}

.profile-title {
    grid-column: 1 / -1;
    margin: 0 0 .65rem;
    color: #050505;
    font-family: Newsreader, Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 5.2vw, 4.55rem);
    font-weight: 600;
    letter-spacing: -.055em;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
}

.profile-title span {
    margin-left: .28em;
    font-family: "Noto Serif SC", "Songti SC", STSong, serif;
    font-size: .68em;
    letter-spacing: .03em;
}

.profile-copy {
    max-width: none;
}

.profile-copy > .eyebrow,
.profile-role {
    display: none;
}

.profile-bio {
    max-width: 1100px;
    color: #111016;
    font-size: clamp(1.22rem, 1.55vw, 1.78rem);
    line-height: 1.3;
}

.profile-bio p {
    margin: 0 0 1.05rem;
}

.profile-bio a {
    color: var(--accent);
    text-decoration-color: rgba(112, 66, 182, .35);
}

.profile-bio strong {
    color: #0a0a0b;
    font-weight: 700;
}

.profile-bio ol {
    margin: 1rem 0 1.15rem;
    padding: 0;
    list-style: none;
    counter-reset: research-direction;
}

.profile-bio ol > li {
    position: relative;
    margin: .7rem 0;
    padding-left: 3.55rem;
    counter-increment: research-direction;
}

.profile-bio ol > li::before {
    position: absolute;
    top: 0;
    left: 0;
    content: "(" counter(research-direction, lower-roman) ")";
    font-variant-numeric: tabular-nums;
}

.profile-portrait {
    width: 100%;
    max-width: 360px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.profile-portrait img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0;
    filter: none;
    transform: none;
}

.profile-portrait figcaption,
.research-tags {
    display: none;
}

.profile-links {
    grid-column: 1 / -1;
    justify-content: center;
    gap: 0;
    margin-top: .15rem;
}

.profile-links a {
    padding: 0;
    color: var(--accent);
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: clamp(1.05rem, 1.45vw, 1.55rem);
    font-weight: 600;
}

.profile-links a:hover {
    color: var(--accent-dark);
    background: transparent;
    transform: none;
}

.profile-links a + a::before {
    margin: 0 .62rem;
    color: #2f2935;
    content: "/";
}

.link-icon {
    display: none;
}

.content-section {
    padding: 5rem 0;
    border-bottom-color: var(--line);
}

.section-heading-row h2 {
    color: #111016;
}

.eyebrow,
.paper-stream-label {
    color: var(--accent);
}

.news-list li,
.paper-stream li,
#awards-md li,
.internship-entry {
    border-color: var(--line);
}

.news-list time,
.news-list strong,
.paper-stream li > em,
.internship-details h4 a {
    color: var(--accent);
}

.project-card,
.research-filter,
.paper-stream .action-link,
.project-links .action-link {
    border-color: #eadff3;
    background: rgba(255, 255, 255, .8);
}

.project-card-featured {
    border-color: #d6c3ea;
    background: linear-gradient(160deg, #fbf5ff 0%, #fff 72%);
}

.snowflake {
    color: rgba(196, 119, 181, .33);
    text-shadow: 0 0 12px rgba(238, 178, 222, .52);
}

@media (max-width: 1180px) {
    .site-header,
    .page,
    .site-footer {
        width: min(calc(100% - 4rem), 1320px);
    }

    .profile-hero {
        gap: 2rem 3rem;
    }
}

@media (max-width: 900px) {
    .site-header,
    .page,
    .site-footer {
        width: min(calc(100% - 3rem), 1120px);
    }

    .site-header {
        min-height: 88px;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .profile-hero {
        grid-template-columns: minmax(0, 1fr) 260px;
        gap: 1.8rem 2.3rem;
    }

    .profile-title {
        font-size: clamp(2.7rem, 7vw, 4rem);
    }

    .profile-bio {
        font-size: clamp(1.13rem, 2.2vw, 1.45rem);
    }
}

@media (max-width: 680px) {
    .site-header,
    .page,
    .site-footer {
        width: calc(100% - 2rem);
    }

    .site-header {
        min-height: 76px;
    }

    .header-tools {
        gap: .25rem;
    }

    .day-toggle {
        padding: .48rem .7rem;
        font-size: .82rem;
    }

    .day-toggle-icon {
        font-size: 1.1rem;
    }

    .profile-hero {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.6rem 0 3.4rem;
    }

    .profile-title {
        grid-column: 1;
        font-size: clamp(2.2rem, 10vw, 3.4rem);
        white-space: normal;
    }

    .profile-copy {
        grid-column: 1;
        grid-row: 3;
    }

    .profile-portrait {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        width: min(72vw, 290px);
    }

    .profile-links {
        grid-column: 1;
        grid-row: 4;
        justify-content: flex-start;
        flex-wrap: wrap;
        row-gap: .35rem;
    }

    .profile-links a {
        font-size: 1.05rem;
    }

    .profile-links a + a::before {
        margin: 0 .42rem;
    }
}

@supports not (aspect-ratio: 1 / 1) {
    .profile-portrait img {
        height: 360px;
    }
}

/* News timeline */
.news-section .section-heading-row {
    margin-bottom: 2.2rem;
}

.news-section .section-heading-row .eyebrow {
    display: none;
}

.news-section .section-heading-row h2 {
    display: inline-block;
    color: #080709;
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    text-decoration: underline;
    text-decoration-color: #e2a24c;
    text-decoration-thickness: .16rem;
    text-underline-offset: .18rem;
}

.news-list {
    position: relative;
    max-width: 1320px;
    margin: 0;
    padding: .25rem 0;
}

.news-list::before {
    position: absolute;
    top: 1.4rem;
    bottom: 1.4rem;
    left: calc(190px + 2.8rem);
    width: 1px;
    content: "";
    background: #d9c9e7;
}

.news-list li {
    display: grid;
    grid-template-columns: 190px 3.6rem minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    min-height: 4.2rem;
    padding: 1.15rem 0;
    border: 0;
}

.news-list li:last-child {
    border-bottom: 0;
}

.news-list time {
    padding-top: .12rem;
    color: #74697d;
    font-family: "DM Mono", monospace;
    font-size: clamp(.72rem, 1.1vw, 1rem);
    letter-spacing: .03em;
    line-height: 1.5;
    text-align: right;
    white-space: nowrap;
}

.news-list time::before {
    content: "[";
}

.news-list time::after {
    content: "]";
}

.news-marker {
    position: relative;
    z-index: 1;
    display: grid;
    width: 3.6rem;
    min-height: 2.3rem;
    place-items: center;
    background: var(--paper);
    font-size: 1.55rem;
    line-height: 1;
}

.news-marker::before {
    position: absolute;
    z-index: -1;
    width: .72rem;
    height: .72rem;
    content: "";
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 .28rem var(--paper);
}

.news-event {
    max-width: 1110px;
    padding-top: .02rem;
    color: #101014;
    font-size: clamp(1.05rem, 1.45vw, 1.5rem);
    line-height: 1.42;
}

.news-event strong {
    display: inline;
    margin: 0;
    margin-right: .32em;
    color: var(--accent);
    font-size: inherit;
    font-weight: 700;
}

.news-event p {
    display: inline;
    margin: 0;
    color: #101014;
    font-size: inherit;
    line-height: inherit;
}

@media (max-width: 680px) {
    .news-list::before {
        left: calc(90px + 2rem);
    }

    .news-list li {
        grid-template-columns: 90px 2.6rem minmax(0, 1fr);
        gap: .55rem;
        padding: 1rem 0;
    }

    .news-list time {
        font-size: .64rem;
        letter-spacing: 0;
    }

    .news-marker {
        width: 2.6rem;
        font-size: 1.28rem;
    }

    .news-event {
        font-size: 1rem;
    }
}

/* Education, research experience, and service use the same editorial CV
   rhythm as the reference page: an institution mark, a concise description,
   and a right-aligned date. */
.cv-section .section-heading-row {
    margin-bottom: 2.6rem;
}

.cv-section .section-heading-row .eyebrow {
    display: none;
}

.cv-section .section-heading-row h2 {
    display: inline-block;
    color: #080709;
    font-size: clamp(2.55rem, 4.6vw, 4.05rem);
    text-decoration: underline;
    text-decoration-color: #e2a24c;
    text-decoration-thickness: .16rem;
    text-underline-offset: .18rem;
}

.cv-section .markdown-body {
    color: #111016;
    font-size: clamp(1rem, 1.18vw, 1.22rem);
    line-height: 1.48;
}

.cv-subheading {
    margin: 0 0 1rem;
    color: #111016;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.25rem, 1.7vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -.02em;
}

.cv-subheading:not(:first-child) {
    margin-top: 3.15rem;
}

.cv-list {
    display: grid;
    margin: 0;
}

.cv-entry {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 190px;
    align-items: start;
    gap: clamp(1.2rem, 3vw, 2.8rem);
    padding: 1.55rem 0;
    border-top: 1px solid var(--line);
}

.cv-entry:last-child {
    border-bottom: 1px solid var(--line);
}

.cv-mark {
    display: flex;
    width: 166px;
    min-height: 76px;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    color: var(--accent);
    border: 1px solid #eadff3;
    border-radius: 10px;
    background: rgba(255, 255, 255, .82);
    font-family: Newsreader, Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
}

.cv-mark-zjsu {
    color: #514e53;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.25rem;
    letter-spacing: .08em;
}

.cv-mark-modelbest {
    padding: .75rem .5rem;
}

.cv-mark-modelbest img {
    display: block;
    width: 100%;
    height: auto;
}

.cv-body h4 {
    margin: 0;
    color: var(--accent);
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.2rem, 1.65vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
}

.cv-body h4 a {
    color: inherit;
}

.cv-body h4 a:hover {
    color: var(--accent-dark);
}

.cv-role {
    margin: .42rem 0 0;
    color: #111016;
    font-weight: 600;
}

.cv-detail {
    margin: .45rem 0 0;
    color: #4c4850;
}

.cv-date {
    margin: .08rem 0 0;
    color: #74697d;
    font-family: "DM Mono", monospace;
    font-size: .84em;
    line-height: 1.45;
    text-align: right;
    white-space: nowrap;
}

.cv-section #awards-md .service-list {
    margin: 0;
    padding: 0 0 0 1.75rem;
    list-style: disc;
}

.cv-section #awards-md .service-list li {
    padding: .3rem 0 .3rem .2rem;
    border: 0;
    color: #111016;
    font-size: clamp(1.05rem, 1.55vw, 1.45rem);
    line-height: 1.5;
}

.cv-section #awards-md .service-list li::before {
    display: none;
    content: none;
}

@media (max-width: 820px) {
    .cv-entry {
        grid-template-columns: 130px minmax(0, 1fr) 145px;
        gap: 1.1rem;
    }

    .cv-mark {
        width: 126px;
        min-height: 66px;
        font-size: 1.25rem;
    }

    .cv-mark-modelbest {
        padding-inline: .35rem;
    }
}

@media (max-width: 680px) {
    .cv-section .section-heading-row h2 {
        font-size: clamp(2.35rem, 10vw, 3.35rem);
    }

    .cv-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: .72rem;
        padding: 1.35rem 0;
    }

    .cv-mark {
        width: 142px;
        min-height: 62px;
    }

    .cv-date {
        order: -1;
        text-align: left;
    }

    .cv-body h4 {
        font-size: 1.22rem;
    }

    .cv-section #awards-md .service-list {
        padding-left: 1.4rem;
    }
}


/* Final pass: compact editorial width, readable type, and larger method figures. */
.site-header,
.page,
.site-footer {
    width: min(calc(100% - 4rem), 1240px);
}

.site-header {
    gap: 1.8rem;
}

.top-nav {
    gap: clamp(1rem, 1.8vw, 1.8rem);
}

.profile-hero {
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 1.8rem clamp(2rem, 4vw, 4rem);
}

.profile-title {
    font-size: clamp(2.45rem, 4.2vw, 3.7rem);
}

.profile-bio {
    max-width: none;
    font-size: clamp(1.02rem, 1.18vw, 1.28rem);
    line-height: 1.48;
}

.profile-bio p {
    margin-bottom: .85rem;
}

.profile-bio ol {
    margin-top: .75rem;
}

.profile-bio ol > li {
    margin: .55rem 0;
    padding-left: 3.05rem;
}

.profile-portrait {
    max-width: 300px;
    justify-self: end;
}

.profile-portrait figcaption {
    display: block;
    margin-top: .7rem;
    color: #74697d;
    font-family: "DM Mono", monospace;
    font-size: .74rem;
    line-height: 1.4;
    text-align: center;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.1rem;
}

.research-tags span {
    padding: .26rem .62rem;
    color: var(--accent-dark);
    border: 1px solid #eadff3;
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    font-family: "DM Mono", monospace;
    font-size: .7rem;
    line-height: 1.35;
}

.paper-stream li {
    min-height: clamp(145px, 12vw, 185px);
    padding: 1.35rem 0 1.45rem calc(20% + 1.5rem);
}

.paper-thumb {
    width: calc(20% - 1.25rem);
    height: clamp(8rem, 10vw, 11rem);
    border-radius: 10px;
}

.paper-stream li > strong,
.paper-stream li > .paper-title-link {
    font-size: clamp(1.08rem, 1.3vw, 1.32rem);
}

.paper-stream .self-author {
    color: inherit;
    font-weight: inherit;
}

/* Markdown wraps most publication rows in a paragraph, so style that title path too. */
.paper-stream li > p {
    margin: 0;
}

.paper-stream li > p > .paper-title-link,
.paper-stream li > p > .paper-title-link strong,
.paper-stream li .paper-title-link {
    display: block;
    margin-bottom: .16rem;
    color: #111016 !important;
    font-family: Newsreader, Georgia, serif;
    font-size: clamp(1.12rem, 1.5vw, 1.42rem);
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.24;
}

.paper-stream li > p > .paper-title-link:hover,
.paper-stream li > p > .paper-title-link:hover strong,
.paper-stream li .paper-title-link:hover {
    color: #111016 !important;
}

.news-event {
    font-size: clamp(1rem, 1.18vw, 1.25rem);
}

@media (max-width: 900px) {
    .site-header,
    .page,
    .site-footer {
        width: min(calc(100% - 3rem), 1120px);
    }

    .profile-hero {
        grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr);
        gap: 1.8rem 2.4rem;
    }

    .profile-portrait {
        max-width: 260px;
    }
}

@media (max-width: 680px) {
    .site-header,
    .page,
    .site-footer {
        width: calc(100% - 2rem);
    }

    .profile-hero {
        grid-template-columns: 1fr;
    }

    .profile-portrait {
        width: min(72vw, 280px);
        justify-self: center;
    }

    .paper-stream li {
        min-height: 0;
        padding-left: 0;
        padding-top: 5.9rem;
    }

    .paper-thumb {
        top: 1rem;
        width: 4.8rem;
        height: 3.8rem;
    }
}

/* Keep the desktop composition centered with roughly one third of the row
   reserved as outer whitespace, while retaining the mobile widths above. */
@media (min-width: 1101px) {
    .site-header,
    .page,
    .site-footer {
        width: min(66.6667vw, 1240px);
    }
}

.news-event .news-detail {
    display: inline;
    margin: 0;
}

.news-event .news-detail + .news-detail {
    margin-top: .18rem;
}

/* Paper visuals: use clean square thumbnails without a card frame. */
.paper-thumb {
    height: auto;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.paper-thumb img {
    padding: 0;
    object-fit: contain;
    background: transparent;
}

/* Keep section labels compact and let each paper read as one continuous line. */
.section-heading-row h2,
.news-section .section-heading-row h2,
.cv-section .section-heading-row h2 {
    font-size: clamp(1.85rem, 3.2vw, 2.65rem);
}

.profile-portrait figcaption {
    display: none !important;
}

.paper-stream .self-author {
    color: var(--accent-dark);
    font-weight: 700;
}

@media (max-width: 680px) {
    .section-heading-row h2,
    .news-section .section-heading-row h2,
    .cv-section .section-heading-row h2 {
        font-size: 2rem;
    }
}

/* Latest content pass: denser timelines, larger paper method previews, and institution marks. */
.news-list li {
    min-height: 3.45rem;
    padding: .72rem 0;
}

.paper-stream li {
    min-height: clamp(170px, 16vw, 240px);
    padding: 1.05rem 0 1.1rem calc(22% + 1.35rem);
}

.paper-thumb {
    top: 1.05rem;
    width: min(calc(22% - 1rem), 240px);
    height: auto;
    aspect-ratio: 1 / 1;
}

.cv-mark {
    overflow: hidden;
    padding: .45rem;
}

.cv-mark img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 62px;
    object-fit: contain;
}

.cv-mark-zju,
.cv-mark-zjsu {
    padding: .42rem;
}

.cv-mark-modelbest {
    padding: .7rem .5rem;
}

@media (max-width: 680px) {
    .news-list li {
        min-height: 0;
        padding: .66rem 0;
    }

    .paper-stream li {
        min-height: 0;
        padding-top: 5.35rem;
        padding-bottom: 1rem;
    }

    .paper-thumb {
        top: .85rem;
        width: 5.5rem;
        height: 4.35rem;
    }
}


/* Align presentation and paper visuals with the title line and use official school marks. */
.paper-thumb img {
    object-position: top center;
}

.cv-mark-zju {
    background: #fff;
}

.cv-mark-zjsu {
    color: #fff;
    border-color: #173b60;
    background: #173b60;
}


/* Use seal-only, white-background institution marks at a larger scale. */
.cv-mark-zju,
.cv-mark-zjsu {
    width: 166px;
    min-height: 106px;
    padding: .35rem;
    color: var(--ink);
    border-color: #e3e3e3;
    background: #fff;
}

.cv-mark-zju img,
.cv-mark-zjsu img {
    width: auto;
    max-width: 100%;
    max-height: 96px;
    object-fit: contain;
}

.cv-mark-zjsu img {
    filter: brightness(0) saturate(100%) invert(20%) sepia(24%) saturate(1716%) hue-rotate(173deg) brightness(88%) contrast(91%);
}

@media (max-width: 820px) {
    .cv-mark-zju,
    .cv-mark-zjsu {
        width: 126px;
        min-height: 94px;
    }

    .cv-mark-zju img,
    .cv-mark-zjsu img {
        max-height: 82px;
    }
}

@media (max-width: 680px) {
    .cv-mark-zju,
    .cv-mark-zjsu {
        width: 142px;
        min-height: 96px;
    }

    .cv-mark-zju img,
    .cv-mark-zjsu img {
        max-height: 86px;
    }
}


/* Paper topic filters and a compact, screenshot-like publication index. */
.paper-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.15rem;
}

.paper-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.paper-filter {
    padding: .42rem .84rem;
    color: #5d5861;
    border: 1.5px solid #eadff3;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
    font: inherit;
    font-size: clamp(.84rem, 1.05vw, 1rem);
    font-weight: 700;
    line-height: 1.25;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.paper-filter:hover,
.paper-filter.is-active,
.paper-filter[aria-pressed="true"] {
    color: var(--accent-dark);
    border-color: var(--accent);
    background: #f3edff;
    transform: translateY(-1px);
}

.paper-count {
    flex: 0 0 auto;
    color: #6f6873;
    font-size: clamp(.9rem, 1.1vw, 1.08rem);
    white-space: nowrap;
}

#papers-md > ul > li[hidden] {
    display: none;
}

/* Keep paper rows close together while preserving the large square preview. */
.paper-stream li {
    min-height: clamp(150px, 13vw, 205px);
    padding: .78rem 0 .82rem calc(22% + 1.15rem);
}

.paper-thumb {
    top: .78rem;
    width: min(calc(22% - .85rem), 220px);
    height: auto;
    aspect-ratio: 1 / 1;
}

.paper-stream .contribution-note {
    margin-top: .8rem;
    color: #6f6873;
    font-size: .82rem;
}

/* Institution marks are clean images without the rounded card frame. */
.cv-mark,
.cv-mark-zju,
.cv-mark-zjsu,
.cv-mark-modelbest {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.cv-mark-zju,
.cv-mark-zjsu {
    width: 166px;
    min-height: 116px;
}

.cv-mark-zju img,
.cv-mark-zjsu img {
    width: auto;
    max-width: 100%;
    max-height: 112px;
    object-fit: contain;
    background: #fff;
    filter: none;
}

.cv-mark-modelbest img {
    max-height: 72px;
    background: transparent;
}

@media (max-width: 820px) {
    .paper-filter-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .cv-mark-zju,
    .cv-mark-zjsu {
        width: 126px;
        min-height: 98px;
    }

    .cv-mark-zju img,
    .cv-mark-zjsu img {
        max-height: 96px;
    }
}

@media (max-width: 680px) {
    .paper-filter-list {
        gap: .42rem;
    }

    .paper-filter {
        padding: .38rem .66rem;
        font-size: .78rem;
    }

    .paper-stream li {
        min-height: 0;
        padding-top: 5.5rem;
        padding-bottom: .72rem;
    }

    .paper-thumb {
        top: .72rem;
        width: 5.5rem;
        height: 5.5rem;
    }

    .cv-mark-zju,
    .cv-mark-zjsu {
        width: 142px;
        min-height: 104px;
    }

    .cv-mark-zju img,
    .cv-mark-zjsu img {
        max-height: 102px;
    }
}

/* Compact CV rhythm: keep sections distinct while fitting more useful detail above the fold. */
.content-section {
    padding-block: 3.4rem;
}

.section-heading-row {
    margin-bottom: 1.45rem;
}

.news-section .section-heading-row,
.cv-section .section-heading-row {
    margin-bottom: 1.45rem;
}

.news-list li {
    min-height: 3rem;
    padding-block: .52rem;
}

.news-event,
.news-event p {
    line-height: 1.34;
}

.cv-section .markdown-body {
    line-height: 1.34;
}

.cv-subheading {
    margin-bottom: .58rem;
    line-height: 1.22;
}

.cv-subheading:not(:first-child) {
    margin-top: 1.7rem;
}

.cv-entry {
    gap: clamp(1rem, 2.4vw, 2.2rem);
    padding-block: .88rem;
}

.cv-body h4 {
    line-height: 1.18;
}

.cv-role {
    margin-top: .24rem;
    line-height: 1.3;
}

.cv-detail {
    margin-top: .24rem;
    line-height: 1.32;
}

.cv-date {
    line-height: 1.3;
}

.cv-section #awards-md .service-list li {
    padding-block: .16rem;
    line-height: 1.34;
}

@media (max-width: 680px) {
    .content-section {
        padding-block: 2.65rem;
    }

    .section-heading-row,
    .news-section .section-heading-row,
    .cv-section .section-heading-row {
        margin-bottom: 1.1rem;
    }

    .news-list li {
        padding-block: .46rem;
    }

    .cv-entry {
        gap: .52rem;
        padding-block: .72rem;
    }

    .cv-subheading:not(:first-child) {
        margin-top: 1.35rem;
    }
}

/* Keep the two CV modules visibly separate without reintroducing large gaps. */
.cv-section + .cv-section {
    padding-top: 2.6rem;
}

.cv-section .cv-block + .cv-block {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.cv-section .cv-block-honors {
    margin-top: 1.15rem;
}

@media (max-width: 680px) {
    .cv-section + .cv-section {
        padding-top: 2.1rem;
    }

    .cv-section .cv-block + .cv-block {
        margin-top: 1rem;
        padding-top: .8rem;
    }
}

/* Keep the Education/Experience and Service/Honors groups visibly distinct. */
.cv-block + .cv-block {
    margin-top: 1.35rem;
}

@media (max-width: 680px) {
    .cv-block + .cv-block {
        margin-top: 1rem;
    }
}

/* Minimal header and text-only paper list. */
.site-header {
    grid-template-columns: 1fr auto;
}

.top-nav {
    justify-content: flex-start;
}

.paper-count,
.paper-thumb {
    display: none !important;
}

.paper-stream li {
    min-height: 0;
    padding: .62rem 0 .68rem;
}

@media (max-width: 680px) {
    .site-header {
        grid-template-columns: 1fr auto;
    }

    .paper-stream li {
        padding: .5rem 0 .58rem;
    }
}

/* Paper typography: make titles the visual anchor and remove ornamental row rules. */
.paper-stream li {
    border-top: 0;
    border-bottom: 0;
    color: #4d4952;
    font-size: clamp(.86rem, .95vw, 1rem);
}

.paper-stream li > strong,
.paper-stream li > .paper-title-link,
.paper-stream li > .paper-title-link strong {
    color: #111016 !important;
    font-size: clamp(1.12rem, 1.5vw, 1.42rem);
    font-weight: 600;
    line-height: 1.24;
}

.paper-stream li > .paper-title-link:hover,
.paper-stream li > .paper-title-link:hover strong {
    color: #111016 !important;
}

.paper-stream .self-author {
    color: #111016;
    font-weight: 700;
}

/* Final layout pass: let the introduction wrap naturally around a smaller portrait. */
.profile-hero {
    display: block;
    min-height: 0;
    padding-block: 3.15rem 3.7rem;
}

.profile-title {
    margin-bottom: .72rem;
}

.profile-portrait {
    float: right;
    width: min(22vw, 240px);
    max-width: 240px;
    margin: 0 0 1rem 2.25rem;
}

.profile-copy {
    max-width: none;
}

.profile-links {
    clear: both;
}

/* The section keeps its internal Education and Research Experience subheads. */
.cv-section-experience {
    padding-top: 2.25rem;
}

/* Keep the content airy without drawing a rule between every module or entry. */
.content-section {
    border-bottom: 0;
}

.cv-entry,
.cv-entry:last-child,
.cv-section .cv-block + .cv-block {
    border-top: 0;
    border-bottom: 0;
}

/* News is a compact timeline rather than a widely spaced list. */
.news-list li {
    min-height: 0;
    padding-block: .34rem;
}

.news-event,
.news-event p {
    line-height: 1.25;
}

.news-list time {
    line-height: 1.25;
}

/* Keep every author at the same weight/color while paper titles remain black. */
.paper-stream .self-author {
    color: inherit;
    font-weight: inherit;
}

@media (max-width: 680px) {
    .profile-hero {
        display: block;
        padding-block: 2.35rem 2.9rem;
    }

    .profile-portrait {
        float: none;
        width: 160px;
        max-width: 160px;
        margin: 0 auto 1.15rem;
    }

    .profile-links {
        margin-top: 1rem;
    }

    .cv-section-experience {
        padding-top: 1.65rem;
    }

    .news-list li {
        padding-block: .28rem;
    }
}

/* Tighter section rhythm and a wider outer margin for the long-form page. */
.content-section {
    padding-block: 2.45rem;
}

.profile-hero {
    padding-block: 2.6rem 3rem;
}

.section-heading-row,
.news-section .section-heading-row,
.cv-section .section-heading-row {
    margin-bottom: 1.05rem;
}

.cv-section-experience,
.cv-section-awards {
    padding-top: 1.8rem;
}

.cv-section + .cv-section {
    padding-top: 1.65rem;
}

/* Education and Research Experience are the visible headings of this CV block. */
.cv-section-experience .cv-subheading {
    margin-bottom: .62rem;
    color: #111016;
    font-family: Newsreader, Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 2.25vw, 2.05rem);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: 1.1;
}

.cv-section-experience .cv-subheading:not(:first-child) {
    margin-top: 1.45rem;
}

/* Meeting and publication decisions read as compact badges. */
.paper-stream li em {
    display: inline-block;
    margin-top: .08rem;
    margin-right: .3rem;
    padding: .18rem .48rem;
    color: var(--accent-dark);
    border: 1px solid #e2d7f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    font-size: .76rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.2;
}

/* Bring the author line close to its title. */
.paper-stream li > p {
    line-height: 1.22;
}

.paper-stream li > p > .paper-title-link,
.paper-stream li .paper-title-link {
    margin-bottom: .03rem;
    line-height: 1.16;
}

.paper-stream li > br {
    line-height: .45;
}

.paper-stream li {
    padding-block: .48rem .54rem;
}

@media (min-width: 1101px) {
    .site-header,
    .page,
    .site-footer {
        width: min(60vw, 1240px);
    }
}

@media (max-width: 680px) {
    .content-section {
        padding-block: 1.9rem;
    }

    .profile-hero {
        padding-block: 2rem 2.35rem;
    }

    .cv-section-experience,
    .cv-section-awards {
        padding-top: 1.35rem;
    }

    .cv-section + .cv-section {
        padding-top: 1.25rem;
    }

    .paper-stream li {
        padding-block: .4rem .46rem;
    }
}


/* Final CV and paper type pass. */
.cv-entry {
    grid-template-columns: 170px minmax(0, 1fr) max-content;
    gap: clamp(.8rem, 1.8vw, 1.55rem);
}

.cv-block-experience .cv-entry {
    grid-template-columns: 170px minmax(0, 1fr);
}

.cv-date {
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    font-weight: 600;
    line-height: 1.2;
}

.cv-detail {
    max-width: none;
    line-height: 1.36;
}

.paper-stream li > p {
    font-family: "Avenir Next", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(.98rem, 1.08vw, 1.1rem);
}

.paper-stream .self-author {
    color: inherit;
    font-family: inherit;
    font-weight: 700;
}

.paper-stream .action-link {
    font-size: .78rem;
}

@media (max-width: 680px) {
    .cv-block-experience .cv-entry {
        grid-template-columns: minmax(0, 1fr);
    }

    .paper-stream li > p {
        font-size: .98rem;
    }

    .paper-stream .action-link {
        font-size: .74rem;
    }
}

/* Theme toggle: preserve the light editorial palette while giving the dark
   mode its own readable surface and rainy atmosphere. */
html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #171321;
    --paper-soft: #171321;
    --ink: #f2edf8;
    --muted: #d0c7dc;
    --faint: #aaa0b6;
    --line: #3a3048;
    --accent: #b993f4;
    --accent-dark: #d4baff;
    --accent-soft: #2d2341;
    --warm: #e4a4ce;
}

html[data-theme="dark"] body {
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 12%, rgba(73, 56, 108, .34), transparent 25rem),
        radial-gradient(circle at 92% 46%, rgba(65, 42, 89, .3), transparent 28rem),
        linear-gradient(180deg, #171321 0%, #1d1728 42rem, #171321 100%);
    transition: background-color .25s ease, color .25s ease;
}

html[data-theme="dark"] body::before {
    opacity: .22;
    background-image: radial-gradient(circle, rgba(189, 157, 239, .2) 1px, transparent 1.2px);
}

html[data-theme="dark"] .site-header {
    border-bottom-color: #3a3048;
    background: rgba(23, 19, 33, .9);
}

html[data-theme="dark"] .nav-link {
    color: #d5cce0;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.is-active {
    color: var(--accent);
}

html[data-theme="dark"] .day-toggle,
html[data-theme="dark"] .language-switcher {
    color: var(--accent);
    border-color: #55436d;
    background: rgba(35, 27, 49, .88);
}

html[data-theme="dark"] .day-toggle:hover,
html[data-theme="dark"] .language-option.is-active,
html[data-theme="dark"] .language-option:hover {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

html[data-theme="dark"] .language-option {
    color: #a99fb6;
}

html[data-theme="dark"] .profile-title,
html[data-theme="dark"] .profile-bio,
html[data-theme="dark"] .section-heading-row h2,
html[data-theme="dark"] .news-section .section-heading-row h2,
html[data-theme="dark"] .cv-section .section-heading-row h2,
html[data-theme="dark"] .news-event,
html[data-theme="dark"] .news-event p,
html[data-theme="dark"] .cv-section .markdown-body,
html[data-theme="dark"] .cv-subheading,
html[data-theme="dark"] .cv-role,
html[data-theme="dark"] .cv-detail,
html[data-theme="dark"] .cv-section #awards-md .service-list li {
    color: var(--ink);
}

html[data-theme="dark"] .profile-bio strong {
    color: #fff;
}

html[data-theme="dark"] .profile-links a + a::before {
    color: #c1b5d0;
}

html[data-theme="dark"] .news-list::before {
    background: #56456a;
}

html[data-theme="dark"] .news-list time,
html[data-theme="dark"] .cv-date,
html[data-theme="dark"] .profile-portrait figcaption {
    color: var(--faint);
}

html[data-theme="dark"] .paper-stream li {
    color: #d0c7d9;
}

html[data-theme="dark"] .paper-stream li > strong,
html[data-theme="dark"] .paper-stream li > .paper-title-link,
html[data-theme="dark"] .paper-stream li > .paper-title-link strong,
html[data-theme="dark"] .paper-stream li > p > .paper-title-link,
html[data-theme="dark"] .paper-stream li > p > .paper-title-link strong,
html[data-theme="dark"] .paper-stream li .paper-title-link,
html[data-theme="dark"] .paper-stream li > .paper-title-link:hover,
html[data-theme="dark"] .paper-stream li > .paper-title-link:hover strong,
html[data-theme="dark"] .paper-stream li .paper-title-link:hover {
    color: var(--ink) !important;
}

html[data-theme="dark"] .paper-stream .self-author {
    color: inherit;
}

html[data-theme="dark"] .paper-filter,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .research-filter,
html[data-theme="dark"] .paper-stream .action-link,
html[data-theme="dark"] .project-links .action-link,
html[data-theme="dark"] .research-tags span {
    color: #d7cce3;
    border-color: #4c3c60;
    background: rgba(37, 28, 51, .88);
}

html[data-theme="dark"] .paper-filter:hover,
html[data-theme="dark"] .paper-filter.is-active,
html[data-theme="dark"] .paper-filter[aria-pressed="true"] {
    color: var(--accent-dark);
    border-color: var(--accent);
    background: #332650;
}

html[data-theme="dark"] .project-card-featured {
    border-color: #654e83;
    background: linear-gradient(160deg, #2d2142 0%, #1e182b 72%);
}

html[data-theme="dark"] .paper-stream .contribution-note,
html[data-theme="dark"] .paper-count {
    color: var(--faint);
}

html[data-theme="dark"] .cv-mark {
    color: var(--accent);
}

html[data-theme="dark"] .snowflake {
    width: 2px;
    height: 22px;
    overflow: hidden;
    color: transparent;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent 0%, rgba(181, 210, 255, .9) 52%, rgba(132, 174, 239, .22) 100%);
    text-shadow: none;
    animation-name: rainfall;
}

@keyframes rainfall {
    0% {
        opacity: 0;
        transform: translate3d(0, -8vh, 0) rotate(18deg);
    }
    8% {
        opacity: .75;
    }
    100% {
        opacity: .16;
        transform: translate3d(-120px, 112vh, 0) rotate(18deg);
    }
}

html[data-theme="dark"] .paper-stream li em {
    color: var(--accent-dark);
    border-color: #654e83;
    background: rgba(45, 35, 65, .86);
}

/* Paper type hierarchy: authors sit between body copy and the larger title. */
.paper-stream li {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(.96rem, 1.02vw, 1.1rem);
}

.paper-stream li > strong,
.paper-stream li > .paper-title-link,
.paper-stream li > .paper-title-link strong,
.paper-stream li > p > strong:first-child,
.paper-stream li > p > .paper-title-link,
.paper-stream li > p > .paper-title-link strong,
.paper-stream li .paper-title-link {
    color: #111016 !important;
    font-family: Newsreader, Georgia, serif;
    font-size: clamp(1.14rem, 1.5vw, 1.42rem) !important;
    font-weight: 600;
    line-height: 1.2;
}

.paper-stream .self-author {
    color: #111016;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: inherit;
    font-weight: 700 !important;
}

.paper-stream .action-paper,
.paper-stream .action-code {
    font-size: clamp(.78rem, .92vw, .92rem);
}

html[data-theme="dark"] .paper-stream li > strong,
html[data-theme="dark"] .paper-stream li > .paper-title-link,
html[data-theme="dark"] .paper-stream li > .paper-title-link strong,
html[data-theme="dark"] .paper-stream li > p > strong:first-child,
html[data-theme="dark"] .paper-stream li > p > .paper-title-link,
html[data-theme="dark"] .paper-stream li > p > .paper-title-link strong,
html[data-theme="dark"] .paper-stream li .paper-title-link {
    color: var(--ink) !important;
}

html[data-theme="dark"] .paper-stream .self-author {
    color: var(--ink);
}

/* Keep the highlighted author in the same typeface as the rest of the author line. */
.paper-stream .self-author {
    font-family: inherit;
}

/* Remove the redundant Markdown break after the block-level paper title. */
.paper-stream li > p > .paper-title-link + br {
    display: none;
}

/* Leave a small, deliberate pause between authors and the venue badge. */
.paper-stream li > p > em {
    margin-top: .2rem;
}

/* Keep equal-contribution marks visible beside the authors who share credit. */
.paper-stream sup[aria-label="equal contribution"] {
    display: inline;
    margin-left: .08em;
    color: var(--accent-dark);
    font-family: inherit;
    font-size: .68em;
    font-weight: 700;
    line-height: 0;
    vertical-align: super;
}

