/* ============================================================
   河大启示录 · 注册 / 登录页
   与 index.html 欢迎页同一套视觉语言：校园四季背景、玻璃面板、
   金色衬线标题、校徽、模块状态侧栏。
   契约：register.js / login.js / captcha.js 的 id 与类名不改。
   ============================================================ */
@font-face {
  font-family: "HbuTitleSerif";
  src: url("./assets/fonts/hbu-title-serif.woff2") format("woff2");
  font-display: swap;
  font-weight: 900;
}

:root {
  --ink: #17293d;
  --ink-2: #3a4d63;
  --gold: #d9bc7a;
  --seal: #9e2b25;
  --safe: #3f8a5a;
  --rush: #c05a2f;
  --muted: rgba(233, 240, 246, .72);
  --glass-line: rgba(255, 255, 255, .40);
  --serif: "HbuTitleSerif", "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: #0d141c;
  -webkit-font-smoothing: antialiased;
}

/* 校园背景：四季图 + 暗角压光，保证玻璃面板可读 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("./assets/hbu-season-spring.png") center / cover no-repeat;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 244, 214, .14), transparent 42%),
    linear-gradient(180deg, rgba(8, 14, 24, .38), rgba(8, 14, 24, .58) 78%);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(18px, 4vw, 40px);
}

/* ---------- 左侧：品牌 + 模块状态侧栏 ---------- */
.auth-hero {
  display: grid;
  gap: clamp(18px, 3vh, 28px);
  justify-items: start;
  color: #f2f6fa;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.auth-brand img {
  width: 54px;
  height: 54px;
  padding: 5px;
  object-fit: contain;
  border: 1px solid rgba(213, 178, 108, .68);
  border-radius: 50%;
  background: rgba(247, 251, 255, .38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .75),
    0 8px 24px rgba(94, 68, 22, .2);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.auth-brand span {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: .12em;
  background: linear-gradient(180deg, #fff6dc 0%, #f3dca7 38%, #d7ad62 72%, #b88432 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(26, 36, 58, .5));
}

.auth-copy { display: grid; gap: 10px; max-width: 460px; }
.auth-copy p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--gold);
}
.auth-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 900;
  line-height: 1.35;
  color: #fdfaf2;
  text-shadow: 0 2px 18px rgba(8, 14, 24, .6);
  text-wrap: balance;
}
.auth-copy span {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--muted);
  text-shadow: 0 1px 12px rgba(8, 14, 24, .55);
}

/* 模块状态侧栏：四模块平级列出 */
.auth-modules {
  display: grid;
  gap: 8px;
  width: min(300px, 100%);
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04)),
    rgba(12, 20, 30, .32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    0 18px 44px rgba(7, 15, 27, .3);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.auth-modules span {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(240, 246, 252, .92);
}
.auth-modules span::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(217, 188, 122, .8);
}

/* ---------- 右侧：玻璃表单卡 ---------- */
.auth-card {
  width: 100%;
  padding: clamp(24px, 3vw, 32px) clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  background:
    radial-gradient(130% 170% at 16% 0%, rgba(255, 255, 255, .30), rgba(255, 255, 255, .10) 56%),
    linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(246, 250, 255, .56)),
    rgba(252, 253, 255, .55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .88),
    inset 0 0 0 1px rgba(255, 255, 255, .30),
    0 24px 60px rgba(7, 15, 27, .38);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.auth-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.auth-seal {
  flex: none;
  width: 52px;
  height: 52px;
  padding: 4px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(158, 43, 37, .30);
  border-radius: 50%;
  background: rgba(255, 255, 255, .66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 6px 16px rgba(94, 68, 22, .16);
}
.auth-seal img { width: 100%; height: 100%; object-fit: contain; }
.auth-card h2 {
  margin: 0 0 3px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--ink);
}
.auth-sub { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 700;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(23, 41, 61, .18);
  border-radius: 11px;
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, .84);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--seal);
  box-shadow: 0 0 0 3px rgba(158, 43, 37, .14);
}

.email-row { display: flex; gap: 8px; }
.email-row input { flex: 1; min-width: 0; }
.email-row .btn.secondary { flex: none; width: auto; padding: 0 14px; white-space: nowrap; }

.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  cursor: pointer;
  color: #f7fffd;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--sans);
  letter-spacing: .05em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #1ca89b 0%, #0f766e 54%, #073f3b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .48),
    inset 0 -1px 0 rgba(0, 36, 33, .30),
    0 12px 24px rgba(10, 80, 75, .22);
  transition: transform .18s var(--ease-out), box-shadow .22s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.48), 0 16px 30px rgba(10, 80, 75, .3); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary {
  color: var(--ink);
  border-color: rgba(15, 118, 110, .22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .62)),
    rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92), 0 9px 22px rgba(13, 34, 36, .1);
  font-size: 13.5px;
}

.msg { font-size: 13px; margin: 10px 0 0; min-height: 18px; color: var(--ink-2); }
.msg.err { color: var(--rush); }
.msg.ok { color: var(--safe); }

.auth-foot {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.auth-foot a { color: var(--seal); text-decoration: none; font-weight: 700; }
.auth-foot a:hover { text-decoration: underline; }

/* ---- 图形验证码组件（captcha.js 注入，类名契约不改） ---- */
.imgcap-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.imgcap-img {
  border: 1px solid rgba(23, 41, 61, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .84);
  cursor: pointer;
  height: 50px;
  width: 150px;
}
.imgcap-refresh {
  border: 1px solid rgba(23, 41, 61, .18);
  background: rgba(255, 255, 255, .84);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  color: var(--ink);
}
.imgcap-input {
  flex: 1;
  min-width: 110px;
  padding: 9px 12px;
  border: 1px solid rgba(23, 41, 61, .18);
  border-radius: 10px;
  font-size: 16px;
  background: rgba(255, 255, 255, .84);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.imgcap-ok {
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #1ca89b, #0f766e);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.imgcap-ok:disabled { opacity: .55; cursor: default; }
.imgcap-tip { flex-basis: 100%; font-size: 13px; min-height: 16px; color: var(--ink-2); }
.imgcap-tip.ok { color: var(--safe); }
.imgcap-tip.bad { color: #b3261e; }

/* ---- 滑块验证码（旧组件保留，防回退） ---- */
.cap-wrap { margin: 6px 0 4px; }
.cap-track { position: relative; width: 300px; max-width: 100%; height: 42px; background: rgba(236, 229, 215, .9); border: 1px solid rgba(23, 41, 61, .2); border-radius: 9px; overflow: hidden; }
.cap-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: rgba(158, 43, 37, .14); }
.cap-gap { position: absolute; top: 0; height: 100%; width: 42px; border: 2px dashed rgba(23, 41, 61, .3); border-radius: 9px; box-sizing: border-box; }
.cap-handle { position: absolute; left: 0; top: 0; width: 42px; height: 42px; background: var(--seal); color: #fff; display: flex; align-items: center; justify-content: center; border-radius: 9px; cursor: grab; user-select: none; font-size: 20px; }
.cap-handle.ok { background: var(--safe); }
.cap-handle.bad { background: var(--rush); }
.cap-tip { font-size: 12px; color: var(--ink-2); margin-top: 6px; cursor: pointer; }
.cap-tip.ok { color: var(--safe); }
.cap-tip.bad { color: var(--rush); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 22px;
    padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  }
  .auth-hero {
    justify-items: center;
    text-align: center;
    gap: 14px;
  }
  .auth-copy { justify-items: center; }
  .auth-copy h1 { font-size: clamp(21px, 5.8vw, 26px); }
  .auth-copy span { font-size: 13.5px; line-height: 1.8; }
  .auth-modules {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 13px 14px;
  }
  .auth-modules span { font-size: 12.5px; }
  .auth-card { border-radius: 24px; }
}

@media (max-width: 420px) {
  .auth-brand img { width: 44px; height: 44px; }
  .auth-brand span { font-size: 24px; }
  .auth-modules { grid-template-columns: 1fr; }
  .email-row { flex-wrap: wrap; }
  .email-row .btn.secondary { flex: 1 1 100%; min-height: 42px; }
  .imgcap-input { min-width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
