/* ==========================================================================
   人广校区试卷库 · 登录页
   配色：深蓝 #123B66 品牌区 / 主按钮 #1769AA / 青蓝 #009CC3 点缀
        页面底 #F5F7FA / 卡片表单纯白 / 正文 #243447 / 辅助 #66758A
   原则：左深蓝右白分栏，去掉背景纹理、减淡阴影，让 Logo 与表单成为唯一主角。
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #243447;
  background: #f5f7fa;
  -webkit-font-smoothing: antialiased;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  overflow-x: hidden;
}

/* 背景只留一层极淡的青蓝光晕（去掉原来的三色暖光晕 + 网格纹理） */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 600px at 8% 0%, rgba(23, 105, 170, .06), transparent 60%),
    radial-gradient(700px 520px at 100% 100%, rgba(0, 156, 195, .05), transparent 62%);
}

/* 外壳：宽 1180 × 高 660，圆角 20。阴影只留一层且很淡。 */
.shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 52fr 48fr;
  width: 100%; max-width: 1180px; min-height: 600px;
  border-radius: 20px; overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(18, 59, 102, .05), 0 24px 56px rgba(18, 59, 102, .09);
  animation: rise .45s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── 左侧品牌区：深蓝底 + 反白 Logo ── */
.brand {
  position: relative; overflow: hidden;
  padding: 48px 50px 36px;
  color: #fff;
  background: linear-gradient(158deg, #123B66 0%, #0F3055 58%, #0C2A4A 100%);
  display: flex; flex-direction: column;
}
/* 青蓝光斑：品牌区里唯一的亮色，呼应 Logo 里的青蓝 */
.brand::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 78%;
  background: linear-gradient(to top, rgba(0, 156, 195, .18), rgba(0, 156, 195, 0) 78%);
}
/* 右上角极淡网格：只留一层、不喧哗，给深蓝一点质感 */
.brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 78% 8%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 78% 8%, #000 10%, transparent 72%);
}
.brand > * { position: relative; z-index: 2; }

/* 无文字 Logo：只保留书本+铅笔图形 */
.brand-top { margin-bottom: 34px; }
.logo-mark { height: 62px; width: auto; display: block; }

.brand h1 {
  margin: 0 0 10px; font-size: 30px; font-weight: 700; letter-spacing: 2px; line-height: 1.25;
  color: #fff;
}
.brand .sub {
  margin: 0; font-size: 13px; color: rgba(255, 255, 255, .68); letter-spacing: .6px; line-height: 1.8;
}
/* 品牌区里的说明正文 */
.brand .desc {
  margin: 16px 0 0; font-size: 13px; line-height: 1.95;
  color: rgba(255, 255, 255, .78); max-width: 30em;
}

/* 宣传数据：从 3 项精简到 2 项，弱化成一条信息 */
.stats { display: flex; gap: 32px; margin: 30px 0 0; }
.stats > div { text-align: left; }
.stats b {
  display: block; font-size: 24px; font-weight: 700;
  color: #fff; letter-spacing: .5px; line-height: 1.2;
}
.stats span { font-size: 11.5px; color: rgba(255, 255, 255, .55); letter-spacing: .3px; }

.feats {
  list-style: none; margin: 28px 0 0; padding: 20px 0 0;
  display: flex; flex-wrap: wrap; gap: 9px 22px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.feats li {
  font-size: 12px; color: rgba(255, 255, 255, .66); letter-spacing: .2px;
  display: flex; align-items: center; gap: 7px;
}
/* 列表点用青蓝，与 Logo 呼应 */
.feats li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: #009cc3; flex: none;
}

/* 版权紧跟功能列表：外壳高度已按内容收紧，不再需要 auto 撑开。
   注意 —— 桌面端 .brand 是 flex 列容器，手机端它只包 76px 内容，
   若保留 margin-top:auto 会被 auto 撑到填满整行（实测 76px → 249px），
   所以手机端必须显式取消 auto。 */
.brand-foot { font-size: 10.5px; color: rgba(255, 255, 255, .38); letter-spacing: .3px; margin-top: 20px; }

/* ── 右侧表单区：纯白 ── */
.panel {
  background: #fff;
  padding: 48px 56px;
  display: flex; align-items: center; justify-content: center;
}
.panel-inner { width: 100%; max-width: 380px; }
.panel h2 {
  margin: 0 0 8px; font-size: 23px; font-weight: 700;
  letter-spacing: .3px; color: #123b66;
}
.panel-sub { margin: 0 0 32px; font-size: 12.5px; color: #66758a; }

.field { display: block; margin-bottom: 18px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 600; color: #4a5a70;
  margin-bottom: 8px; letter-spacing: .3px;
}
/* 密码框需要右侧留出「眼睛」按钮的位置 */
.field.pw input { padding-right: 46px; }
/* 眼睛按钮的定位上下文是「输入框本身」，不是含标签的 .field —— 否则会整体上移一个标签高 */
.pw-wrap { position: relative; }

.field input {
  width: 100%; height: 50px; padding: 0 15px;
  font-size: 14.5px; font-family: inherit; color: #243447;
  background: #fbfcfe;
  border: 1px solid #dfe6ee; border-radius: 10px;
  outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.field input::placeholder { color: #9aa8b8; }
.field input:hover { border-color: #a9bdd2; }
.field input:focus {
  background: #fff; border-color: #1769aa;
  box-shadow: 0 0 0 3px rgba(0, 156, 195, .22);
}

/* 密码显示/隐藏：青蓝图标，点击区 44px（不因为小图标牺牲可点性）
   定位用 top:50% + translateY(-50%)，输入框高度变化（含手机端 48px）都能自动居中 */
.pw-eye {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; padding: 0;
  border: 0; background: none; cursor: pointer;
  color: #8b99ad; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .14s, background .14s;
}
.pw-eye:hover { color: #1769aa; background: #f2f6fb; }
.pw-eye:focus-visible { outline: 2px solid #009cc3; outline-offset: 1px; color: #1769aa; }
.pw-eye svg { width: 18px; height: 18px; display: block; }
.pw-eye .eye-off { display: none; }
.pw-eye.on .eye-on { display: none; }
.pw-eye.on .eye-off { display: block; }
.pw-eye.on { color: #009cc3; }

/* 自绘提示气泡：原生 title 的位置由浏览器决定，会压住输入框右下角，改成固定出现在按钮上方。
   触屏没有 hover，用 @media (hover:hover) 收窄，避免手机上长按也弹出来。 */
@media (hover: hover) {
  .pw-eye::after {
    content: attr(data-tip);
    position: absolute; right: 0; bottom: calc(100% + 8px);
    padding: 5px 9px; border-radius: 7px;
    background: #123b66; color: #fff;
    font-size: 11.5px; line-height: 1.4; white-space: nowrap;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .14s, visibility .14s;
    box-shadow: 0 4px 14px rgba(18, 59, 102, .22);
  }
  /* 小三角 */
  .pw-eye::before {
    content: ""; position: absolute; right: 18px; bottom: calc(100% + 3px);
    border: 5px solid transparent; border-top-color: #123b66;
    border-bottom: 0; opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .14s, visibility .14s;
  }
  .pw-eye:hover::after, .pw-eye:focus-visible::after,
  .pw-eye:hover::before, .pw-eye:focus-visible::before {
    opacity: 1; visibility: visible;
  }
}

/* 按钮：#1769AA，高 52px，加载中显示 spinner */
.login-btn {
  position: relative;
  width: 100%; height: 52px; margin-top: 6px;
  font-size: 15px; font-family: inherit; font-weight: 600; letter-spacing: 1px;
  color: #fff; cursor: pointer; border: 0; border-radius: 10px;
  background: #1769aa;
  box-shadow: 0 3px 10px rgba(23, 105, 170, .22);
  transition: transform .14s, box-shadow .18s, background .18s, opacity .18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn:hover:not(:disabled) {
  background: #12588f; transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23, 105, 170, .26);
}
.login-btn:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 6px rgba(23, 105, 170, .2); }
.login-btn:disabled {
  cursor: default; opacity: .82; transform: none;
  background: #6f9ec4; box-shadow: none;
}
/* 登录中 spinner：白圈缺口旋转 */
.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .38); border-top-color: #fff;
  animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* 错误提示：红底红字 + 左侧竖条，出现/消失不跳版 */
.err {
  min-height: 20px; margin-top: 14px;
  font-size: 12.5px; font-weight: 500; color: #b91c1c; letter-spacing: .2px;
  display: flex; align-items: center; gap: 8px;
}
.err:not(:empty) {
  background: #fdecec; border: 1px solid #f5c6c6; border-left: 3px solid #dc2626;
  border-radius: 8px; padding: 10px 12px; min-height: 0;
}
.err svg { width: 15px; height: 15px; flex: none; }
/* 字段级错误：输入框描边变红 */
.field.bad input { border-color: #dc2626; background: #fffafa; }
.field.bad input:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .16); }

.tip {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid #e8eef5;
  font-size: 11.5px; line-height: 1.9; color: #8b99ad; letter-spacing: .2px;
}
.tip b { color: #66758a; font-weight: 600; }
.tip a { color: #1769aa; }
.tip a:hover { color: #009cc3; text-decoration: underline; }

/* 提示条（与服务端 toast 同名，样式保持一致） */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(16px);
  background: #123b66; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 8px 28px rgba(18, 59, 102, .24);
  max-width: 88vw;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ── 平板：分栏比例收窄，品牌区留白减小 ── */
@media (max-width: 1040px) {
  .shell { grid-template-columns: 46fr 54fr; max-width: 940px; min-height: 560px; }
  .brand { padding: 42px 34px 36px; }
  .logo-mark { height: 54px; }
  .brand h1 { font-size: 26px; }
  .panel { padding: 42px 38px; }
  .stats { gap: 26px; }
}

/* ── 手机：单列，品牌展示大幅精简，表单不需滚动即可完整看到 ── */
@media (max-width: 780px) {
  body { padding: 0; align-items: stretch; }
  .shell {
    grid-template-columns: 1fr; border-radius: 0; max-width: none;
    min-height: 100%; box-shadow: none;
  }
  /* 手机品牌区只做「抬头」：Logo + 名称 + 一行副标题。
     align-self:start 是关键 —— grid 默认 stretch 会把这一行拉到整屏高，
     只写 height:auto 不足以摆脱拉伸（实测 76px → 249px）。 */
  .brand { padding: 18px 20px 16px; height: auto; min-height: 0; align-self: start; }
  .brand::after, .brand::before { display: none; }
  .brand-top { margin-bottom: 12px; }
  .logo-mark { height: 32px; }
  .brand h1 { font-size: 19px; letter-spacing: 1.2px; margin-bottom: 3px; }
  .brand .sub { font-size: 11px; }
  /* 说明、统计、功能列表、版权在手机上全部隐藏：不是登录的必要信息 */
  .brand .desc, .stats, .feats, .brand-foot { display: none; }

  /* 手机：表单顶部对齐，不要再垂直居中 ——
     居中会在标题上方留一大片空白，把表单推到屏幕下半部分。 */
  .panel { padding: 26px 22px 32px; align-items: flex-start; }
  .panel-inner { max-width: 420px; margin: 0 auto; }
  .panel h2 { font-size: 20px; }
  .panel-sub { margin-bottom: 22px; }
  .field { margin-bottom: 14px; }
  .field > label { margin-bottom: 6px; }
  .field input { height: 48px; font-size: 16px; /* 16px 防止 iOS 自动放大 */ }
  .login-btn { height: 50px; }
  .tip { margin-top: 20px; padding-top: 16px; font-size: 11px; line-height: 1.8; }
  .toast { bottom: 24px; }
}

/* 极窄屏（如 320px）：进一步压缩间距，保证表单一屏可见 */
@media (max-width: 360px) {
  .panel { padding: 20px 16px 26px; }
  .brand { padding: 18px 18px 16px; }
  .panel-sub { margin-bottom: 18px; }
  .tip { display: none; }
}
