﻿/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", Arial, sans-serif;
}

/* 页面背景 - 自适应背景覆盖 */
body {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* 手机端左右留白 */
}

/* 登录容器 - 核心自适应 */
.login-container {
    background: #ffffff;
    width: 100%; /* 基础宽度100% */
    max-width: 400px; /* PC端最大宽度 */
    padding: 40px 30px; /* 基础内边距 */
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* LOGO区域 - 居中显示 */
.logo-wrapper {
    text-align: center;
    margin-bottom: 30px;
}

    .logo-wrapper img {
        width: 120px; /* LOGO基础宽度 */
        height: auto; /* 保持宽高比 */
        object-fit: contain; /* 防止图片变形 */
    }

/* 登录标题 */
.login-title {
    text-align: center;
    font-size: 22px; /* 适配字体大小 */
    color: #333333;
    margin-bottom: 25px;
    font-weight: 600;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 18px;
}

/* 输入框标签 */
.form-label {
    display: block;
    margin-bottom: 8px;
    color: #666666;
    font-size: 14px;
}

/* 密码输入框容器 - 用于包裹输入框和图标 */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

/* 输入框样式 - 自适应高度 */
.form-input {
    width: 100%;
    height: 42px; /* 基础高度 */
    padding: 0 15px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

/* 密码输入框额外padding（给图标留空间） */
#password {
    padding-right: 45px; /* 右侧留图标空间 */
}

.form-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.1);
}

/* 密码显隐图标样式 */
.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s ease;
}

    .password-toggle-icon:hover {
        color: #2a5298;
    }

/* 记住密码和忘记密码 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    color: #666666;
}

    .remember-me input {
        margin-right: 6px;
    }

.forgot-password {
    color: #2a5298;
    text-decoration: none;
}

    .forgot-password:hover {
        text-decoration: underline;
    }

/* 登录按钮 - 自适应高度 */
.login-btn {
    width: 100%;
    height: 45px; /* 基础高度 */
    background: #2a5298;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .login-btn:hover {
        background: #1e3c72;
    }

/* 注册链接 */
.register-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #666666;
}

    .register-link a {
        color: #2a5298;
        text-decoration: none;
    }

        .register-link a:hover {
            text-decoration: underline;
        }

/* 错误提示样式 */
.error-tip {
    color: #ff4444;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* 媒体查询 - 手机端适配（屏幕宽度≤480px） */
@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px; /* 减小手机端内边距 */
    }

    .logo-wrapper img {
        width: 100px; /* 手机端LOGO缩小 */
    }

    .login-title {
        font-size: 20px; /* 手机端标题字体缩小 */
        margin-bottom: 20px;
    }

    .form-input {
        height: 40px; /* 手机端输入框高度减小 */
    }

    .login-btn {
        height: 42px; /* 手机端按钮高度减小 */
        font-size: 15px;
    }

    .password-toggle-icon {
        font-size: 16px; /* 手机端图标缩小 */
    }
}

/* Error提示图标 */
.error-message {
    display: flex;
    align-items: center;
    color: #F53F3F;
    font-size: 13px;
    margin-top: 6px;
    opacity: 0;
    height: 0;
    transition: all 0.3s ease;
}

    .error-message i {
        margin-right: 6px;
        font-size: 14px;
        display: inline-block;
    }

.form-group.has-error .form-control {
    border-color: #F53F3F;
}

.form-group.has-error .form-icon {
    color: #F53F3F;
}

.form-group.has-error .error-message {
    opacity: 1;
    height: auto;
    margin-top: 6px;
}