/* 登录页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%) no-repeat fixed;
    background-size: cover;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
}

.login-background {
    width: 100%;
    min-height: 100vh;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

/* 装饰性光晕 */
.login-background::before {
    content: '';
    position: absolute;
    top: -200px;
    left: -200px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.12);
    filter: blur(100px);
    pointer-events: none;
}
.login-background::after {
    content: '';
    position: absolute;
    bottom: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(162, 155, 254, 0.08);
    filter: blur(100px);
    pointer-events: none;
}

.login-form-wrapper {
    position: relative;
    z-index: 1;
}

.login-form-container {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 36px;
    width: 440px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.25),
        0 10px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: box-shadow .3s ease, transform .3s ease;
}

/* 登录框顶部装饰 */
.login-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}
.login-header::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.25);
}
.login-header::after {
    content: '\f023';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 20px;
}

.login-header h1 {
    color: #1a1a2e;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.login-header p {
    color: #888;
    font-size: 14px;
    font-weight: 400;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 22px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 20px 15px 52px;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    font-size: 15px;
    background: #f8faff;
    transition: all 0.25s ease;
    outline: none;
    color: #1a1a2e;
}

.input-wrapper input::placeholder {
    color: #aab;
}

.input-wrapper input:focus {
    border-color: #6c5ce7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aab;
    font-size: 16px;
    z-index: 2;
    transition: color 0.25s ease;
}
.input-wrapper:focus-within .input-icon {
    color: #6c5ce7;
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aab;
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
    transition: color 0.25s ease;
}

.password-toggle:hover {
    color: #6c5ce7;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    user-select: none;
    transition: color 0.2s;
}
.checkbox-label:hover {
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d0d5dd;
    border-radius: 5px;
    margin-right: 10px;
    position: relative;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-color: #6c5ce7;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.login-btn {
    width: 100%;
    padding: 15px;
    min-height: 50px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(108, 92, 231, 0.3);
    letter-spacing: 0.5px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #5a4bd1 0%, #8c7ff5 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(108, 92, 231, 0.4);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
}

.login-footer p {
    color: #888;
    font-size: 13px;
}

.login-footer a {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.login-footer a:hover {
    color: #5a4bd1;
    text-decoration: underline;
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
    .login-background {
        padding: 16px 12px;
    }
    .login-form-wrapper {
        width: 100%;
        flex: 1 1 auto;
    }
    .login-form-container {
        width: 92%;
        max-width: 400px;
        padding: 32px 24px;
        margin: 12px auto;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .input-wrapper input {
        padding: 12px 14px 12px 44px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 14px;
        font-size: 14px;
    }
    
    .password-toggle {
        right: 14px;
        font-size: 14px;
    }
    
    .login-btn {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    .login-header::before {
        width: 44px;
        height: 44px;
    }
    .login-header::after {
        font-size: 18px;
        top: 13px;
    }
}

@media (max-width: 480px) {
    .login-form-wrapper {
        width: 100%;
        flex: 1 1 auto;
    }
    .login-form-container {
        width: 94%;
        max-width: 360px;
        padding: 24px 18px;
        margin: 10px auto;
    }
    
    .login-background {
        padding: 12px 8px;
    }
}

@media (min-width: 769px) {
    .login-form-container {
        width: 440px;
        padding: 40px 36px;
        min-height: auto;
    }
}

/* 加载动画 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
