/**
 * 现代化登录页面样式
 * 基于Ant Design设计语言
 * 渐进式增强，不影响任何功能
 */

/* ========== 登录页面容器 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== 登录卡片 ========== */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1890ff, #52c41a, #faad14, #f5222d);
}

/* ========== 登录标题 ========== */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    margin: 0 0 8px 0;
}

.login-subtitle {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
    margin: 0;
}

/* ========== 表单组 ========== */
.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.85);
    margin-bottom: 8px;
    font-weight: 500;
}

/* ========== 输入框容器 ========== */
.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper .input-icon-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    border-radius: 8px 0 0 8px;
}

.login-input-wrapper .input-icon-wrapper.success {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
}

.login-input-wrapper .input-icon-wrapper.warning {
    background: linear-gradient(135deg, #faad14 0%, #ffc53d 100%);
}

.login-input-wrapper .input-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.login-input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 52px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.login-input-wrapper input:hover {
    border-color: #40a9ff;
}

.login-input-wrapper input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
    outline: none;
}

.login-input-wrapper input::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

/* ========== 密码可见性切换 ========== */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.password-toggle:hover {
    color: #1890ff;
}

/* ========== 记住密码 ========== */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.login-remember {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    accent-color: #1890ff;
    cursor: pointer;
}

.login-forgot {
    color: #1890ff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.login-forgot:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* ========== 登录按钮 ========== */
.login-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(24, 144, 255, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ========== 取消按钮 ========== */
.login-btn-secondary {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    margin-left: 12px;
}

.login-btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(82, 196, 26, 0.4);
}

/* ========== 按钮组 ========== */
.login-btn-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.login-btn-group .login-btn {
    flex: 1;
}

/* ========== 错误提示 ========== */
.login-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #f5222d;
    font-size: 14px;
    display: flex;
    align-items: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-error i {
    margin-right: 8px;
    font-size: 16px;
}

/* ========== 登录页底部 ========== */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.login-footer-text {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    margin: 0;
}

/* ========== 加载状态 ========== */
.login-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 修改密码弹窗 ========== */
.password-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.password-modal-overlay.active {
    display: flex;
}

.password-modal {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-modal h2 {
    font-size: 20px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    margin: 0 0 24px 0;
    text-align: center;
}

.password-modal .form-group {
    margin-bottom: 20px;
}

.password-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.85);
}

.password-modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-sizing: border-box;
    height: 44px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.password-modal .form-group input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
    outline: none;
}

.password-modal .error-message {
    color: #f5222d;
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.password-modal .password-requirements {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 8px;
}

.password-modal .button-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.password-modal button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.password-modal .submit-btn {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    color: #fff;
}

.password-modal .submit-btn:hover {
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.password-modal .cancel-btn {
    background: #f5f5f5;
    color: rgba(0, 0, 0, 0.65);
}

.password-modal .cancel-btn:hover {
    background: #e8e8e8;
}

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .login-input-wrapper input {
        height: 44px;
    }
    
    .login-btn {
        height: 44px;
        font-size: 15px;
    }
    
    .login-btn-group {
        flex-direction: column;
    }
    
    .login-btn-secondary {
        margin-left: 0;
        margin-top: 12px;
    }
}

/* ========== 兼容旧版登录页样式 ========== */
/* 保持旧版ID选择器样式兼容 */
#loginbox {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

#loginbox::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1890ff, #52c41a, #faad14, #f5222d);
}

#loginbox .control-group {
    margin-bottom: 16px;
}

#loginbox .normal_text h3 {
    text-align: center;
    margin: 0 0 24px 0;
}

#loginbox .normal_text img {
    max-width: 180px;
    height: auto;
}

#loginbox .main_input_box {
    position: relative;
    display: flex;
    align-items: center;
}

#loginbox .add-on {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 0 0 8px;
}

#loginbox .add-on.bg_lg {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
}

#loginbox .add-on.bg_ly {
    background: linear-gradient(135deg, #faad14 0%, #ffc53d 100%);
}

#loginbox .add-on img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

#loginbox input[type="text"],
#loginbox input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 52px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

#loginbox input[type="text"]:focus,
#loginbox input[type="password"]:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
    outline: none;
}

#loginbox .form-actions {
    margin-top: 24px;
    padding: 0;
    background: transparent;
    border: none;
}

#loginbox .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

#loginbox .btn-info,
#loginbox .btn-primary {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    color: #fff;
}

#loginbox .btn-info:hover,
#loginbox .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(24, 144, 255, 0.4);
}

#loginbox .btn-success {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: #fff;
}

#loginbox .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(82, 196, 26, 0.4);
}

/* 版权信息样式 */
#loginbox font[color="white"] {
    color: rgba(0, 0, 0, 0.45) !important;
}

#loginbox .controls:last-child {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}
