:root { color-scheme: dark; }
* { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  height: 100vh;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background: #09090b;
  color: #fafafa;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 620px at 15% 12%, rgba(99,102,241,0.20), transparent 62%),
    radial-gradient(980px 580px at 85% 92%, rgba(139,92,246,0.16), transparent 60%),
    linear-gradient(135deg, #2f3136 0%, #3a3d44 45%, #2f3136 100%);
}

.login-page .auth-bg {
  background:
    radial-gradient(900px 420px at 18% 10%, rgba(99,102,241,0.10), transparent 66%),
    linear-gradient(130deg, #2f3136 0%, #383b41 52%, #32353b 100%);
}

.auth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
}

.auth-page-wrap {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.8vh, 20px) clamp(12px, 1.8vw, 22px);
}

.auth-layout {
  width: min(1120px, 100%);
  max-height: calc(100vh - clamp(20px, 3.6vh, 40px));
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(14px, 2vw, 28px);
  align-items: stretch;
}

.auth-left {
  max-width: 680px;
  height: 100%;
  transform: scale(clamp(0.96, 1.5vw, 1.08));
  transform-origin: left center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: radial-gradient(130% 130% at 30% 20%, rgba(255,255,255,0.16), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 8px 18px rgba(0,0,0,0.24);
  display: grid;
  place-items: center;
}
.auth-brand-title { font-weight: 900; letter-spacing: 0.02em; }
.auth-brand-sub { font-size: 12px; color: rgba(255,255,255,0.80); margin-top: 2px; }

.auth-hero { margin-top: 30px; }
.auth-hero-title {
  font-size: clamp(38px, 4.6vw, 58px); line-height: 1.04; font-weight: 900; letter-spacing: -0.04em;
  color: rgba(255,255,255,0.98);
}
.auth-hero-desc { margin-top: 12px; font-size: 14px; color: rgba(255,255,255,0.82); max-width: 520px; }

.auth-feature-list { margin-top: clamp(18px, 2.3vh, 30px); display: grid; gap: clamp(10px, 1.6vh, 16px); max-width: 560px; }
.auth-feature { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.auth-feature-ico {
  width: 28px; height: 28px; border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: grid; place-items: center; color: rgba(255,255,255,0.9);
}
.auth-feature-title { font-weight: 800; }
.auth-feature-desc { margin-top: 4px; font-size: 12px; color: rgba(255,255,255,0.78); line-height: 1.5; }

.auth-stats { margin-top: auto; padding-top: clamp(14px, 2.2vh, 24px); display: flex; gap: clamp(14px, 2vw, 26px); flex-wrap: wrap; }
.auth-stat { display: grid; gap: 2px; }
.auth-stat-num { font-weight: 900; font-size: 16px; color: rgba(255,255,255,0.96); }
.auth-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.72); }

.auth-shell {
  width: min(470px, 90vw);
  margin-left: auto;
  height: 100%;
  display: flex;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  height: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(53,56,63,0.92);
  box-shadow: 0 14px 30px rgba(0,0,0,0.26);
  backdrop-filter: blur(8px);
  padding: clamp(20px, 3vh, 34px) 22px clamp(16px, 2.2vh, 24px);
  overflow: hidden;
}
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.auth-title { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.auth-sub { font-size: 12px; color: rgba(255,255,255,0.68); }

.auth-tab { position: absolute; opacity: 0; pointer-events: none; }
.auth-tabs { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-tabs label {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  height: 32px;
  border-radius: 10px;
  line-height: 32px;
  text-align: center;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  transition: all .22s ease;
}
#auth_tab_pwd:checked ~ .auth-tabs label[for="auth_tab_pwd"],
#auth_tab_code:checked ~ .auth-tabs label[for="auth_tab_code"] {
  background: rgba(74, 80, 92, 0.92);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.auth-panels { margin-top: 14px; }
.auth-panel { display: none; }
#auth_tab_pwd:checked ~ .auth-panels .auth-panel-pwd { display: block; }
#auth_tab_code:checked ~ .auth-panels .auth-panel-code { display: block; }

.auth-card label {
  display: block; margin: 10px 0 6px; font-size: 12px; color: rgba(255,255,255,0.72);
}
.auth-card input {
  width: 100%; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.16); color: rgba(255,255,255,0.94);
  padding: 0 10px; outline: none;
  transition: all .22s ease;
}
.auth-card input::placeholder { color: rgba(255,255,255,0.50); }
.auth-card input:focus {
  border-color: rgba(129,140,248,0.80);
  background: rgba(0,0,0,0.22);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.20);
}

.auth-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.auth-mini {
  height: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9);
  font-weight: 700; cursor: pointer;
  transition: all .2s ease;
}
.auth-mini:hover { background: rgba(255,255,255,0.11); }
.auth-hint { margin-top: 8px; font-size: 11px; color: rgba(255,255,255,0.55); }

.auth-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.auth-btn {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(82, 91, 108, 0.95);
  background: #525b6c;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.auth-btn:hover {
  transform: translateY(-1px);
  background: #5d6678;
  box-shadow: 0 12px 22px rgba(0,0,0,0.32);
}

.auth-foot {
  margin-top: 12px; font-size: 11px; color: rgba(255,255,255,0.7);
  display: flex; justify-content: center; gap: 8px;
}
.auth-foot a { color: inherit; opacity: 0.9; text-decoration: none; }
.auth-foot a:hover { opacity: 1; }

.register-perks {
  margin-top: 22px; max-width: 250px; border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); padding: 16px 16px 14px;
}
.register-perks-title { font-weight: 900; margin-bottom: 10px; }
.register-perks-list { display: grid; gap: 10px; }
.register-perk { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,0.8); font-size: 12px; line-height: 1.5; }
.register-perk-dot { width: 10px; height: 10px; border-radius: 999px; margin-top: 3px; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); flex: 0 0 auto; }

/* 注册页：左右两列同高，上下边界对齐 */
.register-page .auth-layout {
  align-items: stretch;
}
.register-page .auth-left {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.register-page .auth-shell {
  align-items: stretch;
  height: 100%;
}
.register-page .auth-card {
  height: 100%;
  min-height: 0;
  padding: clamp(24px, 3.2vh, 38px) 24px clamp(18px, 2.6vh, 28px);
}
.register-page .auth-head { gap: 8px; }
.register-page .auth-tabs { margin-top: 16px; }
.register-page .auth-panels { margin-top: 16px; }
.register-page .auth-card label {
  margin: 12px 0 7px;
}
.register-page .auth-card input {
  height: 38px;
}
.register-page .auth-row { gap: 10px; }
.register-page .auth-mini { height: 38px; }
.register-page .auth-actions { margin-top: 16px; }
.register-page .auth-hint { margin-top: 8px; font-size: 11px; }
.register-page .auth-foot { margin-top: 14px; }
.register-page #auth_msg:empty {
  display: none;
}

@media (max-width: 980px) {
  body.auth-page { overflow-y: auto; }
  .auth-page-wrap { height: auto; min-height: 100vh; padding: 18px 12px; }
  .auth-layout {
    width: min(760px, 100%);
    max-height: none;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .auth-shell { margin: 0 auto; width: min(480px, 94vw); }
  .auth-card { max-width: 400px; padding: 18px 16px 14px; }
  .auth-left { max-width: none; transform: none; }
  .auth-brand { justify-content: center; }
  .auth-hero-title { font-size: clamp(28px, 8vw, 38px); text-align: center; }
  .auth-hero-desc { text-align: center; margin-left: auto; margin-right: auto; }
  .auth-feature-list { margin-top: 12px; gap: 8px; }
  .auth-stats { margin-top: 10px; gap: 12px; }
  .register-perks { margin-left: auto; margin-right: auto; }
}

@media (max-height: 860px) and (min-width: 981px) {
  .auth-left { transform: translateY(-2px) scale(0.94); }
  .auth-card { max-width: 390px; padding: 16px 16px 12px; }
  .auth-feature-list { margin-top: 12px; gap: 8px; }
  .auth-stats { margin-top: 10px; gap: 12px; }
  .auth-hero-title { font-size: clamp(30px, 3.3vw, 42px); }
}
