/* ============================================================
   Shanshan Zhong Academic Homepage
   Layout inspired by zorazrw.github.io
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
    --bg:            #ffffff;
    --text:          #333333;
    --text-soft:     #555555;
    --text-muted:    #666666;
    --accent:        #8b0000;  /* links, headings, borders */
    --accent-solid:  #8b0000;  /* solid badge bg w/ white text */
    --border-soft:   #dddddd;
    --tag-soft-bg:   #f2f2f2;
    --card-shadow:   rgba(0, 0, 0, 0.10);
    --banner-bg:     #faf1f1;
}

:root[data-theme="dark"] {
    --bg:            #16181c;
    --text:          #e6e6e6;
    --text-soft:     #c2c2c2;
    --text-muted:    #9aa0a6;
    --accent:        #f28b82;  /* light red — readable on dark */
    --accent-solid:  #b3261e;
    --border-soft:   #3a3d42;
    --tag-soft-bg:   #26282c;
    --card-shadow:   rgba(0, 0, 0, 0.55);
    --banner-bg:     rgba(242, 139, 130, 0.10);
    color-scheme: dark;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15.5px;
    transition: background 0.3s ease, color 0.3s ease;
}

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

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

/* ---------- Theme toggle ---------- */
#theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    background: var(--bg);
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
#theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.08);
}

/* ============================================================
   Intro Section
   ============================================================ */
.intro-container {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 20px 0;
}

.profile-photo img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
}

.intro-text {
    flex: 1;
}

.intro-text h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.intro-text .cn-name {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.social-icons {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-icons a {
    color: var(--text-soft);
    font-size: 1.6rem;
    transition: color 0.2s;
}

.social-icons a .ai-google-scholar {
    font-size: 1.9rem;
}
.social-icons a:hover {
    color: var(--accent);
    text-decoration: none;
}

.school-info {
    text-align: right;
}

.school-info h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text);
}

.school-info p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ============================================================
   Navigation Banner
   ============================================================ */
.banner {
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    padding: 4px 0;
    margin: 10px 0 30px;
}

.navbar {
    display: flex;
    gap: 0;
}

.navbar .nav-link {
    flex: 1;
    text-align: center;
    color: var(--text);
    font-weight: 500;
    font-size: 1.1em;
    padding: 2px 0;
    margin-right: 0;
    transition: color 0.2s;
}

.navbar .nav-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.navbar .nav-link.active {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* Upcoming-event banner */
.event-banner {
    margin: 16px 0 0;
    padding: 10px 16px;
    background: var(--banner-bg);
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text);
}
.event-banner a { font-weight: 500; }

/* ============================================================
   Sections
   ============================================================ */
.section {
    margin-bottom: 35px;
}

.section h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

.section p {
    margin: 8px 0;
    line-height: 1.7;
    text-align: justify;
}

/* Details / collapsible */
.section details {
    margin: 8px 0;
}

.section details summary {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text);
    padding: 4px 0;
}

.section details summary:hover {
    color: var(--accent);
}

.section details ol {
    margin: 6px 0 6px 20px;
    padding: 0;
}

.section details ol li {
    margin-bottom: 4px;
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ============================================================
   News
   ============================================================ */
#news ul, .section > ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#news ul li, .section > ul > li {
    padding: 6px 0;
    font-size: 0.93rem;
    line-height: 1.55;
    border-bottom: 1px solid var(--accent);
}

.section > details > li {
    padding: 6px 0;
    font-size: 0.93rem;
    line-height: 1.55;
    border-bottom: 1px solid var(--accent);
    list-style: none;
}

/* ============================================================
   Experience
   ============================================================ */
.exp-table { width: 100%; border-collapse: collapse; }
.exp-table td, .exp-table th { padding: 6px 0; vertical-align: top; border: none; }
.exp-table th {
    white-space: normal;
    font-weight: 600;
    color: var(--accent);
    padding-right: 1.5rem;
    font-size: 0.9rem;
    width: 210px;
    text-align: left;
}
.exp-table td { font-size: 0.95rem; line-height: 1.5; text-align: left; padding-bottom: 18px; }
.exp-table .exp-role { color: var(--text); font-weight: 500; }
.exp-table .exp-detail { color: var(--text-muted); }

.exp-summary { color: var(--text-muted); font-size: 0.9rem; margin: 5px 0 0; line-height: 1.55; }

.exp-outputs { margin: 8px 0 0; }
.exp-outputs-label { color: var(--text-soft); font-weight: 500; font-size: 0.82rem; margin-right: 4px; }
.exp-outputs a {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 1px 9px;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    color: var(--text-soft);
    margin-right: 6px;
    transition: all 0.2s;
}
.exp-outputs a:hover {
    background: var(--accent-solid);
    color: #fff;
    border-color: var(--accent-solid);
    text-decoration: none;
}

/* ============================================================
   Publication Cards
   ============================================================ */
.pub-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pub-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
    align-items: center;
    overflow: hidden;
}

.pub-item:hover {
    box-shadow: 0 2px 8px var(--card-shadow);
}

.pub-item img {
    width: 80px;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.pub-item:hover img {
    transform: scale(1.12);
}

.pub-info {
    flex: 1;
    min-width: 0;
}

.pub-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 5px;
    line-height: 1.4;
    color: var(--text);
}

.pub-title a {
    color: var(--text-muted);
    margin-left: 5px;
    font-size: 0.85rem;
}
.pub-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin: 0 0 4px;
    line-height: 1.45;
}

.pub-authors em {
    font-style: normal;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 2px;
}

.pub-venue {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0;
}

.pub-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
}
.pub-meta .pub-venue { margin: 0; }

.pub-links {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pub-links a {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 2px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    color: var(--text-soft);
    white-space: nowrap;
    transition: all 0.2s;
}

.pub-links a:hover {
    background: var(--accent-solid);
    color: #fff;
    border-color: var(--accent-solid);
    text-decoration: none;
}

.award {
    background: var(--accent-solid);
    color: #fff;
    font-size: 0.72rem;
    font-style: normal;
    padding: 1px 8px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
    text-decoration: none;
}

.pub-more {
    margin-top: 16px;
    font-size: 0.95rem;
}

.pub-year {
    color: var(--text);
    font-size: 1.2rem;
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}

#all-publications .pub-year:first-child {
    margin-top: 0;
}

.pub-image-placeholder {
    width: 80px;
    min-width: 80px;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    display: grid;
    place-items: center;
    background: var(--tag-soft-bg);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
}

/* ============================================================
   Events
   ============================================================ */
.ev-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.5;
}
.ev-tag.talk,
.ev-tag.poster   { background: var(--accent-solid); color: #fff; }
.ev-tag.attended { background: var(--tag-soft-bg); color: var(--text-soft); border: 1px solid var(--border-soft); }

.ev-loc { color: var(--text-muted); }

.ev-note {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

.ev-links a {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 1px 8px;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    color: var(--text-soft);
    margin-left: 6px;
    transition: all 0.2s;
}
.ev-links a:hover {
    background: var(--accent-solid);
    color: #fff;
    border-color: var(--accent-solid);
    text-decoration: none;
}

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

/* ============================================================
   News Page
   ============================================================ */
.page-header { margin-bottom: 0.5rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.2rem; }
.page-header .page-desc { font-size: 0.9rem; color: var(--text-muted); }

.news-table { width: 100%; border-collapse: collapse; }
.news-table td, .news-table th { padding: 5px 0; vertical-align: top; border: none; }
.news-table th {
    white-space: nowrap; font-weight: 600; color: var(--accent);
    padding-right: 1.5rem; font-size: 0.9rem; width: 100px;
    text-align: right;
}
.news-table td { font-size: 0.95rem; line-height: 1.5; text-align: left; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .intro-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .school-info {
        text-align: center;
    }
    .social-icons {
        justify-content: center;
        flex-wrap: wrap;
    }
    .pub-item {
        flex-direction: column;
    }
    .pub-item img {
        width: 120px;
    }
    .navbar .nav-link {
        margin-right: 30px;
    }
    .exp-table th { width: auto; display: block; padding-right: 0; }
    .exp-table td { display: block; padding-top: 0; }
    #theme-toggle { top: 10px; right: 10px; width: 34px; height: 34px; }
}
