:root {
    --primary-color: #00c6ff;
    --secondary-color: #0072ff;
    --accent-color: #4facfe;
    --light-bg: #f8fafc;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) {
    overflow: hidden !important;
}

body.swal2-height-auto {
    height: auto !important;
}

body:not(.swal2-shown) {
    overflow: visible !important;
    height: 100vh !important;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 动态背景 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 25s ease-in-out infinite;
}

.bg-gradient:nth-child(1) {
    width: 800px;
    height: 800px;
    top: -30%;
    right: -20%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4) 0%, rgba(102, 126, 234, 0) 70%);
    animation-delay: 0s;
}

.bg-gradient:nth-child(2) {
    width: 600px;
    height: 600px;
    bottom: -20%;
    left: -15%;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.4) 0%, rgba(118, 75, 162, 0) 70%);
    animation-delay: -8s;
}

.bg-gradient:nth-child(3) {
    width: 500px;
    height: 500px;
    top: 30%;
    left: 40%;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.3) 0%, rgba(240, 147, 251, 0) 70%);
    animation-delay: -15s;
}

.bg-gradient:nth-child(4) {
    width: 400px;
    height: 400px;
    bottom: 30%;
    right: 20%;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.3) 0%, rgba(79, 172, 254, 0) 70%);
    animation-delay: -20s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(40px, -40px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }
    75% {
        transform: translate(-40px, -30px) scale(1.05);
    }
}

.login-container {
    position: relative;
    width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    padding: 50px 40px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    z-index: 10;
    overflow: hidden;
    animation: slideUp 0.8s ease-out;
    border: 1px solid var(--glass-border);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.15) 0, rgba(255, 255, 255, 0) 50%);
    transform: rotate(30deg);
    z-index: -1;
    animation: shimmer 15s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: rotate(30deg) translateY(0);
    }
    100% {
        transform: rotate(30deg) translateY(50%);
    }
}

.login-header h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 35px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 0.8s ease-out;
}

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

.form-group {
    position: relative;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.2s; }
.form-group:nth-child(2) { animation-delay: 0.3s; }
.form-group:nth-child(3) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group input {
    width: 100% !important;
    padding: 18px 24px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px !important;
    color: #fff !important;
    font-size: 16px !important;
    outline: 0 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-group input:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(0, 198, 255, 0.15), 0 8px 24px rgba(0, 198, 255, 0.2) !important;
    transform: translateY(-3px) !important;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group label {
    position: absolute;
    top: 18px;
    left: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    top: -12px;
    left: 16px;
    font-size: 13px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    padding: 4px 14px;
    color: #fff;
    border-radius: 20px;
    transform: scale(0.9);
    box-shadow: 0 4px 12px rgba(0, 198, 255, 0.3);
}

#captcha {
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 0;
    border-radius: 16px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 114, 255, 0.4);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 114, 255, 0.5);
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

.submit-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 114, 255, 0.3);
}

.auth-links {
    text-align: center;
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 8px;
}

.auth-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    top: 0;
    left: 0;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rise 12s infinite ease-in;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-duration: 5s;
    animation-delay: 1s;
}

.bubble:nth-child(3) {
    width: 50px;
    height: 50px;
    left: 35%;
    animation-duration: 7s;
    animation-delay: 2s;
}

.bubble:nth-child(4) {
    width: 80px;
    height: 80px;
    left: 50%;
    animation-duration: 11s;
    animation-delay: 0s;
}

.bubble:nth-child(5) {
    width: 35px;
    height: 35px;
    left: 55%;
    animation-duration: 6s;
    animation-delay: 1s;
}

.bubble:nth-child(6) {
    width: 45px;
    height: 45px;
    left: 65%;
    animation-duration: 8s;
    animation-delay: 3s;
}

.bubble:nth-child(7) {
    width: 25px;
    height: 25px;
    left: 75%;
    animation-duration: 7s;
    animation-delay: 2s;
}

.bubble:nth-child(8) {
    width: 60px;
    height: 60px;
    left: 85%;
    animation-duration: 9s;
    animation-delay: 1s;
}

@keyframes rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-1200px) rotate(720deg);
        opacity: 0;
    }
}

/* 验证码样式优化 */
.captcha-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.captcha-container {
    flex-shrink: 0;
}

#captcha-img {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 52px;
}

#captcha-img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 198, 255, 0.3);
}

#captcha_code {
    flex: 1;
    min-width: 0;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-container {
        width: 90%;
        padding: 40px 30px;
        border-radius: 24px;
    }
    
    .login-header h2 {
        font-size: 28px;
    }
    
    .form-group input {
        padding: 16px 20px !important;
    }
    
    .submit-btn {
        padding: 16px;
        font-size: 16px;
    }
}

/* 添加加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 添加焦点动画 */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 198, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 198, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 198, 255, 0);
    }
}

.form-group input:focus {
    animation: focusRing 0.6s ease-out;
}
