/* Global Styles */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --dark: #212529;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #ffffff;
    color: #2c3e50;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e1e8ed;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: none;
    flex-shrink: 0;
    background: #ffffff;
    text-align: center;
}

.sidebar-brand {
    color: #000000;
    font-size: 1.6rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.sidebar-brand:hover {
    color: var(--primary-color);
    transform: scale(1.02);
}

.sidebar-brand i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.sidebar-content {
    padding: 1rem 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-item {
    margin: 0.3rem 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: #5a6c7d;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 20px;
    position: relative;
    font-weight: 500;
    background: transparent;
    border: 2px solid transparent;
}

.sidebar-link:hover {
    background: #f8f9fa;
    color: #2c3e50;
    transform: translateX(4px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);
}

.sidebar-link.active {
    background: var(--primary-color);
    color: #f8f9fa;
    font-weight: 800;
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    padding: 0.6rem 1.25rem;
}

.sidebar-link.active i {
    color: #f8f9fa;
}

.sidebar-link i {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-link:hover i {
    transform: scale(1.1);
}

.sidebar-link span {
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

/* Sidebar Dropdown */
.sidebar-dropdown {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    background: #fafbfc;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    margin-left: 1rem;
    margin-right: 1rem;
    border: 2px solid #f0f2f5;
}

.sidebar-dropdown.show {
    max-height: 300px;
    opacity: 1;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.sidebar-dropdown-item {
    display: block;
    padding: 0.6rem 1.25rem 0.6rem 3rem;
    color: #5a6c7d;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 0.2rem 0.5rem;
    font-weight: 400;
}

.sidebar-dropdown-item:hover {
    background: var(--primary-color);
    color: #f8f9fa;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.sidebar-dropdown-item.active {
    background: var(--primary-color);
    color: #f8f9fa;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    padding: 0.5rem 1.25rem 0.5rem 3rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #f0f2f5;
    margin-top: auto;
    flex-shrink: 0;
    background: #fafbfc;
    border-radius: 20px;
    margin: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.social-links-sidebar {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #ffffff;
    color: #5a6c7d;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #f0f2f5;
}

.social-link:hover {
    background: var(--primary-color);
    color: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.3);
    border-color: var(--primary-color);
}

.social-link i {
    font-size: 1.2rem;
}



/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 100%;
        background: linear-gradient(180deg, #f8f9ff 0%, #e8f2ff 50%, #f0f4ff 100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Overlay for mobile */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar.show::before {
        opacity: 1;
    }
}

@media (min-width: 993px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

/* Universe Background */
#universe-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

#universe-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #ffffff, transparent),
        radial-gradient(2px 2px at 40px 70px, #ffffff, transparent),
        radial-gradient(1px 1px at 90px 40px, #ffffff, transparent),
        radial-gradient(1px 1px at 130px 80px, #ffffff, transparent),
        radial-gradient(2px 2px at 160px 30px, #ffffff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: universe-move 20s linear infinite;
}

@keyframes universe-move {
    from { transform: translateX(0); }
    to { transform: translateX(-200px); }
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    background-color: var(--white);
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
}



/* Sections */
.section-padding {
    padding: 3rem 0;
}

.section-title {
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-bg) 100%);
    padding: 4rem 0 2rem 0;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23f8f9fa"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.profile-image-container {
    position: relative;
}

.profile-image {
    width: 220px;
    height: 280px;
    border-radius: 60% / 50%;
    object-fit: cover;
    border: 5px solid var(--white);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
}

.social-links {
    margin-top: 1.5rem;
    position: relative;
    z-index: 10;
}

.social-links .btn {
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Research Interests */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.interest-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--light-bg);
    border-radius: 10px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.interest-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background-color: var(--white);
}

.interest-item i {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: var(--primary-color);
}

.interest-item span {
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 3rem;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
}

.timeline-content h5 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.timeline-content small {
    font-weight: 600;
}

/* News Section */
.news-timeline {
    position: relative;
    padding-left: 2rem;
}

.news-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.news-item {
    background-color: var(--white);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.news-date {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.news-year {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    position: relative;
}

.news-year::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.news-title {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.news-content p {
    color: var(--dark);
    line-height: 1.5;
    margin: 0;
}

/* Tutorial Section */
.tutorial-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tutorial-item {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.tutorial-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tutorial-title {
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.tutorial-authors {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-style: italic;
    line-height: 1.5;
}

.tutorial-venue {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.tutorial-arxiv {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.tutorial-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tutorial-links .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

/* Contact Section */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--light-bg);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-item:hover i {
    color: var(--white);
}

/* Footer */
.footer {
    background-color: #ffffff;
    color: var(--dark);
    padding: 1.5rem 0;
    text-align: center;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0 2rem 0;
    }
    
    .profile-image {
        width: 170px;
        height: 220px;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    .interests-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 10px;
    }
    
    .timeline-item {
        padding-left: 2rem;
    }
    
    .timeline-marker {
        width: 20px;
        height: 20px;
        left: -5px;
    }
    
    .tutorial-links {
        flex-direction: column;
    }
    
    .tutorial-links .btn {
        width: 100%;
        text-align: center;
    }
    
    .news-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .profile-image {
        width: 140px;
        height: 180px;
    }
    
    .social-links .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effects */
.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Additional Sidebar Styles */

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(108, 117, 125, 0.05);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.5);
}

/* Sidebar animations */
.sidebar-link {
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-link:hover::before {
    left: 100%;
}

/* Sidebar dropdown animations */
.sidebar-dropdown {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-dropdown.show {
    max-height: 300px;
    opacity: 1;
}



/* Enhanced mobile responsiveness */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 100%;
        background: linear-gradient(180deg, #f8f9ff 0%, #e8f2ff 50%, #f0f4ff 100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .footer {
        margin-left: 0;
        width: 100%;
    }
    
    /* Overlay for mobile */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar.show::before {
        opacity: 1;
    }
}

/* Sidebar scroll effect */
.sidebar.scrolled {
    /* 保持白色背景，不因滚动而改变 */
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 移除滚动时的其他样式变化 */
.sidebar.scrolled .sidebar-header,
.sidebar.scrolled .sidebar-footer,
.sidebar.scrolled .sidebar-link,
.sidebar.scrolled .sidebar-dropdown,
.sidebar.scrolled .social-link {
    /* 保持原有样式，不因滚动而改变 */
}

/* Sidebar item active state */
/* 删除重复的规则，使用上面定义的样式 */

/* Social links hover animation */
.social-link {
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.social-link:hover::before {
    width: 100%;
    height: 100%;
}

/* Sidebar collapse button positioning */

/* Ensure proper z-index for dropdowns */
.sidebar-dropdown {
    z-index: 1000;
}

/* Smooth transitions for all sidebar elements */
.sidebar * {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.sidebar-link:focus,
.sidebar-dropdown-item:focus,
.social-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .sidebar {
        border-right: 2px solid var(--white);
    }
    
    .sidebar-link {
        border-left-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar *,
    .main-content {
        transition: none;
    }
    
    .sidebar-link::before {
        display: none;
    }
}

/* Subpage specific sidebar styles */
/* 删除重复的规则，使用上面定义的样式 */

/* Ensure proper spacing for subpages */
.main-content {
    min-height: 100vh;
}

/* Subpage hero section adjustments */
.hero-section {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Ensure sidebar is visible on all subpages */
@media (min-width: 993px) {
    .sidebar {
        display: flex !important;
        transform: translateX(0) !important;
    }
}
