/* =========================================
   1. 核心基础样式 (Core Basics)
   ========================================= */
:root {
    --pku-red: #8C0000;      /* 北大红 */
    --deep-blue: #00275B;    /* 深邃蓝 */
    --text-main: #333333;    /* 主要文字 */
    --text-light: #666666;   /* 次要文字 */
    --bg-light: #f8f9fa;     /* 浅灰背景 */
    --border-color: #eeeeee;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    line-height: 1.6;
    background-color: #ffffff;
}

a { text-decoration: none; transition: all 0.2s ease; }
ul { list-style: none; margin: 0; padding: 0; }

/* 通用容器 */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* 章节标题 */
.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 50px;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--pku-red);
    margin: 15px auto 0;
}

/* 通用按钮 */
.btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--pku-red);
    color: white !important;
    border-radius: 4px;
    font-weight: bold;
}
.btn:hover { background-color: var(--deep-blue); }

/* =========================================
   2. 导航栏 (Navigation)
   ========================================= */
nav {
    background-color: #ffffff;
    width: 100%;
    border-bottom: 3px solid var(--pku-red); 
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 20px;
}

.logo {
    color: var(--pku-red);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links li a {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    padding: 22px 0;
    position: relative;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--pku-red);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--pku-red);
    transition: width 0.3s;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

/* =========================================
   3. 首页轮播图 (Carousel)
   ========================================= */
.carousel-container {
    max-width: 100%;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
}

.mySlides {
    display: none;
    position: relative;
}
.mySlides img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    opacity: 0.95;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    background: rgba(0, 39, 91, 0.8);
    color: #f2f2f2;
    width: 100%;
    padding: 15px 0;
    text-align: center;
    font-size: 1.2rem;
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}
@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

/* =========================================
   4. 成员与Bio页面 (Members & Bio)
   ========================================= */
   /* 1. 网格容器：控制一行显示两个 */
.members-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2列，等宽 */
    gap: 30px; /* 卡片之间的间距 */
    margin-bottom: 50px; /* 组与组之间的间距 */
}

/* 2. 成员卡片优化 (适配网格) */
.member-card {
    /* 恢复 Flex 布局 (左图右文) */
    display: flex;
    gap: 20px;
    
    /* 给每个卡片加个边框和背景，像一张名片 */
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border-radius: 4px;
    
    /* 去掉之前的底部虚线，改用卡片包裹 */
    border-bottom: 1px solid #eee; 
    margin-bottom: 0; /* 由 grid gap 控制间距 */
}

.member-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #ddd;
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* 3. 照片样式 (让照片变长) */
.member-photo {
    flex-shrink: 0;
    width: 180px; /* 稍微调窄一点宽度，给文字留空间 */
}

.member-photo img {
    width: 100%;
    height: 250px; /* 高度 250px */
    object-fit: cover; /* 保持比例填充，多余部分裁切 */
    border-radius: 4px;
}

/* 5. 手机端适配 (手机上自动变回一行一个) */
@media (max-width: 900px) {
    .members-grid {
        grid-template-columns: 1fr; /* 强制变为1列 */
    }
    .member-card {
        flex-direction: column; /* 手机上图片在名字上面 */
        align-items: center;
        text-align: center;
    }
    .member-photo {
        width: 100%;
        max-width: 240px;
        margin-bottom: 15px;
    }
    /* 手机上时间轴文字左对齐 */
    .member-info {
        width: 100%;
        text-align: left; 
    }
}

.member-info { flex-grow: 1; }

.member-name {
    color: var(--pku-red);
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.member-role {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 5px;
}

/* 修正邮箱字体，去除花哨的等宽字体样式 */
.member-email {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; /* 回归标准字体 */
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

/* 针对 PI 名字的特别优化 */
.pi-name {
    font-size: 2rem;       /* 字号加大 */
    color: var(--pku-red); /* 北大红 */
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.2;
}

/* 针对 PI 头衔的优化 */
.pi-title {
    font-size: 1.3rem;
    color: #444;
    font-weight: 500;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee; /* 加一条细淡的分割线 */
    padding-bottom: 15px;
    display: inline-block; /* 让分割线只包裹文字宽度 */
    min-width: 200px;
}

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.timeline-list li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.alumni-list { list-style: none; padding: 0; }
.alumni-list li { margin-bottom: 12px; font-size: 1rem; line-height: 1.6; }
.alumni-name { font-weight: bold; color: var(--text-main); }

/* =========================================
   5. 发表论文 (Publications)
   ========================================= */
.pub-year-title {
    font-size: 1.5rem;
    color: var(--deep-blue);
    margin-bottom: 20px;
    border-left: 5px solid var(--pku-red);
    padding-left: 15px;
    background: var(--bg-light);
    padding: 10px 15px;
}
.publication-item {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 20px;
}
.pub-index {
    font-weight: bold;
    color: var(--pku-red);
    min-width: 40px;
    font-size: 1.1rem;
}
.pub-journal {
    color: var(--deep-blue);
    font-weight: bold;
    font-style: italic;
}

/* =========================================
   6. 研究页面 (Research)
   ========================================= */
.research-item {
    padding: 30px;
    margin-bottom: 40px;
    background-color: #fff;
    border: 1px solid #eee;
    border-left: 5px solid var(--deep-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.research-header h2 {
    margin-top: 0;
    color: var(--text-main);
    font-size: 1.6rem;
}

.journal-tag {
    display: inline-block;
    background-color: var(--pku-red);
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 15px;
}

/* 1. 内容布局：垂直居中 */
.research-body {
    display: flex;
    gap: 40px;           /* 保持宽间距 */
    margin-bottom: 30px; /* 增加底部间距，区分不同项目 */
    align-items: center; /* 关键修改：让图片在垂直方向上居中 */
}

/* 2. 图片区域 */
.research-thumb {
    flex: 0 0 45%;       /* 图片占 45% 宽度 */
    max-width: 600px;
    width: 100%;
}

.research-thumb img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    /* 静态图片保留淡淡的边框和阴影，增加质感 */
    border: 1px solid #eee; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 3. 轮播容器样式 (去掉了灰色边框) */
.research-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    /* 关键修改：删除了 border 和 background */
    border: none; 
    background: transparent;
}

.research-slider-container img {
    /* 轮播图内部的图片样式 */
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    /* 给轮播图的图片本身加一点阴影，让它立体 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.mini-slides {
    display: none; 
    width: 100%;
}
.mini-slides:first-child {
    display: block;
}

/* 4. 动画 */
.fade-mini {
    animation-name: fade;
    animation-duration: 1.5s;
}

/* 手机端适配：改为上下排列 */
@media (max-width: 900px) {
    .research-body {
        flex-direction: column;
    }
    .research-thumb {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
}

.research-text {
    flex-grow: 1;
    font-size: 1rem;
    color: #444;
    text-align: justify;
}

.research-links {
    background-color: #f9f9f9;
    padding: 15px;
    border-top: 1px dashed #ddd;
}

.video-links a {
    display: inline-block;
    margin-right: 15px;
    font-size: 0.9rem;
    color: var(--pku-red);
    text-decoration: underline;
}

/* =========================================
   7. 下载页面 (Downloads)
   ========================================= */
.software-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-top: 4px solid var(--pku-red);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.software-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.software-card h2 {
    margin-top: 0;
    color: var(--deep-blue);
    font-size: 1.5rem;
}

/* 下载页面：左图右文布局 (Updated) */
.software-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
}

.software-img {
    flex-shrink: 0;
    width: 350px;
}
.software-img img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.software-content { flex-grow: 1; }

.software-desc {
    color: #555;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn-download {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--pku-red);
    color: white !important;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid var(--pku-red);
}
.btn-download:hover {
    background-color: #6d0000;
    border-color: #6d0000;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: transparent;
    color: var(--deep-blue) !important;
    border: 1px solid var(--deep-blue);
    border-radius: 4px;
    font-weight: 500;
}
.btn-view:hover {
    background-color: var(--deep-blue);
    color: white !important;
}

.disclaimer-box {
    background-color: #fff8e1;
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin-bottom: 40px;
    color: #856404;
    font-size: 0.95rem;
}

/* =========================================
   8. 页脚 (Footer)
   ========================================= */
footer {
    background-color: var(--deep-blue);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}
footer p { font-size: 0.9rem; opacity: 0.8; }

/* 响应式调整 (Mobile) */
@media (max-width: 768px) {
    .research-body, .software-body {
        flex-direction: column;
    }
    .research-thumb, .software-img {
        width: 100%;
        margin-bottom: 20px;
    }
    .member-card {
        flex-direction: column;
        text-align: center;
    }
    .member-photo {
        width: 100%;
        margin: 0 auto;
    }
    .member-photo img {
        width: 200px; /* 手机上头像小一点 */
        height: 240px;
    }
}
/* --- Append to style.css: Mini Slider for Research Page --- */

/* 研究项目内部的小轮播容器 */
.research-slider-container {
    position: relative;
    width: 100%;
    height: 100%; /* 撑满左侧缩略图区域 */
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 轮播图片样式 */
.mini-slides {
    display: none; /* 默认隐藏 */
    width: 100%;
    height: auto;
}

.mini-slides img {
    width: 100%;
    height: auto;
    display: block;
}

/* 简单的淡入动画 */
.fade-mini {
    animation-name: fade;
    animation-duration: 1.0s;
}

/* 视频链接的样式优化 */
.movie-link-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}
.movie-link-group a {
    font-size: 0.85rem;
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    color: #555;
    border: 1px solid #ddd;
    text-decoration: none;
}
.movie-link-group a:hover {
    background-color: var(--pku-red);
    color: white;
    border-color: var(--pku-red);
}
/* --- Append to style.css: Video Gallery Styles --- */

/* 视频画廊容器：弹性布局，自动换行 */
.movie-gallery {
    display: flex;
    flex-wrap: wrap; /* 允许换行 */
    gap: 15px;       /* 每个视频项之间的间距 */
    margin-top: 10px;
}

/* 单个视频项：垂直排列（图在上，文在下） */
.movie-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px; /* 限制每个项的宽度 */
}

/* 视频封面缩略图 */
.movie-item img {
    width: 100px;
    height: 65px; /* 固定高度，保证整齐 */
    object-fit: cover; /* 裁剪图片以填充 */
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 5px; /* 图片和文字的间距 */
    transition: transform 0.2s;
    cursor: pointer;
}

.movie-item:hover img {
    transform: scale(1.05); /* 鼠标悬停时轻微放大 */
    border-color: var(--pku-red);
}

/* 视频文字链接 */
.movie-item a {
    font-size: 0.8rem;
    color: #555;
    text-align: center;
    line-height: 1.2;
    text-decoration: none;
    word-wrap: break-word; /* 防止长文件名撑破布局 */
}

.movie-item a:hover {
    color: var(--pku-red);
    text-decoration: underline;
}

/* =========================================
   CSS for Updated Index Page (2025-01-15)
   ========================================= */

/* 1. 轮播图高度调整 (减半) */
.carousel-container {
    /* 将容器高度从 600px 改为 300px */
    height: 300px; 
    overflow: hidden;
}
.mySlides img {
    width: 100%;
    /* 图片高度也同步改为 300px */
    height: 300px;
    object-fit: cover; /* 保持比例裁切填充 */
}

/* 2. Research Overview: 瀑布流式卡片布局 (Updated for Text-Top Layout) */

/* 网格容器 */
.overview-grid {
    display: grid;
    /* 3列等宽 */
    grid-template-columns: repeat(3, 1fr);
    /* 间距 */
    gap: 40px;
    /* 顶部对齐，实现长短不一 */
    align-items: start;
    margin-top: 40px;
}

/* 单个卡片 */
.overview-card {
    background: #fff;
    border: 1px solid #eee;
    /* 顶部装饰条 */
    border-top: 4px solid var(--deep-blue);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-top-color 0.3s ease;
    display: flex;
    flex-direction: column; /* 垂直排列 */
    border-radius: 6px;
    overflow: hidden;
    height: auto; /* 高度自适应 */
}

.overview-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
    border-top-color: var(--pku-red);
}

/* 卡片内容容器 (文字部分 - 现在在上面) */
.overview-content {
    padding: 25px 25px 15px 25px; /* 下方留少一点，紧接视频 */
    display: flex;
    flex-direction: column;
}

/* 标题 */
.overview-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--text-main);
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.overview-title a {
    color: var(--text-main);
    text-decoration: none;
}
.overview-title a:hover {
    color: var(--pku-red);
}

/* 简介文本 */
.overview-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
}

/* 跳转链接 */
.overview-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--deep-blue);
    text-decoration: none;
    margin-bottom: 10px;
}
.overview-link:hover {
    color: var(--pku-red);
    text-decoration: underline;
}

/* 媒体区域 (堆叠图片和视频) */
.overview-media {
    width: 100%;
    background: transparent;
    border: none;
    /* 保持内边距，让媒体素材悬浮在卡片中间 */
    padding: 0 25px 25px 25px; 
    box-sizing: border-box;
    
    display: flex;
    flex-direction: column;
    /* 图片和视频之间的垂直间距 */
    gap: 10px; 
}

.overview-media video, 
.overview-media img {
    width: 100%;
    height: auto;
    display: block;
    
    /* 统一的边框和圆角，让它们看起来是一套的 */
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
    .carousel-container, .mySlides img {
        height: 200px;
    }
}