/* ================================================================
   Auth V3 — 翻译维汉助手 登录页样式（fanyiwh.cn）
   与首页 official-site-v2.css 同一品牌体系：靛蓝 + 青色
   仅重写视觉层；所有类名、ID 与 JS 逻辑保持兼容
   ================================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Keyframes ── */
@keyframes auth-v2-bg-float {
  0%, 100% { opacity: 0.5; transform: translate(0, 0) scale(1); }
  50% { opacity: 0.85; transform: translate(-14px, -12px) scale(1.05); }
}
@keyframes auth-v2-card-in {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-v2-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes auth-v2-register-in {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-v2-spin { to { transform: rotate(360deg); } }
@keyframes auth-v2-qr-scan {
  0% { top: 8%; opacity: 0; }
  12% { opacity: 1; }
  50% { top: 80%; }
  88% { opacity: 1; }
  100% { top: 8%; opacity: 0; }
}
@keyframes auth-v2-bubble-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.92); }
  60% { opacity: 1; transform: translateY(0) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-v2-pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes auth-v2-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-v2-frame-spin {
  to { transform: rotate(360deg); }
}
@keyframes auth-v2-aurora-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.12); }
  66% { transform: translate(-50px, 30px) scale(0.94); }
}
@keyframes auth-v2-floor-move {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 46px, 0 0; }
}
@keyframes auth-v2-sparkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes auth-v2-name-shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}
@keyframes auth-v2-bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes auth-v2-logo-glow {
  0%, 100% { box-shadow: 0 10px 28px -8px rgb(0 0 0 / 0.45), 0 0 0 0 rgb(129 140 248 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.3); }
  50% { box-shadow: 0 10px 28px -8px rgb(0 0 0 / 0.45), 0 0 26px 4px rgb(129 140 248 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.3); }
}

/* ── Page ── */
.auth-v2-page {
  /* Design tokens (light) */
  --a-primary: #4f46e5;
  --a-primary-strong: #4338ca;
  --a-primary-soft: #eef2ff;
  --a-primary-ring: rgb(99 102 241 / 0.14);
  --a-teal: #14b8a6;
  --a-grad-brand: linear-gradient(135deg, #6366f1, #4338ca);
  --a-card: #ffffff;
  --a-card-solid: #ffffff;
  --a-bg: linear-gradient(150deg, #eef1fb 0%, #e7ebf7 45%, #eef6f4 100%);
  --a-text: #0f172a;
  --a-muted: #64748b;
  --a-faint: #94a3b8;
  --a-border: #e2e8f0;
  --a-field-bg: #f8fafc;
  --a-track: #eef1f6;
  --a-danger: #dc2626;
  --a-shadow-lg: 0 32px 80px -24px rgb(30 27 75 / 0.28), 0 12px 28px -12px rgb(15 23 42 / 0.14);
  --a-shadow-md: 0 6px 18px -4px rgb(15 23 42 / 0.1);
  --a-radius: 14px;

  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--a-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景光斑 */
.auth-v2-page::before {
  content: '';
  position: absolute;
  top: -22%;
  left: -12%;
  width: 62%;
  height: 68%;
  background: radial-gradient(ellipse at center, rgb(99 102 241 / 0.16) 0%, transparent 68%);
  border-radius: 50%;
  animation: auth-v2-bg-float 11s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}
.auth-v2-page::after {
  content: '';
  position: absolute;
  bottom: -24%;
  right: -10%;
  width: 58%;
  height: 62%;
  background: radial-gradient(ellipse at center, rgb(20 184 166 / 0.14) 0%, transparent 68%);
  border-radius: 50%;
  animation: auth-v2-bg-float 14s ease-in-out 2s infinite;
  z-index: 0;
  pointer-events: none;
}

/* 极光背景（装饰层） */
.auth-v2-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  filter: blur(70px);
  opacity: 0.85;
}
.auth-v2-aurora-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.auth-v2-aurora-blob--1 {
  width: 520px; height: 520px;
  top: -180px; left: 6%;
  background: radial-gradient(circle, rgb(99 102 241 / 0.32), transparent 68%);
  animation: auth-v2-aurora-drift 17s ease-in-out infinite;
}
.auth-v2-aurora-blob--2 {
  width: 460px; height: 460px;
  bottom: -190px; right: 4%;
  background: radial-gradient(circle, rgb(20 184 166 / 0.26), transparent 68%);
  animation: auth-v2-aurora-drift 21s ease-in-out -6s infinite reverse;
}
.auth-v2-aurora-blob--3 {
  width: 380px; height: 380px;
  top: 32%; right: 26%;
  background: radial-gradient(circle, rgb(217 70 239 / 0.14), transparent 68%);
  animation: auth-v2-aurora-drift 25s ease-in-out -12s infinite;
}

/* ── 顶角控制按钮 ── */
.auth-v2-controls {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-v2-btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--a-border);
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--a-muted);
  box-shadow: var(--a-shadow-md);
  transition: all 0.2s;
}
.auth-v2-btn-icon:hover {
  background: #fff;
  color: var(--a-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -6px rgb(99 102 241 / 0.35);
}
.auth-v2-lang-dropdown { position: relative; }
.auth-v2-lang-menu {
  display: none;
  position: absolute;
  top: 46px;
  right: 0;
  background: var(--a-card-solid);
  border: 1px solid var(--a-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgb(15 23 42 / 0.22);
  padding: 6px;
  min-width: 130px;
  z-index: 101;
}
.auth-v2-lang-menu.show { display: block; }
.auth-v2-lang-menu a {
  display: block;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--a-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.auth-v2-lang-menu a:hover { background: var(--a-primary-soft); color: var(--a-primary); }
.auth-v2-lang-menu a.active { background: var(--a-primary-soft); color: var(--a-primary); font-weight: 600; }
.rtl-text { direction: rtl; unicode-bidi: isolate; font-family: 'UKIJTuzTom', 'Noto Naskh Arabic', serif; }

/* ── 卡片外框：旋转流光边框（装饰） ── */
.auth-v2-frame {
  position: relative;
  z-index: 1;
  padding: 2.5px;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  animation: auth-v2-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 40px 100px -24px rgb(30 27 75 / 0.4),
    0 16px 40px -16px rgb(15 23 42 / 0.2),
    0 0 60px -18px rgb(99 102 241 / 0.45);
}
.auth-v2-frame::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -140%;
  background: conic-gradient(
    from 0deg,
    #4f46e5, #14b8a6, #818cf8, #d946ef, #14b8a6, #4f46e5
  );
  animation: auth-v2-frame-spin 7s linear infinite;
}

/* ── 两栏卡片 ── */
.auth-v2-container {
  position: relative;
  display: flex;
  width: 1000px;
  max-width: calc(96vw - 8px);
  min-height: 640px;
  background: var(--a-card);
  border-radius: 28px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.18s ease-out;
  will-change: transform;
}

/* 鼠标跟随光斑（装饰） */
.auth-v2-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    640px circle at var(--mx, 50%) var(--my, 50%),
    rgb(255 255 255 / 0.13),
    transparent 46%
  );
}
.auth-v2-frame:hover .auth-v2-glare { opacity: 1; }

/* ═══════════ 左侧品牌面板 ═══════════ */
.auth-v2-brand {
  width: 45%;
  background:
    radial-gradient(ellipse 90% 55% at 80% -10%, rgb(20 184 166 / 0.28), transparent 60%),
    radial-gradient(ellipse 70% 50% at 10% 110%, rgb(99 102 241 / 0.35), transparent 62%),
    linear-gradient(165deg, #17153a 0%, #2b2477 45%, #4338ca 80%, #4f46e5 100%);
  padding: 2.4rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
/* 原 a2c1/a2c2 圆形装饰 — 升级为光晕 */
.auth-v2-brand-bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.06);
  filter: blur(2px);
}
.auth-v2-brand-bg-circle.a2c1 {
  top: -60px;
  right: -60px;
  width: 190px;
  height: 190px;
  border: 1.5px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.04);
  animation: auth-v2-bg-float 12s ease-in-out infinite;
}
.auth-v2-brand-bg-circle.a2c2 {
  bottom: -50px;
  left: -50px;
  width: 150px;
  height: 150px;
  background: rgb(20 184 166 / 0.14);
  animation: auth-v2-bg-float 15s ease-in-out 1.5s infinite;
}
/* 点阵纹理 */
.auth-v2-brand-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
}
/* 透视网格地板（合成波风格，装饰） */
.auth-v2-brand-floor {
  position: absolute;
  left: -45%;
  right: -45%;
  bottom: -14%;
  height: 46%;
  background-image:
    linear-gradient(rgb(165 180 252 / 0.28) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgb(165 180 252 / 0.28) 1.5px, transparent 1.5px);
  background-size: 46px 46px;
  transform: perspective(400px) rotateX(60deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(180deg, transparent 2%, #000 55%);
  -webkit-mask-image: linear-gradient(180deg, transparent 2%, #000 55%);
  animation: auth-v2-floor-move 5.5s linear infinite;
  pointer-events: none;
}
/* 闪烁星点（装饰） */
.auth-v2-sparkles { position: absolute; inset: 0; pointer-events: none; }
.auth-v2-sparkles span {
  position: absolute;
  width: 5px; height: 5px;
  background: #e0e7ff;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgb(165 180 252 / 0.8);
  animation: auth-v2-sparkle 3.4s ease-in-out infinite;
}
.auth-v2-sparkles span:nth-child(1) { top: 14%; left: 18%; animation-delay: 0.2s; }
.auth-v2-sparkles span:nth-child(2) { top: 8%; right: 22%; width: 4px; height: 4px; animation-delay: 1.2s; }
.auth-v2-sparkles span:nth-child(3) { top: 38%; right: 12%; animation-delay: 2.1s; }
.auth-v2-sparkles span:nth-child(4) { top: 56%; left: 10%; width: 3px; height: 3px; animation-delay: 2.8s; }

.auth-v2-brand-logo {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.28) 0%, rgb(255 255 255 / 0.08) 100%);
  border: 1px solid rgb(255 255 255 / 0.22);
  box-shadow: 0 10px 28px -8px rgb(0 0 0 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
  animation: auth-v2-logo-glow 3.6s ease-in-out infinite;
}
.auth-v2-brand-logo:hover { transform: rotate(-6deg) scale(1.06); animation-play-state: paused; }
.auth-v2-brand-logo svg { width: 30px; height: 30px; }

.auth-v2-brand-name {
  font-size: 23px;
  font-weight: 800;
  background: linear-gradient(90deg, #ffffff 20%, #a5b4fc 40%, #5eead4 55%, #ffffff 80%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  letter-spacing: 0.04em;
  animation: auth-v2-name-shimmer 5s ease-in-out infinite;
}

.auth-v2-brand-slogan {
  font-size: 14px;
  color: rgb(199 210 254 / 0.92);
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

/* 译配气泡装饰 */
.auth-v2-bubbles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 250px;
  margin: 8px 0 4px;
  position: relative;
  z-index: 1;
}
.auth-v2-bubble {
  padding: 10px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 16px;
  width: fit-content;
  max-width: 88%;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
}
.auth-v2-bubble--in {
  align-self: flex-start;
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.18);
  color: #e0e7ff;
  border-bottom-left-radius: 5px;
  animation: auth-v2-bubble-in 0.6s ease-out 0.5s forwards,
    auth-v2-bubble-float 4.5s ease-in-out 1.4s infinite;
}
.auth-v2-bubble--out {
  align-self: flex-end;
  background: linear-gradient(135deg, rgb(20 184 166 / 0.85), rgb(13 148 136 / 0.85));
  border: 1px solid rgb(94 234 212 / 0.35);
  color: #f0fdfa;
  border-bottom-right-radius: 5px;
  direction: rtl;
  unicode-bidi: isolate;
  font-family: 'UKIJTuzTom', 'Noto Naskh Arabic', serif;
  font-size: 15px;
  box-shadow: 0 6px 18px -6px rgb(13 148 136 / 0.55);
  animation: auth-v2-bubble-in 0.6s ease-out 1.1s forwards,
    auth-v2-bubble-float 5.2s ease-in-out 1.9s infinite;
}

/* 特性标签 */
.auth-v2-brand-features {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 8px;
}
.auth-v2-feature-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgb(224 231 255 / 0.92);
  background: rgb(255 255 255 / 0.07);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 999px;
  padding: 8px 14px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.auth-v2-feature-pill:hover {
  background: rgb(255 255 255 / 0.12);
  border-color: rgb(165 180 252 / 0.4);
  transform: translateX(3px);
}
.auth-v2-feature-pill::before {
  content: '✓';
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #5eead4;
  background: rgb(20 184 166 / 0.22);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══════════ 右侧表单面板 ═══════════ */
.auth-v2-form-panel {
  flex: 1;
  padding: 2.4rem 2.7rem 1.8rem;
  display: flex;
  flex-direction: column;
  background: var(--a-card);
}

.auth-v2-form-head { margin-bottom: 20px; }
.auth-v2-form-title {
  font-size: 25px;
  font-weight: 800;
  color: var(--a-text);
  letter-spacing: -0.01em;
  margin-bottom: 5px;
}
.auth-v2-form-subtitle {
  font-size: 14px;
  color: var(--a-muted);
}

/* 分段式 Tab */
.auth-v2-tabs {
  display: flex;
  gap: 4px;
  background: var(--a-track);
  border: none;
  border-radius: 13px;
  padding: 4px;
  margin-bottom: 22px;
  flex-shrink: 0;
  position: relative;
}
.auth-v2-tab {
  flex: 1;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--a-muted);
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  white-space: nowrap;
  font-family: inherit;
}
.auth-v2-tab:hover { color: var(--a-text); }
.auth-v2-tab.active {
  background: var(--a-card-solid);
  color: var(--a-primary);
  box-shadow: 0 2px 10px -2px rgb(15 23 42 / 0.14), 0 0 0 1px rgb(15 23 42 / 0.03);
}
.auth-v2-badge {
  position: absolute;
  top: -9px;
  right: 6px;
  font-size: 10px;
  background: linear-gradient(135deg, #fb7185, #f97316);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
  font-weight: 700;
  box-shadow: 0 3px 10px -2px rgb(249 115 22 / 0.5);
  letter-spacing: 0.02em;
}

/* Tab 内容 */
.auth-v2-tab-content { flex: 1; display: flex; flex-direction: column; }
.auth-v2-tab-panel { display: none; flex-direction: column; flex: 1; }
.auth-v2-tab-panel.active { display: flex; animation: auth-v2-error-in 0.25s ease-out; }

/* ── 表单元素 ── */
.auth-v2-field { margin-bottom: 14px; }
.auth-v2-field:last-child { margin-bottom: 0; }
.auth-v2-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-v2-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--a-faint);
  z-index: 1;
  pointer-events: none;
  transition: color 0.2s;
}
.auth-v2-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border: 1.5px solid var(--a-border);
  border-radius: var(--a-radius);
  font-size: 14.5px;
  color: var(--a-text);
  background: var(--a-field-bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
}
.auth-v2-input:focus {
  border-color: var(--a-primary);
  box-shadow: 0 0 0 4px var(--a-primary-ring);
  background: var(--a-card-solid);
}
.auth-v2-input-wrap:focus-within .auth-v2-input-icon { color: var(--a-primary); }
.auth-v2-input::placeholder { color: var(--a-faint); }

.auth-v2-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--a-faint);
  padding: 4px;
  z-index: 1;
  border-radius: 6px;
  transition: color 0.2s;
  display: flex;
}
.auth-v2-pw-toggle:hover { color: var(--a-primary); }

.auth-v2-error {
  display: none;
  font-size: 12px;
  color: var(--a-danger);
  margin-top: 6px;
  padding-left: 4px;
  animation: auth-v2-error-in 0.2s ease-out;
}

/* ── 选项行 ── */
.auth-v2-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 13px;
}
.auth-v2-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--a-muted);
  cursor: pointer;
  user-select: none;
}
.auth-v2-remember input[type="checkbox"] {
  accent-color: var(--a-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.auth-v2-forgot {
  background: none;
  border: none;
  color: var(--a-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s;
}
.auth-v2-forgot:hover { color: var(--a-primary-strong); text-decoration: underline; }

/* ── 提交按钮 ── */
.auth-v2-submit {
  position: relative;
  width: 100%;
  padding: 14.5px;
  background: var(--a-grad-brand);
  color: #fff;
  border: none;
  border-radius: var(--a-radius);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 4px;
  font-family: inherit;
  overflow: hidden;
  box-shadow: 0 10px 24px -8px rgb(99 102 241 / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.18);
  transition: all 0.22s ease;
}
.auth-v2-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgb(255 255 255 / 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.auth-v2-submit:hover::before { left: 130%; }
.auth-v2-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgb(99 102 241 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.18);
}
.auth-v2-submit:active { transform: translateY(0) scale(0.99); }
.auth-v2-submit.loading {
  opacity: 0.85;
  cursor: not-allowed;
  pointer-events: none;
  color: transparent !important;
}
.auth-v2-submit.loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgb(255 255 255 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-v2-spin 0.7s linear infinite;
}

/* ── 切换链接 ── */
.auth-v2-switch {
  text-align: center;
  font-size: 13px;
  color: var(--a-muted);
  margin-top: 18px;
}
.auth-v2-switch a {
  color: var(--a-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.auth-v2-switch a:hover { color: var(--a-primary-strong); text-decoration: underline; }

/* ── 返回首页 ── */
.auth-v2-back {
  text-align: center;
  margin-top: 12px;
}
.auth-v2-back a {
  font-size: 12.5px;
  color: var(--a-faint);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s, transform 0.2s;
}
.auth-v2-back a:hover { color: var(--a-primary); transform: translateX(-2px); }

/* ═══════════ 扫码登录（仅样式，逻辑未动） ═══════════ */
.auth-v2-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 15px;
}
.auth-v2-qr-box {
  position: relative;
  width: 204px;
  height: 204px;
  border: 1.5px solid var(--a-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--a-card-solid);
  padding: 11px;
  overflow: hidden;
  box-shadow: var(--a-shadow-md), 0 0 30px -8px rgb(99 102 241 / 0.25);
  transition: box-shadow 0.25s;
}
.auth-v2-qr-box:hover { box-shadow: 0 10px 28px -8px rgb(99 102 241 / 0.35), 0 0 40px -8px rgb(99 102 241 / 0.4); }
/* 四角描边（左上/右下由伪元素绘制，右上/左下由扫描线容器承担视觉平衡） */
.auth-v2-qr-box::before,
.auth-v2-qr-box::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--a-primary);
  pointer-events: none;
  z-index: 2;
}
.auth-v2-qr-box::before { top: -1.5px; left: -1.5px; border-right: none; border-bottom: none; border-top-left-radius: 18px; }
.auth-v2-qr-box::after { bottom: -1.5px; right: -1.5px; border-left: none; border-top: none; border-bottom-right-radius: 18px; }
.auth-v2-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  position: relative;
  z-index: 1;
}
/* 扫描动效线（纯装饰；二维码隐藏时自动消失，降级浏览器仅保持可见、无害） */
.auth-v2-qr-scan {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8%;
  height: 42px;
  background: linear-gradient(180deg, transparent, rgb(79 70 229 / 0.16), transparent);
  border-radius: 8px;
  animation: auth-v2-qr-scan 2.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}
.auth-v2-qr-box:has(#miniapp-qr[style*="display: none"]) .auth-v2-qr-scan,
.auth-v2-qr-box:has(#miniapp-qr[src=""]) .auth-v2-qr-scan { display: none; }
.auth-v2-qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--a-faint);
  font-size: 12px;
  position: relative;
  z-index: 1;
}
.auth-v2-qr-placeholder svg { animation: auth-v2-pulse-soft 2s ease-in-out infinite; }
.auth-v2-qr-hint {
  font-size: 13px;
  color: var(--a-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-v2-qr-actions { display: flex; gap: 12px; }
.auth-v2-qr-refresh {
  background: var(--a-primary-soft);
  border: 1px solid rgb(99 102 241 / 0.25);
  border-radius: 999px;
  padding: 7.5px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--a-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.auth-v2-qr-refresh:hover {
  background: #e0e7ff;
  border-color: rgb(99 102 241 / 0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgb(99 102 241 / 0.45);
}
.auth-v2-qr-back { margin-top: 4px; }
.auth-v2-qr-back button {
  background: none;
  border: none;
  font-size: 12.5px;
  color: var(--a-faint);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}
.auth-v2-qr-back button:hover { color: var(--a-primary); }

/* ═══════════ 注册弹层 ═══════════ */
.auth-v2-overlay {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: auth-v2-overlay-in 0.2s ease-out;
  padding: 20px;
}
.auth-v2-register-card {
  background: var(--a-card);
  border-radius: 22px;
  padding: 2rem;
  width: 460px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: auth-v2-register-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 40px 90px -20px rgb(0 0 0 / 0.45);
  position: relative;
}
.auth-v2-register-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--a-grad-brand);
  border-radius: 22px 22px 0 0;
}
.auth-v2-register-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.auth-v2-register-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--a-text);
}
.auth-v2-register-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--a-track);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--a-muted);
  transition: all 0.2s;
}
.auth-v2-register-close:hover {
  background: rgb(220 38 38 / 0.1);
  color: var(--a-danger);
  transform: rotate(90deg);
}

.auth-v2-field-row { display: flex; gap: 12px; margin-bottom: 14px; }
.auth-v2-field-row .auth-v2-field { flex: 1; margin-bottom: 0; }

/* ── 页脚 ── */
.auth-v2-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 16px 14px;
  font-size: 12px;
  color: var(--a-faint);
}

/* ── RTL 支持 ── */
[dir="rtl"] .auth-v2-input-icon { left: auto; right: 14px; }
[dir="rtl"] .auth-v2-input { padding: 12.5px 42px 12.5px 14px; }
[dir="rtl"] .auth-v2-pw-toggle { right: auto; left: 12px; }
[dir="rtl"] .auth-v2-remember { flex-direction: row-reverse; }

/* ═══════════ Dark Mode ═══════════ */
.auth-v2-page.dark {
  --a-primary: #818cf8;
  --a-primary-strong: #a5b4fc;
  --a-primary-soft: rgb(99 102 241 / 0.16);
  --a-primary-ring: rgb(129 140 248 / 0.22);
  --a-card: #181b2e;
  --a-card-solid: #20243c;
  --a-bg: linear-gradient(150deg, #0c0e1c 0%, #12142a 45%, #0d1520 100%);
  --a-text: #e2e8f0;
  --a-muted: #94a3b8;
  --a-faint: #64748b;
  --a-border: rgb(148 163 184 / 0.16);
  --a-field-bg: rgb(15 18 34 / 0.8);
  --a-track: rgb(148 163 184 / 0.09);
  --a-danger: #f87171;
  --a-shadow-lg: 0 40px 90px -24px rgb(0 0 0 / 0.65);
  --a-shadow-md: 0 6px 18px -4px rgb(0 0 0 / 0.4);
  color: var(--a-muted);
}
.auth-v2-page.dark .auth-v2-frame {
  box-shadow:
    0 40px 100px -24px rgb(0 0 0 / 0.7),
    0 16px 40px -16px rgb(0 0 0 / 0.5),
    0 0 60px -18px rgb(99 102 241 / 0.5);
}
.auth-v2-page.dark .auth-v2-frame::before {
  background: conic-gradient(
    from 0deg,
    #4338ca, #0d9488, #6366f1, #a21caf, #0d9488, #4338ca
  );
}
.auth-v2-page.dark .auth-v2-aurora { opacity: 0.5; }
.auth-v2-page.dark .auth-v2-glare {
  background: radial-gradient(
    640px circle at var(--mx, 50%) var(--my, 50%),
    rgb(165 180 252 / 0.1),
    transparent 46%
  );
}
.auth-v2-page.dark .auth-v2-tab.active {
  box-shadow: 0 2px 10px -2px rgb(0 0 0 / 0.5);
  color: #a5b4fc;
}
.auth-v2-page.dark .auth-v2-badge { color: #fff; }
.auth-v2-page.dark .auth-v2-submit {
  box-shadow: 0 10px 26px -8px rgb(0 0 0 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.auth-v2-page.dark .auth-v2-brand {
  background:
    radial-gradient(ellipse 90% 55% at 80% -10%, rgb(20 184 166 / 0.2), transparent 60%),
    radial-gradient(ellipse 70% 50% at 10% 110%, rgb(99 102 241 / 0.28), transparent 62%),
    linear-gradient(165deg, #10102a 0%, #1e1a55 45%, #312e81 80%, #3b3591 100%);
}
.auth-v2-page.dark .auth-v2-qr-box {
  background: var(--a-card-solid);
  border-color: rgb(148 163 184 / 0.2);
}
.auth-v2-page.dark .auth-v2-qr-box img { background: #fff; }
.auth-v2-page.dark .auth-v2-qr-box::before,
.auth-v2-page.dark .auth-v2-qr-box::after { border-color: #818cf8; }
.auth-v2-page.dark .auth-v2-qr-scan { background: linear-gradient(180deg, transparent, rgb(129 140 248 / 0.2), transparent); }
.auth-v2-page.dark .auth-v2-form-panel,
.auth-v2-page.dark .auth-v2-register-card { background: var(--a-card); }
.auth-v2-page.dark .auth-v2-register-close:hover { background: rgb(248 113 113 / 0.12); color: var(--a-danger); }

/* ── 无障碍焦点 ── */
.auth-v2-btn-icon:focus-visible,
.auth-v2-tab:focus-visible,
.auth-v2-pw-toggle:focus-visible,
.auth-v2-forgot:focus-visible,
.auth-v2-qr-refresh:focus-visible,
.auth-v2-qr-back button:focus-visible,
.auth-v2-register-close:focus-visible,
.auth-v2-submit:focus-visible {
  outline: 2px solid var(--a-primary);
  outline-offset: 2px;
}

/* ── 响应式 ── */
@media (max-width: 1080px) {
  .auth-v2-container { min-height: 580px; }
}
@media (max-width: 860px) {
  .auth-v2-container { width: 600px; }
  .auth-v2-brand { padding: 1.9rem 1.5rem; }
  .auth-v2-brand-floor { display: none; }
  .auth-v2-form-panel { padding: 1.9rem 1.7rem 1.5rem; }
  .auth-v2-bubbles { display: none; }
}
@media (max-width: 680px) {
  .auth-v2-page { justify-content: flex-start; padding-top: 56px; }
  .auth-v2-frame { max-width: 96vw; width: 96vw; }
  .auth-v2-container {
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: auto;
  }
  .auth-v2-sparkles { display: none; }
  .auth-v2-aurora { opacity: 0.55; }
  .auth-v2-brand {
    width: 100%;
    padding: 1.4rem 1.2rem;
    gap: 8px;
  }
  .auth-v2-brand-logo { width: 44px; height: 44px; border-radius: 13px; }
  .auth-v2-brand-logo svg { width: 22px; height: 22px; }
  .auth-v2-brand-name { font-size: 16px; }
  .auth-v2-brand-slogan { font-size: 12px; }
  .auth-v2-brand-features { display: none; }
  .auth-v2-bubbles { display: none; }
  .auth-v2-form-panel { padding: 1.4rem 1.2rem 1.2rem; }
  .auth-v2-form-head { margin-bottom: 14px; }
  .auth-v2-form-title { font-size: 19px; }
  .auth-v2-tab { padding: 8px 10px; font-size: 13px; }
  .auth-v2-badge { top: -8px; right: 2px; font-size: 9px; padding: 1px 6px; }
  .auth-v2-field-row { flex-direction: column; gap: 0; }
  .auth-v2-register-card { padding: 1.5rem 1.2rem; }
  .auth-v2-controls { top: 12px; right: 14px; }
  .auth-v2-footer { padding: 10px 12px 12px; }
}

/* ── 弱动效偏好 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
