/* =========================
   Group Members 页面样式（5 列布局 + 居中优化 + 自适应）
   ========================= */

/* --- 页面整体容器优化 --- */
#members-root.container-fluid {
  max-width: 1600px;         /* 限制最大宽度，避免右侧过空 */
  margin: 0 auto;             /* 居中显示 */
  padding-left: 2rem;
  padding-right: 2rem;
}

main.content {
  max-width: 1700px;          /* 保证内容区与成员区宽度协调 */
  margin: 0 auto;
}

/* --- 网格布局：桌面端 5 列 --- */
#members-root .row {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)); /* 桌面端 5 列 */
  column-gap: 1.25rem;   /* 横向间距 */
  row-gap: 1.5rem;       /* 纵向间距 */
  justify-items: center; /* 每列内容水平居中 */
  align-items: stretch;  /* 每个网格单元等高 */
}

/* 平板端：4 列 */
@media (max-width: 1199.98px) {
  #members-root .row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 小平板：3 列 */
@media (max-width: 991.98px) {
  #members-root .row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 手机端：2 列 */
@media (max-width: 767.98px) {
  #members-root .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 1.25rem;
  }

  #members-root.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* --- 卡片 --- */
.member-card {
  width: 100%;
  max-width: 240px;  /* 原为 260px，略收窄以适配 5 列 */
  min-width: 240px;

  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  padding-top: 1rem;
  margin: 0 auto;
  background-color: #fff;
}

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

/* 头像：圆 + 统一大小 */
.member-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 0.9rem auto;
  border: 3px solid #f8f9fa;
}

@media (min-width: 768px) {
  .member-photo {
    width: 140px;
    height: 140px;
  }
}

/* 卡片正文内容 */
.member-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 0.75rem 0.9rem 0.75rem;
  flex: 1;
}

/* 名字 */
.member-card .card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
  color: #2c3e50;
}
@media (min-width: 768px) {
  .member-card .card-title {
    font-size: 1.2rem;
  }
}

/* 职位 */
.member-card p.text-muted {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
  color: #6c757d;
}

/* 简介（最多显示 3 行） */
.member-card .card-text {
  font-size: 0.85rem;
  line-height: 1.35;
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 链接区（Email, ORCID, PubMed 等） */
.member-card .d-flex {
  margin-top: auto;
  gap: 0.75rem;
  justify-content: center;
}
.member-card .d-flex a {
  font-size: 0.8rem;
  color: #0d6efd;
  text-decoration: none;
}
.member-card .d-flex a:hover {
  text-decoration: underline;
}

/* ====== 适配优化（小屏字体与间距略紧凑） ====== */
@media (max-width: 767.98px) {
  .member-card {
    max-width: 200px;
    min-width: 200px;
    padding-top: 0.75rem;
  }
  .member-photo {
    width: 110px;
    height: 110px;
  }
  .member-card .card-title {
    font-size: 1rem;
  }
  .member-card p.text-muted,
  .member-card .card-text {
    font-size: 0.8rem;
  }
}