/* 浅色双栏登录页（保留入场 / 登录成功过渡） */
html.login-html,
body.login-body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body.login-body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #334155;
    background: #d6d9f5;
    overflow-x: hidden;
}

.login-stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.55) 0%, transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.4) 0%, transparent 26%),
        radial-gradient(circle at 80% 78%, rgba(186, 210, 255, 0.55) 0%, transparent 34%),
        linear-gradient(135deg, #c7c4f0 0%, #b8c7f5 42%, #9ec8f4 100%);
    animation: loginBgIn 1s ease both;
}

.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
    background-size: 56px 32px;
    transform: perspective(600px) rotateX(58deg) scale(1.35);
    transform-origin: center 70%;
    pointer-events: none;
}

.login-vignette {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 90%, rgba(255, 255, 255, 0.35), transparent 24%),
        radial-gradient(circle at 92% 88%, rgba(160, 200, 255, 0.35), transparent 26%);
}

@keyframes loginBgIn {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: scale(1); }
}

/* ---- 顶栏 ---- */
.login-topbar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 88px;
    padding: 0 clamp(24px, 4vw, 56px);
    flex: 0 0 auto;
    animation: loginFadeDown 0.7s ease both;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    color: #1e293b;
    text-decoration: none;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.login-brand span {
    font-weight: 700;
    line-height: 1.1;
}

.login-brand img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.login-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.login-top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    background: transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.login-top-link:hover {
    background: rgba(255, 255, 255, 0.16);
}

.login-top-link.is-solid {
    background: #fff;
    color: #4f7cff;
    border-color: #fff;
}

.login-top-link.is-solid:hover {
    background: #f5f8ff;
}

@keyframes loginFadeDown {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- 主体布局（参考：左插画区 + 右登录卡） ---- */
.login-main {
    position: relative;
    z-index: 2;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(480px, 1.05fr);
    align-items: center;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 clamp(24px, 4vw, 64px) 20px clamp(12px, 2vw, 36px);
    box-sizing: border-box;
}

.login-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 2vw 0 0;
    box-sizing: border-box;
    animation: loginHeroIn 0.9s 0.1s ease both;
}

.login-hero img {
    width: min(96%, 860px);
    max-width: 100%;
    height: auto;
    display: block;
    transform: none;
    filter: drop-shadow(0 18px 30px rgba(80, 100, 180, 0.22));
}

@keyframes loginHeroIn {
    from { opacity: 0; transform: translateX(-28px); }
    to { opacity: 1; transform: translateX(0); }
}

.login-panel {
    position: relative;
    width: min(100%, 520px);
    justify-self: end;
    align-self: center;
    margin: 0 clamp(8px, 2.5vw, 48px) 0 0;
    transform: none;
    animation: loginPanelIn 0.9s 0.18s ease both;
}

@keyframes loginPanelIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-panel-frame {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 48px 44px 28px;
    box-shadow: none;
    overflow: hidden;
}

.login-panel-title {
    margin: 0 0 34px;
    text-align: center;
    font-size: 32px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 1px;
}

.login-panel-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-err {
    min-height: 18px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 13px;
    color: #ef4444;
}

.login-line-field {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    border-bottom: 1px solid #e6eaf0;
}

.login-line-field:focus-within {
    border-bottom-color: #1ab394;
}

.login-line-field > span.label {
    flex: 0 0 52px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
}

.login-line-field input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: 0;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: 15px;
}

.login-line-field input::placeholder {
    color: #64748b;
}

.login-eye {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent center / 20px 20px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E");
    cursor: pointer;
    opacity: 0.9;
}

.login-eye.is-on {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='1.8'%3E%3Cpath d='M3 3l18 18M10.5 10.6A2.5 2.5 0 0013.4 13.5M9.9 5.2A10.4 10.4 0 0112 5c6.5 0 10 7 10 7a17.5 17.5 0 01-3.2 3.9M6.1 6.2A17.2 17.2 0 002 12s3.5 6 10 6c1.3 0 2.5-.2 3.6-.6'/%3E%3C/svg%3E");
}

.login-meta-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 16px 0 22px;
    font-size: 13px;
    color: #334155;
}

.login-meta-row--empty {
    margin: 10px 0 18px;
    min-height: 0;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #334155;
}

.login-remember input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #1ab394;
}

.login-forgot {
    border: 0;
    background: none;
    padding: 0;
    color: #4f7cff;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.login-forgot:hover {
    color: #3563e9;
}

.login-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: #1ab394;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s, transform 0.15s;
}

.login-btn:hover {
    background: #18a689;
    box-shadow: none;
}

.login-btn:active { transform: scale(0.99); }
.login-btn:disabled { opacity: 0.7; cursor: wait; }

/* ---- 其他登录 ---- */
.login-other {
    margin-top: 22px;
}

.login-other-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 14px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.login-other-title::before,
.login-other-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.login-other-title span {
    padding: 0 16px;
    white-space: nowrap;
}

.login-other-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    min-height: 52px;
}

.login-other-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.15s, filter 0.2s;
}

.login-other-icon span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-other-icon:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 6px 10px rgba(99, 102, 241, 0.28));
}

.login-other-icon img {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
    object-position: center center;
    pointer-events: none;
}

/* 原图构图不同，略微校正到同一视觉大小 */
.login-other-icon.is-dashou img {
    transform: scale(0.9);
}

.login-other-icon.is-boss img {
    transform: scale(1.12);
}

.login-other-icon i {
    display: none;
}

.login-card-foot {
    display: none;
}

.login-footer {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0 16px 18px;
    text-align: center;
    font-size: 12px;
    color: rgba(30, 41, 59, 0.72);
    animation: loginFadeDown 0.7s 0.25s ease both;
}

/* ---- 登录成功过渡（保留） ---- */
.login-boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background: radial-gradient(circle at 50% 45%, rgba(120, 150, 255, 0.28), #eef2ff 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.login-boot-overlay.run {
    visibility: visible;
    pointer-events: auto;
    animation: loginBootFade 0.55s ease forwards;
}

@keyframes loginBootFade { to { opacity: 1; } }

.login-boot-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 28%;
    background: linear-gradient(180deg, transparent, rgba(79, 124, 255, 0.18), transparent);
    animation: loginScanMove 1.1s ease-in-out infinite;
}

@keyframes loginScanMove {
    0% { top: -30%; opacity: 0; }
    20% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}

.login-boot-ring {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    border: 3px solid rgba(79, 124, 255, 0.2);
    border-top-color: #4f7cff;
    animation: loginSpin 0.8s linear infinite;
}

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

.login-boot-text {
    font-size: 15px;
    letter-spacing: 4px;
    color: #4f7cff;
}

.login-stage.leaving .login-panel {
    animation: loginPanelOut 0.7s ease forwards;
}

.login-stage.leaving .login-hero {
    animation: loginHeroOut 0.7s ease forwards;
}

.login-stage.leaving .login-topbar,
.login-stage.leaving .login-footer {
    animation: loginTitleOut 0.55s ease forwards;
}

@keyframes loginPanelOut {
    to { opacity: 0; transform: translateY(-12px) scale(1.02); filter: blur(4px); }
}

@keyframes loginHeroOut {
    to { opacity: 0; transform: translateX(-40px); }
}

@keyframes loginTitleOut {
    to { opacity: 0; transform: translateY(-12px); }
}

@media (max-width: 960px) {
    .login-stage {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 12px 0 44px;
        box-sizing: border-box;
    }

    .login-topbar {
        height: auto;
        padding: 0 16px 32px;
        flex: 0 0 auto;
        width: 100%;
        justify-content: center;
    }

    .login-brand {
        font-size: 22px;
        font-weight: 700;
        gap: 12px;
        justify-content: center;
    }

    .login-brand img {
        width: 48px;
        height: 48px;
    }

    .login-brand span {
        max-width: 72vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
        font-weight: 700;
    }

    .login-main {
        position: relative;
        display: block;
        flex: 0 0 auto;
        width: min(520px, calc(100% - 32px));
        margin: 0 auto;
        padding: 0;
        min-height: 0;
    }

    /* 插画叠在登录卡后面 */
    .login-hero {
        position: absolute;
        left: 50%;
        top: 52%;
        z-index: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 130%;
        max-width: 560px;
        padding: 0;
        margin: 0;
        transform: translate(-50%, -50%);
        pointer-events: none;
        opacity: 0.38;
        animation: loginHeroInMobile 0.9s 0.1s ease both;
    }

    @keyframes loginHeroInMobile {
        from { opacity: 0; transform: translate(-50%, -46%) scale(1.04); }
        to { opacity: 0.38; transform: translate(-50%, -50%) scale(1); }
    }

    .login-hero img {
        width: 100%;
        max-width: none;
        margin: 0;
        transform: none;
        filter: none;
    }

    .login-panel {
        position: relative;
        z-index: 2;
        width: 100%;
        margin: 0 auto;
        transform: none;
        animation: loginPanelInMobile 0.9s 0.18s ease both;
    }

    @keyframes loginPanelInMobile {
        from { opacity: 0; transform: translateY(18px) scale(0.98); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .login-panel-frame {
        padding: 28px 22px 22px;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 0;
        box-shadow: none;
    }

    .login-panel-title {
        font-size: 26px;
        margin-bottom: 22px;
        font-weight: 900;
    }

    .login-other {
        margin-top: 18px;
    }

    .login-footer {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 12px;
        margin: 0;
        padding: 0 16px;
    }

    .login-stage.leaving .login-hero {
        animation: loginHeroOutMobile 0.7s ease forwards;
    }

    @keyframes loginHeroOutMobile {
        to { opacity: 0; transform: translate(-50%, -46%) scale(1.02); }
    }
}
