/* ===== Variables ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8888a8;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --nav-height: 64px;
    --max-width: 1100px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #1e1e35;
    --text-primary: #e8e8f0;
    --text-secondary: #b0b0c8;
    --text-muted: #7878a0;
    --accent: #60a5fa;
    --accent-light: #1e3a5f;
    --accent-hover: #93c5fd;
    --border: #2a2a45;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

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

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

.section {
    padding: 80px 0;
}

.alt-bg {
    background: var(--bg-secondary);
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background var(--transition), border var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 15, 26, 0.85);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ===== Hero ===== */
.hero {
    padding: calc(var(--nav-height) + 60px) 0 60px;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.chinese-name {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}

.hero-affiliation {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 24px;
}

.hero-links {
    display: flex;
    gap: 16px;
}

.hero-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all var(--transition);
}

.hero-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-image {
    flex-shrink: 0;
}

.profile-photo {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    box-shadow: var(--shadow-lg);
}

/* ===== News ===== */
.news-section {
    padding-top: 40px;
    padding-bottom: 60px;
}

.news-list {
    max-height: 200px;
    overflow-y: auto;
}

.news-item {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.news-date {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    white-space: nowrap;
    min-width: 90px;
    font-weight: 500;
}

.news-text {
    color: var(--text-secondary);
}

/* ===== Section Titles ===== */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 8px;
}

.section-intro {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 700px;
    margin-bottom: 40px;
}

/* ===== Research Cards ===== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
}

.research-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.research-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 14px;
}

.research-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.research-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ===== Publications ===== */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.pub-item {
    display: flex;
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

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

.pub-year {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    min-width: 55px;
    padding-top: 3px;
}

.pub-title {
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.pub-authors {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pub-venue {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pub-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.pub-links a {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.pub-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.pub-badge {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--accent-light);
    color: var(--accent);
}

/* ===== Projects ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.project-stars {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-stars .fa-star {
    color: #f59e0b;
    font-size: 0.75rem;
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-card h3 a {
    color: var(--text-primary);
}

.project-card h3 a:hover {
    color: var(--accent);
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 14px;
}

.project-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.project-tags span {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--accent-light);
    color: var(--accent);
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 36px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent);
}

[data-theme="dark"] .timeline-dot {
    border-color: var(--bg-secondary);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}

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

.timeline-place {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.timeline-content p:last-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.contact-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.contact-card i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 14px;
}

.contact-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.contact-card p, .contact-card a {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 30px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-links {
        justify-content: center;
    }

    .profile-photo {
        width: 180px;
        height: 180px;
    }

    .research-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .pub-item {
        flex-direction: column;
        gap: 8px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
    }

    .nav-menu.active {
        display: flex;
    }

    .section {
        padding: 50px 0;
    }

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

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.7rem;
    }

    .chinese-name {
        font-size: 1.2rem;
    }
}

/* ===== Publication Categories ===== */
.pub-category {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 30px;
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
}

.pub-category:first-of-type {
    margin-top: 0;
}

/* ===== Awards ===== */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.award-item {
    display: flex;
    gap: 20px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    align-items: baseline;
}

.award-year {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 500;
    min-width: 65px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

/* ===== Selection ===== */
::selection {
    background: var(--accent);
    color: white;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}
