.nav-hero-container {
    position: fixed;
    top: 0;
    left: 400px; /* Same as sidebar width */
    right: 0;
    z-index: 1000;
    background: var(--background-color);
    height: calc(var(--nav-height, 60px) + var(--hero-height, 300px));
}

.nav-container {
    background: var(--background-color);
    padding: 10px 30px;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.nav-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(transparent, rgba(0, 33, 71, 0.02));
}

.nav-buttons {
    display: flex;
    gap: 3rem;
    position: relative;
}

.nav-button {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1em;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -3px;
    left: 0;
    background: var(--gold-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-button:hover, .nav-button.active {
    color: var(--primary-color);
}

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

.lang-switch {
    background: none;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-family: 'Cormorant Garamond', FangSong, "仿宋", serif;
}



.lang-switch:hover {
    background: var(--secondary-color);
    color: var(--background-color);
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #002147;  /* Indigo blue */
    --secondary-color: #e4c000; /* Luxury gold */
    --accent-color: #b76e79;   /* Rose accent */
    --text-color: #1c1c1c;
    --background-color: #ffffff;
    --sidebar-bg: linear-gradient(135deg, #002147 0%, #001529 100%);
    --border-color: #fef5c1;
    --light-text: rgba(255,255,255,0.9);
    --gold-gradient: linear-gradient(135deg, #e4c000 0%, #fef5c1 100%);
    --transition-speed: 0.3s;
    --content-spacing: 1rem;
    --luxury-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

body {
    margin: 0;
    padding: 0;
    font-family: 'Cormorant Garamond', serif;
    display: flex;
    color: var(--text-color);
    line-height: 1.3;
    background-color: var(--background-color);
    letter-spacing: 0.02em;
}

/* Apply Chinese fonts only when Chinese language is active */
html[lang="zh"] body,
html[lang="zh"] h1,
html[lang="zh"] h2,
html[lang="zh"] h3,
html[lang="zh"] .lang-switch,
html[lang="zh"] .period,
html[lang="zh"] .location,
html[lang="zh"] .title {
    font-family: FangSong, "仿宋", serif;
}

.sidebar {
    width: 400px;
    background: var(--sidebar-bg);
    padding: 50px 25px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--light-text);
    box-shadow: var(--luxury-shadow);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar p {
    font-size: 0.9em;
    text-align: center;
    line-height: 1.2;
    color: var(--secondary-color);
}

.profile-container {
    text-align: center;
    margin-bottom: 20px;
}

.contact-info p {
    font-size: 1em;
    text-align: left;
    line-height: 1.3;
    color: var(--secondary-color);
}

.contact-info ul {
    display: flex;          /* Make the ul a flex container */
    flex-wrap: wrap;        /* Allow wrapping onto multiple lines if needed */
    gap: 1rem;              /* Optional: spacing between items */
    list-style: none;       /* Optional: remove default bullets */
    margin: 0;              /* Reset default margin */
    padding: 0;             /* Reset default padding */
}

.contact-info li {
    font-size: 0.9em;
    text-align: left;
    line-height: 1.2;
    color: var(--secondary-color);
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 30px;
    display: block;
    object-fit: cover;
    border: 2px solid var(--secondary-color);
    padding: 8px;
    background: rgba(255,255,255,0.05);
    transition: all var(--transition-speed);
    position: relative;
}

.profile-image::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: var(--gold-gradient);
    z-index: -1;
    opacity: 0.5;
    transition: opacity var(--transition-speed);
}

.profile-image:hover {
    transform: translateY(-3px);
}

.profile-image:hover::after {
    opacity: 1;
}

.open-to-work-container {
    margin-top: 10px;
}

.open-to-work-container p, .open-to-work-container h4 {
    color: var(--light-text);
    margin-bottom: 5px;
}

.contact-info {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 1px;
    background: var(--gold-gradient);
}

.contact-info::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    right: -1px;
    height: 1px;
    background: var(--gold-gradient);
}

.contact-info p, .contact-info a {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.contact-info i {
    color: var(--secondary-color);
    width: 20px;
}

.main-content {
    margin-left: 400px;
    padding: 0;
    flex: 1;
    max-width: 1600px;
    width: calc(100% - 400px);
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
}

.hero-image {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.hero-image:hover img {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0, 33, 71, 0.2) 0%,
        rgba(0, 33, 71, 0.1) 50%,
        rgba(0, 33, 71, 0.2) 100%
    );
    pointer-events: none;
}

#main-sections {
    padding: 30px;
    padding-top: calc(var(--nav-height, 60px) + var(--hero-height, 300px));
    margin-top: 30px;
}

/* Add CSS variables for dynamic heights */
:root {
    --nav-height: 60px; /* Adjust based on your navigation height */
    --hero-height: auto; /* This will be set by JavaScript */
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        var(--border-color) 0,
        var(--border-color) 4px,
        transparent 4px,
        transparent 8px
    );
}

section {
    margin-bottom: 50px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

html {
    font-size: 15px;  /* Base font size reduction from default 16px */
}

h1 {
    color: var(--light-text);
    margin-bottom: 0px;
    font-size: 2em;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 15px;
    font-weight: bold;
}



h2 {
    color: var(--primary-color);
    font-size: 1.5em;
    margin-bottom: 10px;
    padding-bottom: 10px;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.02em;
    position: relative;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 
        1px 1px 1px var(--secondary-color),
        2px 2px 1px var(--secondary-color);
    transform: translateY(-2px); /* Slight lift effect */
    transition: all 0.3s ease;
}



h2::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 1px;
    background: var(--gold-gradient);
}

h3 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin: 0 0 10px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: bold;
}



p {
    margin-bottom: 6px;
    color: #555;
}

.education-item, .research-item, .internship-item, .activity-item {
    margin-bottom: 20px;
    padding: 0 15px 0 20px;
    position: relative;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    border-left: 3px solid var(--secondary-color);
    transition: all var(--transition-speed);
}

.education-item:hover, .research-item:hover, 
.internship-item:hover, .activity-item:hover {
    border-left-color: var(--primary-color);
}


.info-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 450px;
    align-items: center;
    margin-bottom: 8px;
    gap: 20px;
}

.info-line-right {
    display: grid;
    grid-template-columns: 200px 250px;
    align-items: center;
    color: var(--primary-color);
}

.period, .location, .title {
    color: var(--primary-color);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05em;
    margin: 0;
}

.title {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width: 1024px) {
    .info-line {
        grid-template-columns: minmax(0, 1fr) 350px;
    }
    
    .info-line-right {
        grid-template-columns: 150px 200px;
    }
}

.description {
    margin: 8px 0;
    line-height: 1.4;
    color: var(--text-color);
    font-weight: 300;
}

ul {
    list-style: none;
    padding-left: 1.2rem;
    margin: 6px 0;
}

li {
    margin-bottom: 5px;
    color: var(--text-color);
    position: relative;
    line-height: 1.3;
    font-weight: 300;
}

li::before {
    content: '•';
    position: absolute;
    left: -1.2rem;
    color: var(--secondary-color);
    font-size: 1.2em;
    line-height: 1;
    top: 1px;
}

#additional-page {
    display: none;
    padding: 30px;
    padding-top: calc(var(--nav-height, 60px) + var(--hero-height, 300px));
    margin-top: 30px;
    min-height: 100vh;
    overflow-y: auto;
}

#additional-page .additional-item {
    margin-bottom: 20px;
    padding: 0 15px 0 20px;
    position: relative;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    border-left: 3px solid var(--secondary-color);
    transition: all var(--transition-speed);
}

#additional-page .additional-item:hover {
    border-left-color: var(--primary-color);
}

#additional-page h2 {
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    .main-content {
        margin-left: 250px;
        padding: 30px;
    }
    .nav-hero-container {
        left: 250px;
    }
    #main-sections {
        padding: 5px;
        padding-top: calc(var(--nav-height, 60px) + var(--hero-height, 300px));
        margin-top: 0px;
    }
    #additional-page {
        padding: 5px;
        padding-top: calc(var(--nav-height, 60px) + var(--hero-height, 300px));
        margin-top: 0px;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 30px 20px;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    .profile-image {
        width: 150px;
        height: 150px;
    }
    .nav-hero-container {
        position: relative;
        left: 0;
        width: 100%;
    }
    .nav-container {
        padding: 10px 15px;
    }
    .nav-buttons {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-button {
        font-size: 0.8em;
    }
    .info-line {
        grid-template-columns: 1fr;
    }
    .info-line-right {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    .period, .location {
        font-size: 0.9em;
    }
    #main-sections {
        padding: 20px 10px;
        padding-top: 30;
    }
    #additional-page {
        padding: 20px 10px;
        padding-top: 30;
    }
    .education-item, .research-item, 
    .internship-item, .activity-item,
    #additional-page .additional-item {
        padding: 0 10px 0 15px;
    }
    .contact-info {
        padding: 15px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .sidebar {
        padding: 20px 15px;
    }
    .profile-image {
        width: 120px;
        height: 120px;
    }
    h1 {
        font-size: 2em;
    }
    .nav-buttons {
        gap: 0.5rem;
    }
    .nav-button {
        font-size: 0.75em;
        padding: 0.4rem 0;
    }
    .hero-image {
        max-height: 150px;
        overflow: hidden;
    }
    .hero-image img {
        object-position: center 20%;
    }
    .title {
        font-size: 0.95em;
    }
    .period, .location {
        font-size: 0.85em;
    }
    ul {
        padding-left: 1rem;
    }
    li {
        font-size: 0.95em;
    }
    li::before {
        left: -1rem;
    }
    .contact-info p {
        font-size: 0.85em;
    }
}

/* Print styles */
@media print {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        box-shadow: none;
    }
    .main-content {
        margin-left: 0;
    }
    .education-item, .research-item, 
    .internship-item, .activity-item {
        break-inside: avoid;
        box-shadow: none;
    }
}