/* --- style.css (最新版) --- */
:root {
    --primary-color: #003366;
    --secondary-color: #f4f4f4;
    --text-color: #333;
    --accent-color: #0056b3;
    --border-color: #ddd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- 导航栏 (更新支持图标) --- */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

header .container {
    max-width: 98%;   /* 让它占据屏幕宽度的 98%，几乎贴边 */
    padding: 0 40px;  /* 左右稍微留一点点缝隙，更美观 */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px; /*稍微增高以容纳图标*/
}

/* 左侧 Logo 区域 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 15px; /* 图标之间的间距 */
}

.header-logo {
    height: 50px; /* 控制图标高度 */
    width: auto;
}

.lab-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-left: 10px;
}

.nav-links { display: flex; }
.nav-links li { margin-left: 20px; }
.nav-links a { font-weight: 500; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-color); font-weight: bold; }

/* --- 通用内容区域 --- */
main { flex: 1; padding: 40px 0 80px; background: #fff; }

h2 {
    text-align: center; font-size: 2rem; margin-bottom: 40px;
    color: var(--primary-color); position: relative;
}
h2::after {
    content: ''; display: block; width: 50px; height: 3px;
    background: var(--accent-color); margin: 10px auto 0;
}

/* --- Team 页面特定样式 (更新分类) --- */
.team-category-title {
    font-size: 1.4rem;
    color: var(--primary-color);
    border-left: 5px solid var(--accent-color);
    padding-left: 15px;
    margin: 40px 0 20px 0;
    background-color: #f9f9f9;
    padding-top: 5px;
    padding-bottom: 5px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 40px; /* 每个分类之间的间距 */
}

.member-card {
    background: #fff; padding: 20px; text-align: center;
    border: 1px solid #eee; border-radius: 5px;
    transition: transform 0.3s;
}
.member-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.member-photo {
    width: 120px; height: 140px; border-radius: 0;
    background-color: #eee; margin: 0 auto 15px; object-fit: cover;
    border: 3px solid #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.member-name { font-weight: bold; margin-bottom: 5px; font-size: 1.1rem; }
.member-role { font-size: 0.9rem; color: #666; }

/* --- 其他通用 --- */
/* 修改后 */
.hero {
    height: calc(100vh - 80px);
    /* 下面这行是重点：url里面的路径要改成您照片的路径 */
    background: linear-gradient(rgba(0, 51, 102, 0.1), rgba(0, 51, 102, 0.1)), url('images/home-bg.jpg') no-repeat center center/cover;
    
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}
.hero h1 { font-size: 3rem; margin-bottom: 20px; }

.pi-content { display: flex; align-items: flex-start; gap: 50px; flex-wrap: wrap; margin-top: 40px;}
.pi-img { flex: 1; min-width: 300px; }
.pi-img img { width: 100%; border-radius: 5px; }
.pi-text { flex: 2; }
.pi-text h3 { font-size: 1.8rem; margin-bottom: 10px; color: var(--primary-color); }
.pub-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.pub-title { font-weight: bold; color: var(--primary-color); }
footer { background: var(--primary-color); color: #fff; text-align: center; padding: 20px 0; margin-top: auto; }


.research-section { 
    background: #fff; 
    text-align: center; 
    padding-bottom: 60px;
}

/* 1. 新增：大图容器 */
.research-banner {
    max-width: 900px; /* 限制最大宽度，防止图片过大 */
    margin: 0 auto 40px; /* 居中，且距离下方文字40px */
}

.research-banner img {
    width: 100%;       /* 宽度自适应 */
    height: auto;      /* 高度自动 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* 增加一点阴影让图片更有质感 */
}

/* 2. 下方文字三列布局 */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 自适应列宽 */
    gap: 30px;
    text-align: left; /* 文字左对齐更易阅读 */
}

.res-card {
    background: #fdfdfd;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eee; /* 加个细边框 */
    border-top: 4px solid var(--primary-color); /* 顶部加条色带装饰 */
    transition: 0.3s;
}

.res-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.res-title { 
    font-weight: bold; 
    font-size: 1.3rem; 
    color: var(--primary-color); 
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;

    line-height: 1.25;
    min-height: 5.5em;               /* 2 行标题高度 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;           /* 最多两行 */
    overflow: hidden;
}

/* 正文：左右两端对齐 */
.res-card p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;

    text-align: justify;             /* 关键：两端对齐 */
    text-justify: inter-word;        /* 英文按单词间距调整（部分浏览器有效） */
    hyphens: auto;                   /* 允许断词，避免空隙过大（英文更自然） */
}

/* 2. 首页：实验室活动板块 (Activities) */
.activity-section { background: var(--secondary-color); }
.act-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.act-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.act-img { width: 100%; height: 200px; object-fit: cover; transition: transform 0.5s; }
.act-card:hover .act-img { transform: scale(1.05); } /* 鼠标悬停图片轻微放大 */
.act-info { padding: 15px; }
.act-date { font-size: 0.85rem; color: #888; margin-bottom: 5px; display: block; }
.act-desc { font-weight: bold; color: #333; }

/* 3. News 页面样式 */
.news-list { max-width: 900px; margin: 0 auto; }
.news-item {
    display: flex; gap: 20px; padding: 25px 0;
    border-bottom: 1px solid #eee; align-items: flex-start;
}
.news-date-box {
    background: var(--primary-color); color: #fff;
    padding: 10px; width: 80px; text-align: center; border-radius: 5px; flex-shrink: 0;
}
.news-day { font-size: 1.5rem; font-weight: bold; display: block; line-height: 1; }
.news-year { font-size: 0.8rem; }
.news-content h3 { color: var(--primary-color); margin-bottom: 8px; font-size: 1.2rem; }
.news-tag {
    display: inline-block; background: #eef; color: var(--accent-color);
    font-size: 0.8rem; padding: 2px 8px; border-radius: 4px; margin-bottom: 5px;
}

/* 4. Contact 页面样式 */
.contact-layout { display: flex; gap: 50px; flex-wrap: wrap; }
.contact-info { flex: 1; min-width: 300px; }
.contact-map { flex: 1; min-width: 300px; height: 400px; background: #ddd; border-radius: 8px; overflow: hidden; }
.info-item { display: flex; align-items: flex-start; margin-bottom: 25px; }
.info-icon { width: 24px; margin-right: 15px; margin-top: 5px; } /* 使用简单的文字或图片做图标 */
.info-label { font-weight: bold; display: block; color: var(--primary-color); }
.info-item{
  display: flex;
  align-items: flex-start;
  gap: 10px;          /* Address: / Email: 后面的空格 */
}

.info-label{
  margin-right: 0;    /* 可留可不留，gap 已经控制间距 */
  min-width: 70px;    /* 可选：让 Address/Email 对齐 */
}
/* --- style.css 新增内容 (视频 + 环境版块) --- */

/* 1. 活动板块的视频样式 */
.act-video {
    width: 100%;
    height: 200px; /* 保持和旁边图片一样的高度，整齐 */
    object-fit: cover; /* 保证画面填满，不留黑边，但可能会裁剪掉一点边缘 */
    background: #000; /* 视频加载前显示黑色背景 */
    display: block;
}

/* 2. 实验室环境板块 (Lab Environments) */
.env-section {
    background: #fff; /* 白色背景，与上一个灰色板块区分 */
    padding-bottom: 60px;
}

.env-grid {
    display: grid;
    /* 自动适应列数，每张图最小宽度 250px */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 15px; /* 图片之间的间隙 */
}

.env-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.env-item:hover {
    transform: scale(1.02); /* 鼠标悬停轻微放大 */
    z-index: 10;
}

.env-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* 图片上的文字说明 (可选，鼠标悬停显示) */
.env-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 51, 102, 0.8); /* 半透明深蓝背景 */
    color: #fff;
    padding: 8px;
    font-size: 0.9rem;
    text-align: center;
    transform: translateY(100%); /* 默认隐藏在下面 */
    transition: transform 0.3s;
}

.env-item:hover .env-caption {
    transform: translateY(0); /* 悬停时滑上来 */
}
/* --- style.css 新增内容 --- */

/* Acknowledgements 页面样式 */
.grant-list {
    max-width: 800px;
    margin: 0 auto;
}
.grant-item {
    background: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 5px solid var(--accent-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.grant-title { font-weight: bold; font-size: 1.1rem; color: var(--primary-color); }
.grant-info { color: #666; font-size: 0.9rem; margin-top: 5px; }

/* 青年论坛 (Forum) 样式 */
.forum-section { background: #f9f9f9; padding-bottom: 60px; }
.forum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.forum-card {
    background: #fff; border-radius: 8px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.forum-img { width: 100%; height: 220px; object-fit: cover; }
.forum-content { padding: 20px; }
.forum-title { font-weight: bold; font-size: 1.1rem; margin-bottom: 10px; color: var(--primary-color); }

/* Alumni (校友) 简易列表样式 (如果不想用大头像卡片，可以用这个，或者继续用 member-card) */
/* 这里我们沿用 member-card 但稍微缩小一点，表示已毕业 */
.alumni-card {
    background: #f4f4f4; /* 灰色背景区分 */
    padding: 15px;
    text-align: center;
    border-radius: 5px;
}
/* Alumni：一行多名字，自动换行 */
.alumni-names{
  max-width: 1100px;
  margin: 0 auto 20px;
  display: flex;
  flex-wrap: wrap;      /* 名字太多自动换行 */
  gap: 12px 18px;       /* 行间距/列间距 */
}

.alumni-name{
  font-weight: 600;
  color: var(--primary-color);
  background: #f4f4f4;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #eee;
}
.map-img{
  width: 100%;
  height: 100%;
  object-fit: cover;   /* 填满容器，不留空白 */
  display: block;
}
/* Forum image click-to-zoom */
.zoomable{
  cursor: zoom-in;
}

/* Lightbox overlay */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.lightbox.show{
  display: flex;
}

.lightbox-inner{
  position: relative;
  max-width: 1100px;
  width: 100%;
}

#lightboxImg{
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: #000;
}

.lightbox-close{
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 18px;
  font-size: 24px;
  line-height: 36px;
  cursor: pointer;
  background: #fff;
}

.lightbox-caption{
  margin-top: 10px;
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
}