/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ===== 背景动画粒子 ===== */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: float linear infinite;
}

.particle:nth-child(1) { left: 10%; width: 4px; height: 4px; animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; width: 8px; height: 8px; animation-duration: 15s; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; width: 5px; height: 5px; animation-duration: 10s; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; width: 7px; height: 7px; animation-duration: 18s; animation-delay: 0.5s; }
.particle:nth-child(5) { left: 50%; width: 3px; height: 3px; animation-duration: 14s; animation-delay: 1.5s; }
.particle:nth-child(6) { left: 60%; width: 6px; height: 6px; animation-duration: 11s; animation-delay: 3s; }
.particle:nth-child(7) { left: 70%; width: 9px; height: 9px; animation-duration: 16s; animation-delay: 0.8s; }
.particle:nth-child(8) { left: 80%; width: 4px; height: 4px; animation-duration: 13s; animation-delay: 2.2s; }
.particle:nth-child(9) { left: 90%; width: 7px; height: 7px; animation-duration: 17s; animation-delay: 1.2s; }
.particle:nth-child(10) { left: 15%; width: 5px; height: 5px; animation-duration: 19s; animation-delay: 0.3s; }
.particle:nth-child(11) { left: 45%; width: 8px; height: 8px; animation-duration: 12s; animation-delay: 2.5s; }
.particle:nth-child(12) { left: 75%; width: 3px; height: 3px; animation-duration: 15s; animation-delay: 1.8s; }
.particle:nth-child(13) { left: 55%; width: 6px; height: 6px; animation-duration: 14s; animation-delay: 0.7s; }
.particle:nth-child(14) { left: 85%; width: 5px; height: 5px; animation-duration: 11s; animation-delay: 3.2s; }
.particle:nth-child(15) { left: 5%; width: 7px; height: 7px; animation-duration: 16s; animation-delay: 1.4s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== 登录容器 ===== */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

/* ===== 登录卡片 ===== */
.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 30px 60px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ===== Logo 区域 ===== */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.7);
    }
}

.login-logo h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-logo p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-top: 6px;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 46px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.input-wrapper input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
    color: #667eea;
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color 0.3s ease;
}

.input-wrapper .toggle-password:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ===== 表单选项 ===== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.forgot-password {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #667eea;
}

/* ===== 登录按钮 ===== */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

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

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 按钮加载动画 */
.login-btn .btn-text {
    transition: opacity 0.3s ease;
}

.login-btn .btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    display: block;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 错误消息 ===== */
.error-message {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #fca5a5;
    font-size: 13px;
    align-items: center;
    gap: 8px;
}

.error-message.show {
    display: flex;
}

.error-message .error-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ===== 页脚 ===== */
.login-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #667eea;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .login-container {
        padding: 12px;
    }
    
    .login-card {
        padding: 28px 24px;
        border-radius: 20px;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .login-logo h1 {
        font-size: 20px;
    }
}

/* ===== 暗色滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
