@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

@font-face {
    font-display: block;
    font-family: "VCR OSD Mono";
    src: url("https://type.cargo.site/files/VCROSD-Mono.woff") format("woff");
    font-style: normal;
    font-weight: normal;
}

:root {
    --base-size: 14.837760351562501px;
    --mobile-scale: 0.9;
    --swatch-1: rgba(0, 0, 0, 0.85);
    --swatch-2: rgba(0, 0, 0, 0.75);
    --swatch-3: rgba(0, 0, 0, 0.6);
    --swatch-4: rgba(0, 0, 0, 0.4);
    --swatch-5: rgba(0, 0, 0, 0.25);
    --accent-yellow: #ffc500;
    --accent-orange: #ff5f00;
    --text-gold: #fcf6d8;
    --nav-h: 6.6rem;
}

* {
    box-sizing: border-box;
}

video {
    border: 1px solid #fff !important;
    outline: none;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-size: var(--base-size);
}

body {
    font-family: 'Source Sans 3', sans-serif;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    background-color: #000;
    color: #fff;
}

.content {
    min-height: 100vh;
    position: relative;
}

.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.backdrop::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 70, 160, 0.15);
    pointer-events: none;
}

.backdrop video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.page-layout {
    position: fixed;
    top: var(--nav-h, 6rem);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / 旧 Edge */
}

.page-layout::-webkit-scrollbar {
    display: none;                /* Chrome / Safari / 新 Edge */
}

.page-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    border-width: 2rem;
    border-style: solid;
    border-color: transparent;
    border-top-width: 0;
}

/* 非首页：宽度与导航栏对齐，下移 */
.page-content:not(:has(.title-container)) {
    padding-top: 50px;
    max-width: 1120px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

/* 响应式导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    z-index: 1000;
    padding: 2.75rem 1.75rem 1.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.navbar-brand {
    font-family: "VCR OSD Mono", monospace;
    font-size: 1.85rem;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    margin-right: auto;
}

.navbar-menu {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.45rem;
    font-weight: 498;
    color: #ffc500;
    text-decoration: none;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
    padding: 0.5rem 0.7rem;
    white-space: nowrap;
}

.lang-switch {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: #ffc500;
    background: transparent;
    border: 1px solid rgba(255, 197, 0, 0.45);
    border-radius: 0.4rem;
    padding: 0.35rem 1rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: nowrap;
    line-height: 1;
}

.lang-switch:hover {
    color: #000;
    background-color: #ffc500;
}

/* 中英文切换 */
body.lang-en .lang-zh,
body.lang-en .text-primary,
body.lang-en .title,
body.lang-en .education,
body.lang-en .expertise {
    display: none;
}

body:not(.lang-en) .lang-en,
body:not(.lang-en) .text-secondary,
body:not(.lang-en) .title-english,
body:not(.lang-en) .education-english,
body:not(.lang-en) .expertise-english {
    display: none;
}

.navbar-menu a:hover {
    color: #fff;
    text-decoration: none;
}

.navbar-menu a.active {
    color: #fff;
    font-weight: bold;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.navbar-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #ffc500;
    transition: all 0.3s ease;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 1400px) {
    .navbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 1024px) {
    .navbar {
        padding: 1.75rem 1.5rem 1rem;
        top: 0;
        width: 100%;
        gap: 0.75rem;
    }

    .navbar-brand {
        font-size: 1.4rem;
    }

    .lang-switch {
        font-size: 1.2rem;
        padding: 0.3rem 0.7rem;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: right 0.3s ease;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .navbar-menu.active {
        right: 0;
    }

    .navbar-menu a {
        font-size: 1.4rem;
        padding: 1rem 2rem;
        white-space: normal;
    }

    .navbar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .navbar-overlay.active {
        display: block;
    }
}

@media (max-width: 1000px) {
    .page-layout {
        padding: 0 1rem 2rem;
    }
    .page-content {
        border-width: 0.75rem;
    }
    .page-content:not(:has(.title-container)) {
        padding-top: 40px;
    }
}

@media (max-width: 768px) {
    .page-layout {
        padding: 0 0.5rem 2rem;
    }

    .page-content {
        padding: 1rem 0.5rem;
        border-width: 0.5rem;
    }
}

.title-container {
    flex: 1 1 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.main-title {
    font-family: "VCR OSD Mono", monospace;
    font-size: 2.85rem;
    color: #fff;
    line-height: 1.45;
    text-align: center;
    animation: marquee-vertical 8s ease-in-out infinite;
    filter: drop-shadow(0.4rem 0.4rem 0rem rgba(68, 214, 231, 0.25));
}

@keyframes marquee-vertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes marquee-vertical-fast {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.subtitle {
    font-family: 'Source Sans 3', "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 3.85rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    text-align: center;
    letter-spacing: 0.06em;
    margin-top: 1.25rem;
    filter: drop-shadow(0.4rem 0.4rem 0rem rgba(68, 214, 231, 0.25));
}

.subtitle.lang-zh {
    animation: marquee-vertical-fast 2s ease-in-out infinite;
}

.subtitle.lang-en {
    font-size: 2.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.section-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.85rem;
    color: #ffd600;
    margin-bottom: 2rem;
}

.text-primary {
    font-size: 1.6rem;
    color: var(--text-gold);
    line-height: 1.6;
    letter-spacing: 0.085em;
}

.text-secondary {
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    letter-spacing: 0.085em;
}

.text-highlight {
    color: var(--accent-yellow);
}

.intro-section {
    text-align: center;
    padding: 4rem 0;
}

.intro-section p {
    margin-bottom: 2rem;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

.card {
    text-align: center;
}

.card img {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.5rem;
    color: #ffd600;
    margin-bottom: 1rem;
}

.card p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.73);
    line-height: 1.5;
}

.team-section {
    text-align: center;
    padding: 4rem 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    margin-top: 6rem;
}

/* 最后一行只剩2个时：左右各占一端，中间空列 */
.team-member:last-child:nth-child(3n+2) {
    grid-column: 3;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 100%;
    max-width: 260px;
    height: auto;
    margin-bottom: 1.5rem;
}

.team-member h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.85rem;
    color: #ffd600;
    margin-bottom: 1rem;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.team-member .title,
.team-member .title-english,
.team-member .education,
.team-member .education-english,
.team-member .expertise,
.team-member .expertise-english {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.team-member .title {
    font-size: 1.4rem;
    color: rgba(249, 150, 21, 0.73);
    font-weight: bold;
    line-height: 1.6;
}

.team-member .title-english {
    font-size: 1.15rem;
    color: rgba(249, 150, 21, 0.73);
    line-height: 1.6;
}

.team-member .education,
.team-member .education-english {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-top: 0.75rem;
    font-style: normal;
}

.team-member .expertise,
.team-member .expertise-english {
    font-size: 1.1rem;
    color: rgba(255, 200, 50, 0.85);
    line-height: 1.7;
    margin-top: 0.5rem;
}

.director-section {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.director-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.director-photo {
    flex: 0 0 300px;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.director-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top center;
}

.director-photo h2 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.5rem;
    color: #ffd600;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

.director-info {
    flex: 1;
}

.director-info p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-gold);
    margin-bottom: 1rem;
}

.director-info p.text-secondary {
    color: rgba(255, 255, 255, 0.6);
}

.director-info p strong {
    color: #ffd600;
}

.director-info h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.85rem;
    color: #ffd600;
    margin-top: 0;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .director-photo {
        flex: 0 0 240px;
        width: 240px;
    }
}

@media (max-width: 768px) {
    .director-layout {
        flex-direction: column;
        align-items: center;
    }
    .director-photo {
        flex: none;
        width: 240px;
    }
}

.contact-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    margin-top: 0.5rem;
    padding-bottom: 0;
}

.contact-block {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.contact-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 2rem;
    color: #ffd600;
    margin-bottom: 1.2rem;
    letter-spacing: 0.05em;
}

.contact-title .icon {
    margin-right: 0.4em;
    opacity: 0.85;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.8rem;
}

.contact-label {
    font-family: "Diatype Variable", sans-serif;
    font-size: 1.4rem;
    color: var(--text-gold);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.contact-label .icon {
    font-size: 1.1em;
    opacity: 0.8;
}

.contact-value {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    letter-spacing: 0.08em;
    text-align: center;
}

.qr-code {
    margin-top: 0.25rem;
}

.qr-code img {
    width: 180px;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.section-box {
    border: 1px solid rgba(255, 255, 255, 0.85);
    padding: 0.5rem 2.3rem;
    margin: 4rem 0 6rem;
}

.intro-box {
    height: 22.2em;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-box h2 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.85rem;
    color: #ffd600;
    margin-bottom: 2rem;
}

.section-box p {
    font-size: 1.45rem;
    line-height: 1.8;
    color: var(--text-gold);
    margin-bottom: 1.5rem;
}

.section-box .text-secondary {
    color: rgba(255, 255, 255, 0.6);
}

.section-box strong {
    color: #ffd600;
}

.project-item {
    margin-bottom: 4rem;
}

.project-item h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.5rem;
    color: #ffd600;
    margin-bottom: 1rem;
}

.project-item p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

@media (max-width: 768px) {
    html {
        font-size: calc(var(--base-size) * var(--mobile-scale));
    }
    
    .page-layout {
        padding: 4rem 2rem;
    }
    
    .page-content {
        padding: 6rem 2rem;
        border-width: 2rem;
    }
    
    nav {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    
    nav a {
        font-size: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 2.4rem;
    }

    .subtitle.lang-en {
        font-size: 1.8rem;
    }

    .card-container,
    .team-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-section {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        margin-top: 0;
    }

    .contact-block {
        max-width: 300px;
    }

    .qr-code img {
        width: 140px;
    }

    .section-box {
        padding: 2.5rem 1.5rem;
    }

}

.photo-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 4rem;
}

.photo-gallery h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffc500;
    margin: 0 0 0.5rem;
    text-align: center;
}

.photo-gallery .gallery-divider {
    width: 60px;
    height: 2px;
    background: #ffc500;
    margin: 0 auto 1.5rem;
}

.photo-gallery img {
    width: 100%;
    display: block;
    border: 1px solid #fff;
}

/* ── Section-box h3 ─────────────────────────── */
.section-box h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1.25rem;
}

/* ── Publication list ───────────────────────── */
.pub-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: pub-counter;
}

.pub-list[start="9"] {
    counter-reset: pub-counter 8;
}

.pub-item {
    position: relative;
    padding: 1.25rem 0 1.25rem 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    counter-increment: pub-counter;
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-item::before {
    content: counter(pub-counter) ".";
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    color: #ffc500;
    position: absolute;
    left: 0;
    top: 1.25rem;
}

.pub-title {
    font-weight: 600;
    color: var(--text-gold);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.pub-citation {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
}

.pub-citation a {
    color: #ffc500;
    text-decoration: none;
}

.pub-citation a:hover {
    text-decoration: underline;
}

.pub-status {
    display: inline-block;
    font-size: 0.82rem;
    color: #ffc500;
    border: 1px solid rgba(255, 197, 0, 0.5);
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.4rem;
    white-space: nowrap;
    vertical-align: middle;
}

/* ── Research project sections ──────────────── */
.project-section {
    margin-bottom: 5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.project-section:last-child {
    border-bottom: none;
    margin-bottom: 2rem;
}

.project-section h3 {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.5rem;
    color: #ffd600;
    margin: 0 0 1.5rem;
    line-height: 1.45;
}

.project-section > p {
    font-size: 1.3rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
}

.project-section > p.text-secondary {
    color: rgba(255, 255, 255, 0.75);
}

/* ── Media grids ─────────────────────────────── */
.media-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.media-grid-1 { grid-template-columns: 1fr; }
.media-grid-2 { grid-template-columns: repeat(2, 1fr); }
.media-grid-3 { grid-template-columns: repeat(3, 1fr); }
.media-grid-5 { grid-template-columns: repeat(5, 1fr); }
.media-grid-10 { grid-template-columns: repeat(10, 1fr); }
.media-grid-15 { grid-template-columns: repeat(15, 1fr); row-gap: 0; }

.media-grid video,
.media-grid img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* PECT 视频 2:3 比例 */
.media-grid-2pect {
    grid-template-columns: 2fr 3fr;
}

@media (max-width: 900px) {
    .media-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .media-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .media-grid-10 { grid-template-columns: repeat(5, 1fr); }
    .media-grid-15 { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 600px) {
    .media-grid-2,
    .media-grid-3 { grid-template-columns: 1fr; }
    .media-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .media-grid-10 { grid-template-columns: repeat(3, 1fr); }
    .media-grid-15 { grid-template-columns: repeat(3, 1fr); }
}

/* 项目二 m1-m16 无上下边距 */
.media-grid-15 {
    gap: 0;
    margin-top: 0;
    background: #fff;
}
.media-grid-15 video {
    border: 1px solid rgba(255, 255, 255, 0.85);
}