/* 登录页 · 独立视觉入口（依赖 ../styles.css 的 token 与按钮）
   本页不执行真实鉴权，提交行为见 login.js */

.login-body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  min-height: 100svh;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  min-height: 100svh;
}

/* ================= 左侧：深墨品牌面板 ================= */
.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 3vw, 46px);
  background: var(--ink);
  color: var(--paper);
  isolation: isolate;
}

.aurora {
  position: absolute;
  inset: -10%;
  z-index: -1;
  background:
    radial-gradient(46% 38% at 22% 18%, rgba(54, 201, 121, .26), transparent 62%),
    radial-gradient(40% 40% at 82% 30%, rgba(96, 150, 255, .14), transparent 64%),
    radial-gradient(52% 46% at 60% 88%, rgba(54, 201, 121, .18), transparent 66%);
  filter: blur(6px);
  animation: auroraShift 16s ease-in-out infinite alternate;
}
@keyframes auroraShift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: .9; }
  100% { transform: translate3d(-3%, 3%, 0) scale(1.08); opacity: 1; }
}

#authCanvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: .9;
}

.brand-panel-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 640;
  letter-spacing: -.03em;
}
.auth-mark { width: 34px; height: 34px; color: var(--paper); }
.auth-tag {
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: rgba(255, 255, 255, .62);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
}

.brand-panel-center {
  position: relative;
  z-index: 2;
  padding: clamp(20px, 6vh, 64px) 0;
}
.brand-kicker {
  margin: 0;
  color: rgba(255, 255, 255, .5);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.brand-word {
  margin: 20px 0 0;
  font-size: clamp(68px, 9vw, 140px);
  font-weight: 280;
  line-height: .84;
  letter-spacing: -.07em;
  color: var(--paper);
}
.brand-word span {
  display: inline-block;
  background: linear-gradient(100deg, #8ff0b8, var(--signal) 55%, #2fae6a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  margin: 28px 0 0;
  max-width: 380px;
  color: rgba(255, 255, 255, .68);
  font-size: 15px;
  line-height: 1.78;
}
.trust-list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  max-width: 420px;
  display: grid;
  gap: 2px;
}
.trust-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .8);
  font-size: 13.5px;
  line-height: 1.6;
}
.trust-list i {
  flex: 0 0 auto;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: .1em;
}

.brand-panel-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.status-ticker {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  gap: 26px;
  animation: tickerRun 26s linear infinite;
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .56);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  white-space: nowrap;
}
.ticker-track span i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(54, 201, 121, .14);
}
@keyframes tickerRun {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.brand-back {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .62);
  font-size: 12.5px;
  transition: color .2s ease;
}
.brand-back:hover { color: var(--paper); }

/* ================= 右侧：登录卡 ================= */
.login-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: clamp(28px, 4vw, 56px);
  background:
    radial-gradient(70% 60% at 80% 0%, rgba(54, 201, 121, .07), transparent 60%),
    var(--paper);
}

.login-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: clamp(26px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 30px 80px rgba(12, 13, 12, .09);
}

.login-head { margin-bottom: 26px; }
.auth-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--signal-ink);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
}
.auth-index::before { content: ""; width: 22px; height: 1px; background: var(--line-strong); }
.login-head h2 {
  margin: 14px 0 8px;
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 540;
  letter-spacing: -.04em;
}
.login-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ---------- 表单字段（浮动 label） ---------- */
.login-form { display: grid; }
.field {
  position: relative;
  margin-top: 14px;
}
.field input {
  width: 100%;
  height: 58px;
  padding: 20px 16px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper-bright);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  letter-spacing: -.01em;
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.field--pwd input { padding-right: 66px; }
.field label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
  transition: top .2s var(--ease), transform .2s var(--ease), color .2s ease, font-size .2s ease;
}
.field input:focus,
.field input:not(:placeholder-shown) {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
  background: #fff;
  outline: none;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 15px;
  transform: translateY(-50%);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--signal-ink);
}
.field input:focus { border-color: var(--signal-ink); }

.pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  transition: color .2s ease, background .2s ease;
}
.pwd-toggle:hover { color: var(--ink); background: var(--signal-soft); }

.field-hint {
  margin: 9px 2px 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------- 错误提示 ---------- */
.login-error {
  display: none;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #e5b3ad;
  border-radius: 10px;
  background: #fdf1ef;
  color: #a5342a;
  font-size: 12.5px;
  line-height: 1.55;
}
.login-error.show { display: block; }

/* ---------- 条款 ---------- */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  cursor: pointer;
}
.terms input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.terms-box {
  flex: 0 0 auto;
  margin-top: 1px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper-bright);
  transition: background .2s ease, border-color .2s ease;
}
.terms input:checked + .terms-box {
  background: var(--signal);
  border-color: var(--signal-dark);
  box-shadow: inset 0 0 0 3px var(--paper-bright);
}
.terms input:focus-visible + .terms-box {
  outline: 3px solid rgba(54, 201, 121, .4);
  outline-offset: 2px;
}
.terms a { color: var(--signal-ink); border-bottom: 1px solid rgba(11, 107, 61, .35); }

/* ---------- 提交按钮 ---------- */
.login-submit {
  position: relative;
  margin-top: 20px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--paper-bright);
  font-size: 15px;
  font-weight: 560;
  letter-spacing: -.01em;
  box-shadow: 0 14px 30px rgba(12, 13, 12, .16);
  transition: transform .22s var(--ease), background .22s ease, box-shadow .22s ease, opacity .22s ease;
}
.login-submit:hover:not(:disabled) { transform: translateY(-2px); background: #232421; box-shadow: 0 18px 36px rgba(12, 13, 12, .2); }
.login-submit:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.login-submit.is-loading { pointer-events: none; }
.login-submit.is-loading .submit-label { opacity: .35; }
.submit-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: var(--paper-bright);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.login-submit.is-loading .submit-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 次要入口 ---------- */
.login-alt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.passkey-wrap { position: relative; display: inline-flex; }
.ghost-btn {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: not-allowed;
  opacity: .6;
}
.passkey-wrap::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.passkey-wrap:hover::after { opacity: 1; transform: translateY(0); }
.alt-hint { color: var(--muted); font-size: 11.5px; }

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.login-links a { color: var(--muted); transition: color .2s ease; }
.login-links a:hover { color: var(--signal-ink); }

.turnstile-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.turnstile-note span { color: var(--signal-ink); }

.login-foot {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .05em;
}
.login-foot a { color: var(--muted); }
.login-foot a:hover { color: var(--ink); }

/* ================= 响应式 ================= */
@media (max-width: 1199px) {
  .login-shell { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .brand-word { font-size: clamp(60px, 9vw, 104px); }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 16px 22px;
    min-height: 0;
  }
  .brand-panel-center { display: none; }
  .aurora { opacity: .8; }
  #authCanvas { display: none; }
  .brand-panel-bottom { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .status-ticker { display: none; }
  .brand-back { color: rgba(255, 255, 255, .8); }
  .login-main { padding: 28px 20px 40px; gap: 20px; }
}

@media (max-width: 520px) {
  .brand-panel { padding: 14px 16px; }
  .auth-brand { font-size: 17px; gap: 9px; }
  .auth-mark { width: 28px; height: 28px; }
  .auth-tag { font-size: 9px; padding: 5px 9px; }
  .login-card { padding: 22px 18px; border-radius: 20px; }
  .login-head h2 { font-size: 26px; }
  .login-main { gap: 16px; padding: 22px 14px 32px; }
  .login-foot { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .ticker-track { animation: none !important; }
  .ticker-track { transform: none !important; }
}
