/* --- 1. 保留原有的背景渐变颜色 --- */
:root {
    --primary-purple: #2f8b57;
    --primary-blue: #1f5e3a;
    --input-bg: #f3f4f6;
    --text-dark: #333;
    --link-color: #6c757d; /* 灰色系链接 */
    --link-hover: #495057; /* 悬停颜色 */
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    min-height: 100vh;
    /* background: linear-gradient(180deg, #dbece0 0%, #a8c5af 50%, #6d9f77 100%); */
    overflow-y: auto;
    overflow-x: hidden;
}

section{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
}

/* --- 2. 登录卡片容器 (左右布局) --- */
.login-container {
    position: relative;
    left: auto;
    transform: none;
    z-index: 1;
    width: 90%;
    max-width: 800px;
    height: auto;
    max-height: calc(100vh - 120px);  /* 最大不超过视口 */
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    overflow: hidden;
    margin: auto;
}

/* --- 3. 左侧图片区域 --- */
.image-section {
    flex: 1;
    background-color: #f0f0f0;
    position: relative;
}

.image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 4. 右侧表单区域 --- */
.form-section {
    flex: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

h1 {
    text-align: center;
    /* color: var(--text-dark); */
    margin-bottom: 35px;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-purple);
}

label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

/* --- 5. 输入框样式 --- */
input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 1rem;
    border: 1px solid #dcdfe6;
    border-radius: 12px;
    background-color: var(--input-bg);
    box-sizing: border-box;
    transition: all 0.3s;
    outline: none;
}

input:focus {
    border-color: var(--primary-purple);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(47, 139, 87, 0.15);
}

small {
    color: #999;
    font-size: 0.8rem;
    margin-top: -15px;
    margin-bottom: 15px;
}

/* --- 6. 按钮样式 --- */
button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
    /* background:#2f8b57; */
    border: none;
    border-radius: 25px;
    cursor: pointer;
    /* transition: opacity 0.3s, transform 0.1s; */
    transition: all 0.3s ease;
    /* 让伪元素相对按钮定位，并裁剪溢出内容 */
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(47, 139, 87, 0.3);
}

button:hover {
    /* opacity: 0.9; */
    background: linear-gradient(135deg, #1f5e3a, #164a2d);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 139, 87, 0.3);
}

button:active {
    /* transform: scale(0.98); */
    transform: translateY(1px);
}

/* 脉冲动画 */
button.pulse {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 光效划过 */
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before {
    left: 100%;
}

/* --- 7. 新增：链接容器 --- */
.links-container {
    display: flex;
    justify-content: space-between;
     /* 与上面的按钮保持距离 */
    margin-top: 35px;
    font-size: 0.9rem;
}

.links-container a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s;
    padding: 5px 0; /* 增加点击区域高度 */
}

.links-container a:hover {
    color: var(--primary-purple);
    text-decoration: underline;
}

/* --- 错误提示 --- */
.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: -15px;
    /* margin-bottom: 100px; */
    margin-bottom: 20px;
    display: none;
}
.input-error {
    border-color: #e74c3c !important;
}

/* --- 响应式处理 --- */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        max-width: 400px;
    }
    .image-section {
        display: none;
    }
    .form-section {
        padding: 30px 20px;
    }
}

/* 大屏：卡片更大 */
@media (min-width: 1600px) and (min-height: 900px) {
    .login-container {
        max-width: 1000px;
        height: 580px;        /* 固定高度 */
        max-height: none;
    }

    .form-section {
        padding: 50px 60px;      /* 内间距加大 */
    }
    
    h1 {
        font-size: 2.2rem;       /* 标题放大 */
        margin-bottom: 45px;
    }
    
    input {
        padding: 14px 18px;      /* 输入框加大 */
        margin-bottom: 24px;
        font-size: 1.1rem;
    }
    
    button {
        padding: 16px;           /* 按钮加大 */
        font-size: 1.2rem;
    }
}