body {
    font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #fff;
}

header {
    font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color:#f4f4f4;
    display: flex;
    flex-direction: column;
    padding-top: 30px;  /* 添加顶部内边距 */
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    width: 80%;
    margin-bottom: 20px;
    margin-left: 10%;
}

.header-content-profile-img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    
}
.header-content-icon-img{
    width: 150px;
    height: 150px;
    margin-left: 100px;
}

.header-text {
    max-width: 800px;
}

.header-text h1 {
    margin: 0;
    font-size: 28px;
    color: #1D0235;
}

.header-text p {
    margin: 5px 0;
    color: #11091d;
    font-size: 16px;
}

.header-text .email {
    color: #888;
    margin-bottom: 10px;
}

.profile-container {
    display: flex;
    flex-direction: column; /* Stack profile image and icons vertically */
    align-items: center;    /* Center the items horizontally */
    text-align: center;     /* Optional: center-align text if needed */
    margin-right: 100px;
}


.home-page {
    display: flex;
    flex-direction: row; /* Icons in a row */
    gap: 20px; /* Space between icons */
}

.home-page-icon-img {
    width: 25px;  /* Set a fixed size for icons */
    height: 25px;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
}


section {
    margin: 10px 0;
}

h2 {
    color: #333;
    margin-bottom: 10px;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    margin-top: 20px;
}

.link {
    color: #684C96; /* Set the desired color for the link */
    text-decoration: none; /* Optional: Remove underline from link */
}

.link:hover {
    color: #836EAA; /* Set the color when the link is hovered over */
    text-decoration: underline; /* Optional: Add underline on hover */
}


.news-carousel {
    --visible-count: 4;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(var(--visible-count, 4) * 48px);
    padding: 6px 10px;
    border-radius: 12px;
    background: #f6f4fb;
    cursor: grab;
    scrollbar-width: thin;
}

.news-carousel::-webkit-scrollbar {
    width: 6px;
}

.news-carousel::-webkit-scrollbar-thumb {
    background: rgba(120, 92, 168, 0.4);
    border-radius: 999px;
}

.news-carousel.news-dragging {
    cursor: grabbing;
}

.news-carousel.news-dragging * {
    user-select: none;
    cursor: inherit;
}

.news-track {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.news-emoji {
    flex: 0 0 auto;
    font-size: 1.2rem;
    line-height: 1;
}

.news-text {
    flex: 1;
    min-width: 0;
    color: #3a3a3a;
}

.news-text strong {
    color: #2d2d2d;
}

.news-loading,
.news-empty {
    color: #666;
    padding: 12px;
}

.publication-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.publication-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    cursor: zoom-in;
}

.publication-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    background: #000;
}

.publication-media {
    flex: 0 0 320px;
    max-width: 300px;
    height: 140px;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    position: relative;
}

.publication-details {
    flex: 1;
}

.publication-details p {
    margin: 4px 0; /* Consistent margin for each row */
    color: #4a4a4a;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 8px;
    align-items: center;
}

.publication-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.publication-title {
    margin: 0 0 8px;
    color: #2d2d2d;
}

.publication-authors {
    font-size: 0.95rem;
}

.publication-venues {
    font-size: 0.9rem;
    color: #5b5b5b;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0;
}

.publication-venue + .publication-venue {
    margin-top: 0;
}

.publication-venue-note {
    color: #c0392b;
    font-weight: 600;
}

.code-star-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 0.82rem;
    color: #444;
    flex-shrink: 0;
}

.code-star-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
}

.code-star-text {
    font-weight: 500;
}

.publication-loading {
    color: #666;
}


.media-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 1000;
}

.media-lightbox.active {
    display: flex;
}

.media-lightbox img {
    max-width: min(960px, 90vw);
    max-height: 90vh;
    border-radius: 12px;
}

.media-lightbox button {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
}

/* Media c for mobile screens */
@media only screen and (max-width: 768px) {
    /* Header: Stack profile image, content, and icon vertically */
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-content-profile-img {
        margin: 0 auto 20px auto; /* Center the images and add spacing */
    }

    .header-content-icon-img{
        display: none;
    }

    .home-page {
        margin-right: 0; /* Remove the right margin */
    }

    .news-carousel {
        --visible-count: 5;
    }

    .news-item {
        padding: 8px 10px;
    }

    /* Navigation bar: Hamburger menu */
    nav {
        display: none;
        background-color: #E4E0EE;
        text-align: center;

    }

    nav.active {
        display: grid;  /* Show when active */
        grid-template-columns: repeat(2, 1fr); /* Two items per row */
        grid-gap: 5px; /* Add some space between the items */
        padding: 10px;
    }

    /* Hamburger menu style */
    .hamburger-menu {
        display: block;
        position: relative;
        cursor: pointer;
        width: 30px;
        height: 30px;
    }

    .hamburger-menu span {
        display: block;
        background-color: #333;
        height: 4px;
        margin: 6px 0;
        width: 100%;
    }

    /* Publication items: Stack media and text vertically */
    .publication-item {
        flex-direction: column;
        gap: 16px;
    }

    .publication-media {
        max-width: 100%;
        width: 100%;
        height: 200px;
    }

    .publication-image,
    .publication-video {
        height: 100%;
    }

    .publication-details {
        text-align: left;
    }

    .publication-links {
        justify-content: flex-start;
    }
}

@media only screen and (min-width: 769px) {
    .nav-container {
        width: 100%;
        background-color: #E4E0EE;
    }

    nav {
        display: flex;
        justify-content: space-between;
        width: 80%;
        margin: auto;
        padding: 10px 0;
    }
    
    nav a {
        text-decoration: none;
        font-size: 20px;
        font-weight: 600;
    }
    
    .hamburger-menu {
        display: none;
    }
}

#news ul {
    margin-top: 10px;
}

#news ul li {
    margin-bottom: 5px;
}

#research ul {
    margin-top: 10px;
}

#research ul li {
    margin-bottom: 5px;
}

.highlight {
    background: linear-gradient(120deg, #E4E0EE 0%, #C5B6E3 100%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 85%;
    padding: 0 2px;
}

/* 可选：让高亮效果有个简单的动画 */
.highlight {
    transition: background-size 0.2s ease;
}

.highlight:hover {
    background-size: 100% 100%;
}
