/* ========== 基础重置 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #050a18;
  color: #cfd6e6;
  overflow: hidden;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ========== 背景层 ========== */
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 30%, #0a1a3d 0%, #050a18 60%),
              radial-gradient(ellipse at 80% 70%, #0c2a4a 0%, transparent 60%),
              #050a18;
  overflow: hidden;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 12s ease-in-out infinite;
}
.glow-1 { width: 500px; height: 500px; background: #1e40af; top: -150px; left: -100px; }
.glow-2 { width: 400px; height: 400px; background: #0891b2; bottom: -100px; right: -50px; animation-delay: -4s; }
.glow-3 { width: 300px; height: 300px; background: #7c3aed; top: 40%; left: 50%; animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.1); }
}

/* ========== 主容器 ========== */
.login-wrapper {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  height: calc(100vh - 48px);
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 32px;
  gap: 24px;
}

/* ========== 左侧品牌 ========== */
.brand-pane {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 30, 70, 0.6), rgba(8, 18, 45, 0.4));
  border: 1px solid rgba(37, 99, 235, 0.25);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.brand-pane::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #2563eb, #06b6d4, transparent);
}
.brand-top { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 56px; height: 56px; border-radius: 12px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.4);
}
.brand-name {
  font-size: 24px; font-weight: 700; color: #fff;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 13px; color: #94a3b8; margin-top: 2px; }

.brand-title {
  font-size: 36px; font-weight: 700; color: #fff;
  margin: 32px 0 16px; line-height: 1.3;
}
.brand-desc { font-size: 15px; color: #94a3b8; line-height: 1.8; }

.brand-features { list-style: none; margin-top: 32px; }
.brand-features li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  color: #cbd5e1;
  font-size: 14px;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.15);
}
.brand-features li:last-child { border-bottom: none; }
.brand-features .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
}

.brand-footer { color: #64748b; font-size: 12px; line-height: 1.8; }
.brand-contact { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; color: #94a3b8; }

/* ========== 右侧表单 ========== */
.form-pane { display: flex; align-items: center; justify-content: center; }
.form-card {
  width: 100%; max-width: 440px;
  padding: 40px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(15, 28, 60, 0.85), rgba(8, 18, 45, 0.7));
  border: 1px solid rgba(37, 99, 235, 0.25);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  position: relative;
}
.form-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #22d3ee, #2563eb, transparent);
}

.form-header { text-align: center; margin-bottom: 28px; }
.form-header h2 { color: #fff; font-size: 24px; font-weight: 700; }
.form-header p { color: #64748b; font-size: 12px; margin-top: 6px; letter-spacing: 1px; }

/* Tab 切换 */
.tab-switch {
  display: flex; padding: 4px; gap: 4px;
  background: rgba(15, 30, 70, 0.5);
  border-radius: 10px; margin-bottom: 24px;
}
.tab {
  flex: 1; padding: 10px 0;
  border-radius: 8px;
  color: #94a3b8; font-size: 14px;
  transition: all 0.25s;
}
.tab.active {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* 表单 */
.form { display: flex; flex-direction: column; gap: 16px; }
.form.hidden { display: none; }
.field label {
  display: block; color: #94a3b8; font-size: 12px;
  margin-bottom: 8px; letter-spacing: 0.5px;
}
.field input {
  width: 100%; height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(8, 18, 45, 0.6);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #fff; font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.field input::placeholder { color: #475569; }
.field input:focus {
  border-color: #2563eb;
  background: rgba(15, 30, 70, 0.8);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.input-group .prefix {
  display: flex; align-items: center; padding: 0 12px;
  background: rgba(8, 18, 45, 0.6);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 10px;
  color: #94a3b8; font-size: 14px;
}
.btn-code {
  padding: 0 16px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(34, 211, 238, 0.2));
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #60a5fa; font-size: 13px; white-space: nowrap;
  transition: all 0.2s;
}
.btn-code:hover { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; }
.btn-code:disabled { opacity: 0.5; cursor: not-allowed; }

.form-row { display: flex; align-items: center; }
.form-row.between { justify-content: space-between; margin-top: -4px; }
.check { display: flex; align-items: center; gap: 6px; color: #94a3b8; font-size: 13px; cursor: pointer; }
.check input { accent-color: #2563eb; }
.link { color: #60a5fa; font-size: 13px; }
.link:hover { color: #22d3ee; }

.btn-primary {
  height: 46px; margin-top: 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff; font-size: 15px; font-weight: 600;
  letter-spacing: 2px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: all 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.5); }
.btn-primary:active { transform: translateY(0); }

.form-tip {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px dashed rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  color: #64748b; font-size: 12px;
  text-align: center;
}
.back-login { display: inline-block; margin-top: 12px; text-align: center; }

.form-foot {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed rgba(37, 99, 235, 0.15);
  color: #64748b; font-size: 12px; text-align: center;
}

/* ========== 底栏备案 ========== */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 32px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(5, 10, 24, 0.7);
  border-top: 1px solid rgba(37, 99, 235, 0.15);
  color: #64748b; font-size: 12px;
  z-index: 10;
  backdrop-filter: blur(10px);
}
.site-footer a { transition: color 0.2s; }
.site-footer a:hover { color: #60a5fa; }
.site-footer .sep { color: #1e3a8a; }
.beian-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }

/* ========== Toast ========== */
.toast-host {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 1000; pointer-events: none;
}
.toast {
  padding: 10px 20px; margin-bottom: 8px;
  border-radius: 8px; color: #fff; font-size: 13px;
  background: rgba(15, 30, 70, 0.95);
  border: 1px solid rgba(37, 99, 235, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.25s ease;
}
.toast.error { border-color: rgba(239, 68, 68, 0.5); background: rgba(127, 29, 29, 0.95); }
.toast.success { border-color: rgba(34, 197, 94, 0.5); background: rgba(20, 83, 45, 0.95); }
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .brand-pane { display: none; }
  .login-wrapper { height: calc(100vh - 48px); padding: 16px; }
}
@media (max-width: 640px) {
  .form-card { padding: 24px; }
  .form-header h2 { font-size: 20px; }
  .site-footer { font-size: 11px; gap: 4px; }
  .site-footer .sep { display: none; }
}
