
/* 切换按钮样式 */
.toggle-btn {
  background-color: #eee;
  border: none;
  padding: 10px 20px;
  margin: 0 10px;
  font-size: 2.85em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover { background-color: #ddd; }
.toggle-btn.active { background-color: #2b252c; color: white; }

/* 教师信息区容器 */
.teacher-section {
  /* 默认不占位，显示时由 JS 将 display 改为 flex */
  display: none;
  flex-wrap: wrap;         /* 自动换行 */
  justify-content: flex-start;
  opacity: 0;              /* 默认隐藏 */
  visibility: hidden;
  transition: opacity 0.3s ease;
}

/* 默认显示教授信息（初始使其占位并可见） */
#professorSection {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* 教师卡片样式 */
.teacher-card {
  display: flex;
  flex-direction: column;  /* 垂直排列头像和文字 */
  align-items: center;     /* 水平居中所有内容 */
  justify-content: center;
  width: calc(33.333% - 1em);
  margin: 0.5em;
  background: #fff;
  border-radius: 12px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
  overflow: hidden;
  text-align: center; /* ✅ 让文字居中 */
}

.teacher-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  color: #2b252c;
}

/* 头像 */
.teacher-photo {
  width: 100%;
  text-align: center;
  padding: 1em;
}
.teacher-photo img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #2b252c;
}

/* 信息区域 */
.teacher-info {
  flex: 1;                  /* ✅ 让信息区域撑满剩余空间 */
  display: flex;            /* ✅ 开启flex布局 */
  flex-direction: column;
  align-items: center;      /* ✅ 水平居中 */
  justify-content: center;  /* ✅ 垂直居中 */
  padding: 1em;
  text-align: center;
}
.teacher-info h4 {
  margin: 0.5em 0;
  font-size: 1.2em;
}
.teacher-info p {
  font-size: 0.95em;
  line-height: 1.4em;
  color: #666;
  margin: 0;
  text-align: center; /* ✅ 再次保证文字本身居中 */
}


/* 响应式布局 */
@media (max-width: 1024px) { .teacher-card { width: calc(50% - 1em); } }
@media (max-width: 768px)  { .teacher-card { width: 100%; } }

/* 切换淡入效果（可通过 JS 控制 display 为 flex） */
.teacher-section.fade-in { display: flex; opacity: 1 !important; visibility: visible !important; }
