/**
 * LSRONG 登录弹窗增量样式
 * ---------------------------------------------------------------------------
 * 只作用于 .lsrong-auth 作用域；选择器优先级需高于公共登录面板的状态标题规则，
 * 才能把标题改造成可点击的登录方式切换 Tab。
 */

/* ---- 弹窗可视区与内部滚动 ------------------------------------------------- */
.modal-login-panel.lsrong-auth {
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  max-height: calc(var(--lsr-auth-viewport-height, 100dvh) - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.modal-login-panel.lsrong-auth .modal-close {
  right: 8px;
  top: 8px;
  color: #8f8f8f;
}
.modal-login-panel.lsrong-auth.modal-show {
  top: var(--lsr-auth-viewport-center, 50%);
}

/* ---- 登录方式切换 Tab ---------------------------------------------------- */
.modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: nowrap;
}
.modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs span {
  display: inline-block;
  width: auto;
  font-size: 16px;
  line-height: 1.4;
  color: #8a8a8a;
  cursor: pointer;
  padding: 0 2px 10px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
  -webkit-user-select: none;
  user-select: none;
}
.modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs span.current {
  display: inline-block;
  color: #323232;
  border-bottom-color: var(--lsr-primary);
}
.modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs span:hover {
  color: #323232;
}
.modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs span:focus-visible {
  outline: 2px solid var(--lsr-primary);
  outline-offset: 2px;
}

/* ---- 三个面板显隐 -------------------------------------------------------- */
.lsrong-auth .lsrong-auth-panel { display: none; }
.lsrong-auth .lsrong-auth-panel.is-current { display: block; }

.lsrong-auth .lsrong-auth-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 16px 50px 0 rgba(202, 202, 202, 0.2);
}

/* ---- 表单 ---------------------------------------------------------------- */
.lsrong-auth .lsrong-auth-form { margin: 0; }
.lsrong-auth .lsrong-auth-field { display: block; margin-bottom: 15px; }
.lsrong-auth .lsrong-auth-label {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: #525252;
  margin-bottom: 6px;
}
.lsrong-auth .lsrong-auth-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;
  color: #323232;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.lsrong-auth .lsrong-auth-input::placeholder { color: #8a8a8a; }
.lsrong-auth .lsrong-auth-input:hover { border-color: #d5d7de; }
.lsrong-auth .lsrong-auth-input:focus {
  border-color: var(--lsr-primary);
  box-shadow: 0 0 0 3px rgb(var(--lsr-primary-rgb) / 0.1);
}
.lsrong-auth .lsrong-auth-input:focus-visible {
  outline: 2px solid var(--lsr-primary);
  outline-offset: 1px;
}

.lsrong-auth .lsrong-auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #8a8a8a;
  margin-bottom: 10px;
}
.lsrong-auth .lsrong-auth-agree input { margin-top: 3px; accent-color: var(--lsr-primary); }
.lsrong-auth .lsrong-auth-agree a { color: var(--lsr-primary); text-decoration: none; }

.lsrong-auth .lsrong-auth-submit {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  padding: 0;
  font-size: 15px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}
.lsrong-auth .lsrong-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.lsrong-auth .lsrong-auth-submit:focus-visible { outline: 2px solid var(--lsr-primary); outline-offset: 2px; }

.lsrong-auth .lsrong-auth-foot {
  margin: 15px 0 0;
  text-align: center;
  font-size: 13px;
  color: #8a8a8a;
}
.lsrong-auth .lsrong-auth-link {
  color: var(--lsr-primary);
  text-decoration: none;
  cursor: pointer;
}
.lsrong-auth .lsrong-auth-link:hover { text-decoration: underline; }
.lsrong-auth .lsrong-auth-link:focus-visible { outline: 2px solid var(--lsr-primary); outline-offset: 2px; }

.lsrong-auth .lsrong-auth-error {
  margin: 0 0 10px;
  min-height: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: #d93026;
}
.lsrong-auth .lsrong-auth-error:empty { display: none; }
.lsrong-auth .lsrong-auth-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #8a8a8a;
}

/* ---- 微信扫码容器 -------------------------------------------------------- */
.lsrong-auth #lsrongWechatQr canvas,
.lsrong-auth #lsrongWechatQr table {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.lsrong-auth .lsrong-auth-qr-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: #8a8a8a;
  background: #f3f5f7;
  border-radius: 6px;
}

/* ---- 窄屏 ---------------------------------------------------------------- */
/* 基础仅在 ≥1024 给 .login_wrap 固定宽（72.14em）；<1024 时 width:100% 落空，
   .modal-login-panel 收缩到内容宽（195px），Tab 被挤压换行、账号登录纵向堆叠。
   这里给窄屏面板一个与视口成比例、上限 360px 的宽度，内容自然排开；
   .wxlogin-main 铺满，并回收基础 min-height:37.5em（525px）在窄屏造成的下方空白。 */
@media (max-width: 1023.5px) {
  .modal-login-panel.lsrong-auth .login_wrap { width: min(92vw, 360px); }
  .modal-login-panel.lsrong-auth .wxlogin-main {
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .modal-login-panel.lsrong-auth .login_wrap {
    width: min(calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px), 360px);
  }
  .modal-login-panel.lsrong-auth .wxlogin-main .wmc { width: 100%; }
  .modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs { gap: 20px; }
  .modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs span {
    min-height: 44px;
    font-size: 14px;
  }
  .lsrong-auth .lsrong-auth-card { padding: 15px; }
  .modal-login-panel.lsrong-auth .modal-close {
    width: 44px;
    height: 44px;
    line-height: 44px;
  }
}

/* ---- 登录 / 注册结果提示 ------------------------------------------------ */
.lsrong-auth-msg {
  display: none;
  min-height: 20px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #8a8a8a;
  background: #f3f5f7;
  border: 1px solid transparent;
}
.lsrong-auth-msg:not(:empty) { display: block; }
.lsrong-auth-msg.ok { color: #15803d; background: #eaf6ee; border-color: #c7ecd4; }
.lsrong-auth-msg.error { color: #dc2626; background: #fef2f2; border-color: #f4c8c8; }

/* 尊重减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .modal-login-panel.lsrong-auth .wxlogin-main h2.lsrong-auth-tabs span,
  .lsrong-auth .lsrong-auth-input { transition: none; }
}

/* ---------- B4 找回密码：图形验证码行 ---------- */
.lsrong-auth .lsrong-auth-captchabox { display: flex; gap: 10px; align-items: stretch; }
.lsrong-auth .lsrong-auth-captchabox .lsrong-auth-captcha-input { flex: 1; min-width: 0; }
.lsrong-auth .lsrong-auth-captcha-img {
  width: 108px;
  height: 40px;
  flex: none;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  cursor: pointer;
  background: #f7f8fa;
  object-fit: cover;
}
.lsrong-auth .lsrong-auth-captcha-img:hover { border-color: var(--lsr-primary); }
