:root {
  /* 统一圆角变量：后续页面所有 R 角都用它 */
  --ui-radius: 22px;
  --login-blue: #002060;
  /* 小胶囊继续缩小：更小的下限/更低的缩放斜率/略小的上限 */
  --pill-tag-width: clamp(76px, 18vw, 150px);
  --pill-tag-long-width: clamp(260px, 40vw, 360px);
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 先纯黑，再 0.5s 淡出黑遮罩显示内容 */
.page-black {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 1;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
html.page-loaded .page-black {
  opacity: 0;
}

/* 隐藏模板原有文案/控件，仅保留背景 canvas */
.heading,
.color-controls,
.toggle-adjuster-btn,
.color-adjuster-panel,
.footer,
.custom-cursor,
.welcome-text,
.black-transition {
  display: none !important;
}

#webGLApp {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.login-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 1s ease, transform 1s ease;
}

.login-shell.visible {
  opacity: 1;
  transform: scale(1);
}

.view-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  grid-area: 1 / 1;
  width: min(88vw, 540px);
  max-width: 100%;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* 三页叠在同一格时，隐藏的 view-card 仍占位会按「最高那张」撑开行高，管理员页会被拉成与学生页同高而出现大块空白 */
.view-card:not(.is-active) {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.view-card.is-active {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.login-card {
  width: min(88vw, 540px);
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--ui-radius);
  padding: 20px 22px 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  color: var(--login-blue);
  font-family: "Microsoft YaHei UI Light", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

.login-title {
  margin: 0 0 45px;
  display: flex;
  align-items: baseline;
  gap: 25px;
  font-weight: 300;
  color: var(--login-blue);
  white-space: nowrap;
}

.title-cn {
  font-size: 24px;
  line-height: 1;
}

.title-sep {
  font-size: 28px; /* 竖线要求 28px */
  line-height: 1;
}

.title-en {
  font-size: 22px; /* 英语字号小于中文 */
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 35px; /* 胶囊间距继续加大 */
}

.reset-form {
  gap: 34px;
}

/* 管理员重置：标题↔账号、账号↔底部按钮行 与登录页标题↔首行胶囊一致（45px）；底部两按钮间距仍用 .reset-actions（与学生端相同） */
.reset-form--admin {
  gap: 45px;
}

/* 大胶囊（底层） */
.pill-row {
  position: relative;
  height: 48px; /* 稍扁一点 */
  border: 2px solid var(--login-blue);
  border-radius: var(--ui-radius);
  background: #ffffff;
  display: flex;
  align-items: center;
  overflow: visible;
}

/* 小胶囊（覆盖在大胶囊左侧上方） */
.pill-tag {
  position: absolute;
  left: -2px; /* 与大胶囊左外边界严格对齐 */
  top: -2px;  /* 与大胶囊上外边界严格对齐 */
  height: 48px; /* 与大胶囊一致 */
  width: var(--pill-tag-width);
  padding: 0 10px;
  border: 2px solid var(--login-blue);
  border-radius: var(--ui-radius);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--login-blue);
  z-index: 2;
  gap: 15px;
  pointer-events: none;
}

.pill-tag--long {
  width: var(--pill-tag-long-width);
  white-space: nowrap;
  font-size: 15px;
  gap: 10px;
}

/* 输入框在大胶囊右侧区域 */
.pill-row input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--login-blue);
  /* 输入文本起点跟随小胶囊宽度，默认约从165px开始，并与小胶囊贴近 */
  /* 预留更宽的左侧空间，避免被覆盖的小胶囊遮挡输入文本 */
  padding: 0 16px 0 calc(var(--pill-tag-width) + 28px);
  font-size: 17px;
  border-radius: var(--ui-radius);
}

.pill-row--long input {
  padding-left: calc(var(--pill-tag-long-width) + 24px);
}

.pill-select-trigger {
  height: calc(100% - 8px);
  margin: 4px 4px 4px calc(var(--pill-tag-width) + 14px);
  width: calc(100% - (var(--pill-tag-width) + 18px));
  border: none;
  border-radius: var(--ui-radius);
  background: #fff;
  color: var(--login-blue);
  font-family: "Microsoft YaHei UI Light", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1;
  text-align: left;
  padding: 0 44px 0 12px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-row.is-open .pill-select-trigger {
  background: #002060;
  color: #fff;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

.pill-select-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #002060;
}

.pill-row.is-open .pill-select-trigger::after {
  border-top-color: #fff;
}

.pill-select-trigger:focus-visible {
  outline: 2px solid rgba(0, 32, 96, 0.2);
}

.pill-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: calc(var(--pill-tag-width) + 14px);
  right: 4px;
  border: 2px solid transparent;
  border-radius: var(--ui-radius);
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 30;
  padding: 0;
  overflow: hidden;
}

.pill-row.is-open .pill-select-menu {
  display: block;
}

.pill-select-option {
  width: 100%;
  border: none;
  border-radius: var(--ui-radius);
  background: #fff;
  color: #002060;
  padding: 10px 0;
  text-align: center;
  font-size: 18px;
  font-family: "Microsoft YaHei UI Light", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  line-height: 1.15;
  cursor: pointer;
}

.pill-select-option + .pill-select-option {
  margin-top: 0;
  border-top: 1px solid rgba(0, 32, 96, 0.25);
}

.pill-select-option:hover,
.pill-select-option.is-selected {
  background: #002060;
  color: #fff;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

.pill-select-option:active {
  background: #3353a0;
  color: #fff;
  font-family: "Microsoft YaHei UI Light", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-weight: 300;
}

.forgot-password {
  justify-self: start;
  margin-top: -8px;
  border: none;
  background: transparent;
  color: var(--login-blue);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.login-button {
  height: 48px; /* 稍扁一点 */
  border: none;
  border-radius: var(--ui-radius);
  background: var(--login-blue);
  color: #ffffff;
  font-size: 22px; /* 缩小登录按钮字号 */
  letter-spacing: 1px;
  cursor: pointer;
}

.reset-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.reset-actions .login-button {
  font-size: 16px;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reset-actions .login-button .bi-cn {
  font-size: 20px;
  line-height: 1;
}

.reset-actions .login-button .bi-en {
  font-size: 14px;
  line-height: 1;
}

/* 登录页 .login-title 为 margin-bottom: 45px；学生重置标题略收紧 */
.reset-card--student .login-title {
  margin-bottom: 30px;
}

/* 管理员重置：与登录页「第一行标题 → 账号胶囊」间距一致 */
.reset-card--admin .login-title {
  margin: 0 0 45px;
}

.bi-sep {
  opacity: 0.9;
}

/* 小屏时隐藏英文、竖线和中英文间空格（所有位置统一生效） */
@media (max-width: 700px) {
  .bi-en,
  .bi-sep {
    display: none !important;
  }

  .login-title {
    gap: 0;
  }

  .pill-tag {
    justify-content: center;
  }
}

/* 按钮统一交互态（登录页） */
button,
.login-button,
.forgot-password,
.pill-select-trigger {
  transition: transform 0.14s ease, background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
button:hover:not(:disabled),
.login-button:hover:not(:disabled),
.forgot-password:hover:not(:disabled),
.pill-select-trigger:hover:not(:disabled) {
  transform: scale(1.04);
}
button:active:not(:disabled),
.login-button:active:not(:disabled),
.forgot-password:active:not(:disabled),
.pill-select-trigger:active:not(:disabled) {
  transform: scale(0.98);
}
.login-button:active:not(:disabled) {
  background: #3353a0;
  color: #fff;
}
.pill-select-trigger:active:not(:disabled) {
  background: #002060;
  color: #fff;
}

