/* ==========================================================================
   1. 核心变量与基础设置
   ========================================================================== */
:root {
  /* 实验室主题配色 */
  --primary-color: #1a5b92;   /* 学术深蓝 */
  --accent-color: #ee5a24;    /* 生命橙色 */
  --text-main: #2c3e50;
  --text-muted: #6c757d;
  --bg-subtle: #f8f9fa;
  --nav-bg: rgba(255, 255, 255, 0.85);
  
  /* 字体堆栈 */
  --font-main: "Noto Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-main);
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}


/* ==========================================================================
   2. 导航栏 (Navbar) - 穿透与模糊效果
   ========================================================================== */
.navbar {
  background-color: var(--nav-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  z-index: 1030;
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary-color) !important;
  margin-left: 1rem;
}

.nav-link {
  font-weight: 500;
  color: var(--text-main) !important;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent-color) !important;
}

/* ==========================================================================
   3. 标题排版
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { 
  font-size: 1.8rem; 
  color: var(--primary-color);
  border-left: 5px solid var(--accent-color);
  padding-left: 15px;
  margin-top: 2.5rem;
}

/* ==========================================================================
   4. Hero 区域 (背景图部分)
   ========================================================================== */
.hero-section {
  position: relative;
  width: 100%;
  height: 45vh;
  min-height: 350px;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  margin-top: 0;
  color: white;
}

/* 渐变遮罩，确保左侧文字清晰 */
.hero-overlay {
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 100%);
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.hero-text-wrapper {
  position: relative;
  z-index: 2;
  padding-top: 60px; /* 避开导航栏高度 */
}

.hero-text-wrapper h1 {
  color: #fff;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.hero-text-wrapper .lead {
  font-size: 1.2rem;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
  max-width: 700px;
}

/* ==========================================================================
   5. 文章卡片列表 (News Index)
   ========================================================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.post-image {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

/* 核心修复：为卡片文字内容添加内边距容器 */
.post-card-body {
  padding: 20px 25px; /* 左右留出足够空间 */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-body h2 {
  font-size: 1.3rem;
  margin: 0 0 12px 0;
  border: none;
  padding: 0;
}

.post-card-body h2 a {
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.2s;
}

.post-card-body h2 a:hover { color: var(--primary-color); }

.post-card-body .abstract {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.read-more {
  margin-top: auto; /* 将按钮推到底部 */
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.read-more:hover { text-decoration: underline; }

/* ==========================================================================
   6. 文章详情页 (Post Page)
   ========================================================================== */
.post-content {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* 修复：限制详情页图片大小并居中 */
.post-hero-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.page-abstract {
  background-color: var(--bg-subtle);
  border-left: 5px solid var(--accent-color);
  padding: 25px;
  margin: 30px 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
  font-size: 1.1rem;
}

/* ==========================================================================
   7. 人员展示 (People Page)
   ========================================================================== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px;
}

.person-card {
  text-align: center;
  padding-bottom: 20px;
}

.person-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 20px;
  border: 4px solid var(--bg-subtle);
  transition: border-color 0.3s;
}

.person-card:hover .person-photo {
  border-color: var(--accent-color);
}

.person-role {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
  margin-bottom: 10px;
}

/* ==========================================================================
   8. 响应式布局
   ========================================================================== */
@media (max-width: 768px) {
  .hero-section {
    height: 40vh;
    justify-content: center;
    text-align: center;
  }
  
  .hero-text-wrapper { padding: 20px; }
  
  .posts-grid { grid-template-columns: 1fr; }
  
  h1 { font-size: 1.8rem; }
}