/* ============================================
   Yang Liu Academic Homepage
   All-serif typography, wide layout, high density
   ============================================ */

:root {
    --bg-primary: #FDF8F0;
    --bg-secondary: #F5EFE6;
    --bg-tertiary: #EDE4D3;
    --bg-card: #FFFFFF;
    
    --text-primary: #1A1614;
    --text-secondary: #4A4239;
    --text-tertiary: #7A6F61;
    --text-muted: #9A8F81;
    
    --accent-primary: #D4653A;
    --accent-secondary: #E87B4F;
    --accent-light: #F5D4C7;
    --accent-subtle: #FAEBE4;
    
    --border-light: #E8E0D4;
    --border-medium: #D4C8B8;
    
    --font-serif: 'Crimson Pro', 'Crimson Text', Georgia, 'Times New Roman', serif;
    --font-body: 'Crimson Text', Georgia, 'Times New Roman', serif;
    
    --container-max: 1100px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1A1714;
        --bg-secondary: #242019;
        --bg-tertiary: #2E2820;
        --bg-card: #2A2420;
        
        --text-primary: #F5EFE6;
        --text-secondary: #D4C8B8;
        --text-tertiary: #A89B8C;
        --text-muted: #7A6F61;
        
        --border-light: #3A332A;
        --border-medium: #4A4239;
    }
}

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

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

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

::selection {
    background-color: var(--accent-subtle);
    color: var(--accent-primary);
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(253, 248, 240, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.25rem;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--transition-fast);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width var(--transition-normal);
}

.nav-menu a:hover {
    color: var(--accent-primary);
    text-decoration: none;
}

.nav-menu a:hover::after {
    width: 100%;
}

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

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding-top: 3.25rem;
}

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

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

.section-tag {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-primary);
}

.section-header-compact {
    margin-bottom: 1rem;
}

/* ============================================
   About Section
   ============================================ */
.section-about {
    padding-top: 4rem;
    background-color: var(--bg-secondary);
}

.about-layout {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 4rem;
    align-items: start;
}

.about-left {
    text-align: center;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-card);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 0.875rem;
}

.profile-info {
    font-size: 0.9rem;
    line-height: 1.5;
}

.profile-name {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-title {
    color: var(--text-secondary);
    margin-bottom: 0.125rem;
}

.profile-affil {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.profile-research {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.profile-email {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.profile-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.profile-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.profile-links a:hover {
    color: var(--accent-primary);
    text-decoration: none;
}

.profile-links .icon {
    width: 22px;
    height: 22px;
}

.profile-advisor {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.about-right {
    padding-top: 0;
}

.about-header {
    margin-bottom: 0.75rem;
}

.biography-content {
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.biography-content p {
    margin-bottom: 0.5rem;
}

.biography-content p:last-child {
    margin-bottom: 0;
}

.status-line {
    margin-top: 1rem;
}

.status-text {
    color: var(--text-secondary);
    font-size: 1rem;
}

.status-text strong {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ============================================
   News Section
   ============================================ */
.section-news {
    background-color: var(--bg-primary);
}

.news-list {
    column-count: 2;
    column-gap: 2rem;
}

.news-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.15rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    break-inside: avoid;
    margin-bottom: 0.25rem;
}

.news-date {
    flex-shrink: 0;
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
}

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

/* ============================================
   Publications Section - High Density
   ============================================ */
.section-publications {
    background-color: var(--bg-secondary);
}

.publications-list {
    display: flex;
    flex-direction: column;
}

.publication-item {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.pub-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.125rem;
}

.pub-title a {
    color: var(--text-primary);
}

.pub-title a:hover {
    color: var(--accent-primary);
}

.pub-authors {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

.pub-authors strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pub-meta {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.pub-venue {
    font-style: normal;
    color: var(--text-secondary);
}

.pub-venue em {
    font-style: normal;
    font-weight: 600;
    color: var(--accent-primary);
}

.pub-meta a {
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.pub-meta a:first-child {
    margin-left: 0;
}

.pub-meta a:hover {
    color: var(--accent-primary);
}

/* ============================================
   Experience Section
   ============================================ */
.section-experience {
    background-color: var(--bg-primary);
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.experience-category {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.25rem;
}

.experience-category:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.experience-category-title {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.875rem;
}

.experience-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.experience-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.exp-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exp-date {
    font-size: 0.95rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.exp-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.exp-description {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

/* ============================================
   Awards Section
   ============================================ */
.section-awards {
    background-color: var(--bg-secondary);
}

.awards-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.award-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.375rem 0;
    border-bottom: 1px dotted var(--border-light);
    font-size: 0.95rem;
    line-height: 1.4;
}

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

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

.award-name strong {
    color: var(--text-primary);
    font-weight: 600;
}

.award-year {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 1rem;
}

/* ============================================
   Services Section
   ============================================ */
.section-services {
    background-color: var(--bg-primary);
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-category {
    border-bottom: 1px dotted var(--border-light);
    padding-bottom: 1rem;
}

.service-category:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.service-title {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.service-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1.5rem;
}

.service-item {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.service-conf {
    font-weight: 600;
    color: var(--text-primary);
}

.service-year {
    color: var(--text-muted);
}

.service-year a {
    color: var(--text-tertiary);
}

.service-year a:hover {
    color: var(--accent-primary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 1.75rem 0;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-medium);
    text-align: center;
}

.footer p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-tertiary);
}

/* ============================================
   Back to top button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .news-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 3.25rem;
        left: 0;
        right: 0;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 0.75rem;
        border-bottom: 1px solid var(--border-light);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .about-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .about-left {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        text-align: left;
    }
    
    .avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .profile-info {
        flex: 1;
    }
    
    .profile-links {
        justify-content: flex-start;
    }
    
    .award-item {
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .award-year {
        margin-left: 0;
    }
    
    .exp-header {
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .exp-date {
        margin-left: 0;
    }
    
    .service-category {
        flex-direction: column;
        gap: 0.375rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .nav-container {
        padding: 0 1.25rem;
    }
    
    .about-left {
        flex-direction: column;
        text-align: center;
    }
    
    .avatar {
        width: 90px;
        height: 90px;
    }
    
    .profile-links {
        justify-content: center;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .nav, .back-to-top, .status-line {
        display: none;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    .section {
        padding: 1rem 0;
        border-bottom: 1px solid #ccc;
    }
    
    body {
        background: white;
        color: black;
        font-size: 11pt;
    }
}

/* Smooth scroll offset for fixed header */
html {
    scroll-padding-top: 4rem;
}
