/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
    --primary-color: #00409A; /* SJTU Blue-ish or Academic Blue */
    --secondary-color: #C8102E; /* SJTU Red-ish for accents */
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #f9f9f9; /* Very light grey for background */
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --section-spacing: 2rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: row; /* Desktop default */
    gap: 3rem;
}

/* Sidebar (Left Column) */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: 2rem;
}

.profile-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center;
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.name-primary {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.name-secondary {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.institution {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.contact-info {
    text-align: left;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.contact-item {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    word-break: break-all;
}

.contact-icon {
    width: 18px;
    flex-shrink: 0;
    color: var(--text-light);
}

/* Main Content (Right Column) */
.main-content {
    flex-grow: 1;
    min-width: 0; /* Prevent overflow */
}

section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    margin-bottom: 2rem;
}

.section-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.bio-content {
    font-family: 'Merriweather', serif; /* Academic feel for long text */
    text-align: justify;
    margin-bottom: 1.5rem;
}

.bio-content p + p {
    margin-top: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.pub-link {
    margin-bottom: 1rem;
    font-weight: 500;
}

.pub-note-line {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f0f4f8;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Publications */
.pub-list {
    list-style: none;
}

.pub-item {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    position: relative;
}

/* Numbering or Bullets for pubs */
.pub-item::before {
    content: attr(data-index);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    color: var(--text-light);
    font-size: 0.9rem;
}

.pub-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: block;
    margin-bottom: 0.25rem;
}

.pub-authors {
    color: var(--text-color);
    margin-bottom: 0.25rem;
    display: block;
}

.author-me {
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--secondary-color);
}

.pub-venue {
    font-style: italic;
    color: var(--primary-color);
    font-weight: 500;
}

.pub-note {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-left: 0.5rem;
    background: rgba(200, 16, 46, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Funding & Awards & Service Lists */
.simple-list {
    list-style: none;
}

.simple-list li {
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    position: relative;
}

.simple-list li::before {
    content: "•";
    color: var(--secondary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Language toggle */
body[data-lang="en"] .lang-cn {
    display: none !important;
}

body[data-lang="cn"] .lang-en {
    display: none !important;
}

.lang-switch {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.lang-toggle {
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--primary-color);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-toggle:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-1px);
}

.lang-toggle:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.lang-label {
    display: none;
    font-size: 0.85rem;
}

body[data-lang="en"] .lang-label.lang-en {
    display: inline;
}

body[data-lang="cn"] .lang-label.lang-cn {
    display: inline;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .sidebar {
        width: 100%;
        text-align: center;
    }
    
    .sidebar-sticky {
        position: static;
    }
    
    .contact-info {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
}
