/* ============================================================
   文脉智传 · 一村一歌 —— 账号页 v3「暮色声场」
   深色产品级界面：左侧村庄主视觉 + 右侧玻璃卡表单。
   依赖 static/v2/tokens.css、static/wm/fonts.css。
   只作用于账号页（templates/wm/auth/**）。
   ============================================================ */

/* ---------- 0. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.auth-body img,
.auth-body svg { display: block; max-width: 100%; }
.auth-body a { color: inherit; text-decoration: none; }
.auth-body button { font: inherit; color: inherit; }
.auth-body h1,
.auth-body h2,
.auth-body p,
.auth-body ul { margin: 0; padding: 0; }
.auth-body ul { list-style: none; }

.auth-body ::selection { background: var(--accent-flat); color: var(--on-accent); }

.auth-body :focus-visible,
.auth-body a:focus-visible,
.auth-body button:focus-visible {
  outline: 2px solid var(--accent-flat);
  outline-offset: 2px;
}

.auth-body .grad,
.auth-grad {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ---------- 1. 整页布局 ---------- */
.auth-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 48fr) minmax(0, 52fr);
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
}

/* ---------- 2. 左侧品牌区 ---------- */
.auth-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(26px, 3.4vw, 48px);
  background: var(--bg-1);
  color: var(--text);
}

@media (min-width: 981px) {
  .auth-hero {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    min-height: 640px;
  }
}

.auth-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.auth-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 62%;
  filter: saturate(0.98) contrast(1.04) brightness(0.98);
}

.auth-hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 55% at 12% 88%, rgba(255, 120, 70, 0.2), transparent 66%),
    linear-gradient(180deg, rgba(6, 7, 10, 0.84) 0%, rgba(6, 7, 10, 0.28) 34%, rgba(6, 7, 10, 0.82) 100%),
    linear-gradient(90deg, rgba(6, 7, 10, 0.86) 0%, rgba(6, 7, 10, 0.46) 52%, rgba(6, 7, 10, 0.14) 100%);
}

/* 与右侧暗部衔接的细亮线 */
.auth-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-strong) 18%, var(--line) 82%, transparent);
  pointer-events: none;
}

.auth-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 100%;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 100%;
}

.auth-brand__seal {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 10px 26px rgba(255, 110, 80, 0.35));
}

.auth-brand__text { display: flex; flex-direction: column; min-width: 0; }
.auth-brand__text b {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  color: var(--text);
}
.auth-brand__text small {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  color: var(--text-3);
  text-transform: uppercase;
}

.auth-hero__copy {
  margin-top: auto;
  margin-bottom: auto;
  padding: clamp(34px, 6vh, 68px) 0;
  max-width: 35em;
  min-width: 0;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: var(--text-2);
}

.auth-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px rgba(110, 231, 183, 0.8);
  flex-shrink: 0;
}

.auth-hero__title {
  margin-top: clamp(16px, 2.4vh, 24px);
  font-family: var(--font-ui);
  font-size: clamp(34px, 3.5vw, 52px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.auth-hero__lead {
  margin-top: clamp(14px, 2vh, 20px);
  max-width: 30em;
  font-size: 14px;
  line-height: 1.95;
  color: var(--text-2);
}

.auth-hpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: clamp(20px, 3.4vh, 30px);
}

.auth-hpoints li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: nowrap;
}

.auth-hpoints svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--mint);
  opacity: 0.92;
}

.auth-hero__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--text-3);
}

.auth-hero__foot a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.auth-hero__foot a:hover { color: var(--accent-flat); }
.auth-arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.auth-hero__foot a:hover .auth-arrow { transform: translate(2px, -2px); }

/* ---------- 3. 右侧表单区 ---------- */
.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px, 4.5vw, 64px) clamp(20px, 4vw, 60px);
  background: var(--bg);
  overflow: hidden;
}

/* 卡片背后的暖色光晕 */
.auth-panel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(720px, 96%);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 90, 0.14) 0%, rgba(255, 140, 90, 0) 62%);
  filter: blur(6px);
  pointer-events: none;
}

.auth-panel__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 440px;
  min-width: 0;
}

/* 玻璃卡 */
.auth-card {
  position: relative;
  padding: clamp(26px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 178, 94, 0.09), transparent 58%);
}

/* 顶部一道暖色发丝线 */
.auth-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 26px;
  right: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 178, 94, 0.55), transparent);
  pointer-events: none;
}

.auth-head { position: relative; }

.auth-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--text-3);
}
.auth-kicker::before {
  content: "";
  width: 16px;
  height: 1px;
  flex-shrink: 0;
  background: var(--accent);
}

.auth-title {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.auth-lead {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-2);
}

/* ---------- 4. 提示条 ---------- */
.auth-alerts {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-color: color-mix(in srgb, var(--err) 32%, transparent);
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.08);
  background: color-mix(in srgb, var(--err) 8%, transparent);
  font-size: 12.5px;
  line-height: 1.7;
  color: #FCA5A5;
}

.auth-alert--success {
  border-color: rgba(110, 231, 183, 0.3);
  border-color: color-mix(in srgb, var(--mint) 30%, transparent);
  background: rgba(110, 231, 183, 0.08);
  background: color-mix(in srgb, var(--mint) 8%, transparent);
  color: var(--mint);
}

.auth-alert--info {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}

.auth-alert__icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* ---------- 5. 表单 ---------- */
.auth-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.auth-field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: var(--text-2);
}

.auth-field__label a {
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--accent-flat);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.auth-field__label a:hover { color: var(--amber); }

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  caret-color: var(--accent-flat);
  transition: border-color 0.22s, background 0.22s, box-shadow 0.22s;
}

.auth-input::placeholder { color: var(--text-3); }

.auth-input:hover { border-color: var(--line-strong); }

.auth-input:focus {
  outline: none;
  border-color: rgba(255, 122, 92, 0.55);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 122, 92, 0.12);
}

.auth-input:autofill,
.auth-input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #14171f inset;
  caret-color: var(--text);
}

.auth-pw {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.auth-pw .auth-input { padding-right: 58px; }

.auth-pw__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.auth-pw__toggle:hover { color: var(--accent-flat); background: rgba(255, 255, 255, 0.05); }

.auth-error {
  font-size: 12px;
  line-height: 1.7;
  color: var(--err);
}

.auth-hint {
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--text-3);
}

/* 主按钮（暖橙渐变） */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, filter 0.25s, background 0.25s, border-color 0.25s;
}
.auth-btn:hover { transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }

.auth-btn--accent {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 12px 34px -14px rgba(255, 110, 90, 0.65);
}
.auth-btn--accent:hover {
  box-shadow: 0 18px 44px -16px rgba(255, 110, 90, 0.8);
  filter: brightness(1.05);
}

.auth-btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.auth-btn--ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- 6. 底部链接 ---------- */
.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-3);
}

.auth-links a {
  color: var(--text-2);
  transition: color 0.2s var(--ease);
}
.auth-links a:hover { color: var(--accent-flat); }
.auth-links a.is-accent { color: var(--accent-flat); font-weight: 500; }

.auth-panel__foot {
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.auth-panel__foot a { color: var(--text-2); transition: color 0.2s; }
.auth-panel__foot a:hover { color: var(--accent-flat); }

/* ---------- 7. 状态页 ---------- */
.auth-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
}

.auth-state__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-flat);
}
.auth-state__icon svg { width: 22px; height: 22px; }
.auth-state__icon--ok {
  border-color: rgba(110, 231, 183, 0.26);
  background: rgba(110, 231, 183, 0.1);
  color: var(--mint);
}
.auth-state__icon--err {
  border-color: rgba(248, 113, 113, 0.26);
  border-color: color-mix(in srgb, var(--err) 26%, transparent);
  background: rgba(248, 113, 113, 0.1);
  background: color-mix(in srgb, var(--err) 10%, transparent);
  color: var(--err);
}

.auth-state__text {
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-2);
}
.auth-state__text strong {
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.auth-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
.auth-state__actions .auth-btn { flex: 0 1 auto; }

/* ---------- 8. 响应式 ---------- */
@media (max-width: 1180px) {
  .auth-hero__copy { max-width: 31em; }
  .auth-hpoints { gap: 8px 16px; }
  .auth-hpoints li { font-size: 12px; }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-hero {
    position: relative;
    height: auto;
    min-height: 0;
    padding: clamp(20px, 4.4vw, 34px) var(--gutter) clamp(24px, 4vw, 34px);
  }

  .auth-hero__copy {
    margin: 26px 0 0;
    padding: 0;
    max-width: 36em;
  }

  .auth-hero__title {
    margin-top: 14px;
    font-size: clamp(27px, 6.4vw, 36px);
  }

  .auth-hero__lead {
    margin-top: 12px;
    max-width: 34em;
    font-size: 13px;
  }

  .auth-hpoints {
    margin-top: 16px;
    gap: 8px 18px;
  }

  .auth-hero__foot {
    display: none;
  }

  .auth-hero::after { display: none; }

  .auth-panel {
    align-items: flex-start;
    padding: 0 var(--gutter) clamp(40px, 7vw, 64px);
    background: var(--bg);
  }

  .auth-panel::before {
    top: 34%;
    width: min(640px, 100%);
  }

  .auth-panel__inner { max-width: 480px; gap: 14px; }
}

@media (max-width: 560px) {
  .auth-hero { padding: 18px var(--gutter) 22px; }
  .auth-brand { gap: 10px; }
  .auth-brand__seal { width: 33px; height: 33px; }
  .auth-brand__text b { font-size: 15px; }
  .auth-brand__text small { font-size: 8px; letter-spacing: 0.14em; }
  .auth-hero__copy { margin-top: 20px; }
  .auth-hero__title { font-size: 25px; }
  .auth-hero__lead,
  .auth-hpoints { display: none; }
  .auth-panel { padding: 0 16px 36px; }
  .auth-card { padding: 24px 18px 26px; border-radius: 16px; }
  .auth-title { font-size: 24px; }
  .auth-form { gap: 15px; margin-top: 20px; }
  .auth-panel__foot { font-size: 10.5px; }
  .auth-state__actions { flex-direction: column; align-items: stretch; }
  .auth-state__actions .auth-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-body *,
  .auth-body *::before,
  .auth-body *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
