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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-tertiary: rgba(0, 0, 0, 0.55);
    --heading-color: #1a1a1a;
    --link-color: #2563eb;
    --link-hover: #1d4ed8;
    --border-color: #e5e5e5;
    --section-title: #000000;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --text-primary: #e4e4e7;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.55);
    --heading-color: #f4f4f5;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --border-color: #3f3f46;
    --section-title: #fafafa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.45;
    font-size: 1.1rem;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    padding: 6rem 2rem 1rem;
    gap: 2.5rem;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
}

.profile {
    position: sticky;
    top: 1.5rem;
}

.avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin-bottom: 0.8rem;
    display: block;
    object-fit: cover;
    object-position: center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.sidebar .name {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
    color: var(--heading-color);
}

.bio {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
}

.location i {
    font-size: 0.75rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.contact-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-links a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.contact-links i {
    font-size: 1rem;
    width: 18px;
    text-align: left;
}

.main-content {
    flex: 1;
    max-width: 700px;
}

.header {
    margin-bottom: 0;
}

.main-name {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--heading-color);
    margin-bottom: 0.3rem;
}

.main-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.social-links {
    font-size: 0.9rem;
    line-height: 1.6;
}

.social-links a {
    color: var(--link-color);
    text-decoration: none;
}

.social-links a:hover {
    text-decoration: underline;
}

.section {
    margin-bottom: 1.6rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--border-color);
}

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

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--section-title);
    margin-bottom: 0.5rem;
}

.note {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-tertiary);
}

.entry {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.entry-title {
    font-weight: 500;
}

.entry em {
    font-style: italic;
    font-size: 1rem;
}

.publication {
    margin-bottom: 0.8rem;
}

.pub-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--heading-color);
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.paper-link {
    font-size: 0.85rem;
    color: var(--link-color);
    text-decoration: none;
    margin-left: 0.3rem;
}

.paper-link:hover {
    text-decoration: underline;
}

.pub-venue {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

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

.spotlight {
    font-weight: 400;
    color: var(--text-secondary);
}

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

.pub-authors strong {
    font-weight: 600;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        max-width: 700px;
        gap: 1.5rem;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .profile {
        position: static;
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .contact-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .profile {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 0.4rem;
    }
}

.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(20deg);
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 42px;
        height: 42px;
    }
    
    .theme-toggle i {
        font-size: 1.1rem;
    }
}

@media print {
    body {
        font-size: 10pt;
    }
    
    .container {
        max-width: 100%;
        padding: 0.5in;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    .theme-toggle {
        display: none;
    }
}
