/* ===== CSS Variables ===== */
:root {
    --primary: #1a56db;
    --primary-light: #e8f0fe;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --bg: #fafbfc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 8px;
    --max-width: 960px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ===== Navbar ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.lang-switch a {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.lang-switch a:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

/* ===== Main Layout ===== */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.section {
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.section:last-child { border-bottom: none; }

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ===== Profile Header ===== */
.profile {
    display: flex;
    align-items: flex-start;
    gap: 36px;
    flex-wrap: wrap;
}

.profile-avatar {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    box-shadow: var(--shadow);
    background: #e2e8f0;
}

.profile-info { flex: 1; min-width: 260px; }

.profile-name {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
}

.profile-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.profile-affiliation {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.profile-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-contact a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.15s;
}

.profile-contact a:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
    box-shadow: var(--shadow);
}

/* ===== Bio ===== */
.bio-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ===== Timeline Items (Education, Work, Projects) ===== */
.timeline { list-style: none; }

.timeline-item {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px dashed var(--border);
}

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

.timeline-date {
    flex-shrink: 0;
    width: 150px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 1px;
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-content .meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.timeline-content .note {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== Awards Grid ===== */
.awards-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    list-style: none;
}

.awards-list li {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    align-items: flex-start;
}

.awards-list .year {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.82rem;
    min-width: 36px;
}

/* ===== Publications: Collapsible Year Tabs ===== */
.pub-year-group { margin-bottom: 4px; }

.pub-year-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
    font-family: inherit;
    user-select: none;
}

.pub-year-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.pub-year-toggle .year-label {
    color: var(--primary);
    font-size: 1.1rem;
}

.pub-year-toggle .count {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: auto;
}

.pub-year-toggle .arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.pub-year-toggle.open .arrow {
    transform: rotate(90deg);
}

.pub-year-body {
    display: none;
    padding: 8px 0 0 8px;
}

.pub-year-body.open {
    display: block;
}

.pub-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.7;
}

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

.pub-item .authors { color: var(--text-secondary); }

.pub-item .authors .hl {
    font-weight: 700;
    color: var(--text);
}

.pub-item .title {
    font-weight: 600;
    color: var(--primary);
}

.pub-item .journal {
    font-style: italic;
    color: var(--text-secondary);
}

.pub-item .tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
    margin-bottom: 2px;
    vertical-align: middle;
}

.pub-item .tag.first   { background: #dbeafe; color: #1e40af; }
.pub-item .tag.cofirst { background: #e0e7ff; color: #3730a3; }
.pub-item .tag.corr    { background: #fef3c7; color: #92400e; }
.pub-item .tag.collab  { background: #f3f4f6; color: #6b7280; }

.pub-item .links {
    margin-top: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pub-item .links a {
    font-size: 0.82rem;
    padding: 3px 10px;
    background: var(--primary-light);
    border-radius: 4px;
    font-weight: 500;
}

.pub-subtitle {
    font-size: 1rem;
    font-weight: 600;
    margin: 28px 0 14px;
    color: var(--text);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 30px 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-contact { justify-content: center; }

    .profile-avatar {
        width: 120px;
        height: 120px;
    }

    .profile-name { font-size: 1.4rem; }

    .timeline-item { flex-direction: column; gap: 4px; }

    .timeline-date { width: auto; }

    .navbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .main { padding: 24px 16px 60px; }

    .section { padding: 28px 0; }

    .section-title { font-size: 1.15rem; }

    .profile-avatar {
        width: 100px;
        height: 100px;
    }

    .nav-links a { padding: 6px 12px; font-size: 0.82rem; }

    .awards-list { grid-template-columns: 1fr; }

    .pub-item { font-size: 0.85rem; }
}
