/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    margin-top: 80px;
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

/* ===================================================
   1. 基础卡片与网格布局（保留，供普通成员使用）
   =================================================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 2rem;
}

.team-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    padding-bottom: 1.5rem;
    display: flex;
    flex-direction: column; 
}

.team-card img {
    width: 100%;
    aspect-ratio: 3 / 4; 
    object-fit: cover;   
    object-position: top center; 
}

.team-card h3 {
    margin: 1rem 0 0.5rem;
    color: #222;
}

.team-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0.2rem 0;
    padding: 0 1rem; 
}


/* ===================================================
   2. 导师专属样式（文字全在左，图片全在右）
   =================================================== */

/* 导师网格：大屏下一排并列两份 */
.pi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem !important; 
}

/* 导师卡片：通通从左到右并排 */
.team-card.pi-card {
    display: flex !important;
    flex-direction: row !important; /*  强制所有人都是：左边文字，右边图片 */
    background: none !important;
    box-shadow: none !important;
    padding-bottom: 0;
    align-items: stretch;
    height: 320px; /* 固定高度 */
}

/* 导师文本框（左侧） */
.pi-text-box {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 1.5rem 2rem 1.5rem 0; /* 右侧留空距隔开图片 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left; /* 文字全部左对齐，如果想名字居中可以单独调 */
}

.pi-text-box h3 {
    font-size: 1.25rem;
    text-decoration: underline; 
    margin: 0 0 0.5rem 0 !important;
    text-align: left;
}

.pi-subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 1rem;
}

.pi-bio p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0.3rem 0;
    padding: 0 !important; /* 去除原本基础样式的 padding 干扰 */
    text-align: left;
}

/* 导师图片框（右侧） */
.pi-image-box {
    width: 240px; 
    min-width: 240px;
    height: 100%;
}

.pi-image-box img {
    width: 100%;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center;
    border-radius: 0; 
}


/* ===================================================
   3. 移动端响应式适配
   =================================================== */
@media (max-width: 992px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
    .pi-grid {
        grid-template-columns: 1fr !important;
    }
    .team-card.pi-card {
        flex-direction: column-reverse !important; /* 手机上变成图片在上文字在下 */
        height: auto;
    }
    .pi-image-box {
        width: 100%;
        height: 300px;
    }
    .pi-text-box {
        padding: 1.5rem 0; 
    }
}
/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 5rem 1rem 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .nav {
        padding: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .research-card,
    .team-member,
    .publication-item {
        padding: 1.5rem;
    }
}

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

/* Loading animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}