/* =========================================================
   轻域互联 · 平台总后台登录页
   顶级SaaS企业级UI重构 (纯净高亮白·极简苹果风)
   ========================================================= */

/* ---------- 1. 全局重置与强制满屏 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #f8fafc; /* 极简浅灰白底色 */
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 993px) {
  html, body { height: 100%; overflow: hidden; /* 桌面端绝对禁止竖向滚动 */ }
}
@media (max-width: 992px) {
  html, body { 
    overflow-x: hidden; 
    overflow-y: auto; 
    height: auto; 
    min-height: 100vh; 
    -webkit-overflow-scrolling: touch; 
    overscroll-behavior-y: none;
  }
  /* 修复 iOS Safari 底部栏导致的跳动 */
  @supports (-webkit-touch-callout: none) {
    html, body { min-height: -webkit-fill-available; }
    .split-layout { min-height: -webkit-fill-available; }
  }
}

/* 解决浏览器自动填充导致的背景色变白问题 */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 1000px #f1f5f9 inset !important;
    -webkit-text-fill-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ---------- 2. 强制固定布局 (全屏统一浅色背景) ---------- */
.split-layout {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  position: relative;
  background: #f8fafc;
  box-sizing: border-box;
  overflow-x: hidden; /* 防止横向滚动条导致内容偏移 */
}

@media (min-width: 993px) {
  .split-layout { height: 100vh; overflow: hidden; }
}
@media (max-width: 992px) {
  .split-layout { display: flex; flex-direction: column; min-height: 100vh; height: auto; } /* 恢复 flex-direction: column 确保顺序 */
}

/* 顶级 SaaS 标志性的柔和 Mesh Gradient (网格渐变背景) */
.mesh-bg {
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(at 0% 0%, rgba(224, 231, 255, 0.7) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(219, 234, 254, 0.6) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(243, 232, 255, 0.6) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(224, 242, 254, 0.6) 0px, transparent 50%);
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  animation: mesh-breathe 15s ease-in-out infinite alternate;
}

@keyframes mesh-breathe {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

/* 极简网格线 */
.grid-pattern {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  z-index: 1;
  pointer-events: none;
}

/* ---------- 3. 左侧品牌区 (55%) ---------- */
.split-left {
  flex: 0 0 55%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8%;
  z-index: 10;
  padding-bottom: 90px; /* 为固定的底部栏留出空间 */
  box-sizing: border-box;
}

.brand-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  animation: fade-in-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* 顶部徽标 */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 100px;
  color: #3b82f6;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.badge-dot {
  width: 6px; height: 6px; background: #3b82f6; border-radius: 50%;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* 标题 */
.brand-title {
  font-size: 56px; font-weight: 800; letter-spacing: -1px; margin-bottom: 24px;
  color: #0f172a; line-height: 1.15;
}
.brand-title span {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-subtitle {
  font-size: 17px; color: #475569; font-weight: 400; line-height: 1.7;
  margin-bottom: 48px; max-width: 520px;
}

/* 丰富的左侧内容：数据面板展示 (替代单调的列表) */
.dashboard-preview {
  position: relative;
  width: 100%;
  height: 220px;
}

.preview-card {
  position: absolute;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
  padding: 24px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: float-card 6s infinite alternate ease-in-out;
}
.preview-card:hover { transform: translateY(-5px) scale(1.02); z-index: 20; }

.card-main {
  top: 0; left: 0; width: 320px; z-index: 2;
  animation-delay: 0s;
}
.card-sub {
  bottom: 0; right: 40px; width: 260px; z-index: 1;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation-delay: -3s;
}

@keyframes float-card {
  0% { transform: translateY(0); }
  100% { transform: translateY(-12px); }
}

/* 面板内部骨架 */
.skeleton-title { width: 40%; height: 12px; background: #f1f5f9; border-radius: 6px; margin-bottom: 16px; }
.skeleton-data { font-size: 28px; font-weight: 800; color: #0f172a; margin-bottom: 16px; font-family: "Inter", sans-serif; }
.skeleton-chart { display: flex; align-items: flex-end; gap: 8px; height: 40px; }
.skeleton-bar { flex: 1; background: #e0e7ff; border-radius: 4px 4px 0 0; }
.skeleton-bar.active { background: #3b82f6; }

.skeleton-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.skeleton-icon { width: 32px; height: 32px; border-radius: 8px; background: #f0fdf4; color: #16a34a; display: flex; align-items: center; justify-content: center; }
.skeleton-line { flex: 1; height: 8px; background: #f1f5f9; border-radius: 4px; }


/* ---------- 4. 右侧登录区 (45%) ---------- */
.split-right {
  flex: 0 0 45%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column; 
  align-items: center;
  justify-content: flex-start; /* 修复 flex-center 导致的上下截断问题 */
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 24px 120px 24px; /* 增加顶部 padding 并为固定的底部栏留出足够空间 */
  box-sizing: border-box;
}
@media (max-width: 992px) {
  .split-right { height: auto; overflow-y: visible; flex: 1 0 auto; padding-bottom: 0; }
}

/* 独立圆角悬浮玻璃卡片 (纯白极简，高度压缩防遮挡) */
.login-card {
  width: 100%;
  max-width: 420px; /* 稍微收窄一点，更显精致 */
  padding: 40px 36px; /* 核心修复：大幅减少上下内边距，防止底部按钮被遮挡 */
  margin: auto 0; /* 配合 flex-start 实现安全居中 */
  flex-shrink: 0; /* 核心修复：防止在屏幕高度较小时卡片被压缩，导致内部内容被 overflow:hidden 截断 */
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  /* 顶级苹果风阴影：多层叠加，极其柔和 */
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.02), 
    0 10px 15px -3px rgba(0, 0, 0, 0.03),
    0 25px 50px -12px rgba(0, 0, 0, 0.08);
  animation: card-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both 0.2s;
  position: relative;
  z-index: 20;
  box-sizing: border-box; /* 确保内边距不撑大宽度 */
  overflow: hidden; /* 防止内部元素撑破卡片 */
}

@keyframes card-enter {
  0% { opacity: 0; transform: translateY(30px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header { 
  margin-bottom: 32px; /* 减少间距 */
  text-align: center; 
}
.login-header-icon {
  width: 48px; height: 48px; margin: 0 auto 16px;
  background: #f8fafc; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.login-header h2 { font-size: 24px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.login-header p { font-size: 14px; color: #64748b; }

/* ---------- 5. 输入控件 (压缩高度，完美对齐) ---------- */
.input-group { 
  position: relative; 
  margin-bottom: 20px; /* 减少间距 */
}

.input-control {
  width: 100%; 
  height: 52px; /* 核心修复：降低高度，节省垂直空间 */
  padding: 20px 16px 4px 16px; /* 重新校准文字位置 */
  background: #f1f5f9; /* 浅灰底色，与纯白卡片区分 */
  border: 1.5px solid transparent;
  border-radius: 14px;
  font-size: 15px; color: #0f172a; font-weight: 500;
  transition: all 0.2s ease;
  outline: none; font-family: inherit;
}
.input-control::placeholder { color: transparent; }

.input-label {
  position: absolute; left: 16px; top: 16px; /* 居中 */
  font-size: 14px; color: #64748b; pointer-events: none;
  transition: all 0.2s ease;
}

.input-control:hover { background: #e2e8f0; }

.input-control:focus {
  background: #ffffff; border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* 标签上浮 */
.input-control:focus ~ .input-label,
.input-control:not(:placeholder-shown) ~ .input-label,
.input-control:-webkit-autofill ~ .input-label {
  top: 6px; font-size: 11px; color: #3b82f6; font-weight: 600;
}
.input-control:not(:focus):not(:placeholder-shown) ~ .input-label,
.input-control:-webkit-autofill:not(:focus) ~ .input-label { 
  color: #64748b; 
}

/* 验证码专属排版 */
.cap-row { 
  display: flex; gap: 12px; margin-bottom: 24px; 
}
.cap-question {
  flex: 0 0 auto; 
  padding: 0 16px;
  height: 52px;
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #0f172a; font-family: "SF Mono", Consolas, monospace;
  font-size: 16px; letter-spacing: 1px;
  white-space: nowrap;
}
.cap-input-group { flex: 1; margin-bottom: 0; }

/* ---------- 6. 复选框与选项 ---------- */
.login-options {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; padding: 0 4px;
}

.remember-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: #475569; font-weight: 500; transition: color 0.2s;
}
.remember-label:hover { color: #0f172a; }
.remember-label input { display: none; }

.checkbox-custom {
  width: 18px; height: 18px; border: 1.5px solid #cbd5e1; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; background: #ffffff;
}
.remember-label input:checked + .checkbox-custom {
  background: #3b82f6; border-color: #3b82f6;
}
.check-icon {
  width: 10px; height: 10px; fill: none; stroke: white; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 16; stroke-dashoffset: 16;
  transition: stroke-dashoffset 0.2s ease;
}
.remember-label input:checked + .checkbox-custom .check-icon { stroke-dashoffset: 0; }

.forgot-link {
  font-size: 13px; color: #475569; font-weight: 500; text-decoration: none;
  transition: color 0.2s;
}
.forgot-link:hover { color: #3b82f6; }

/* ---------- 7. 顶级登录按钮 (纯粹的高级蓝) ---------- */
.login-btn {
  width: 100%; height: 52px; border: none; border-radius: 14px;
  background: #0f172a; /* 默认深邃黑，极简高级 */
  color: white; font-size: 15px; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}

.login-btn:hover {
  background: #3b82f6; /* Hover 时变成亮蓝色 */
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}
.login-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* ---------- 8. 底部辅助链接 (独立于卡片外部，完美居中) ---------- */
.bottom-links {
  margin-top: 32px; 
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  position: relative;
  padding-bottom: 0px;
}
.bottom-link {
  font-size: 13px; color: #64748b; text-decoration: none;
  transition: color 0.2s;
}
.bottom-link:hover { color: #0f172a; }
.link-divider {
  width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1;
}

/* 全局底部链接 (横跨全屏底部) */
.global-bottom-links {
  position: fixed; /* 强制固定在屏幕最底部 */
  bottom: 0;
  left: 0;
  width: 100%; /* 强制撑满屏幕宽度，避免 100vw 导致横向滚动条 */
  padding: 16px 20px;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999; /* 确保在最上层 */
  align-items: center;
  box-sizing: border-box;
  max-width: 100%; /* 防止超出屏幕 */
}
.footer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-nav a:hover {
  color: #0f172a;
}
.footer-copyright {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
  text-align: center;
}
.footer-copyright a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-copyright a:hover {
  color: #0f172a;
}
.link-divider {
  width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1;
}

/* ---------- 9. 错误提示 ---------- */
.login-error {
  margin-bottom: 20px; padding: 12px 16px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px;
  color: #b91c1c; font-size: 13px; display: flex; align-items: center; gap: 8px;
  animation: shake 0.4s ease both;
}

/* ---------- 10. 全局动画定义 ---------- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* ---------- 11. 手机端自动上下排版 (响应式) ---------- */
@media (max-width: 992px) {
  .split-layout { display: flex; flex-direction: column; height: auto; min-height: 100vh; overflow: visible; box-sizing: border-box; }
  .global-bottom-links {
    position: relative; /* 手机端恢复相对定位跟在内容最后 */
    bottom: auto;
    width: 100%;
    padding: 20px 20px 30px;
    margin-top: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    box-sizing: border-box;
  }
  .split-left {
    width: 100%; height: auto; min-height: auto; flex: 0 0 auto;
    padding: 50px 24px 30px; display: flex; justify-content: center; position: relative; z-index: 10; box-sizing: border-box; max-width: 100%;
  }
  .dashboard-preview { display: none; } /* 手机端隐藏复杂面板 */
  .brand-content { text-align: center; padding: 0; max-width: 100%; box-sizing: border-box; }
  .brand-badge { margin: 0 auto 20px; }
  .brand-title { font-size: 32px; margin-bottom: 12px; }
  .brand-subtitle { font-size: 15px; margin-bottom: 0; display: block; }
  
  .split-right {
    width: 100%; height: auto; flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 40px 24px 0px; overflow: visible; position: relative; z-index: 10; box-sizing: border-box; max-width: 100%;
  }
  .login-card {
    padding: 32px 24px; max-width: 100%; width: 100%; margin: 0 auto; box-sizing: border-box; overflow: hidden;
  }
  .login-header { margin-bottom: 24px; }
  .login-header h2 { font-size: 22px; }
  .cap-row { flex-direction: column; gap: 12px; }
  .cap-question { flex: none; width: 100%; }
  
  .trust-section { justify-content: center; margin-top: 32px; }
}

@media (max-width: 480px) {
  .split-left { padding: 40px 20px 20px; box-sizing: border-box; max-width: 100%; }
  .brand-title { font-size: 28px; }
  .brand-subtitle { font-size: 14px; }
  .login-card { padding: 28px 20px; border-radius: 20px; box-sizing: border-box; width: 100%; overflow: hidden; margin: 0 auto; }
  .split-right { padding: 20px 20px 0px; box-sizing: border-box; max-width: 100%; justify-content: flex-start; }
}

/* 修复入驻页表单网格在手机端显示问题 */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-col-span-2 {
    grid-column: 1 / -1;
  }
  .action-row {
    flex-direction: column;
    gap: 16px;
  }
  .btn-action {
    width: 100%;
  }
  .cap-question {
    width: 100%;
    flex: none;
  }
}

/* 信任背书头像组样式 (用于左侧底部) */
.trust-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}
.trust-avatars {
  display: flex;
}
.trust-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
  margin-left: -10px;
}
.trust-avatar:first-child { margin-left: 0; background: #10b981; }
.trust-avatar:nth-child(2) { background: #f59e0b; }
.trust-avatar:nth-child(3) { background: #6366f1; }
.trust-avatar-more {
  background: #f1f5f9;
  color: #64748b;
  border-color: #ffffff;
}
.trust-text {
  font-size: 13px;
  color: #64748b;
}
.trust-text strong {
  color: inherit;
  font-weight: 700;
}

/* 修复暗黑模式下的信任背书 */
[data-theme="dark"] .trust-section { border-top-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .trust-avatar { border-color: #0f172a; }
[data-theme="dark"] .trust-avatar-more { background: #1e293b; color: #94a3b8; border-color: #0f172a; }
[data-theme="dark"] .trust-text { color: #94a3b8; }
[data-theme="dark"] .trust-text strong { color: inherit; }