/* mobile-auth-51banban.css
 * 移动端登录/注册/找回密码页面 51banban 风格统一样式
 * 仅在 max-width:767px 生效，覆盖原有豪华版卡片样式
 * 设计基准：375px 视口，自然滚动，内容与 footer 均走文档流
 */

.mobile-only {
  display: none;
}

@media (max-width: 767px) {
  html,
  body,
  body.login-page,
  body.reg-page,
  body.forgot-page {
    background: #f9f9f9 !important;
    min-height: 100% !important;
    height: auto !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-text-size-adjust: 100%;
  }

  body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
  }

  /* 隐藏 PC 与旧版移动端的页脚、品牌块、分割线等 */
  body.login-page .pc-only,
  body.reg-page .pc-only,
  body.forgot-page .pc-only,
  body.login-page .login-footer,
  body.reg-page .reg-footer,
  body.forgot-page .forgot-footer,
  body.login-page .login-pc-header,
  body.reg-page .reg-pc-header,
  body.forgot-page .header,
  body.login-page .login-brand,
  body.reg-page .reg-brand,
  body.forgot-page .forgot-brand,
  body.login-page .divider,
  body.login-page .quick-login,
  body.login-page .login-bottom,
  body.reg-page .reg-bottom,
  body.forgot-page .forgot-bottom,
  body.forgot-page .security-note,
  body.forgot-page .steps,
  body.reg-page .agree-row {
    display: none !important;
  }

  /* mobile-only 容器：纵向 flex，高度由内容决定，避免底部白色底色过长 */
  body.login-page .mobile-only,
  body.reg-page .mobile-only,
  body.forgot-page .mobile-only {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #f9f9f9 !important;
  }

  /* 顶部固定导航：与 m.51banban.com 一致，白底、居中、最大宽度 768px */
  .m51-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 768px;
    height: 52px;
    background: #fff;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 17px;
    box-sizing: border-box;
  }

  .m51-header .m51-back,
  .m51-header .m51-home {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  .m51-header .m51-back svg,
  .m51-header .m51-home svg {
    width: 22px;
    height: 22px;
    stroke: #333;
    fill: none;
    stroke-width: 2;
  }

  .m51-header .m51-home svg {
    fill: #333;
    stroke: none;
  }

  .m51-header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 17px;
    color: #202020;
    font-weight: bold;
    margin: 0;
    text-align: center;
    white-space: nowrap;
  }

  /* 主内容区：改为块级文档流，高度完全由内容决定，避免底部白色留白过长 */
  .m51-wrap {
    display: block;
    padding: 52px 17px 40px;
    max-width: 768px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
  }

  /* 标题区 */
  .m51-auth-hd {
    padding: 19px 6px 32px;
    flex-shrink: 0;
  }

  .m51-auth-hd h2 {
    font-size: 23px;
    color: #000;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
  }

  .m51-auth-hd p {
    font-size: 14px;
    color: #666;
    padding-top: 5px;
    margin: 0;
  }

  .m51-auth-hd a {
    color: #266eff !important;
    text-decoration: none;
  }

  /* 表单区域：flex 列，高度由内容决定 */
  .m51-form {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
  }

  .m51-item {
    position: relative;
    margin-bottom: 18px;
    flex-shrink: 0;
  }

  .m51-input {
    width: 100%;
    box-sizing: border-box;
    line-height: 19px;
    padding: 13px 19px !important;
    border-radius: 23px;
    background: #f5f7f7;
    font-size: 14px;
    color: #202020;
    border: none;
    outline: none;
    -webkit-appearance: none;
    height: auto !important;
    min-height: 0 !important;
  }

  .m51-input::placeholder {
    color: #c5c8cf;
  }

  .m51-eyes {
    width: 46px;
    height: 46px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 24;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .m51-form .m51-eyes::after {
    content: "";
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2393a6ba'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    display: block;
  }

  .m51-form .m51-eyes.on::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2393a6ba'%3E%3Cpath d='M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z'/%3E%3C/svg%3E");
  }

  .m51-form .m51-code-btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 46px;
    line-height: 46px;
    padding: 0 19px;
    background: none;
    border: none;
    font-size: 14px;
    color: #606060;
    cursor: pointer;
  }

  .m51-form .m51-code-btn:disabled {
    opacity: 0.3;
  }

  /* 按钮：与输入框保持固定间距，不再强行撑满屏幕 */
  .m51-btn-box {
    margin-top: 16px;
    margin-bottom: 10px;
    flex-shrink: 0;
  }

  .m51-btn {
    width: 100%;
    display: block;
    font-size: 17px;
    border-radius: 23px;
    background: #266eff;
    color: #fff;
    box-shadow: 0 1px 4px rgba(38, 110, 255, 0.18);
    padding: 11px 0;
    border: none;
    text-align: center;
    cursor: pointer;
    -webkit-appearance: none;
  }

  .m51-btn:disabled {
    background: #cbd5e0;
    box-shadow: none;
  }

  .m51-toggle {
    display: block;
    text-align: center;
    font-size: 15px;
    color: #666;
    line-height: 46px;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
  }

  /* 底部：跟随文档流，避免固定定位造成底部空白 */
  .m51-footer {
    position: static;
    text-align: center;
    padding: 12px 0 0;
    margin-top: 10px;
    z-index: 100;
  }

  .m51-footer .m51-wechat,
  .m51-footer .m51-terms {
    pointer-events: auto;
  }

  .m51-footer .m51-terms {
    text-align: center !important;
  }

  .m51-footer .m51-wechat {
    width: 46px;
    height: 46px;
    display: block;
    margin: 0 auto 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2307c160'%3E%3Cpath d='M8.69 4C5.43 4 2.8 6.13 2.8 8.78c0 1.49.83 2.83 2.13 3.73l-.53 1.6 1.86-.94c.66.13 1.2.27 1.87.27h.17a4.1 4.1 0 0 1-.17-1.16c0-2.83 2.45-5.14 5.48-5.14h.17C13.4 5.1 11.26 4 8.69 4zm-2.1 3.36c-.33 0-.67-.2-.84-.53-.17-.33-.17-.7 0-1.03.17-.33.5-.53.84-.53.33 0 .67.2.84.53.17.33.17.7 0 1.03-.17.33-.5.53-.84.53zm4.2 0c-.33 0-.67-.2-.84-.53-.17-.33-.17-.7 0-1.03.17-.33.5-.53.84-.53.33 0 .67.2.84.53.17.33.17.7 0 1.03-.17.33-.5.53-.84.53zM21.2 12.28c0-2.22-2.23-4.04-4.98-4.04s-4.98 1.81-4.98 4.04c0 2.23 2.23 4.04 4.98 4.04.58 0 1.16-.1 1.74-.29l1.58.85-.44-1.32c1.18-.76 2.1-1.92 2.1-3.28zm-6.62-.59c-.27 0-.54-.16-.68-.43-.14-.27-.14-.57 0-.84.14-.27.4-.43.68-.43.27 0 .54.16.68.43.14.27.14.57 0 .84-.14.27-.4.43-.68.43zm3.28 0c-.27 0-.54-.16-.68-.43-.14-.27-.14-.57 0-.84.14-.27.4-.43.68-.43.27 0 .54.16.68.43.14.27.14.57 0 .84-.14.27-.4.43-.68.43z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    overflow: hidden;
    text-indent: -9999px;
    border: none;
    background-color: transparent;
    cursor: pointer;
  }

  .m51-footer .m51-terms {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    margin: 0;
  }

  .m51-footer .m51-terms a {
    color: #266eff !important;
    text-decoration: none;
  }

  /* 提示条 */
  .m51-alert {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .m51-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .m51-alert-error {
    background: #fef2f2;
    color: #e74c3c;
  }

  .m51-alert-success {
    background: #f0fdf4;
    color: #22c55e;
  }

  /* 同意协议行（注册页） */
  .m51-agree {
    margin: -6px 0 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .m51-agree input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #266eff;
  }

  .m51-agree span {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
  }

  .m51-agree a {
    color: #266eff !important;
  }

  /* 忘记密码步骤 */
  .m51-step-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 24px;
    flex-shrink: 0;
  }

  .m51-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #93a6ba;
  }

  .m51-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid #d8e6f2;
    background: #fff;
    color: #8ba0b4;
  }

  .m51-step.active .m51-step-num {
    background: #266eff;
    border-color: #266eff;
    color: #fff;
  }

  .m51-step.active {
    color: #266eff;
    font-weight: 500;
  }

  .m51-step-line {
    width: 24px;
    height: 1px;
    background: #dfeaf3;
  }

  /* 成功提示 */
  .m51-success-box {
    text-align: center;
    padding: 24px 0 16px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .m51-success-box .m51-check-icon {
    width: 70px;
    height: 70px;
    background: #48bb78;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
  }

  .m51-success-box .m51-check-icon svg {
    width: 34px;
    height: 34px;
    fill: #fff;
  }

  .m51-success-box h3 {
    font-size: 20px;
    color: #000;
    margin-bottom: 8px;
    font-weight: bold;
  }

  .m51-success-box p {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
  }

  /* 隐藏主站可能引入的冲突元素 */
  body.login-page .page-search-header,
  body.reg-page .page-search-header,
  body.forgot-page .page-search-header,
  body.login-page .login-m-header,
  body.reg-page .reg-m-header {
    display: none !important;
  }
}
