*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: -webkit-fill-available;
}

body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-text-size-adjust: 100%;
}

button,
input {
    font: inherit;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(120, 219, 255, 0.4) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.1); }
}

.abstract-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

.network-nodes,
.network-lines,
.bg-stars,
.stars {
    position: absolute;
    inset: 0;
}

.node {
    position: absolute;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(162, 155, 254, 0.4), transparent);
    transform-origin: 0 50%;
}

.bg-star,
.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

.bg-star {
    box-shadow:
        0 0 5px #fff,
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 15px rgba(255, 255, 255, 0.6);
    animation: starTwinkle linear infinite;
}

.star {
    width: 2px;
    height: 2px;
    box-shadow:
        0 0 4px #fff,
        0 0 8px rgba(255, 255, 255, 0.8),
        0 0 12px rgba(255, 255, 255, 0.6);
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.1; transform: scale(0.6); }
    50% { opacity: 1; transform: scale(2.5); }
}

@keyframes starTwinkle {
    0% { opacity: 0.05; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(2.2); }
    100% { opacity: 0.05; transform: scale(0.5); }
}

.login-wrapper {
    width: 90%;
    max-width: 700px;
    height: 85vh;
    max-height: 450px;
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 50px rgba(102, 126, 234, 0.2);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.login-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        linear-gradient(225deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-left {
    flex: 1;
    background: linear-gradient(180deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 40, 0.98) 50%, rgba(15, 15, 30, 0.95) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.logo-icon {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
}

.grid-icon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    width: 30px;
    height: 30px;
}

.grid-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}

.brand-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 5;
    margin-top: -50px;
}

.brand-title {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    margin: 50px 0 0;
    max-width: 300px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.brand-illustration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    z-index: 1;
}

.illustration-bg {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.light-trails {
    position: absolute;
    inset: 0;
}

.trail {
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: trailMove 8s infinite;
}

.trail-1 { left: 20%; top: 30%; transform: rotate(45deg); }
.trail-2 { left: 60%; top: 50%; transform: rotate(-30deg); animation-delay: 2s; }
.trail-3 { left: 80%; top: 20%; transform: rotate(60deg); animation-delay: 4s; }

@keyframes trailMove {
    0% { opacity: 0; transform: translateY(0) rotate(var(--rotate, 0deg)); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-50px) rotate(var(--rotate, 0deg)); }
}

.hexagons {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 40px;
}

.hexagon {
    position: relative;
    width: 70px;
    height: 60px;
    margin: 0 10px;
}

.hexagon-inner {
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(74, 144, 226, 0.4);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(74, 144, 226, 0.9);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.8), inset 0 0 10px rgba(74, 144, 226, 0.3);
    animation: hexagonGlow 3s infinite;
}

.hexagon-2 { transform: translateY(-15px); animation-delay: 1s; }
.hexagon-3 { transform: translateY(-30px); animation-delay: 2s; }

@keyframes hexagonGlow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.clouds {
    position: absolute;
    inset: 0;
    z-index: 8;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 25px;
    animation: cloudFloat 10s infinite;
    filter: blur(1px);
}

.cloud-1 {
    width: 70px;
    height: 35px;
    left: 20%;
    top: 35%;
    box-shadow: 12px 0 0 -6px rgba(255, 255, 255, 0.6), 25px 0 0 -12px rgba(255, 255, 255, 0.6);
}

.cloud-2 {
    width: 60px;
    height: 30px;
    left: 60%;
    top: 30%;
    box-shadow: 10px 0 0 -5px rgba(255, 255, 255, 0.6), 20px 0 0 -10px rgba(255, 255, 255, 0.6);
    animation-delay: 3s;
}

@keyframes cloudFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -5px); }
}

.brand-text-glow {
    position: absolute;
    bottom: 38%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 2px;
    animation: textGlow 1s infinite;
    z-index: 9;
}

@keyframes textGlow {
    0%, 100% { opacity: 0.6; filter: brightness(0.8); }
    50% { opacity: 1; filter: brightness(1.5); }
}

.login-right {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

.login-box {
    width: 100%;
    max-width: 250px;
}

.login-header {
    margin-bottom: 30px;
}

.title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.login-form__error {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.login-form__error[hidden] {
    display: none;
}

.form-item {
    margin-bottom: 20px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    height: 44px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: text;
}

.input-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.input-wrapper:focus-within::before {
    left: 100%;
}

.input-icon {
    font-size: 16px;
    margin-right: 10px;
    flex-shrink: 0;
    user-select: none;
}

.input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #fff;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.eye-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    padding: 2px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    min-width: 30px;
    flex-shrink: 0;
}

.eye-icon {
    font-size: 16px;
    line-height: 1;
    margin-bottom: 2px;
}

.eye-icon.eye-open {
    color: #87cefa;
}

.eye-tip {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.input-wrapper--captcha {
    overflow: visible;
    gap: 10px;
}

.captcha-input {
    flex: 1;
    min-width: 0;
}

.captcha-code {
    display: block;
    height: 44px;
    width: 100px;
    max-width: none;
    margin-left: auto;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    object-fit: contain;
    background: transparent;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.remember input {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.login-btn {
    width: 100%;
    height: 44px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.security-tip {
    margin: 15px 0 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.login-toast {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0));
    left: 50%;
    transform: translateX(-50%) translateY(calc(-100% - 12px));
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    max-width: min(90vw, 480px);
    text-align: center;
    word-break: break-word;
}

.login-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media screen and (max-width: 768px) {
    body {
        overflow: hidden;
    }

    .abstract-bg,
    .login-container::before {
        display: none;
    }

    .login-container {
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        padding-top: env(safe-area-inset-top, 0);
        background: linear-gradient(180deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 40, 0.98) 50%, rgba(15, 15, 30, 0.95) 100%);
        animation: none;
        overflow: hidden;
    }

    .login-wrapper {
        width: 100%;
        max-width: none;
        flex: 1;
        height: auto;
        min-height: 0;
        max-height: none;
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .login-left {
        flex: 0 0 auto;
        min-height: clamp(150px, 26vh, 210px);
        padding: calc(16px + env(safe-area-inset-top, 0)) 16px 20px;
        background: linear-gradient(180deg, rgba(30, 30, 60, 0.95) 0%, rgba(20, 20, 40, 0.98) 100%);
        overflow: visible;
    }

    .logo-icon {
        top: calc(16px + env(safe-area-inset-top, 0));
        left: 16px;
    }

    .grid-icon {
        width: 26px;
        height: 26px;
        gap: 3px;
    }

    .brand-content {
        margin-top: -36px;
        margin-bottom: 8px;
        padding: 0 8px;
    }

    .brand-title {
        font-size: clamp(15px, 4.5vw, 18px);
        white-space: normal;
        word-break: break-word;
        line-height: 1.35;
        margin-bottom: 8px;
    }

    .brand-subtitle {
        font-size: 12px;
        line-height: 1.5;
        margin-top: 20px;
        max-width: 100%;
    }

    .brand-illustration {
        display: none;
    }

    .login-right {
        flex: 1;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 24px 16px calc(20px + env(safe-area-inset-bottom, 0));
        background: #fff;
        border-radius: 20px 20px 0 0;
        border-left: none;
    }

    .login-box {
        width: 100%;
        max-width: none;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .title {
        font-size: 24px;
        margin-bottom: 8px;
        -webkit-text-fill-color: #1e1e3c;
        color: #1e1e3c;
        background: none;
        filter: none;
    }

    .subtitle {
        font-size: 14px;
        color: #64748b;
    }

    .form-item {
        margin-bottom: 16px;
    }

    .input-wrapper {
        height: 48px;
        padding: 0 12px;
        background: #f1f5f9;
        border-color: #e2e8f0;
        box-shadow: none;
        -webkit-tap-highlight-color: transparent;
    }

    .input-wrapper:focus-within {
        background: #fff;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        transform: none;
    }

    .input {
        font-size: 16px;
        color: #1e293b;
    }

    .input::placeholder {
        color: #94a3b8;
    }

    .input-icon {
        font-size: 18px;
        margin-right: 8px;
        color: #64748b;
    }

    .eye-icon-wrapper {
        min-width: 44px;
        min-height: 44px;
        margin-left: 4px;
        padding: 6px;
    }

    .eye-icon {
        font-size: 18px;
    }

    .eye-tip {
        font-size: 10px;
        color: #64748b;
    }

    .input-wrapper--captcha {
        flex-wrap: wrap;
        height: auto;
        min-height: 48px;
        align-content: center;
        row-gap: 8px;
        padding-bottom: 8px;
    }

    .input-wrapper--captcha .captcha-input {
        flex: 1 1 calc(100% - 34px);
        min-width: 0;
    }

    .input-wrapper--captcha .captcha-code {
        flex: 0 0 auto;
        height: 40px;
        margin-left: auto;
        margin-right: 0;
        border-color: #e2e8f0;
    }

    .remember {
        font-size: 14px;
        color: #64748b;
    }

    .remember input {
        width: 18px;
        height: 18px;
    }

    .login-btn {
        height: 48px;
        font-size: 17px;
        margin-top: 8px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        color: #fff;
        -webkit-tap-highlight-color: transparent;
    }

    .security-tip {
        font-size: 12px;
        color: #94a3b8;
        margin-top: 12px;
    }

    .login-form__error {
        color: #b91c1c;
        background: #fef2f2;
        border-color: #fecaca;
    }

    .login-toast {
        top: calc(12px + env(safe-area-inset-top, 0));
        max-width: calc(100vw - 32px);
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media screen and (max-width: 375px) {
    .login-left {
        min-height: 130px;
        padding-bottom: 16px;
    }

    .brand-content {
        margin-top: -28px;
    }

    .brand-title {
        font-size: 15px;
    }

    .brand-subtitle {
        font-size: 11px;
        margin-top: 12px;
    }

    .title {
        font-size: 22px;
    }

    .subtitle {
        font-size: 13px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-right {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .login-left {
        min-height: 88px;
        padding: calc(8px + env(safe-area-inset-top, 0)) 16px 12px;
    }

    .logo-icon {
        top: calc(8px + env(safe-area-inset-top, 0));
    }

    .brand-content {
        margin-top: 0;
        margin-bottom: 0;
    }

    .brand-title {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .brand-subtitle {
        display: none;
    }

    .login-right {
        padding-top: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
        border-radius: 16px 16px 0 0;
    }

    .login-header {
        margin-bottom: 12px;
    }

    .title {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .form-item {
        margin-bottom: 10px;
    }

    .input-wrapper {
        height: 44px;
    }

    .input-wrapper--captcha {
        min-height: 44px;
        row-gap: 6px;
        padding-bottom: 6px;
    }

    .input-wrapper--captcha .captcha-code {
        height: 36px;
    }

    .login-btn {
        height: 44px;
        font-size: 16px;
        margin-top: 4px;
    }

    .security-tip {
        margin-top: 8px;
    }
}

/* ===== FastAdmin 错误提示 ===== */
#errtips {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid #fecaca;
}
#errtips.hide {
    display: none;
}
