/* =========================================================
   登录页样式（独立页面，不依赖其它样式表）
   版式：居中单卡片，顶部品牌 + 卡片表单 + 底部页脚
   ========================================================= */
:root {
  --primary: #2f6db5;
  --primary-deep: #1e5aa0;
  --text: #2b3a55;
  --muted: #7c8aa0;
  --border: #dfe6ef;
  --danger: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(255, 255, 255, .9), transparent 65%),
    linear-gradient(180deg, #f0f4fa 0%, #e6edf6 60%, #e2eaf4 100%);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* 整页固定在一屏内，不出现滚动条 */
}

/* 一屏布局：中部品牌+卡片垂直居中，页脚固定在页面底部 */
.login-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

.login-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ---------- 顶部品牌（左 Logo + 右「标题 / 副标题」两行） ---------- */
.login-head {
  text-align: center;
  margin-bottom: 22px;
}

.logo-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  text-align: left;
}

/* 站点设置里上传的 Logo（未上传时用内置默认图形） */
.logo-slot { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.logo-pic {
  display: block;
  width: auto;
  height: auto;
  max-height: 74px;
  max-width: 220px;
  object-fit: contain;
}

/* 站点名称 + 副标题（竖排两行，左对齐） */
.brand-words {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.wordmark {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text);
}

.slogan {
  display: block;
  margin: 8px 0 0;
  font-size: 14px;
  color: #5b6b85;
  letter-spacing: .5px;
  line-height: 1.4;
}

/* ---------- 登录卡片 ---------- */
.login-card {
  width: 100%;
  max-width: 392px;
  background: #fff;
  border-radius: 20px;
  padding: 34px 40px 30px;
  box-shadow:
    0 26px 60px rgba(43, 58, 85, .10),
    0 4px 14px rgba(43, 58, 85, .04);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.ipt {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0 16px;
  font-size: 14px;
  color: var(--text);
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}

.ipt::placeholder { color: #b6c0cf; }

.ipt:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 109, 181, .12);
}

.ipt-wrap { position: relative; }

.ipt-wrap .ipt { padding-right: 46px; }

.toggle-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.toggle-eye:hover { color: var(--primary); }

/* 记住密码 */
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  margin: 0 0 18px;
}

.remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 登录按钮 */
.btn-login {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #4185d8 0%, #2f6ec6 100%);
  box-shadow: 0 12px 26px rgba(47, 110, 198, .35);
  transition: transform .12s, box-shadow .18s, opacity .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login span { text-indent: 6px; } /* 视觉上抵消字距造成的偏移 */

.btn-login:hover {
  background: linear-gradient(180deg, #4a8de0 0%, #3578d0 100%);
  box-shadow: 0 14px 30px rgba(47, 110, 198, .42);
}

.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { opacity: .65; cursor: not-allowed; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 其他登录方式 ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 14px;
  color: #9aa7ba;
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e6ecf3;
}

.btn-wechat {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: border-color .15s, box-shadow .15s;
}

.btn-wechat:hover {
  border-color: #b9d3f0;
  box-shadow: 0 6px 16px rgba(47, 109, 181, .10);
}

/* ---------- 页脚 ---------- */
.login-foot {
  flex: 0 0 auto;
  padding-top: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.85;
}

.login-foot p { margin: 0; }

.foot-link {
  color: var(--muted);
  text-decoration: none;
}

.foot-link:hover { color: var(--primary); }

.foot-sep { margin: 0 10px; color: #c3ccd8; }

.hotline { margin-top: 2px; }

.hotline a {
  color: var(--primary-deep);
  font-weight: 700;
  text-decoration: none;
}

.hotline a:hover { text-decoration: underline; }

/* ---------- 错误提示 ---------- */
.alert {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert.show { display: flex; }
.alert .ico { display: flex; }

/* ---------- 窄屏 ---------- */
@media (max-width: 560px) {
  .login-page { padding: 14px 16px; }
  .login-head { margin-bottom: 16px; }
  .logo-row { gap: 14px; }
  .logo-pic { max-height: 58px; max-width: 150px; }
  .wordmark { font-size: 26px; letter-spacing: 2px; }
  .slogan { font-size: 13px; margin-top: 6px; }
  .login-card { padding: 26px 24px 24px; border-radius: 18px; }
  .btn-login { letter-spacing: 4px; }
  .login-foot { font-size: 11.5px; line-height: 1.7; }
}

/* ---------- 矮屏压缩：保证一屏放下，不出现滚动 ---------- */
@media (max-height: 780px) {
  .login-head { margin-bottom: 16px; }
  .logo-pic { max-height: 62px; }
  .wordmark { font-size: 28px; }
  .slogan { margin-top: 6px; }
  .login-card { padding: 26px 36px 24px; }
  .field { margin-bottom: 13px; }
  .remember { margin-bottom: 14px; }
  .divider { margin: 16px 0 12px; }
  .login-foot { padding-top: 12px; }
}

@media (max-height: 660px) {
  .login-page { padding: 10px 16px; }
  .login-head { margin-bottom: 10px; }
  .logo-row { gap: 12px; }
  .logo-pic { max-height: 50px; max-width: 130px; }
  .wordmark { font-size: 24px; }
  .slogan { font-size: 12.5px; margin-top: 4px; }
  .login-card { padding: 20px 32px 18px; }
  .field { margin-bottom: 10px; }
  .field label { margin-bottom: 6px; font-size: 13px; }
  .ipt { height: 42px; }
  .remember { margin-bottom: 11px; }
  .btn-login { height: 44px; font-size: 15px; }
  .divider { margin: 12px 0 10px; }
  .btn-wechat { height: 42px; font-size: 14px; }
  .login-foot { padding-top: 8px; font-size: 11.5px; line-height: 1.65; }
}

/* 极矮屏（如嵌入窗口）最后兜底：允许内部滚动，避免内容被裁掉 */
@media (max-height: 520px) {
  body { overflow: auto; }
  .login-page { height: auto; min-height: 100vh; }
}
