/* ═══════════════════════════════════════════════════
   H5 登录页面样式 — 响应式适配 PC / 移动端 / 微信浏览器
   ═══════════════════════════════════════════════════ */

/* ── 基础重置 ──────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Segoe UI', Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 背景渐变 ──────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* ★__LOGIN_INK_20261120j__ 去微信绿化：登录页背景改企仕墨蓝家族 */
  background: linear-gradient(135deg, #073543 0%, #0a4657 40%, #0e7490 100%);
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
}

/* 背景装饰圆 */
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}
.login-page::before {
  width: 500px;
  height: 500px;
  background: #fff;
  top: -150px;
  right: -150px;
}
.login-page::after {
  width: 300px;
  height: 300px;
  background: #0e7490;
  bottom: -80px;
  left: -80px;
}

/* ── 登录卡片 ──────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 880px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: cardFadeIn 0.5s ease;
}

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

/* ── Logo 区域 ─────────────────────────────────────── */
.logo-area {
  text-align: center;
  padding: 32px 20px 16px;
}
.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #0a4657, #0e7490);
  border-radius: 16px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.3);
}
.logo-area h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  letter-spacing: 1px;
}

/* ── Tab 切换（移动端用） ──────────────────────────── */
.tabs {
  display: none; /* PC 端隐藏 */
  border-bottom: 1px solid #eee;
  margin: 0 20px;
}
.tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-size: 15px;
  color: #999;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.tab.active {
  color: #0e7490;
  font-weight: 600;
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #0e7490;
  border-radius: 3px;
}

/* ── 登录内容区 ────────────────────────────────────── */
.login-body {
  display: flex;
  padding: 28px 36px 20px;
  gap: 0;
}

/* ── 表单区域 ──────────────────────────────────────── */
.form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: #bbb;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}
.input-group input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  color: #333;
  transition: all 0.25s;
  outline: none;
  background: #fafafa;
}
.input-group input::placeholder {
  color: #bbb;
}
.input-group input:focus {
  border-color: #0e7490;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.10);
}

/* ── 按钮 ──────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0e7490, #0a5d75);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ── WxLogin SDK 容器（真实模式） ───────────────────── */
/* WxLogin SDK 创建的 iframe 固定为 300x400，容器必须容纳 */
.wxlogin-container {
  width: 300px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.wxlogin-container iframe {
  border: none;
  vertical-align: middle;
}
/* 二维码加载失败提示 */
.wxlogin-error {
  text-align: center;
  padding: 20px;
  color: #e74c3c;
  font-size: 13px;
  line-height: 1.6;
}
.wxlogin-error h4 {
  color: #e74c3c;
  font-size: 15px;
  margin-bottom: 8px;
}
.wxlogin-error p {
  color: #999;
  font-size: 12px;
  margin-top: 6px;
}

/* ── 二维码区域 ────────────────────────────────────── */
.qr-section {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-left: 32px;
  border-left: 1px solid #f0f0f0;
}
.qr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}
.qr-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  background: #f5f5f5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* WxLogin 真实模式：容器需要容纳 300×400 的 iframe */
.qr-wrapper.wxlogin-mode {
  width: 300px;
  height: 400px;
  overflow: visible;
  background: transparent;
}
.qr-image {
  width: 200px;
  height: 200px;
  border-radius: 8px;
}
.qr-loading {
  position: absolute;
  inset: 0;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #999;
  font-size: 13px;
}
.qr-mask {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  backdrop-filter: blur(2px);
}
.qr-mask-text {
  text-align: center;
}
.qr-mask-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}
.qr-mask-text p {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
}
.btn-refresh {
  padding: 8px 24px;
  border: 2px solid #0e7490;
  background: #fff;
  color: #0e7490;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-refresh:hover {
  background: #0e7490;
  color: #fff;
}
.qr-tip {
  margin-top: 14px;
  font-size: 13px;
  color: #999;
  text-align: center;
}
.qr-status {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
  transition: all 0.3s;
}
.qr-status.success {
  color: #0e7490;
  font-weight: 600;
}
.qr-status.waiting {
  color: #999;
}

/* 模拟扫码按钮 */
.btn-mock {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px dashed #0e7490;
  background: rgba(14, 116, 144, 0.06);
  color: #0e7490;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-mock:hover {
  background: rgba(14, 116, 144, 0.12);
}

/* ── 表单提示 ──────────────────────────────────────── */
.form-hint {
  font-size: 13px;
  color: #e74c3c;
  text-align: center;
  min-height: 18px;
}

/* ── 底部 ──────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 16px 20px 24px;
  font-size: 12px;
  color: #bbb;
}
.footer a {
  color: #0e7490;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ── Spinner ───────────────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: #0e7490;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── 微信跳转页 ────────────────────────────────────── */
.wechat-redirect {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0e7490 0%, #0a5d75 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.redirect-content {
  text-align: center;
  color: #fff;
}
.redirect-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}
.redirect-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}
.redirect-content p {
  font-size: 14px;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════
   响应式 —— PC 端（≥768px）
   ═══════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .login-card {
    /* PC 端卡片更宽 */
  }
  .login-body {
    flex-direction: row;
  }
  /* PC 端隐藏 Tab */
  .tabs {
    display: none;
  }
  .form-section {
    display: flex;
  }
  .qr-section {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════
   响应式 —— 移动端（<768px）
   ═══════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .login-page {
    padding: 0;
    align-items: stretch;
  }
  .login-card {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .logo-area {
    padding: 40px 20px 12px;
  }
  .login-body {
    flex-direction: column;
    padding: 12px 24px 12px;
    gap: 0;
  }
  /* 移动端显示 Tab */
  .tabs {
    display: flex;
    margin: 0 24px;
  }
  /* 移动端：只显示当前选中的部分 */
  .form-section {
    display: none;
    padding-right: 0;
    padding-top: 24px;
  }
  .qr-section {
    display: none;
    padding-left: 0;
    padding-top: 24px;
    border-left: none;
    border-top: 1px solid #f0f0f0;
  }
  .form-section.active,
  .qr-section.active {
    display: flex;
  }
  .qr-wrapper {
    width: 200px;
    height: 200px;
  }
  .qr-image {
    width: 180px;
    height: 180px;
  }
  .footer {
    padding: 24px 20px 40px;
  }
}

/* ═══════════════════════════════════════════════════
   超小屏（<375px）
   ═══════════════════════════════════════════════════ */
@media (max-width: 374px) {
  .login-body {
    padding: 12px 16px;
  }
  .logo-area h1 {
    font-size: 20px;
  }
}
