/**
 * Study 登录页样式
 *
 * 登录页视觉与辅助弹窗统一在此维护，模板仅保留语义结构与动态配置。
 */

body {
  overflow-x: hidden;
  overflow-y: auto;
  background-color: #0a1020;
}

/* 自动高度保证手机横屏、软键盘弹出和矮窗口下仍可完整滚动登录卡片。 */
#login_id {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto !important;
  padding: max(1rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
  /* 粒子资源尚未加载或被性能策略跳过时，仍提供无需持续重绘的完整背景。 */
  background:
    radial-gradient(circle at 18% 20%, rgba(96, 165, 250, .18), transparent 22rem),
    radial-gradient(circle at 82% 78%, rgba(69, 105, 255, .14), transparent 24rem),
    #0a1020;
}

html.mxj-performance-lite #login_id {
  background: #0a1020;
}

/* 登录页头部：Logo + 系统名 */
.login-header {
  display: flex;
  align-items: center;
  justify-content: center;   /* 整体居中 */
  gap: 10px;                 /* Logo 与文字间距 */
}

/* LOGO */
.login-logo {
  width: 110px;
  height: auto;
  display: block;
}

/* 系统名称文字 */
.login-title {
  position: relative;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.login-title .badge {
  font-size: max(12px, 0.5rem);
  position: relative;
  top: -10px;
}

/* 登录卡片主体 */
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 22px;
  padding: 20px 18px 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

html.mxj-performance-lite .login-card {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
}

/* 顶部切换 */
.login-tabs {
  display: flex;
  background: #f2f5fb;
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 20px;
}

.login-tab {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: center;
  font-size: 14px;
  padding: 8px 0;
  border-radius: 10px;
  color: #888;
  cursor: pointer;
}

.login-tab.active {
  background: #fff;
  color: #3b7cff;
  font-weight: 600;
}

/* 表单区 */
.login-form {
  padding: 0 6px;
}

.login-panel {
  display: none;
}

.login-panel.active {
  display: block;
}

/* 输入框 */
.login-input {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  border: none;
  background: #f4f6fa;
  color: #333;
  padding: 0 18px;
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
}

.login-input:focus-visible {
  outline: 3px solid rgba(59, 124, 255, .28);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px #3b7cff inset;
}

.login-tab:focus-visible,
.btn-login:focus-visible,
.login-helper-links .js-login-helper-link:focus-visible {
  outline: 3px solid rgba(59, 124, 255, .38);
  outline-offset: 2px;
}
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #333;
  box-shadow: 0 0 0 1000px #f4f6fa inset !important;
  background-color: #ff0000 !important;
  caret-color: #333;
  transition: background-color 9999s ease-out 0s;
}
.login-input:autofill {
  box-shadow: 0 0 0 1000px #f4f6fa inset;
  -webkit-text-fill-color: #333;
  background-color: #f4f6fa;
  caret-color: #333;
}

/* 扫码提示 */
.login-qr {
  width: 210px;
  height: 210px;
  border-radius: 8px;
  background: #f4f6fa;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.login-qr-wrap {
  width: 210px;
  height: 210px;
  margin: 14px auto 10px;
  position: relative;
}
.login-qr-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #f4f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 13px;
  text-align: center;
  position: absolute;
  inset: 0;
}
.login-qr-tip {
  font-size: 13px;
  color: #666;
  text-align: center;
}
.login-qr-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.login-qr-refresh {
  border: none;
  background: #eef2ff;
  color: #3b7cff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.login-qr-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-qr-countdown {
  font-size: 12px;
  color: #999;
}
.login-qr-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cdd7f5;
  border-top-color: #3b7cff;
  border-radius: 50%;
  margin-right: 8px;
  animation: qr-spin 1s linear infinite;
}
@keyframes qr-spin {
  to { transform: rotate(360deg); }
}

/* 登录按钮 */
.btn-login {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  border: none;
  background: #3b7cff;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-top: 12px;
}
.login-helper-links {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  color: #7a8297;
}
.login-helper-links .js-login-helper-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #7a8297;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.login-helper-links .js-login-helper-link:hover {
  color: #3b7cff;
}
.study-scan-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.study-scan-user-info {
  min-width: 0;
}
.study-scan-user-meta {
  font-size: 12px;
  color: #7a8297;
}

/* 登录辅助弹窗：统一复用登录卡片的圆角、留白和阴影，避免出现默认模态框的生硬边框。 */
.study-login-helper-dialog {
  max-width: 420px;
}
#study-login-helper-modal .modal-content {
  border: none;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
#study-login-helper-modal .modal-header {
  padding: 18px 22px 12px;
  border-bottom: 1px solid #eef2f8;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
#study-login-helper-modal .modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2a44;
}
#study-login-helper-modal .btn-close {
  /* 关闭按钮固定推到标题栏最右侧，避免与标题文字挤在一起。 */
  margin: 0 0 0 auto;
  border-radius: 999px;
  background-color: #f4f6fa;
  /* 仅缩小内部 X 图标，使用固定像素避免百分比缩放出现视觉放大。 */
  background-size: 12px 12px;
  opacity: 1;
}
#study-login-helper-modal .modal-body {
  padding: 18px 22px 24px;
  background: #fff;
}

/* 弹窗表单区：输入、提示、结果卡片都与登录页保持同一套浅灰底与胶囊圆角语言。 */
.study-login-helper-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* 扫码弹窗的说明区与二维码之间不需要太大留白，单独收紧间距。 */
.js-scan-login-box {
  gap: 8px;
}
.study-login-helper-intro,
.study-login-helper-note {
  font-size: 13px;
  line-height: 1.7;
  color: #7a8297;
}
.study-login-helper-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.study-login-helper-field {
  margin-bottom: 0;
}
.study-login-helper-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #55607a;
}
.study-login-helper-field .login-input {
  margin-bottom: 0;
}
.study-login-helper-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.study-login-helper-inline .login-input {
  flex: 1;
  margin-bottom: 0;
}
.study-login-helper-side-btn {
  height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 24px;
  background: #eef2ff;
  color: #3b7cff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.study-login-helper-side-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.study-login-helper-card,
.study-login-helper-empty,
.study-login-helper-success {
  border-radius: 18px;
  background: #f4f6fa;
}
.study-login-helper-card {
  padding: 18px;
}
.study-login-helper-meta-label {
  font-size: 12px;
  color: #7a8297;
  margin-bottom: 6px;
}
.study-login-helper-empty {
  padding: 32px 16px;
  text-align: center;
  color: #7a8297;
}
.study-login-helper-success {
  padding: 26px 18px;
  text-align: center;
}
.study-login-helper-success-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2a44;
  margin-bottom: 8px;
}
.study-login-helper-success-text {
  font-size: 13px;
  line-height: 1.7;
  color: #7a8297;
}
.study-login-helper-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}
.study-login-helper-actions > button {
  flex: 1;
}
.btn-login-light {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  border: 1px solid #dbe5ff;
  background: #fff;
  color: #3b7cff;
  font-size: 15px;
  font-weight: 600;
}
.btn-login-light:hover {
  background: #f7faff;
}

/* 登录页辅助弹窗单独使用 60% 遮罩，保留背景动效与页面层次。 */
.modal-backdrop.mxj-modal-backdrop-gray.study-login-helper-backdrop,
.modal-backdrop.show.mxj-modal-backdrop-gray.study-login-helper-backdrop {
  opacity: 0.6 !important;
}
/* 扫码弹窗内再次确认学员时，确认框遮罩必须盖住下层学员列表，避免出现半透明但仍可读的叠层。 */
.modal-backdrop.study-login-confirm-backdrop {
  z-index: 1070 !important;
  opacity: 0.45 !important;
}
#global-confirm-modal {
  z-index: 1080 !important;
}

/* 扫码登录的多账号选择列表同样使用登录页风格的圆角卡片与主按钮。 */
.study-login-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.study-login-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #f4f6fa;
}
.study-login-user-info {
  min-width: 0;
  flex: 1;
}
.study-login-user-name {
  font-size: 16px;
  font-weight: 600;
  color: #1f2a44;
  margin-bottom: 4px;
}
.study-login-user-pick {
  flex-shrink: 0;
  min-width: 84px;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: #3b7cff;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
/* 二维码容器上边距减半，贴近截图中要求的压缩效果。 */
.js-scan-login-box .login-qr-wrap {
  margin: 6px auto 10px;
}

/* 移动端下收紧弹窗边距，避免按钮与输入框贴边导致视觉失衡。 */
@media (max-width: 575.98px) {
  .study-login-helper-dialog {
    max-width: calc(100vw - 24px);
    margin: 0 auto;
  }
  #study-login-helper-modal .modal-header {
    padding: 16px 16px 10px;
  }
  #study-login-helper-modal .modal-body {
    padding: 16px;
  }
  .study-login-helper-inline,
  .study-login-helper-actions,
  .study-login-user-item {
    flex-direction: column;
    align-items: stretch;
  }
  .study-login-helper-side-btn,
  .study-login-user-pick {
    width: 100%;
  }
}
