/* 人才队伍名录页（学科带头人 / 学科骨干）：
   浅蓝底 + 顶部返回与标题 + 按姓氏首字母筛选条 + 姓名网格。
   返回按钮用两页共用的 .team-back（见 team-page.css，由 team/layout.tsx 统一引入），
   宽高与人物页完全一致，这里只负责它在标题左侧的排布。 */

.directory-page {
  position: relative;
  box-sizing: border-box;
  /* 站点头部高 115px，内容不足一屏时也把浅蓝底铺满 */
  min-height: calc(100vh - 115px);
  padding: 30px 0 72px;
  background: linear-gradient(180deg, #eaf3ff 0%, #e2eeff 100%);
  color: #111;
}
.directory-wrap {
  width: min(1232px, calc(100% - 48px));
  margin: 0 auto;
  font-family: "微软雅黑", "Microsoft Yahei", Arial, "Helvetica Neue", "Hiragino Sans GB", Simsun, sans-self;
}

/* 返回 + 大标题同一行，垂直居中 */
.directory-head {
  display: flex;
  align-items: center;
  gap: 28px;
}
.directory-title {
  margin: 0;
  color: #000;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
}

/* 蓝底筛选条：左侧「按姓氏」，右侧字母均匀分布 */
.directory-filter {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 26px;
  padding: 0 22px;
  min-height: 48px;
  border-radius: 6px;
  /* 与设计稿一致：蓝色横向渐变，左侧深、右侧浅 */
  background: linear-gradient(90deg, #4388d9 0%, #60a2e9 55%, #7cb9f2 100%);
  color: #fff;
}
.directory-filter-label {
  flex: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 48px;
  white-space: nowrap;
}
.directory-letters {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  overflow: hidden;
}
.directory-letter {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 16px;
  line-height: 38px;
  text-align: center;
  cursor: pointer;
  /* 去掉 iOS Safari 原生按钮外观 */
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 140ms ease, color 140ms ease;
}
/* 「全部」是中文词，比单个字母宽，不参与等比压缩 */
.directory-letter:first-child {
  flex: 0 0 auto;
  padding: 0 10px;
}
.directory-letter:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.directory-letter[data-on="true"] { background: rgba(255, 255, 255, 0.92); color: #2f6fd0; font-weight: 700; }
.directory-letter:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* 教师名录标题 + 左侧小圆圈和渐变横线的装饰 */
.directory-list-head { margin-top: 30px; }
.directory-list-title {
  margin: 0;
  color: #1b2b3f;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}
.directory-list-title span {
  margin-left: 4px;
  color: #4a5a6c;
  font-size: 16px;
  font-weight: 400;
}
.directory-rule {
  position: relative;
  display: block;
  width: min(680px, 100%);
  height: 2px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7fb0ea 0%, rgba(127, 176, 234, 0) 100%);
}
.directory-rule::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -2px;
  box-sizing: border-box;
  width: 9px;
  height: 9px;
  border: 2px solid #2f6fd0;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}

/* 姓名网格：白底圆角按钮，hover 蓝色描边 */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}
.directory-name {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 8px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 68, 126, 0.06);
  color: #2a3648;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.directory-name:hover,
.directory-name:focus-visible {
  border-color: #2f6fd0;
  box-shadow: 0 4px 12px rgba(47, 111, 208, 0.18);
  color: #2f6fd0;
  text-decoration: none;
}
.directory-empty {
  margin: 40px 0 0;
  color: #5d7088;
  font-size: 16px;
  text-align: center;
}

@media (max-width: 1100px) {
  .directory-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .directory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .directory-name { height: 50px; font-size: 16px; }
}

@media (max-width: 620px) {
  .directory-page { padding: 20px 0 56px; }
  .directory-wrap { width: calc(100% - 32px); }
  .directory-head { gap: 14px; }
  .directory-title { font-size: 30px; }
  .directory-filter { gap: 12px; padding: 6px 12px; }
  .directory-filter-label { line-height: 38px; }
  .directory-letters {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .directory-letter,
  .directory-letter:first-child { flex: 0 0 auto; padding: 0 7px; }
  .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .directory-name { height: 46px; font-size: 15px; }
  .directory-list-title { font-size: 20px; }
  .directory-list-title span { font-size: 14px; }
}

@media (max-width: 460px) {
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
