/* WISE 完整师资阵容：只作用于老师区块与老师详情弹窗。 */
#teachers .teacher-filters {
  display: flex;
  margin: 0 0 22px;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

#teachers .teacher-filters::-webkit-scrollbar { display: none; }

#teachers .teacher-filters button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 12px 18px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}

#teachers .teacher-filters button:hover { border-color: #2f68b7; }

#teachers .teacher-filters button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(86, 155, 230, .18);
}

#teachers .directory-note {
  display: flex;
  margin-bottom: 16px;
  padding: 15px 18px;
  align-items: center;
  gap: 14px;
  color: #fff;
  background: linear-gradient(105deg, #071f4d, #0d397c);
  border: 1px solid rgba(129, 185, 244, .45);
  border-radius: 14px;
}

#teachers .directory-note strong {
  padding: 7px 11px;
  color: #0a2b62;
  background: #b8dcff;
  border-radius: 9px;
  font-size: .8rem;
  white-space: nowrap;
}

#teachers .directory-note span { color: rgba(255, 255, 255, .88); font-weight: 700; }

#teachers .directory-status {
  display: flex;
  margin-bottom: 18px;
  padding: 13px 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--navy);
  background: rgba(217, 235, 255, .7);
  border: 1px solid #b9d7f7;
  border-radius: 12px;
}

#teachers .directory-status span { color: #3168a9; font-size: .82rem; font-weight: 900; }
#teachers .directory-status strong { font-family: Georgia, "Songti SC", serif; }
#teachers .directory-status b { color: #174f91; font-size: 1.45rem; }

#teachers .teacher-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

#teachers .teacher-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  color: #102245;
  background: #fff;
  border: 1px solid #cbdcf0;
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(9, 42, 90, .09);
  transition: transform .24s ease, box-shadow .24s ease;
}

#teachers .teacher-card[hidden] { display: none; }
#teachers .teacher-card:hover { transform: translateY(-5px); box-shadow: 0 24px 52px rgba(9, 42, 90, .16); }

#teachers .photo-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1 / 1.04;
  background: #e9f2fc;
  border: 0;
  border-radius: 0;
  cursor: zoom-in;
}

#teachers .photo-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--photo-x, 50%) var(--photo-y, 16%);
  transform: translate(var(--photo-offset-x, 0%), var(--photo-offset-y, 0%)) scale(var(--photo-zoom, 1.18));
  transition: transform .35s ease;
}

#teachers .photo-button:hover img { transform: translate(var(--photo-offset-x, 0%), var(--photo-offset-y, 0%)) scale(calc(var(--photo-zoom, 1.18) + .025)); }

.photo-edit-mode #teachers .photo-button { cursor: move; }
.photo-edit-mode #teachers .teacher-card.editor-selected { outline: 4px solid #efb847; outline-offset: 3px; }

#teachers .branch-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(5, 31, 75, .9);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  backdrop-filter: blur(8px);
}

#teachers .card-body {
  display: flex;
  padding: 20px;
  flex: 1;
  flex-direction: column;
}

#teachers .subject {
  margin: 0 0 6px;
  color: #3269aa;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .045em;
}

#teachers .teacher-card h2 {
  margin: 0;
  color: #091f49;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.42rem;
  line-height: 1.2;
}

#teachers .tags {
  display: flex;
  margin: 12px 0;
  flex-wrap: wrap;
  gap: 6px;
}

#teachers .tag {
  padding: 4px 8px;
  color: #174f91;
  background: #e8f3ff;
  border: 1px solid #bedaf7;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 850;
}

.teacher-course-line { display: block; max-width: 100%; white-space: nowrap; letter-spacing: 0; }
#teachers .tags .tag, .team-profile-dialog .tags .tag { flex: 0 0 auto; max-width: 100%; padding-inline: 6px; white-space: nowrap; font-size: var(--teacher-tag-size, .68rem); line-height: 1.4; letter-spacing: 0; text-transform: none; }
.team-profile-dialog .tags .tag { font-size: var(--teacher-tag-size, .7rem); }
.team-profile-dialog .profile-course.teacher-course-lines { display: block; max-width: 100%; }

#teachers .quote {
  margin: 0 0 16px;
  color: #5b6b84;
  font-size: .86rem;
  line-height: 1.65;
}

#teachers .card-actions {
  display: grid;
  margin-top: auto;
  grid-template-columns: 1.35fr .65fr;
  gap: 8px;
}

#teachers .btn,
.team-profile-dialog .btn {
  display: inline-flex;
  min-height: 42px;
  padding: 10px 12px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 850;
  text-align: center;
}

#teachers .btn-primary,
.team-profile-dialog .btn-primary { color: #fff; background: #0a2f6f; }
#teachers .btn-secondary,
.team-profile-dialog .btn-secondary { color: #082657; background: #9fd0ff; }

#teachers .book-button {
  grid-column: 1 / -1;
  color: #174f91;
  background: #eef7ff;
  border: 1px solid #bdd9f5;
}

#teachers .btn:hover,
.team-profile-dialog .btn:hover { filter: brightness(1.04); transform: translateY(-1px); }

.team-profile-dialog {
  width: min(1120px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #082657;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 40px 120px rgba(0, 20, 55, .56);
}

.team-profile-dialog::backdrop { background: rgba(0, 15, 40, .78); backdrop-filter: blur(10px); }

.team-profile-dialog .profile {
  display: grid;
  height: min(760px, calc(100dvh - 32px));
  min-height: 0;
  grid-template-columns: minmax(320px, .9fr) 1.1fr;
}

.team-profile-dialog .profile-photo { position: relative; min-height: 0; overflow: hidden; background: #e9f2fc; }

.team-profile-dialog .profile-photo img {
  position: absolute;
  top: var(--photo-top, -15%);
  left: 50%;
  width: calc(var(--photo-zoom, 1.65) * 100%);
  max-width: none;
  height: calc(var(--photo-zoom, 1.65) * 100%);
  object-fit: cover;
  object-position: var(--photo-x, 50%) top;
  transform: translateX(calc(-50% + var(--photo-offset-x, 0%))) translateY(var(--photo-offset-y, 0%));
}

.photo-editor {
  position: fixed;
  z-index: 120;
  left: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
  color: #fff;
  background: rgba(5, 31, 75, .97);
  border: 2px solid #efb847;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 20, 55, .38);
  backdrop-filter: blur(12px);
}

.photo-editor.in-dialog { z-index: 10; }
.photo-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.photo-editor-head div { display: grid; gap: 2px; }
.photo-editor-head small { color: #f7cd76; font-weight: 900; }
.photo-editor-head strong { font-size: 1.15rem; }
.photo-editor-head span { padding: 5px 8px; color: #07275b; background: #aed7ff; border-radius: 999px; font-size: .72rem; font-weight: 900; }
.photo-editor > p { margin: 10px 0; color: #d8ebff; font-size: .78rem; line-height: 1.5; }
.photo-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.photo-editor button { min-height: 38px; padding: 8px 10px; color: #092653; background: #eef7ff; border: 1px solid #a9cdf2; border-radius: 9px; cursor: pointer; font-weight: 850; }
.photo-editor button:hover { background: #fff; }
.photo-editor output { display: block; margin: 10px 0; color: #f7cd76; font-size: .78rem; font-weight: 800; text-align: center; }
.photo-editor-actions { display: grid; grid-template-columns: 1.25fr .75fr; gap: 7px; }
.photo-editor-actions button:first-child { color: #fff; background: #1d66b3; border-color: #68a7ea; }
.photo-editor .photo-editor-collapse { width: 100%; min-height: 30px; margin-top: 8px; padding: 4px; color: #cfe6ff; background: transparent; border-color: rgba(207, 230, 255, .35); font-size: .72rem; }
.photo-editor.collapsed { width: auto; padding: 8px; border-radius: 10px; }
.photo-editor.collapsed > :not(.photo-editor-collapse) { display: none; }
.photo-editor.collapsed .photo-editor-collapse { width: auto; margin: 0; padding: 6px 12px; }

.team-profile-dialog .profile-content {
  position: relative;
  min-height: 0;
  padding: clamp(32px, 4vw, 56px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at 100% 0, rgba(132, 195, 255, .22), transparent 38%), linear-gradient(145deg, #071f4d, #0d3d84 82%);
}

.team-profile-dialog .icon-btn {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(5, 27, 66, .74);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  cursor: pointer;
  place-items: center;
  font-size: 1.4rem;
}

.team-profile-dialog .profile-kicker { margin: 0 0 10px; color: #a8d5ff; font-size: .8rem; font-weight: 900; letter-spacing: .14em; }
.team-profile-dialog .profile h2 { margin: 0; padding-right: 42px; color: #fff; font-family: Georgia, "Songti SC", serif; font-size: clamp(2.5rem, 5vw, 4.4rem); line-height: 1; }
.team-profile-dialog .profile-course { display: inline-block; margin: 18px 0 6px; padding: 10px 14px; color: #082657; background: #a8d5ff; border-radius: 9px; font-weight: 900; }
.team-profile-dialog .tags { display: flex; margin: 12px 0; flex-wrap: wrap; gap: 6px; }
.team-profile-dialog .tag { padding: 5px 9px; color: #fff; background: rgba(144, 205, 255, .12); border: 1px solid rgba(168, 213, 255, .48); border-radius: 999px; font-size: .7rem; font-weight: 850; }
.team-profile-dialog .profile-quote { margin: 10px 0 16px; color: #deefff; font-family: Georgia, "Songti SC", serif; font-size: 1.08rem; }
.team-profile-dialog .profile-sections { display: grid; gap: 11px; }
.team-profile-dialog .profile-section { padding: 15px 17px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .19); border-radius: 12px; }
.team-profile-dialog .profile-section h3 { margin: 0 0 6px; color: #a8d5ff; font-size: .92rem; }
.team-profile-dialog .profile-section p { margin: 0; color: #f1f7ff; line-height: 1.7; }
.team-profile-dialog .profile-actions { display: flex; margin-top: 16px; flex-wrap: wrap; gap: 10px; }
.team-profile-dialog .profile-actions .btn { min-width: 160px; }

.team-toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 20px;
  width: min(92%, 620px);
  padding: 14px 16px;
  color: #fff;
  background: #071f4d;
  border: 1px solid rgba(168, 213, 255, .55);
  border-radius: 12px;
  box-shadow: 0 14px 44px rgba(0, 20, 55, .34);
  text-align: center;
  transform: translate(-50%, 160%);
  transition: transform .25s ease;
}

.team-toast.show { transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  #teachers .teacher-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  #teachers .teacher-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-profile-dialog { overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .team-profile-dialog .profile { height: auto; grid-template-columns: 1fr; }
  .team-profile-dialog .profile-photo { min-height: 48dvh; }
  .team-profile-dialog .profile-content { overflow: visible; }
}

@media (max-width: 560px) {
  #teachers .teacher-filters { justify-content: flex-start; }
  #teachers .directory-note { align-items: flex-start; flex-direction: column; gap: 8px; }
  #teachers .directory-note strong { white-space: normal; }
  #teachers .teacher-grid { grid-template-columns: 1fr; }
  #teachers .teacher-card { width: min(100%, 430px); margin-inline: auto; }
  #teachers .photo-button { aspect-ratio: 1 / 1.02; }
  .team-profile-dialog .profile-photo { min-height: 53dvh; }
  .team-profile-dialog .profile-content { padding: 32px 16px 20px; }
  .team-profile-dialog .profile-actions { display: grid; grid-template-columns: 1fr; }
  .photo-editor { left: 8px; bottom: 8px; width: calc(100vw - 16px); }
}

@media (prefers-reduced-motion: reduce) {
  #teachers *, .team-profile-dialog *, .team-toast { transition: none !important; }
}
