.student-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  width: min(100%, 390px);
  aspect-ratio: 1.586 / 1;
  min-height: 0;
  height: auto;
  margin-inline: auto;
  box-sizing: border-box;
  margin: 15px 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--opto-base-rgb), 0.2);
  border-radius: 10px;
  background: linear-gradient(145deg, #fff 0%, #fbfbfd 100%);
  box-shadow: 0 13px 28px rgba(26, 30, 42, 0.1), 0 2px 5px rgba(26, 30, 42, 0.06);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.student-card::after {
  position: absolute;
  top: 50%;
  right: 22px;
  bottom: auto;
  width: 68px;
  height: 86px;
  background: url("../picture/brand/nju-mark-watermark.png") center / contain no-repeat;
  opacity: .055;
  content: "";
  pointer-events: none;
  user-select: none;
  transform: translateY(-50%);
}

.student-card:hover {
  border-color: rgba(var(--opto-base-rgb), 0.34);
  box-shadow: 0 20px 42px rgba(26, 30, 42, 0.14), 0 4px 9px rgba(26, 30, 42, 0.07);
  transform: translateY(-4px);
}

.student-card__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(105deg, var(--opto-base) 0%, #5147a8 68%, #756cc6 100%);
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.student-card__header::before {
  width: 30px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  content: "";
}

.student-card__header span:first-of-type { margin-right: auto; margin-left: 10px; }
.student-card__header span:last-of-type { color: rgba(255, 255, 255, 0.76); font-size: 10px; }

.student-card__main {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px 17px 12px;
}

.student-card .student-card__photo {
  position: relative;
  flex: 0 0 92px;
  width: 92px;
  height: 116px;
  margin: 0 16px 0 0;
  padding: 4px;
  border: 1px solid rgba(40, 43, 56, 0.14);
  background: #fff;
  box-shadow: 0 5px 12px rgba(28, 32, 43, 0.1);
}

.student-card .student-card__photo::after {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 15px;
  height: 15px;
  border-right: 2px solid rgba(var(--opto-base-rgb), 0.48);
  border-bottom: 2px solid rgba(var(--opto-base-rgb), 0.48);
  content: "";
}

.student-card .student-card__photo .student-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
  object-position: center;
}

.student-card .student-card__info {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  transform: translateY(-11px);
}

.student-card__type {
  display: inline-block;
  margin-bottom: 3px;
  color: var(--opto-base);
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1.4;
}

.student-card .student-card__info h2 {
  overflow: hidden;
  margin: 0 0 3px;
  color: var(--opto-black);
  font-family: "Poppins", sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-card .student-card__info p,
.student-card .student-card__info a {
  position: relative;
  z-index: 1;
  color: rgba(34, 34, 34, 0.62);
  font-family: "Avenir", var(--opto-font), sans-serif;
  font-size: 12px;
  line-height: 1.42;
}

.student-card .student-card__info .student-title {
  display: -webkit-box;
  margin: 4px 0 7px !important;
  overflow: hidden;
  color: rgba(34, 34, 34, 0.76);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.student-card .student-card__info .student-email {
  display: block;
  overflow: hidden;
  margin-bottom: 6px;
  color: var(--opto-base);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-card .student-card__info > p:last-child {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.student-card__footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 34px);
  flex: 0 0 27px;
  min-height: 27px;
  height: 27px;
  margin: 0 17px;
  border-top: 1px dashed rgba(40, 43, 56, 0.16);
}

.student-card__footer > span {
  color: rgba(40, 43, 56, 0.42);
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.student-card__footer .member-detail-button {
  display: inline-grid;
  width: 30px;
  height: 27px;
  min-width: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--opto-base);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  place-items: center;
}

.student-card__footer .member-detail-button:hover,
.student-card__footer .member-detail-button:focus-visible {
  outline: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--opto-base);
  transform: translateX(3px);
}

.staff-card .assistant-title {
  display: -webkit-box;
  margin: 4px 0 7px !important;
  overflow: hidden;
  color: rgba(34, 34, 34, 0.76);
  font-size: 13px !important;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.staff-card__location {
  display: -webkit-box;
  margin: 0 0 6px !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.staff-card__location .icon-pin { color: var(--opto-base); }

.professor-details .professor-card {
  position: relative;
  display: block;
  width: min(1120px, 100%);
  margin: 42px auto 56px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--opto-base-rgb), 0.2);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff 0%, #fbfbfd 100%);
  box-shadow: 0 18px 40px rgba(26, 30, 42, 0.11), 0 3px 7px rgba(26, 30, 42, 0.06);
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.professor-details .professor-card::after {
  position: absolute;
  right: 24px;
  bottom: 16px;
  width: 125px;
  height: 157px;
  background: url("../picture/brand/nju-mark-watermark.png") center / contain no-repeat;
  opacity: .05;
  pointer-events: none;
  user-select: none;
}

.professor-details .professor-card:hover {
  border-color: rgba(var(--opto-base-rgb), 0.32);
  box-shadow: 0 24px 54px rgba(26, 30, 42, 0.14), 0 5px 11px rgba(26, 30, 42, 0.07);
  transform: translateY(-3px);
}

.professor-card__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(105deg, var(--opto-base) 0%, #5147a8 68%, #756cc6 100%);
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.professor-card__header::before {
  width: 38px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  content: "";
}

.professor-card__header span:first-of-type { margin-right: auto; margin-left: 12px; }
.professor-card__header span:last-of-type { color: rgba(255, 255, 255, 0.78); }

.professor-card__main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 34px;
  padding: 30px;
}

.professor-card__main .professor-card-left {
  display: flex;
  align-self: start;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-width: 300px;
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(40, 43, 56, 0.14);
  background: #fff;
  box-shadow: 0 8px 19px rgba(28, 32, 43, 0.11);
}

.professor-card__main .professor-img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 4px;
  object-fit: cover;
}

.professor-card__photo-label {
  padding: 12px 8px 7px;
  color: rgba(40, 43, 56, 0.5);
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-align: center;
}

.professor-card__main .professor-card-right {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 3px 0 0;
}

.professor-card__type {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--opto-base);
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.professor-card__main .professor__top-name {
  margin: 0 0 2px;
  color: var(--opto-black);
  font-size: clamp(30px, 3.2vw, 43px);
  line-height: 1.18;
}

.professor-card__main .professor__top-title {
  margin-bottom: 12px;
  color: var(--opto-base);
  font-size: 16px;
}

.professor-card__main .professor_top-address {
  margin-bottom: 12px;
  padding: 10px 13px;
  border-left: 3px solid rgba(var(--opto-base-rgb), 0.48);
  background: rgba(var(--opto-base-rgb), 0.045);
}

.professor-card__main .professor__top-text {
  margin: 0;
  color: rgba(34, 34, 34, 0.72);
  font-size: 16px;
  line-height: 1.72;
  text-align: justify;
}

@media (max-width: 999.98px) {
  .professor-details .professor-card { width: 100%; margin-block: 30px 44px; }
  .professor-card__main { grid-template-columns: 1fr; gap: 25px; padding: 24px; }
  .professor-card__main .professor-card-left { width: min(100%, 300px); margin: 0 auto; }
  .professor-card__main .professor-card-right { width: 100%; }
  .professor-card__main .professor__top-text { font-size: 16px; line-height: 1.68; }
}

@media (max-width: 399.98px) {
  .student-card { width: min(100%, 360px); }
  .student-card__header { padding-inline: 12px; }
  .student-card__header span:last-of-type { display: none; }
  .student-card__main { padding: 13px 13px 7px; }
  .student-card .student-card__photo {
    flex-basis: 80px;
    width: 80px;
    height: 102px;
    margin-right: 12px;
  }
  .student-card .student-card__info h2 { font-size: 17px; }
  .student-card__footer { width: calc(100% - 26px); margin-inline: 13px; }
  .professor-card__header { min-height: 42px; padding-inline: 14px; }
  .professor-card__header span:last-of-type { display: none; }
  .professor-card__main { padding: 16px; }
  .professor-card__main .professor__top-text { font-size: 15px; line-height: 1.65; }
}

@media (prefers-reduced-motion: reduce) {
  .student-card,
  .professor-details .professor-card,
  .student-card__footer .member-detail-button { transition: none; }
}

/* Shared enlarged badge used by every student and undergraduate card. */
html.member-detail-open { overflow: hidden; }
.member-detail-viewer[hidden] { display: none; }
.member-detail-viewer {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 11, 22, .72);
  opacity: 0;
  transition: opacity .36s cubic-bezier(.22,.75,.25,1);
  backdrop-filter: blur(5px);
}
.member-detail-viewer.is-open { opacity: 1; }
.member-detail-card {
  position: relative;
  display: grid;
  width: min(850px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(var(--opto-base-rgb), .25);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--opto-base-rgb), .018) 25%, transparent 25%) 0 0 / 16px 16px,
    #fff;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .34);
  transform: translateY(42px) scale(.78) rotate(-1.2deg);
  transform-origin: center center;
  transition: transform .36s cubic-bezier(.18,.82,.22,1);
}
.member-detail-viewer.is-open .member-detail-card { transform: translateY(0) scale(1) rotate(0deg); }
.member-detail-card::before {
  position: absolute;
  z-index: 3;
  top: 17px;
  left: 50%;
  width: 76px;
  height: 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.42);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.16);
  content: "";
  transform: translateX(-50%);
  pointer-events: none;
}
.member-detail-card::after {
  position: absolute;
  right: 24px;
  top: 92px;
  bottom: auto;
  width: 140px;
  height: 176px;
  background: url("../picture/brand/nju-mark-watermark.png") center / contain no-repeat;
  opacity: .055;
  content: "";
  pointer-events: none;
  user-select: none;
}
.member-detail-card__header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(105deg, var(--opto-base), #5147a8 68%, #756cc6);
  font: 600 12px/1 "Poppins", sans-serif;
  letter-spacing: .12em;
}
.member-detail-card__header::after {
  display: none;
}
.member-detail-card__close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 25px;
  line-height: 30px;
}
.member-detail-card__intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  padding: 30px 30px 22px;
}
.member-detail-card__photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 7px;
  border: 1px solid rgba(40,43,56,.16);
  background: #fff;
  box-shadow: 0 8px 18px rgba(28,32,43,.14);
}
.member-detail-card__photo-frame::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 18px;
  border: 1px solid rgba(var(--opto-base-rgb), .35);
  background: repeating-linear-gradient(90deg, var(--opto-base) 0 2px, transparent 2px 4px);
  content: "";
  opacity: .55;
}
.member-detail-card__photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.member-detail-card__identity { min-width: 0; align-self: start; }
.member-detail-card__type { color: var(--opto-base); font: 600 15px/1.4 "Poppins", sans-serif; letter-spacing: .08em; }
.member-detail-card__identity h2 { margin: 7px 0 4px; color: var(--opto-black); font-size: 34px; line-height: 1.18; }
.member-detail-card__title { margin: 0 0 9px; color: var(--opto-base); font-size: 17px; line-height: 1.45; }
.member-detail-card__email { display: inline-flex; align-items: center; color: var(--opto-base); font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.member-detail-card__email-icon { flex: 0 0 auto; margin-right: 6px; font-size: 16px; }
.member-detail-card__sections { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 0 30px 24px; }
.member-detail-card__section { padding: 14px 16px; border-left: 3px solid rgba(var(--opto-base-rgb),.45); background: rgba(var(--opto-base-rgb),.045); }
.member-detail-card__section h3 { margin: 0 0 6px; color: var(--opto-base); font-size: 15px; line-height: 1.4; }
.member-detail-card__section p { margin: 0; color: rgba(34,34,34,.76); font-size: 15px; line-height: 1.62; }
.member-detail-card__footer { min-height: 45px; padding: 0 30px; border-top: 1px dashed rgba(40,43,56,.16); color: rgba(40,43,56,.45); font: 600 11px/45px "Poppins",sans-serif; letter-spacing: .15em; }
.member-detail-card__footer::after { display: none; }

@media (max-width: 650px) {
  .member-detail-viewer { padding: 0; }
  .member-detail-card { width: 100vw; max-height: 100vh; border-radius: 0; }
  .member-detail-card__intro { grid-template-columns: 125px minmax(0,1fr); gap: 18px; padding: 22px; }
  .member-detail-card__identity h2 { font-size: 27px; }
  .member-detail-card__email {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    letter-spacing: -.035em;
    text-overflow: clip;
  }
  .member-detail-card__email-text { white-space: nowrap; }
  .member-detail-card__sections { grid-template-columns: 1fr; gap: 12px; padding: 0 22px 18px; }
  .member-detail-card__section p { font-size: 14px; }
  .member-detail-card__footer { padding-inline: 22px; }
  .member-detail-card::after { right: 10px; top: 82px; bottom: auto; width: 96px; height: 121px; opacity: .045; }
}

@media (max-width: 390px) {
  .member-detail-card__intro { grid-template-columns: 1fr; }
  .member-detail-card__photo-frame { width: 140px; margin: 0 auto; }
  .member-detail-card__email { font-size: 12px; }
  .student-card::after { top: 50%; right: 12px; bottom: auto; width: 55px; height: 70px; opacity: .04; transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .member-detail-viewer,
  .member-detail-card { transition: none; }
}
