/* login.css — 登录页样式（复刻 public/test.html 设计；暗色模式由 .dark 触发） */

.login {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  background: #eef2fa;
  overflow: hidden;
}

.login * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================================
   柔光渐变背景
   ============================================================ */
.login .glow-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #f7f9ff 0%, #eaf0fc 50%, #f2eefc 100%);
}

.login .glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  will-change: transform;
  animation: floatGlow 14s infinite alternate ease-in-out;
}

.login .glow-1 {
  width: 70vmax;
  height: 70vmax;
  background: radial-gradient(circle, rgba(180, 205, 255, 0.65), rgba(180, 205, 255, 0) 70%);
  top: -30vmax;
  left: -20vmax;
  animation-delay: -2s;
}

.login .glow-2 {
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle, rgba(255, 200, 225, 0.55), rgba(255, 200, 225, 0) 70%);
  bottom: -25vmax;
  right: -20vmax;
  animation-delay: -6s;
  animation-duration: 16s;
}

.login .glow-3 {
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle, rgba(210, 195, 255, 0.5), rgba(210, 195, 255, 0) 70%);
  top: 20vmax;
  left: 35vmax;
  animation-delay: -9s;
  animation-duration: 18s;
}

@keyframes floatGlow {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(2.5vmax, 1.5vmax) scale(1.08); }
  100% { transform: translate(-1.5vmax, -2vmax) scale(0.96); }
}

/* ============================================================
   右上角语言切换按钮（在主题切换按钮左边）
   ============================================================ */
.login .lang-toggle {
  position: fixed;
  top: 1.5rem;
  right: calc(1.5rem + 38px + 0.6rem);
  z-index: 100;
  width: 38px;
  height: 38px;
  border-radius: 18px;
  border: 1px solid rgba(180, 200, 240, 0.5);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 20px -8px rgba(120, 140, 190, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.25s ease;
}

.login .lang-toggle:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px -8px rgba(120, 140, 190, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(150, 180, 240, 0.7);
}

.login .lang-toggle:active {
  transform: translateY(0) scale(0.96);
}

.login .lang-toggle svg {
  width: 20px;
  height: 20px;
  stroke: #5c6f96;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s ease;
}

/* ============================================================
   右上角主题切换按钮
   ============================================================ */
.login .theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  width: 38px;
  height: 38px;
  border-radius: 18px;
  border: 1px solid rgba(180, 200, 240, 0.5);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 20px -8px rgba(120, 140, 190, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.25s ease;
}

.login .theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px -8px rgba(120, 140, 190, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(150, 180, 240, 0.7);
}

.login .theme-toggle:active {
  transform: translateY(0) scale(0.96);
}

.login .theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: #5c6f96;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.25s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login .theme-toggle .icon-moon { display: block; }
.login .theme-toggle .icon-sun  { display: none; }
.dark .login .theme-toggle .icon-moon { display: none; }
.dark .login .theme-toggle .icon-sun  { display: block; }

/* ============================================================
   主布局
   ============================================================ */
.login .layout {
  position: relative;
  z-index: 5;
  display: flex;
  width: 100%;
  height: 100vh;
}

.login .left-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem 3rem 5rem;
}

.login .left-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.login .illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.login .illustration svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  overflow: visible;
}

/* ---------- 通用浮动动画 ---------- */
.login .float-slow {
  animation: floatY 7s ease-in-out infinite;
  transform-origin: center;
}
.login .float-med {
  animation: floatY 5.5s ease-in-out infinite;
}
.login .float-fast {
  animation: floatY 4s ease-in-out infinite;
}
.login .float-slow-rev {
  animation: floatY 8s ease-in-out infinite reverse;
}

.login .pulse-soft {
  animation: pulseSoft 6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

@keyframes pulseSoft {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.04); }
}

/* ---------- 卡片堆叠慢浮动 ---------- */
.login .card-stack {
  animation: cardStack 8s ease-in-out infinite;
  transform-origin: 260px 270px;
}

@keyframes cardStack {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-1deg); }
}

/* ---------- 同心圆弧系统 ---------- */
.login .arc-system {
  animation: arcSystemBreath 7s ease-in-out infinite;
  transform-origin: 380px 280px;
}

@keyframes arcSystemBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

.login .arc-spin {
  animation: arcSpin 18s linear infinite;
  transform-origin: 380px 280px;
}

.login .arc-spin-rev {
  animation: arcSpinReverse 14s linear infinite;
  transform-origin: 380px 280px;
}

.login .arc-spin-slow {
  animation: arcSpin 26s linear infinite;
  transform-origin: 380px 280px;
}

@keyframes arcSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes arcSpinReverse {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.login .core-pulse {
  animation: corePulse 3s ease-in-out infinite;
  transform-origin: 380px 280px;
}

@keyframes corePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.15); opacity: 0.85; }
}

/* ============================================================
   标语区
   ============================================================ */
.login .left-caption {
  margin-top: 2.5rem;
  text-align: center;
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.login .caption-desc {
  font-size: 0.9rem;
  font-weight: 400;
  color: #8a9bb5;
  letter-spacing: 0.02em;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
  transition: color 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   右侧全高面板
   ============================================================ */
.login .right-panel {
  flex: 0 0 580px;
  position: relative;
  height: 100vh;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  display: flex;
  flex-direction: column;
  animation: panelIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
  transition: background 0.3s ease;
}

@keyframes panelIn {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}

.login .panel-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 2rem 3.5rem 3rem;
}

.login .panel-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  transform: translateY(-1rem);
}

.login .panel-header {
  flex-shrink: 0;
  margin-bottom: 2.5rem;
}

.login .panel-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login .panel-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #a8c0ff 0%, #c8b6ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 24px -8px rgba(150, 170, 240, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.login .panel-brand-logo svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(100, 120, 200, 0.3));
}

.login .panel-brand-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.login .panel-brand-logo.has-logo {
  background: transparent;
  box-shadow: none;
}

.dark .login .panel-brand-logo.has-logo {
  background: linear-gradient(135deg, rgba(225, 235, 255, 0.92) 0%, rgba(240, 232, 255, 0.92) 100%);
  box-shadow:
    0 10px 24px -8px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.login .panel-brand-name {
  font-size: 1.35rem;
  font-weight: 600;
  color: #2c3e5c;
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
}

.login .panel-form-wrap {
  display: flex;
  flex-direction: column;
}

.login .panel-subtitle {
  font-size: 0.9rem;
  color: #9aa5c0;
  font-weight: 400;
  position: relative;
  padding-bottom: 1rem;
  margin-bottom: 1.6rem;
  transition: color 0.3s ease;
}

.login .panel-subtitle::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #a8c0ff, #c8b6ff);
  opacity: 0.85;
}

.login .login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.login .login-form .n-form-item,
.login .login-form .n-form-item-blank {
  width: 100%;
  display: block;
}

.login .login-form .n-form-item-feedback {
  display: block;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #d03050;
  margin-top: 0.4rem;
  margin-left: 0.15rem;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}

.login .login-form .n-form-item-feedback:empty {
  display: none;
}

.login .input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #7a87a8;
  margin-bottom: 0.45rem;
  margin-left: 0.15rem;
  transition: color 0.3s ease;
}

.login .input-wrap {
  position: relative;
}

.login .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: #a3aecd;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.25s ease;
}

.login .input-group .form-input {
  width: 100%;
  padding: 0.95rem 1.1rem 0.95rem 2.8rem;
  border-radius: 14px;
  border: 1.5px solid #e2e8f5;
  background: #ffffff;
  font-size: 0.93rem;
  color: #2e3a52;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 3px rgba(150, 170, 220, 0.06);
  font-family: inherit;
}

.login .input-group .form-input::placeholder {
  color: #b2bdd6;
  font-size: 0.88rem;
  transition: color 0.3s ease;
}

.login .input-group .form-input:focus {
  border-color: #a8c0ff;
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(168, 192, 255, 0.18),
    inset 0 1px 3px rgba(150, 170, 220, 0.05);
}

.login .input-group .form-input:focus ~ .input-icon {
  stroke: #7a9fe8;
}

.login .options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: -0.1rem;
}

.login .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  color: #7a87a8;
  transition: color 0.2s;
}

.login .checkbox-label:hover { color: #5c6f96; }

.login .checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #8faef5;
  border-radius: 4px;
  cursor: pointer;
}

.login .login-btn {
  margin-top: 0.5rem;
  padding: 1rem 0;
  width: 100%;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #6a8dff 0%, #8b6eff 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow:
    0 14px 28px -10px rgba(106, 141, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.login .login-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: left 0.6s ease;
}

.login .login-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 36px -10px rgba(106, 141, 255, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, #5a7dff 0%, #7b5eff 100%);
}

.login .login-btn:hover::after { left: 100%; }

.login .login-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 8px 18px -6px rgba(140, 165, 240, 0.55);
}

.login .login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login .panel-bottom {
  margin-top: 1.8rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9aa5c0;
  transition: color 0.3s ease;
}

.login .panel-bottom a {
  color: #7a9fe8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
}

.login .panel-bottom a:hover { color: #5c7fd0; }

.login .panel-copyright {
  position: absolute;
  bottom: 1.8rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: #a8b2c8;
  letter-spacing: 0.02em;
  font-weight: 400;
  transition: color 0.3s ease;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1280px) {
  .login .left-panel {
    padding: 3rem 3rem 3rem 3.5rem;
  }
  .login .right-panel {
    flex: 0 0 500px;
  }
  .login .panel-inner {
    padding: 2rem 3rem 2.5rem;
  }
  .login .illustration svg {
    max-width: 380px;
  }
}

@media (max-width: 1024px) {
  .login .left-panel {
    padding: 2.5rem 2rem 2.5rem 2.5rem;
  }
  .login .right-panel {
    flex: 0 0 440px;
  }
  .login .panel-inner {
    padding: 2rem 2.5rem 2rem;
  }
  .login .panel-content {
    transform: translateY(-0.5rem);
  }
  .login .illustration svg {
    max-width: 320px;
  }
  .login .caption-desc {
    font-size: 0.85rem;
  }
  .login .panel-brand-name {
    font-size: 1.2rem;
  }
}

@media (max-width: 860px) {
  .login .left-panel {
    display: none;
  }
  .login .right-panel {
    flex: 1 1 auto;
  }
  .login .panel-inner {
    padding: 2.5rem 2rem 2.5rem;
  }
  .login .panel-content {
    max-width: 400px;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .login .panel-inner {
    padding: 2rem 1.8rem 2rem;
  }
  .login .panel-brand-name {
    font-size: 1.1rem;
  }
  .login .panel-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .login .panel-brand-logo svg {
    width: 20px;
    height: 20px;
  }
  .login .panel-copyright {
    font-size: 0.7rem;
    bottom: 1.2rem;
  }
  .login .theme-toggle {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
  .login .lang-toggle {
    top: 1rem;
    right: calc(1rem + 40px + 0.5rem);
    width: 40px;
    height: 40px;
  }
}

/* ============================================================
   暗色模式（由 body.dark 触发，跟随全局 nova-theme）
   ============================================================ */
.dark .login {
  background: #0b0f1a;
}

.dark .login .glow-bg {
  background: linear-gradient(145deg, #0a0e18 0%, #0f1422 50%, #131024 100%);
}

.dark .login .glow-1 {
  background: radial-gradient(circle, rgba(70, 100, 200, 0.28), rgba(70, 100, 200, 0) 70%);
}

.dark .login .glow-2 {
  background: radial-gradient(circle, rgba(150, 80, 140, 0.22), rgba(150, 80, 140, 0) 70%);
}

.dark .login .glow-3 {
  background: radial-gradient(circle, rgba(120, 90, 200, 0.24), rgba(120, 90, 200, 0) 70%);
}

.dark .login .theme-toggle {
  background: rgba(40, 46, 64, 0.85);
  border-color: rgba(100, 115, 150, 0.5);
  box-shadow:
    0 8px 20px -8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark .login .theme-toggle:hover {
  background: rgba(52, 60, 82, 0.9);
  border-color: rgba(106, 141, 255, 0.5);
}

.dark .login .theme-toggle svg {
  stroke: #a8b8e0;
}

.dark .login .lang-toggle {
  background: rgba(40, 46, 64, 0.85);
  border-color: rgba(100, 115, 150, 0.5);
  box-shadow:
    0 8px 20px -8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark .login .lang-toggle:hover {
  background: rgba(52, 60, 82, 0.9);
  border-color: rgba(106, 141, 255, 0.5);
}

.dark .login .lang-toggle svg {
  stroke: #a8b8e0;
}

.dark .login .right-panel {
  background: rgba(32, 38, 54, 0.85);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.dark .login .panel-brand-name {
  color: #e8edf8;
}

.dark .login .panel-subtitle {
  color: #8a94ad;
}

.dark .login .input-group label {
  color: #8a94ad;
}

.dark .login .input-group .form-input {
  background: rgba(44, 52, 72, 0.9);
  border-color: rgba(100, 115, 150, 0.45);
  color: #e0e8f5;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.dark .login .input-group .form-input::placeholder {
  color: #5a6680;
}

.dark .login .input-group .form-input:focus {
  border-color: #6a8dff;
  background: rgba(50, 58, 80, 0.95);
  box-shadow:
    0 0 0 4px rgba(106, 141, 255, 0.2),
    inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.dark .login .input-icon {
  stroke: #5a6680;
}

.dark .login .input-group .form-input:focus ~ .input-icon {
  stroke: #6a8dff;
}

.dark .login .checkbox-label {
  color: #8a94ad;
}

.dark .login .checkbox-label:hover {
  color: #b0bcd4;
}

.dark .login .checkbox-label input[type="checkbox"] {
  accent-color: #6a8dff;
}

.dark .login .panel-bottom {
  color: #7a849c;
}

.dark .login .panel-bottom a {
  color: #6a8dff;
}

.dark .login .panel-bottom a:hover {
  color: #8ba5ff;
}

.dark .login .panel-copyright {
  color: #5a6478;
}

.dark .login .caption-desc {
  color: #6a748c;
}

.dark .login .login-form .n-form-item-feedback {
  color: #ff6b85;
}

.dark .login .login-btn {
  box-shadow:
    0 14px 28px -10px rgba(106, 141, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.dark .login .login-btn:hover {
  box-shadow:
    0 20px 36px -10px rgba(106, 141, 255, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---------- 浏览器自动填充背景色覆盖 ---------- */
.login input:-webkit-autofill,
.login input:-webkit-autofill:hover,
.login input:-webkit-autofill:focus,
.login input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #2e3a52 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.dark .login input:-webkit-autofill,
.dark .login input:-webkit-autofill:hover,
.dark .login input:-webkit-autofill:focus,
.dark .login input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #2c3448 inset !important;
  -webkit-text-fill-color: #e0e8f5 !important;
}

/* ---------- 登录/注册切换左右切入动画（与 app.js pageTransitionName 一致） ---------- */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,
.slide-right-leave-active {
  transition: all 0.3s ease;
}
.slide-left-enter-from {
  opacity: 0;
  transform: translateX(100%);
}
.slide-left-leave-to {
  opacity: 0;
  transform: translateX(-100%);
}
.slide-right-enter-from {
  opacity: 0;
  transform: translateX(-100%);
}
.slide-right-leave-to {
  opacity: 0;
  transform: translateX(100%);
}