/* 登录页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    background: #1e88e5;
}

.login-container {
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
}

.login-background {
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: #1e88e5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="20" cy="80" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-form-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 20px;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

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

.login-form {
    width: 100%;
}

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

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

.input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
    height: 44px;
}

.input-wrapper input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 14px;
    z-index: 2;
}

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

.password-toggle:hover {
    color: #3498db;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #7f8c8d;
    user-select: none;
}

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

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #3498db;
    border-color: #3498db;
}

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

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

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

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

.login-footer p {
    color: #95a5a6;
    font-size: 12px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .login-background {
        padding: 15px;
        /* 保持居中对齐，与微信登录页一致 */
    }
    
    .login-form-container {
        width: 100%;
        max-width: 400px;
        padding: 30px 25px;
        border-radius: 16px;
    }
    
    .login-header {
        margin-bottom: 25px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-header p {
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .input-wrapper input {
        padding: 14px 45px 14px 45px;
        font-size: 16px; /* 防止iOS自动缩放 */
        border-radius: 10px;
    }
    
    .input-icon {
        left: 15px;
        font-size: 16px;
    }
    
    .password-toggle {
        right: 15px;
        font-size: 16px;
        padding: 10px; /* 增大点击区域 */
        margin: -10px;
    }
    
    .checkbox-group {
        margin-bottom: 20px;
    }
    
    .login-btn {
        padding: 14px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .divider {
        margin: 20px 0;
    }
    
    .wechat-login-btn {
        padding: 14px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .login-footer {
        margin-top: 20px;
        padding-top: 15px;
    }
}

@media (max-width: 480px) {
    .login-background {
        padding: 12px;
        /* 保持居中对齐，与微信登录页一致 */
    }
    
    .login-form-container {
        padding: 30px 20px;
        border-radius: 14px;
    }

    .login-form-container.compact-mode {
        padding: 25px 20px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
    
    .input-wrapper input {
        padding: 12px 42px 12px 42px;
    }
    
    .input-icon {
        left: 14px;
        font-size: 15px;
    }
    
    .password-toggle {
        right: 14px;
        font-size: 15px;
    }
}

/* 安全区域适配 (iPhone X+) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .login-background {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .login-background {
        padding-top: 20px;
        align-items: flex-start;
    }
    
    .login-form-container {
        padding: 20px;
    }
    
    .login-header {
        margin-bottom: 15px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .divider {
        margin: 15px 0;
    }
    
    .login-footer {
        margin-top: 15px;
        padding-top: 10px;
    }
}

/* 加载动画 */
.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); }
}

/* 分隔线 */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: #e1e8ed;
}

.divider-text {
    padding: 0 15px;
    color: #95a5a6;
    font-size: 12px;
    white-space: nowrap;
}

/* 微信登录按钮 */
.wechat-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #07C160 0%, #06AD56 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.wechat-login-btn:hover {
    background: linear-gradient(135deg, #06AD56 0%, #059648 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.3);
}

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

.wechat-login-btn i {
    font-size: 20px;
}