/* 老师们（名册页）：左边大舞台 + 右边选人卡片。参考 Downloads 里那份 tuwhite-teachers-interactive-preview.html 的布局，
   数据、主题、返回键、合作推广标签沿用本站的做法。基础变量在 roster.css。
   --c 是当前这位老师的代表色，由 roster.js 写到 <html> 上，整页的强调色都跟着变。 */
.sel2 { position: relative; isolation: isolate; overflow: clip; display: grid; grid-template-columns: minmax(0, 5fr) minmax(360px, 3fr); min-height: calc(100svh - 61px); border-bottom: 1px solid var(--line); }

/* A shared image carries the teacher's colors through both columns. */
.roster-ambient { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.roster-ambient img { position: absolute; inset: -48px; width: calc(100% + 96px); height: calc(100% + 96px);
  object-fit: cover; object-position: 72% 45%; filter: blur(36px) saturate(.72); }
.roster-ambient::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(22, 22, 28, .67), rgba(22, 22, 28, .4) 50%, rgba(22, 22, 28, .63)); }
:root[data-theme="light"] .roster-ambient::after {
  background: linear-gradient(90deg, rgba(247, 247, 250, .48), rgba(247, 247, 250, .2) 50%, rgba(247, 247, 250, .4)); }
.sel2.has-ambient .stage2 { background: transparent; }
.sel2.has-ambient .stage2::after { display: none; }
.sel2.has-ambient .picker2 { background: color-mix(in srgb, var(--bg) 24%, transparent); }
.sel2.has-ambient .st-bg {
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 78%, transparent 100%); }
.sel2.has-ambient .st-bg::after {
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 78%, transparent), color-mix(in srgb, var(--bg) 42%, transparent) 34%, transparent 64%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 35%, transparent), transparent 26%); }
.sel2.has-ambient .st-shade {
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 24%, transparent), transparent 58%); }
@media (max-width: 900px) {
  .sel2.has-ambient .st-bg {
    -webkit-mask-image: linear-gradient(#000 0%, #000 70%, transparent 100%);
    mask-image: linear-gradient(#000 0%, #000 70%, transparent 100%); }
}
@media (max-width: 640px) {
  .sel2.has-ambient .st-shade {
    background: linear-gradient(0deg, color-mix(in srgb, var(--bg) 92%, transparent) 12%, color-mix(in srgb, var(--bg) 74%, transparent) 45%, transparent 76%); }
  .roster-ambient img { filter: blur(24px) saturate(.72); }
}

/* —— 左边：舞台 —— */
.stage2 { position: relative; overflow: hidden; isolation: isolate; min-height: 600px;
  background:
    radial-gradient(ellipse at 74% 42%, color-mix(in srgb, var(--c) 36%, transparent), transparent 52%),
    linear-gradient(115deg, color-mix(in srgb, var(--c) 6%, var(--bg)) 0%, color-mix(in srgb, var(--c) 9%, var(--bg)) 50%, color-mix(in srgb, var(--c) 24%, var(--bg)) 100%); }
.stage2 [hidden] { display:none !important; }
.stage2::after { content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%; pointer-events: none; background: linear-gradient(transparent, color-mix(in srgb, var(--c) 60%, transparent), transparent); }
/* 老师有横版大图（bg）时铺满舞台。左边盖一层底色渐变保证字看得清，底部再压一点，和右边选人区接得上 */
.st-bg { position: absolute; inset: 0; z-index: -2; opacity: 0; transition: opacity .5s; pointer-events: none; }
.st-bg.on { opacity: 1; }
.st-bg img { width: 100%; height: 100%; object-fit: cover; object-position: var(--bgpos, 70% 30%); }
.st-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, color-mix(in srgb, var(--bg) 62%, transparent) 34%, transparent 62%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 55%, transparent), transparent 30%); }
.stage2.has-bg .st-ghost, .stage2.has-bg .stars2 { opacity: .35; }
/* 有背景大图时不再放中间的大圆头像（会盖住背景里的人），头像改成名字上方的小圆章 */
.stage2.has-bg > .st-avatar { display: none; }
.st-mini { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: center 25%; display: block; margin-bottom: 14px;
  border: 3px solid color-mix(in srgb, var(--c) 70%, #fff); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent), 0 10px 24px rgba(10, 7, 17, .2); }
.stars2 { position: absolute; inset: 0; pointer-events: none; }
.stars2 i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff6fb; opacity: .6; box-shadow: 0 0 12px 3px color-mix(in srgb, var(--c) 40%, transparent); animation: twinkle 4s ease-in-out infinite; }
:root[data-theme="light"] .stars2 i { background: color-mix(in srgb, var(--c) 70%, #6b4a5c); opacity: .45; }
.stars2 i:nth-child(1) { top: 19%; left: 58%; } .stars2 i:nth-child(2) { top: 46%; left: 91%; animation-delay: -1s; }
.stars2 i:nth-child(3) { top: 65%; left: 39%; animation-delay: -2s; } .stars2 i:nth-child(4) { top: 84%; left: 74%; animation-delay: -3s; }
.stars2 i:nth-child(5) { top: 11%; left: 86%; animation-delay: -1.5s; }
@keyframes twinkle { 50% { opacity: .15; } }
/* 背景里的大号空心字：老师名字的拼音或英文 */
.st-ghost { position: absolute; top: 5%; right: -6%; z-index: -1; font-family: var(--latin); font-size: clamp(90px, 10.5vw, 190px); font-weight: 900; line-height: 1; letter-spacing: -.05em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 40%, transparent); user-select: none; pointer-events: none; }
.st-faint { position: absolute; top: 9%; left: 6.3%; z-index: 7; font-family: var(--mono); font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-3); }
/* 有全身立绘时 */
.st-art { position: absolute; right: 0; bottom: 0; height: 100%; width: min(62%, 600px); display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.st-art img { height: 100%; width: 100%; object-fit: contain; object-position: bottom center; filter: drop-shadow(0 18px 24px rgba(13, 10, 18, .24)); }
/* 只有头像，或者什么图都还没有时：带光环的大圆 */
.st-avatar { position: absolute; right: 5%; top: 9%; height: 76%; width: 50%; display: flex; align-items: center; justify-content: center; }
.st-orbit { position: absolute; width: min(84%, 400px); aspect-ratio: 1; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); pointer-events: none;
  box-shadow: 0 0 0 23px color-mix(in srgb, var(--c) 6%, transparent), 0 0 0 72px color-mix(in srgb, var(--c) 3%, transparent); animation: orbit 40s linear infinite; }
.st-orbit::before { content: ""; position: absolute; inset: 15%; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--c) 45%, transparent); }
.st-orbit::after { content: ""; position: absolute; inset: -28px; border-radius: 50%; border: 1px solid transparent; border-bottom-color: color-mix(in srgb, var(--c) 60%, transparent); }
@keyframes orbit { to { rotate: 360deg; } }
.st-disc { position: relative; width: min(300px, 70%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 6px solid color-mix(in srgb, var(--c) 65%, #fff); background: linear-gradient(145deg, color-mix(in srgb, var(--c) 55%, #fff), color-mix(in srgb, var(--c) 35%, #3c3043));
  box-shadow: 0 21px 60px rgba(10, 7, 17, .22), 0 0 0 12px color-mix(in srgb, var(--c) 16%, transparent); }
.st-disc > img, .st-disc > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-disc > svg { inset: 12% 0 0; height: 88%; }
.st-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, color-mix(in srgb, var(--bg) 18%, transparent) 40%, transparent 62%); }
.st-info { position: absolute; z-index: 8; left: 6.3%; top: 50%; translate: 0 -50%; width: min(42%, 360px); min-width: 270px; }
.st-soc { display: flex; align-items: center; gap: 10px; font-size: 12.5px; letter-spacing: .06em; color: var(--ink-2); }
.st-soc::before { content: ""; width: 20px; height: 1px; background: var(--c); }
.st-soc .ad { letter-spacing: 0; }
.st-name { margin: 14px 0 2px; font-family: var(--serif); font-weight: 900; font-size: clamp(38px, 4.1vw, 64px); line-height: 1.1; letter-spacing: .03em; }
.st-name .ph { font-size: 11px; letter-spacing: 0; }
.st-en { margin: 0 0 20px; font-family: var(--latin); font-style: italic; font-size: 23px; letter-spacing: .05em; color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.st-tag { margin: 0 0 14px; font-family: var(--serif); font-weight: 600; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.7; }
.st-intro { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); max-width: 29em; }
.st-info .teacher-links { margin: 18px 0 22px; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.teacher-links a { color: inherit; font-size: 14px; text-decoration: none; padding: 6px 0; border-bottom: 1px solid currentColor; }
.teacher-links a:hover { color: var(--c); }
.teacher-links a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 9px; }
.cta { display: inline-flex; align-items: center; gap: 9px; padding: 11px 21px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; white-space: nowrap; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.cta:hover { transform: translateY(-3px); border-color: var(--c); }
.cta.primary { background: var(--c); border-color: var(--c); color: #24161f; font-weight: 700; box-shadow: 0 6px 25px color-mix(in srgb, var(--c) 30%, transparent); }
.cta.primary:hover { box-shadow: 0 8px 32px color-mix(in srgb, var(--c) 50%, transparent); }
.st-bottom { position: absolute; z-index: 7; left: 6.3%; bottom: 28px; display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .12em; color: var(--ink-3); }
.st-bottom strong { font-family: var(--latin); font-style: italic; font-weight: 400; font-size: 22px; color: var(--ink); }
.st-bottom i { width: 60px; height: 1px; background: var(--line-2); }
.st-bottom button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: none; display: grid; place-items: center; transition: border-color .2s, color .2s; }
.st-bottom button:hover { border-color: var(--c); color: var(--c); }
/* 换人时：文字往左滑出再滑回，图从右边进来 */
.stage2.info-right .st-info { left: auto; right: 6.3%; }
.stage2.info-right > .st-shade { transform: scaleX(-1); }
.stage2.background-mirrored > .st-bg img { transform: scaleX(-1); }
@media (min-width: 641px) {
  .sel2 .stage2.info-right > .st-bg::after {
    transform: none;
    background: linear-gradient(90deg, transparent 22%, color-mix(in srgb, var(--bg) 12%, transparent) 38%, color-mix(in srgb, var(--bg) 92%, transparent) 53%, color-mix(in srgb, var(--bg) 97%, transparent));
  }
}
/* Outgoing stage is a short-lived inert visual layer, never a second UI. */
.stage2 > .roster-stage-leaving { position:absolute; inset:0; z-index:6; width:100%; height:100%; min-height:0; pointer-events:none; margin:0; }
.stage2 > .roster-stage-leaving.was-ambient { background:transparent; }
.stage2 > .roster-stage-leaving.was-ambient.portrait-right { background:#f5f8f7; }
.roster-stage-leaving *, .roster-ambient-leaving * { animation:none !important; transition:none !important; }
.roster-stage-leaving .st-bottom, .roster-stage-leaving .st-faint { visibility:hidden; }
.sel2 > .stage2:not(.roster-stage-leaving), .picker2 { z-index:1; }
.roster-ambient-leaving { z-index:-1; }

/* —— 右边：选人 —— */
.picker2 { position: relative; display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 36px clamp(24px, 3.8vw, 64px) 26px 30px;
  background: radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 58%), var(--bg); }
.pk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pk-head h2 { margin: 4px 0 0; font-family: var(--serif); font-weight: 900; font-size: clamp(28px, 2.2vw, 38px); line-height: 1.2; }
.pk-head p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.pk-count { font-family: var(--latin); font-style: italic; font-size: 30px; color: color-mix(in srgb, var(--c) 75%, var(--ink)); white-space: nowrap; }
.pk-count span { margin-left: 4px; font-family: var(--sans); font-style: normal; font-size: 12px; color: var(--ink-3); }

/* 一张卡：接近正方形的平行四边形，头像只放在框里。
   2026-10-14 用户要求先不要动效：没有冒出、抬起、放大、进场动画。选中的那张描一圈代表色的边，好知道当前是谁。 */
.cards4 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 6px; align-content: start; }
.pc { --tc: var(--ink-3); --fc: var(--ink-3); position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; background: none; isolation: isolate; }
.pc .bg, .pc .pop { position: absolute; inset: 0; clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%); }
.pc .bg { background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 22%, var(--bg-2)) 0%, color-mix(in srgb, var(--tc) 45%, var(--bg-3)) 100%); }
.pc .pop { z-index: 1; overflow: hidden; pointer-events: none; }
.pc .pop > img, .pc .pop > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
/* 底部压暗，名字看得清。上沿在卡片 45% 高处，那里的斜边在 12% × 55% = 6.6% */
.pc .shade { position: absolute; z-index: 2; inset: 45% 0 0; clip-path: polygon(6.6% 0, 100% 0, 88% 100%, 0 100%); background: linear-gradient(transparent, rgba(18, 13, 21, .82)); pointer-events: none; }
.pc .ring { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: color-mix(in srgb, var(--tc) 55%, #ffe27a);
  clip-path: polygon(evenodd, 12% 0, 100% 0, 88% 100%, 0 100%, 12% 0,
    calc(12% + 2px) 3px, calc(100% - 3px) 3px, calc(88% - 2px) calc(100% - 3px), 3px calc(100% - 3px), calc(12% + 2px) 3px); }
.pc.on .ring { opacity: 1; }
.pc .ring { transition:opacity 180ms ease; }
.pc:focus-visible { outline:2px solid var(--tc); outline-offset:4px; }
.pc .meta { position: absolute; z-index: 4; left: 12px; right: 16px; bottom: 7px; text-align: left; color: #fff; text-shadow: 0 2px 7px rgba(23, 16, 27, .9); pointer-events: none; }
.pc .meta b { display: block; font-family: var(--serif); font-size: clamp(12px, .95vw, 14px); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc .meta small { display: flex; align-items: center; gap: 5px; font-size: 10px; line-height: 1.4; color: #f1e4ec; white-space: nowrap; overflow: hidden; }
.pc .meta small::before { content: ""; flex: none; width: 12px; height: 7px; background: var(--fc); clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.pc .flag { position: absolute; z-index: 4; top: 6px; right: 7px; font-size: 9px; line-height: 1.5; padding: 0 5px; border-radius: 3px; background: #ffd98a; color: #2a1c10; }
.pc.locked { cursor: default; }
.pc.locked .bg { background: repeating-linear-gradient(105deg, var(--bg-2) 0 7px, var(--bg-3) 7px 14px); }
.pc.locked .q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 26px; font-weight: 900; color: var(--ink-3); opacity: .55; }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-3); }
.pk-foot kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.picker2 .featured { margin-top: auto; }

/* 电脑上一屏放下，不用上下翻：名册正好占满顶栏以下的高度，页脚不显示（顶栏已经有四个入口）。
   右边内容万一放不下（窗口很矮），只在右边那一栏里滚，不让整页滚。 */
@media (min-width: 901px) {
  .sel2 { height: calc(100svh - 61px); min-height: 540px; border-bottom: 0; }
  .stage2 { min-height: 0; }
  .picker2 { overflow-y: auto; padding-top: 26px; padding-bottom: 20px; gap: 14px; }
  body[data-page="roster"] footer.foot { display: none; }
}
/* 窗口比较矮时（比如 768 高的笔记本）再收紧一点 */
@media (min-width: 901px) and (max-height: 820px) {
  .st-faint { top: 5%; }
  .st-name { font-size: clamp(34px, 3.4vw, 52px); margin-top: 8px; }
  .st-en { margin-bottom: 12px; font-size: 20px; }
  .st-tag { margin-bottom: 8px; }
  .st-intro { line-height: 1.7; }
  .st-info .teacher-links { margin: 12px 0 16px; }
  .st-mini { width: 52px; height: 52px; margin-bottom: 10px; }
  .st-bottom { bottom: 18px; }
  .pk-head p { display: none; }
  .picker2 { padding-top: 20px; gap: 12px; }
}

@media (max-width: 1280px) {
  .sel2 { grid-template-columns: minmax(0, 5fr) minmax(340px, 3fr); }
  .picker2 { padding: 28px 26px 22px 20px; }
  .st-info { left: 5%; width: 44%; min-width: 240px; } .st-faint, .st-bottom { left: 5%; }
  .st-art { width: 64%; }
}
@media (max-width: 900px) {
  .sel2 { grid-template-columns: 1fr; min-height: 0; }
  .stage2 { min-height: 600px; }
  .stage2::after { display: none; }
  .st-info { left: 16px; width: 52%; min-width: 0; }
  .st-faint, .st-bottom { left: 16px; }
  .st-art { width: 56%; right: -2%; }
  .st-avatar { width: 46%; right: 2%; }
  .picker2 { padding: 26px 16px 34px; }
  .pk-foot .keys { display: none; }
}
@media (max-width: 640px) {
  .stage2 { min-height: 720px; }
  .st-ghost { top: 40px; font-size: 96px; }
  .st-faint { top: 20px; }
  .st-art { top: 40px; bottom: auto; height: 360px; width: 80%; right: -6%; }
  .st-art img { object-position: top center; }
  .st-avatar { top: 40px; height: 330px; width: 100%; right: 0; }
  .st-disc { width: 200px; } .st-orbit { width: 260px; }
  .st-shade { background: linear-gradient(0deg, var(--bg) 22%, color-mix(in srgb, var(--bg) 55%, transparent) 52%, transparent 75%); }
  .st-info { top: auto; bottom: 70px; translate: none; width: calc(100% - 32px); }
  .st-name { font-size: 38px; } .st-en { font-size: 18px; margin-bottom: 8px; }
  .st-tag { font-size: 15px; margin-bottom: 6px; } .st-intro { font-size: 12.5px; line-height: 1.7; }
  .st-info .teacher-links { margin: 10px 0 14px; }
  .cta { padding: 9px 16px; font-size: 12.5px; }
  .st-bottom { bottom: 20px; }
  .cards4 { gap: 6px 4px; }
  .pc .meta { left: 9px; right: 10px; bottom: 6px; } .pc .meta b { font-size: 11.5px; } .pc .meta small { font-size: 9.5px; }
  .pk-count { font-size: 22px; }
}
@media (max-width: 380px) { .pc .meta small { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .pc .ring, .st-bg { transition:none; }
  .stage2 .stars2 i, .stage2 .st-orbit { animation:none; }
}

/* The user prefers black introduction text in both themes, without a picture veil. */
.st-info { --ink: #161616; --ink-2: #161616; --ink-3: #303030; color: #161616; }
.st-info .st-en, .st-info .teacher-links a { color: #161616; }
.stage2.has-bg > .st-bg::after, .sel2.has-ambient .stage2.has-bg > .st-bg::after { background: none; }
.stage2.has-bg > .st-shade { display: none; }
.sel2.has-ambient .stage2.portrait-right { background: #f5f8f7; }
.sel2.has-ambient .stage2.portrait-right > .st-bg { left: 52%; mask-image: none; -webkit-mask-image: none; }
.stage2.portrait-right > .st-bg img { object-fit: contain; }
.stage2.portrait-right .st-info { left: 5%; right: auto; width: 43%; min-width: 0; }
.stage2.portrait-right .st-name { font-size: 36px; overflow-wrap: anywhere; letter-spacing: 0; }
.stage2.portrait-right .st-bottom, .stage2.portrait-right .st-faint { color: #303030; }
@media (max-width: 640px) {
  .stage2.portrait-right .st-name { font-size: 25px; }
  .stage2.portrait-right .st-info { top: 110px; bottom: auto; }
  .stage2.portrait-right > .st-bg { top: 80px; }
}
