/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面整体样式 */
body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: linear-gradient(-45deg, #89f7fe, #66a6ff, #ff758c, #ff7eb3);
    background-size: 400% 400%;
    animation: gradientAnimation 12s ease infinite;
}

/* 动态渐变背景动画 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 表单容器 */
.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
    animation: fadeIn 0.8s ease-out;
}

/* 表单标题 */
h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
}

/* 输入框样式 */
input {
    width: 100%;
    padding: 12px 14px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* 输入框聚焦时的样式 */
input:focus {
    border-color: #66a6ff;
    box-shadow: 0 0 8px rgba(102, 166, 255, 0.3);
}

/* 登录按钮样式调整 */
button.main-btn {
    width: 50%; /* 设置为输入框的一半宽度 */
    padding: 8px; /* 增加按钮高度 */
    margin: 20px auto; /* 居中按钮，增加顶部间距 */
    font-size: 1.1rem; /* 增大字体 */
    font-weight: bold;
    border-radius: 10px; /* 调整圆角为更柔和的样式 */
    background-color: #007bff; /* 蓝色背景 */
    color: rgb(20, 30, 226);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: block; /* 确保按钮占用整行，便于居中 */
}
/* 登录按钮单独样式 */
#loginButton {
    width: 50%; /* 设置按钮宽度为输入框的50% */
    padding: 8px; /* 增加按钮高度 */
    margin: 8px 0; /* 仅设置上下外边距，左右外边距为0 */
    font-size: 1.1rem; /* 增大字体 */
    font-weight: bold;
    border-radius: 10px; /* 调整圆角为更柔和的样式 */
    background-color: #007bff; /* 蓝色背景 */
    color: rgb(7, 234, 14);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: block; /* 保证按钮占满宽度 */
    text-align: center; /* 内容居中 */
}

/* 登录按钮的悬停效果 */
#loginButton:hover {
    background-color: #0056b3;
    transform: scale(1.07); /* 调整悬停效果的放大比例 */
}
/* 登录按钮的悬停效果 */
button.main-btn:hover {
    background-color: #0056b3;
    transform: scale(1.07); /* 调整悬停效果的放大比例 */
}

/* 辅助按钮布局 */
.form-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: 0.9rem;
    color: #011102;
}

/* 辅助按钮样式 */
.form-extra button {
    background: none;
    border: none;
    color: #007bff;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.form-extra button:hover {
    color: #0056b3;
}

/* 模态框样式 */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    visibility: visible;
}

.hidden {
    display: none;
}

/* 模态框内容 */
.modal-content {
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 15px;
    width: 95%;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInModal 0.5s ease-out;
    text-align: center;
}

/* 模态框关闭按钮 */
.close {
    cursor: pointer;
    float: right;
    font-size: 1.5rem;
    color: #007bff;
    font-weight: bold;
}

.close:hover {
    color: #0056b3;
}

/* 动态淡入效果 */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 模态框动画 */
@keyframes fadeInModal {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* 模态框按钮样式 */
.modal-content button {
    width: 100%; /* 按钮宽度自适应，填满容器 */
    padding: 8px 0; /* 增加上下内边距，提升按钮的点击区域 */
    font-size: 1.1rem; /* 增大字体 */
    font-weight: bold;
    border-radius: 8px; /* 圆角按钮 */
    background-color: #007bff; /* 蓝色背景 */
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 8px; /* 上方间距 */
    box-sizing: border-box; /* 确保宽度和内边距适应容器 */
}

/* 按钮悬停效果 */
.modal-content button:hover {
    background-color: #0056b3;
    transform: scale(1.05); /* 微调悬停时的放大效果 */
}

/* 按钮的辅助样式（如关闭按钮） */
.modal-content button.close {
    background: none;
    color: #007bff;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 0;
    margin-top: 0;
    cursor: pointer;
    border: none;
}

/* 按钮的关闭效果（悬停时变色） */
.modal-content button.close:hover {
    color: #0056b3;
}

/* 响应式设计：让按钮适应不同屏幕宽度 */
@media (max-width: 600px) {
    .modal-content button {
        font-size: 1rem; /* 小屏幕上字体稍微缩小 */
        padding: 12px; /* 缩小内边距 */
    }

    /* 登录按钮自适应 */
    button.main-btn {
        font-size: 1rem; /* 调整小屏幕上的字体 */
        padding: 14px; /* 调整按钮的内边距 */
        width: 90%; /* 按钮宽度自适应，使用较大的宽度 */
    }
}

/* 按钮在模态框中的排列：保持按钮的美观和对齐 */
.modal-content form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.modal-content button + button {
    margin-top: 10px; /* 为按钮之间增加间距 */
}

.success-message {
    color: green;
    font-weight: bold;
    margin-top: 10px;
}

.error-message {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}

/* Footer 样式调整 */
#footer {
    text-align: center; /* 文本居中 */
    padding: 10px 0; /* 增加上下内边距 */
    background-color: transparent; /* 背景色与页面融合 */
    color: #666; /* 文字颜色调整为中性 */
    font-size: 12px; /* 文字大小适配整体风格 */
    position: absolute; /* 绝对定位 */
    bottom: 10px; /* 紧贴底部，增加适当间距 */
    left: 0;
    width: 100%;
}
/* 自定义禁用状态下的按钮样式 */
button:disabled {
    background-color: #ccc; /* 灰色背景 */
    color: #888; /* 灰色文本 */
    cursor: not-allowed; /* 禁用时鼠标显示为禁止图标 */
    border: 1px solid #ddd; /* 边框颜色 */
}
