/* ==========================================================================
   登录页：左右分栏，左侧品牌与角色动画，右侧登录表单。
   只作用于 .login-page，不影响后台外壳与子页面。
   ========================================================================== */

.login-page {
    --login-ink: #111827;
    --login-muted: #6b7280;
    --login-line: #e5e7eb;
    --login-brand: var(--brand, #1e6fb8);
    min-height: 100%;
    margin: 0;
    background: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--login-ink);
    -webkit-font-smoothing: antialiased;
}

.login-page *,
.login-page *::before,
.login-page *::after {
    box-sizing: border-box;
}

.login-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ---------- 左侧视觉区 ---------- */
.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 55%, #4b5563 100%);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.login-brand-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.login-brand-text small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 400;
    opacity: .72;
}

.login-stage {
    height: 500px;
    flex: 0 1 500px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.char-stage {
    position: relative;
    width: 550px;
    height: 400px;
    flex: 0 0 auto;
}

.char {
    position: absolute;
    bottom: 0;
    transition: transform .7s ease-in-out, height .7s ease-in-out;
    transform-origin: bottom center;
}

.char-purple {
    left: 70px;
    width: 180px;
    height: 400px;
    background: #6C3FF5;
    border-radius: 10px 10px 0 0;
    z-index: 1;
}

.char-black {
    left: 240px;
    width: 120px;
    height: 310px;
    background: #2D2D2D;
    border-radius: 8px 8px 0 0;
    z-index: 2;
}

.char-orange {
    left: 0;
    width: 240px;
    height: 200px;
    background: #FF9B6B;
    border-radius: 120px 120px 0 0;
    z-index: 3;
}

.char-yellow {
    left: 310px;
    width: 140px;
    height: 230px;
    background: #E8D754;
    border-radius: 70px 70px 0 0;
    z-index: 4;
}

.char-face {
    position: absolute;
    display: flex;
    transition: left .7s ease-in-out, top .7s ease-in-out;
}

.char-face-purple { left: 45px; top: 40px; gap: 32px; }
.char-face-black { left: 26px; top: 32px; gap: 24px; }
.char-face-orange { left: 82px; top: 90px; gap: 32px; transition-duration: .2s; }
.char-face-yellow { left: 52px; top: 40px; gap: 24px; transition-duration: .2s; }

.eye {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    overflow: hidden;
    transition: height .15s ease;
}

.eye-lg { width: 18px; height: 18px; }
.eye-md { width: 16px; height: 16px; }
.eye.is-blinking { height: 2px; }
.eye.is-blinking .pupil { opacity: 0; }

.pupil {
    display: block;
    border-radius: 50%;
    background: #2D2D2D;
    transition: transform .1s ease-out, opacity .05s linear;
}

.eye .pupil { width: 7px; height: 7px; }
.eye-md .pupil { width: 6px; height: 6px; }
.pupil-lg { width: 12px; height: 12px; }

.char-mouth {
    position: absolute;
    left: 40px;
    top: 88px;
    width: 80px;
    height: 4px;
    border-radius: 999px;
    background: #2D2D2D;
    transition: left .2s ease-out, top .2s ease-out;
}

.login-tagline {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .78);
}

/* ---------- 右侧表单 ---------- */
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: #fff;
}

.login-form-wrap {
    width: 100%;
    max-width: 420px;
}

.login-mobile-brand { display: none; }

.login-head {
    margin-bottom: 38px;
    text-align: center;
}

.login-head h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #0b1220;
}

.login-head p {
    margin: 0;
    font-size: 14px;
    color: var(--login-muted);
}

.login-field { margin-bottom: 18px; }

.login-field label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--login-ink);
}

.login-input {
    width: 100%;
    height: 48px;
    padding: 0 18px;
    border: 1px solid var(--login-line);
    border-radius: 999px;
    background: #fff;
    font-size: 15px;
    color: var(--login-ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.login-input::placeholder { color: #9ca3af; }
.login-input:hover { border-color: #d1d5db; }
.login-input:focus {
    border-color: var(--login-brand);
    box-shadow: 0 0 0 3px rgba(30, 111, 184, .12);
}

.login-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: var(--login-ink);
}

.login-password { position: relative; }
.login-password .login-input { padding-right: 54px; }

.login-eye {
    position: absolute;
    right: 5px;
    top: 50%;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.login-eye:hover { color: var(--login-ink); background: #f3f4f6; }
.login-eye:focus-visible { outline: 2px solid var(--login-brand); outline-offset: 2px; }
.login-eye svg { width: 20px; height: 20px; }
.login-eye .icon-eye-off { display: none; }
.login-eye.is-visible .icon-eye { display: none; }
.login-eye.is-visible .icon-eye-off { display: block; }

.login-err {
    margin: 0;
    min-height: 18px;
    font-size: 13px;
    color: #dc2626;
}

.login-err:not(:empty) {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
}

.login-submit {
    width: 100%;
    height: 48px;
    margin-top: 8px;
    padding: 0 24px;
    border: 1px solid var(--login-line);
    border-radius: 999px;
    background: #fff;
    color: var(--login-ink);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.login-submit-arrow {
    width: 18px;
    height: 18px;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .25s ease, transform .25s ease;
}

.login-submit:hover:not(:disabled),
.login-submit:focus-visible {
    background: var(--login-brand);
    border-color: var(--login-brand);
    color: #fff;
}

.login-submit:hover:not(:disabled) .login-submit-arrow,
.login-submit:focus-visible .login-submit-arrow {
    opacity: 1;
    transform: translateX(0);
}

.login-submit:focus-visible {
    outline: 2px solid var(--login-brand);
    outline-offset: 3px;
}

.login-submit:disabled { opacity: .6; cursor: default; }
.login-submit.is-loading { opacity: .75; }

.login-foot {
    margin: 22px 0 0;
    text-align: center;
    font-size: 12px;
    color: #a3adbb;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
    .login-visual { padding: 36px; }
}

@media (max-width: 1100px) {
    .char-stage { transform: scale(.74); transform-origin: bottom center; }
}

@media (max-height: 760px) and (min-width: 992px) {
    .login-stage { height: 400px; flex-basis: 400px; }
    .char-stage { transform: scale(.82); transform-origin: bottom center; }
}

@media (max-width: 991.98px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { padding: 28px 24px; }
    .login-mobile-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 40px;
    }
    .login-mobile-brand .login-mark { background: var(--login-brand); color: #fff; }
    .login-head h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .char, .char-face, .eye, .pupil, .char-mouth,
    .login-submit, .login-submit-arrow, .login-input, .login-eye {
        transition: none !important;
    }
}
