/* ===== 登录页专属样式（基于原型 login.css，覆盖 vue-page.css 框架级约束） ===== */

/* ===== 覆盖 vue-page.css 的全局约束 ===== */
html,
body {
    overflow: auto;
}

body {
    background: #F0F3F7 url('../../assets/login/page-bg.png') center / cover no-repeat;
}

body.login-body #app {
    width: 100%;
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* ===== 登录页布局（设计稿 1440×900） ===== */
/* 卡片高度变量 + banner 宽推导：矮屏断点只改 --card-h，卡片/banner 实际渲染宽（aspect-ratio）
   与验证码弹窗定位变量同步联动；变量挂 :root —— 阿里云验证码弹窗为 body 级节点，
   不在 .login-page 子树内，只有根作用域变量才能被其继承 */
:root {
    --card-h: 38.125rem;                         /* 610px */
    --banner-w: calc(var(--card-h) * 710 / 610); /* =44.375rem */
}

.login-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-width: 77.5rem;
    display: flex;
    flex-direction: column;
    row-gap: 1.5rem;
    overflow: hidden auto;
}

/* 左上角平台标题 */
.login-title {
    flex-shrink: 0;
    margin: 2.5rem 0 0 3.75rem;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.448;
    color: #051C3B;
    white-space: nowrap;
}

/* 中央白色卡片：宽度由高度按设计比例 1162:610 推导，
   矮屏媒体查询压缩高度时宽度同步等比收窄，不再出现「矮而宽」的变形 */
.login-card {
    flex-shrink: 0;
    margin: auto;
    width: 72.625rem; /* 不支持 aspect-ratio 的旧浏览器兜底（各断点另有 @supports not 分级值） */
    height: var(--card-h);
    aspect-ratio: 1162 / 610;
    display: flex;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px 0 rgba(88, 146, 200, 0.2);
    overflow: hidden;
}

@supports (aspect-ratio: 1) {
    .login-card {
        width: auto; /* 宽度交给 aspect-ratio 由高度推导 */
        /* 窄窗口（如浏览器半屏、窗口高而窄）下卡片宽受限时，高度随比例联动压低，不横向溢出；
           两侧各留 1rem 安全边距 */
        max-width: calc(100vw - 2rem);
    }
}

/* ===== 左侧宣传位 ===== */
/* 宽度按素材原生比例 710:610 随卡片高度自适应，矮屏压缩高度时宣传位等比变窄，cover 不裁切海报上下内容 */
.login-banner {
    position: relative;
    width: 44.375rem; /* 不支持 aspect-ratio 的旧浏览器兜底（各断点另有 @supports not 分级值） */
    height: 100%;
    flex-shrink: 0;
    aspect-ratio: 710 / 610;
    background: #043397;
}

@supports (aspect-ratio: 1) {
    .login-banner {
        width: auto; /* 宽度随卡片高度按比例推导 */
    }
}

.login-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.banner-carousel {
    width: 100%;
    height: 100%;
}

.banner-carousel .el-carousel__container {
    height: 100%;
}

/* 轮播指示条：6 个 12×4 圆角条 */
.login-dots {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 100px;
    z-index: 3;
}

.login-dots .dot {
    width: 0.75rem;
    height: 0.25rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.2s;
}

.login-dots .dot.active {
    background: #fff;
}

/* ===== 右侧表单区 ===== */
.login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4.9375rem;
}

.login-form>* {
    width: 19.875rem;
    flex-shrink: 0;
}

/* 登录方式页签 */
.login-tabs {
    display: flex;
    gap: 2.25rem;
}

.login-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    line-height: 1.222;
    color: var(--text-3);
    cursor: pointer;
    user-select: none;
}

.login-tab::after {
    content: '';
    width: 2.25rem;
    height: 0.1875rem;
    border-radius: 100px;
    background: transparent;
}

.login-tab.active {
    font-weight: 700;
    color: var(--text-1);
}

.login-tab.active::after {
    background: var(--brand);
}

/* ===== 输入框组 ===== */
.login-inputs {
    margin-top: 3.125rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input {
    height: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3125rem 0.75rem;
    background: #fff;
    border: 1px solid #C4C8CF;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.login-input:hover {
    border-color: #9AA5B1;
}

.login-input:focus-within {
    border-color: var(--brand);
}

.login-input .input-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.login-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    line-height: 1.375;
    color: var(--text-1);
}

.login-input input::placeholder {
    color: #AAB3BD;
}

.login-input .eye-toggle {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.login-input .eye-toggle img {
    width: 1rem;
    height: 1rem;
    display: block;
}

/* 获取验证码按钮 */
.login-input .code-btn {
    position: relative;
    left: 0.5rem;
    flex-shrink: 0;
    height: 2rem;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    background: var(--brand);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.571;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s;
}

.login-input .code-btn:hover:not(:disabled) {
    background: #2B63C2;
}

.login-input .code-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== 按钮组 ===== */
.login-buttons {
    margin-top: 1.875rem;
    display: flex;
    gap: 1rem;
}

.login-btn {
    width: 9.4375rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.375;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-reset {
    background: #fff;
    border: 1px solid var(--brand);
    color: var(--brand);
}

.btn-reset:hover {
    background: rgba(51, 114, 216, 0.06);
}

.btn-submit {
    background: var(--brand);
    border: 1px solid var(--brand);
    color: #fff;
}

.btn-submit:hover {
    background: #2B63C2;
    border-color: #2B63C2;
}

/* ===== 记住用户名与登录方式切换 ===== */
.login-remember {
    margin-top: 1rem;
    display: flex;
    /* justify-content: space-between; */
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

/* .phone-login-account .login-remember {
    justify-content: flex-end;
} */

.mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.571;
    color: var(--brand);
    cursor: pointer;
    user-select: none;
}

.mode-switch:hover {
    opacity: 0.8;
}

.mode-switch img {
    width: 1rem;
    height: 1rem;
    display: block;
}

.login-remember .el-checkbox {
    --el-checkbox-height: 1.375rem;
    --el-checkbox-input-width: 1rem;
    --el-checkbox-input-height: 1rem;
    --el-checkbox-text-color: var(--text-3);
}

.login-remember .el-checkbox .el-checkbox__inner::after {
    left: 0.3125rem;
    top: 0.125rem;
}

/* ===== 二维码与客服信息 ===== */
.login-info {
    /* 上边距收窄：二维码上移，卡片底部预留呼吸空间（卡片定高、内容顶对齐，减小 margin 即同时产生底部留白） */
    margin-top: 3.5rem;
    display: flex;
    align-items: center;
    gap: 1.875rem;
}

.login-qr {
    padding: 0.375rem;
    border: 1px solid #7EAEF5;
    border-radius: 6px;
}

.login-qr img {
    width: 6.5rem;
    height: 6.5rem;
    display: block;
}

.qr-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.571;
    color: var(--brand);
    margin-bottom: 0.125rem;
}

.qr-text {
    font-size: 0.75rem;
    line-height: 1.448;
    color: var(--text-3);
}

.qr-divider {
    border-top: 1px dashed #A0BFDC;
    margin: 0.25rem 0;
}

/* ===== 底部备案信息 ===== */
.login-footer {
    flex-shrink: 0;
    margin: 0 0 1.625rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.75rem;
    line-height: 1.448;
    color: var(--text-3);
}

.beian-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.beian-row img {
    width: 0.9375rem;
    height: 1.0625rem;
    display: block;
}

/* ===== 无痕验证弹窗（popup）定制：不隐藏弹窗，仅隐藏关闭按钮 ===== */

/* 隐藏弹窗关闭按钮（必须滑动通过，不能手动关闭） */
#aliyunCaptcha-window-popup [class*="close"],
#aliyunCaptcha-window-popup [id*="close"] {
    display: none !important;
}

/* 弹窗主体美化（圆角 + 阴影），仅作用于弹窗不作用于遮罩 */
#aliyunCaptcha-window-popup {
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(13, 42, 85, 0.25);
    overflow: hidden;
    /* calc() 精确定位：弹窗水平居中于表单区域
       表单中心 = 卡片左边距(vw-卡片宽)/2 + banner宽 + 表单宽/2 = vw/2 + banner宽/2
       banner 宽取自 :root 变量，矮屏压缩高度时 aspect-ratio 联动收窄，弹窗自动跟随表单中心，无需JS监听 */
    top: 46% !important;
    left: calc(50% + var(--banner-w, 44.375rem) / 2) !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    margin: 0 !important;
}

/* 旧版兼容（防止残留类影响） */
.maskHeader,
.tipsImage,
.tipsTitle {
    display: none !important;
}

/* ===== 弹窗样式已提取至 dialog-common.css，登录页 + 主框架页共用 ===== */

/* ===== 矮屏（笔记本）适配 ===== */
@media (max-height: 840px) {
    :root {
        --card-h: 33.75rem; /* 540px，卡片/banner 宽度由 aspect-ratio 自动联动收窄 */
    }

    .login-form {
        padding-top: 2.75rem;
    }

    .login-inputs {
        margin-top: 2.25rem;
    }

    .login-info {
        margin-top: 1.75rem;
    }
}

@media (max-height: 760px) {
    :root {
        --card-h: 30.625rem; /* 490px */
    }

    .login-title {
        margin-top: 1.5rem;
    }

    .login-form {
        padding-top: 2rem;
    }

    .login-inputs {
        margin-top: 1.75rem;
    }

    .login-buttons {
        margin-top: 1.5rem;
    }

    .login-info {
        margin-top: 1.25rem;
    }
}

/* ===== 宽度自适应（≥1260px 常规 PC 不受影响，以下断点仅窄屏生效） ===== */

/* 窄屏 PC / 浏览器半屏：卡片宽度由 aspect-ratio 随可用空间自动收窄，无需手工分级；
   弹窗定位变量始终由 --card-h 推导，与实际渲染宽一致，此断点下无需覆盖 */
@media (max-width: 1260px) {
    .login-page {
        min-width: 0;
    }

    .login-title {
        margin-left: 2rem;
        font-size: 2rem;
    }
}

/* 旧浏览器兜底：不支持 aspect-ratio 时，卡片/banner 按原分级固定宽高渲染（原行为）；
   此类浏览器同样不支持 CSS 变量，height 须用字面值；宽高比按 1162:610 / 710:610 与变量推导保持一致 */
@supports not (aspect-ratio: 1) {
    @media (max-height: 840px) {
        .login-card {
            height: 33.75rem;
            width: 64.375rem; /* 540×1162/610 */
        }

        .login-banner {
            width: 39.375rem; /* 540×710/610 */
        }
    }

    @media (max-height: 760px) {
        .login-card {
            height: 30.625rem;
            width: 58.4375rem; /* 490×1162/610 */
        }

        .login-banner {
            width: 35.75rem; /* 490×710/610 */
        }
    }

    @media (max-width: 1260px) {
        .login-card {
            width: 60rem;
        }

        .login-banner {
            width: 33.75rem;
        }
    }
}

/* 平板竖屏 / 小窗口：隐藏宣传轮播，仅保留登录表单卡片 */
@media (max-width: 1024px) {
    .login-card {
        width: 30rem;
    }

    .login-banner {
        display: none;
    }

    /* banner 隐藏后表单即全部内容，弹窗偏移归零 = 视口居中 = 表单居中 */
    :root {
        --banner-w: 0rem;
    }
}

/* 手机：卡片占满可用宽度，按钮改弹性均分 */
@media (max-width: 540px) {
    .login-page {
        row-gap: 1rem;
    }

    /* 卡片改弹性全宽，aspect-ratio 停止作用，弹窗保持视口居中 */
    :root {
        --banner-w: 0rem;
    }

    .login-title {
        margin: 1.5rem auto 0;
        font-size: 1.5rem;
        white-space: normal;
        text-align: center;
        padding: 0 1rem;
    }

    .login-card {
        width: calc(100% - 2rem);
        max-width: 30rem;
        aspect-ratio: auto;
        height: auto;
    }

    .login-form {
        padding: 2.75rem 1rem 2rem; /* 卡片 height:auto，底部内边距预留二维码下方空间 */
    }

    .login-form>* {
        width: 100%;
        max-width: 19.875rem;
    }

    .login-buttons {
        gap: 0.75rem;
    }

    .login-btn {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .login-input .code-btn {
        left: 0;
    }

    .login-info {
        gap: 1rem;
    }

    .login-remember {
        flex-wrap: wrap;
        justify-content: center;
    }
}
