/* ========================================
   Academic CV Homepage — Jiaxin Cheng
   Clean, minimal, two-column layout
   ======================================== */

:root {
    --bg-page:          #fafafa;
    --bg-card:          #ffffff;
    --border:           #e5e7eb;
    --border-light:     #f0f0f0;
    --text-primary:     #1a1a2e;
    --text-secondary:   #4a5568;
    --text-link:        #2563eb;
    --accent:           #2563eb;
    --tag-bg:           #eff6ff;
    --tag-text:         #1d4ed8;
    --badge-ccf-a-bg:   #dcfce7;
    --badge-ccf-a-text: #166534;
    --badge-ccf-c-bg:   #f3f4f6;
    --badge-ccf-c-text: #6b7280;
    --badge-oral-bg:    #fef3c7;
    --badge-oral-text:  #92400e;
    --sidebar-width:    280px;
    --content-max:      780px;
    --radius:           6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

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

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

.nav-content {
    max-width: calc(var(--sidebar-width) + var(--content-max) + 4rem);
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
}

.nav-content a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-content a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* =========================================
   Layout: Two-Column Grid
   ========================================= */
.layout {
    max-width: calc(var(--sidebar-width) + var(--content-max) + 4rem);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 3rem;
    align-items: start;
}

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    position: sticky;
    top: 80px;
    padding: 2.5rem 0;
}

.sidebar-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    margin-bottom: 1.5rem;
}

.sidebar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sidebar .title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sidebar .affiliation {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    transition: color 0.15s;
}
.sidebar-link:hover {
    color: var(--text-link);
    text-decoration: none;
}
.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--accent);
}

/* =========================================
   Main Content
   ========================================= */
.main-content {
    padding: 2.5rem 0 3rem;
}

.section {
    margin-bottom: 3.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* =========================================
   About
   ========================================= */
.about p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
}

/* =========================================
   Timeline
   ========================================= */
.timeline {
    position: relative;
    padding-left: 2rem;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 2.25rem;
}

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

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-page);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-item h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.timeline-item h5 {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.timeline-item p {
    font-size: 0.9rem;
    line-height: 1.55;
}

/* =========================================
   Publications
   ========================================= */
.pub-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pub-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: box-shadow 0.15s;
}

.pub-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.pub-thumb {
    width: 140px;
    min-width: 140px;
    height: 84px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.pub-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.pub-content {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.pub-venue {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.pub-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.pub-authors {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pub-links {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.pub-link {
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}

.pub-link:hover {
    color: var(--text-link);
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.5;
}

.badge-ccfa {
    background: var(--badge-ccf-a-bg);
    color: var(--badge-ccf-a-text);
}

.badge-ccfc {
    background: var(--badge-ccf-c-bg);
    color: var(--badge-ccf-c-text);
}

.badge-oral {
    background: var(--badge-oral-bg);
    color: var(--badge-oral-text);
}

/* Publication link subtle styling */
.pub-card h4 a {
    color: var(--text-primary);
}
.pub-card h4 a:hover {
    color: var(--text-link);
}

/* =========================================
   Footer
   ========================================= */
footer {
    margin-top: 1rem;
    padding: 2rem 0 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 800px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sidebar {
        position: static;
        padding: 2rem 0 0.5rem;
        text-align: center;
    }

    .sidebar-photo {
        margin: 0 auto 1rem;
        width: 120px;
        height: 120px;
    }

    .sidebar-links {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
    }

    .pub-card {
        flex-direction: column;
        padding: 0.85rem 1rem;
    }

    .pub-thumb {
        width: 100%;
        max-width: 200px;
        margin-bottom: 0.5rem;
    }

    .main-content {
        padding: 1.5rem 0 2rem;
    }

    .nav-content {
        justify-content: center;
    }
}
