/* ==== Base layout ==== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #f9fafb;
  line-height: 1.6;
}

.main-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  background-color: #ffffff;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.02);
}

/* ==== Header & Nav ==== */
.site-header {
  border-bottom: 1px solid #eee;
  margin-bottom: 40px;
  padding-bottom: 20px;
}

.site-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.site-subtitle {
  margin-top: 8px;
  color: #666;
  font-size: 1rem;
}

.navbar {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.navbar a {
  text-decoration: none;
  color: #555;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.navbar a:hover {
  background-color: #f0f0f0;
  color: #000;
}

.navbar a.active {
  background-color: #111;
  color: #fff;
}

/* ==== Sections ==== */
section { margin-bottom: 50px; }
h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}
p { margin-bottom: 16px; color: #444; }
ul { padding-left: 20px; color: #444; }
li { margin-bottom: 8px; }
.highlight { font-weight: 600; color: #000; }
.small-muted { font-size: 0.9rem; color: #777; }

/* ==== Research Page (Overview Style) ==== */
/* 顶部三张图的容器 */
.research-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.overview-img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #eee;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

.overview-img:hover {
  transform: scale(1.02);
}

.overview-caption {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 10px;
  color: #111;
}

/* Research 详细文本区 */
.research-statement {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
}

/* ==== Projects Page (Vertical Layout for Details) ==== */
.project-item {
  display: flex;
  flex-direction: column; /* 【关键修改】改为垂直排列：上图下文 */
  gap: 20px;
  margin-bottom: 50px;      /* 增加项目之间的间距 */
  border-bottom: 1px solid #eee;
  padding-bottom: 50px;
}
.project-item:last-child { border-bottom: none; }

.project-img-wrapper {
  width: 100%;             /* 图片容器占满宽度 */
  background-color: #fafafa; /* 给透明图片加个淡背景，可选 */
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}

.project-img-wrapper img {
  width: 100%;             /* 宽度撑满 */
  height: auto;            /* 【关键修改】高度自动！这样图多高就显示多高，不会看不见 */
  display: block;
  object-fit: contain;     /* 保证图片内容完整显示 */
}

.project-info {
  width: 100%;
}

.project-title {
  font-size: 1.5rem;       /* 标题稍微加大一点 */
  font-weight: 700;
  color: #111;
  margin: 10px 0 12px 0;   /* 增加一点上下的留白 */
}

/* Tags 样式 */
.tags {
  margin-bottom: 16px;
}
.tag {
  display: inline-block;
  background-color: #e0e7ff;
  color: #3730a3;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  margin-right: 8px;
  margin-bottom: 8px;
}

/* ==== About / Profile / Pubs (图片样式调整) ==== */
.about-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.about-text { flex: 1; }
.about-photo { flex: 0 0 240px; } /* 稍微加宽一点给方形照片 */

.about-photo img {
  width: 100%;
  border-radius: 12px; /* 【关键修改】不再是 50% 圆形，改为圆角矩形 */
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* 增加一点阴影质感 */
}

.pub-item { margin-bottom: 20px; }
.pub-title { font-weight: 600; color: #000; }

/* ==== Responsive ==== */
@media (max-width: 768px) {
  /* Research Grid 变单列 */
  .research-overview-grid { grid-template-columns: 1fr; }
  
  /* Project 列表变竖排 */
  .project-item { gap: 15px; }
  
  /* 手机上图片高度微调 */
  .project-img-wrapper img { height: auto; }

  /* About 区域变竖排 */
  .about-container { flex-direction: column-reverse; }
  
  /* 手机上头像宽度自适应 */
  .about-photo { width: 100%; max-width: 300px; margin: 0 auto; }
}
