/* 登录页专用样式 — 最后加载，覆盖 backend.css 的 body 灰色背景 */

html.login-body,
body.login-body {
    margin: 0 !important;
    min-height: 100vh;
    height: 100%;
    background: #060b16 !important;
    overflow-x: hidden;
}

.login-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 70% at 15% 20%, rgba(201, 169, 98, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 70% 60% at 88% 75%, rgba(148, 120, 80, 0.16) 0%, transparent 50%),
        radial-gradient(ellipse 55% 45% at 50% 100%, rgba(30, 41, 59, 0.85) 0%, transparent 70%),
        radial-gradient(ellipse 40% 35% at 70% 15%, rgba(201, 169, 98, 0.1) 0%, transparent 60%),
        linear-gradient(155deg, #060b16 0%, #0f172a 35%, #131a2e 65%, #0a0e18 100%) !important;
}

.login-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(201, 169, 98, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 169, 98, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
    z-index: 0;
}

.login-page::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201, 169, 98, 0.1) 0%, transparent 38%),
        radial-gradient(circle at 80% 70%, rgba(201, 169, 98, 0.07) 0%, transparent 32%);
    pointer-events: none;
    z-index: 0;
    animation: loginBgShimmer 12s ease-in-out infinite alternate;
}

@keyframes loginBgShimmer {
    0%   { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1;   transform: scale(1.05); }
}

.login-page-deco {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.login-deco-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.75;
    animation: loginOrbFloat 18s ease-in-out infinite;
}

.login-deco-orb-1 {
    width: 520px;
    height: 520px;
    top: -160px;
    left: -140px;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.5) 0%, rgba(201, 169, 98, 0) 70%);
}

.login-deco-orb-2 {
    width: 480px;
    height: 480px;
    bottom: -120px;
    right: -100px;
    background: radial-gradient(circle, rgba(168, 134, 63, 0.42) 0%, rgba(168, 134, 63, 0) 70%);
    animation-delay: -6s;
    animation-duration: 22s;
}

.login-deco-orb-3 {
    width: 320px;
    height: 320px;
    top: 40%;
    left: 60%;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.25) 0%, transparent 70%);
    animation-delay: -10s;
    animation-duration: 16s;
}

.login-deco-orb-4 {
    width: 260px;
    height: 260px;
    top: 10%;
    right: 15%;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.18) 0%, transparent 70%);
    animation-delay: -4s;
    animation-duration: 20s;
}

@keyframes loginOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(24px, -18px) scale(1.05); }
    66%       { transform: translate(-16px, 12px) scale(0.96); }
}

.login-deco-diamonds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23c9a962' stroke-opacity='0.1' stroke-width='1'%3E%3Cpath d='M60 10 L110 60 L60 110 L10 60 Z'/%3E%3Cpath d='M60 30 L90 60 L60 90 L30 60 Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px 120px;
}

.login-deco-corner {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(201, 169, 98, 0.15);
    pointer-events: none;
}

.login-deco-corner-tl {
    top: 40px;
    left: 40px;
    border-right: none;
    border-bottom: none;
    border-radius: 24px 0 0 0;
}

.login-deco-corner-br {
    bottom: 40px;
    right: 40px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 24px 0;
}

.login-deco-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(201, 169, 98, 0.15) 30%, rgba(201, 169, 98, 0.08) 70%, transparent 100%);
    transform: translateX(-50%);
}

.login-page.has-bg-image {
    background-image: url('var(--login-bg-image)');
    background-size: cover;
    background-position: center;
}

.login-page.has-bg-image::before {
    background-color: rgba(6, 11, 22, 0.78);
}

.login-page.has-bg-image::after {
    background: linear-gradient(135deg, rgba(6, 11, 22, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.login-page.has-bg-image .login-deco-orb {
    opacity: 0.45;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(201, 169, 98, 0.08),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(201, 169, 98, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-brand {
    position: relative;
    padding: 48px 40px;
    color: #fff;
    background:
        radial-gradient(ellipse 80% 60% at 0% 100%, rgba(201, 169, 98, 0.12) 0%, transparent 55%),
        linear-gradient(160deg, #1e293b 0%, #0f172a 55%, #1a1f35 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.login-brand::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 4 L76 40 L40 76 L4 40 Z' fill='none' stroke='%23c9a962' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 80px 80px;
    opacity: 0.8;
}

.login-brand::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.2) 0%, transparent 70%);
}

.brand-glow {
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.brand-badge {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #c9a962 0%, #a8863f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(201, 169, 98, 0.35);
}

.brand-badge span {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.brand-title {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #fff;
}

.brand-subtitle {
    position: relative;
    z-index: 1;
    margin: 0 0 32px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.brand-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.45);
    max-width: 260px;
}

.brand-divider {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #c9a962, transparent);
    margin: 28px 0;
}

.login-panel {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.login-panel-header {
    margin-bottom: 32px;
}

.login-panel-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
}

.login-panel-header p {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
}

.last-login {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.last-login.visible {
    display: flex;
}

#profile-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c9a962;
    flex-shrink: 0;
}

#profile-name {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

#profile-name strong {
    color: #c9a962;
    font-weight: 600;
}

#login-form {
    margin: 0;
}

#login-form .form-group {
    margin-bottom: 0;
}

.field-group {
    margin-bottom: 18px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

#login-form .input-group {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}

#login-form .input-group:focus-within {
    border-color: #c9a962;
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.15);
    background: #fff;
}

#login-form .input-group-addon {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0 14px;
    min-width: 44px;
}

#login-form .input-group-addon .glyphicon {
    font-size: 15px;
}

#login-form .form-control {
    border: none;
    box-shadow: none;
    height: 46px;
    font-size: 14px;
    background: transparent;
    color: #1e293b;
}

#login-form .form-control:focus {
    box-shadow: none;
}

#login-form .form-control::placeholder {
    color: #cbd5e1;
}

.captcha-group .form-control {
    border-right: 1px solid #e2e8f0;
}

.captcha-group .input-group-addon:last-child {
    padding: 0;
    background: #f1f5f9;
    cursor: pointer;
}

.captcha-group .input-group-addon:last-child img {
    display: block;
    height: 46px;
    width: 110px;
    object-fit: cover;
}

.login-options {
    margin: 6px 0 22px;
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-weight: normal;
}

.remember-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.remember-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.remember-check::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -2px;
    transition: transform 0.15s;
}

.remember-label input[type="checkbox"]:checked + .remember-check {
    background: #c9a962;
    border-color: #c9a962;
}

.remember-label input[type="checkbox"]:checked + .remember-check::after {
    transform: rotate(45deg) scale(1);
}

.remember-label:hover .remember-check {
    border-color: #c9a962;
}

.remember-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1;
}

.btn-login {
    height: 48px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #fff;
    background: linear-gradient(135deg, #c9a962 0%, #a8863f 100%);
    box-shadow: 0 4px 14px rgba(201, 169, 98, 0.4);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-login:hover,
.btn-login:focus {
    color: #fff;
    background: linear-gradient(135deg, #d4b872 0%, #b8944a 100%);
    box-shadow: 0 6px 20px rgba(201, 169, 98, 0.5);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: #cbd5e1;
}

#errtips {
    margin-bottom: 16px;
}

@media (max-width: 767px) {
    .login-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        border-radius: 12px;
    }

    .login-brand {
        padding: 32px 28px 28px;
    }

    .brand-title {
        font-size: 22px;
    }

    .brand-desc,
    .brand-divider {
        display: none;
    }

    .login-panel {
        padding: 32px 28px 36px;
    }

    .login-panel-header {
        margin-bottom: 24px;
    }

    .login-panel-header h2 {
        font-size: 20px;
    }
}
