/* 登录页面专用样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
    /* 防止星星背景溢出 */
}

.login-box {
    width: 100%;
    max-width: 450px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 15px 35px var(--shadow-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Safari 支持 */
    animation: fadeIn 1s ease;
    position: relative;
    /* 确保内容层叠正确 */
    z-index: 2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 针对旧Safari的兼容性修复 */
@supports not (backdrop-filter: blur(10px)) {
    .login-box {
        background-color: rgba(255, 255, 255, 0.97);
    }
}

.login-header {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 添加背景装饰效果 */
.login-header::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.5;
    transform: rotate(-15deg);
    pointer-events: none;
}

.login-header h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.login-form {
    padding: 30px;
}

.login-form .form-group {
    margin-bottom: 25px;
    position: relative;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    background-color: #fefefe;
    transition: all 0.3s ease;
}

.login-form input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(158, 119, 119, 0.2);
    outline: none;
}

/* 输入框有内容时的样式 */
.login-form input.has-content {
    border-color: var(--accent-color);
    background-color: rgba(212, 165, 165, 0.05);
}

/* 自动填充样式修复 */
.login-form input:-webkit-autofill,
.login-form input.autofilled {
    -webkit-box-shadow: 0 0 0 30px #fff8f8 inset !important;
    box-shadow: 0 0 0 30px #fff8f8 inset !important;
    -webkit-text-fill-color: var(--text-color) !important;
    border-color: var(--accent-color);
}

@keyframes autofill {
    to {
        background-color: #fff8f8;
        color: var(--text-color);
    }
}

.login-form input:-webkit-autofill {
    animation-name: autofill;
    animation-fill-mode: both;
}

.login-form i {
    margin-right: 8px;
    color: var(--accent-color);
}

.login-btn {
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    font-size: 1.1rem;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 按钮悬停效果 */
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮点击效果 */
.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 禁用按钮样式 */
.login-btn:disabled {
    background: linear-gradient(45deg, #b5a2a2, #e0c4c4);
    cursor: not-allowed;
    opacity: 0.8;
    transform: none !important;
}

.login-btn .fa-spinner {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.login-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--secondary-color);
    position: relative;
}

.login-footer p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.login-footer .love-quote {
    font-style: italic;
    color: var(--accent-color);
    font-weight: 500;
    position: relative;
    display: inline-block;
    padding: 0 10px;
}

/* 心跳动画效果优化 */
.login-footer .love-quote::before,
.login-footer .love-quote::after {
    content: '❤️';
    display: inline-block;
    animation: heartbeat 1.5s infinite;
    vertical-align: middle;
}

.login-footer .love-quote::before {
    animation-delay: 0s;
    margin-right: 8px;
}

.login-footer .love-quote::after {
    animation-delay: 0.5s;
    margin-left: 8px;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: -15px;
    margin-bottom: 15px;
    height: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-5px);
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* 抖动动画 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* 登录成功样式 */
.login-success {
    padding: 40px 20px;
    text-align: center;
    color: var(--accent-color);
    transition: all 0.5s ease;
}

.login-success i {
    font-size: 3rem;
    color: #2ecc71;
    margin-bottom: 15px;
    display: block;
}

.login-success h2 {
    margin-bottom: 10px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
}

.login-success p {
    color: var(--text-color);
    font-size: 1.1rem;
}

/* 星星样式优化 */
.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle 5s infinite;
    transition: opacity 0.3s ease;
    z-index: 1;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.2;
    }
}

/* 响应式样式调整 */
@media (max-width: 480px) {
    .login-box {
        max-width: 90%;
    }

    .login-header h1 {
        font-size: 2rem;
    }

    .login-form {
        padding: 20px;
    }
}