/* 全局样式 */
body {
    background-image: url("../图片/retouch_2025100604023242.jpg");
    background-repeat: no-repeat; 
    background-size: cover;
    background-position: center; 
    background-attachment: fixed;
    text-align: center;
    margin: 0; /* 清除默认边距 */
    padding-top: 70px; /* 增加导航栏预留空间，适配移动端 */
    /* 防止移动端横向滚动 */
    overflow-x: hidden;
}

/* 标题样式 */
h1{
    background-color: rgba(178, 193, 134,0.6);
    color: brown;
    text-align: center;
    font-size: clamp(20px, 5vw, 30px); /* 响应式字体大小 */
    border-radius: 20px;
    padding: 10px 20px; /* 增加内边距 */
    display: inline-block; /* 宽度适配内容 */
    margin: 0 10px; /* 移动端左右边距 */
}

/* 表单容器样式 - 核心修改：移除固定宽度，改用百分比 */
.box{
    display: flex;
    justify-content: center;
    align-items: center;
    /* 移除固定高度和宽度，改用自适应 */
    min-height: 400px;
    width: 90%; /* 占屏幕90%宽度 */
    max-width: 800px; /* 桌面端最大宽度 */
    background-color: rgba(238, 248, 248,0.8);
    border-radius: 40px;
    margin: 50px auto; /* 水平居中 */
    padding: 20px; /* 内边距 */
    box-sizing: border-box; /* 内边距计入宽高 */
}

/* 表单整体样式 */
.box form {
    width: 100%;
    max-width: 400px; /* 限制表单宽度 */
}

/* 表单行（标签+输入框）样式 - 移动端适配 */
.form-row {
    display: flex;
    flex-wrap: wrap; /* 移动端允许换行 */
    align-items: center;
    justify-content: flex-end; /* 整体右对齐，输入框对齐 */
    margin-bottom: 15px; /* 行间距 */
}

/* 标签样式（核心：固定宽度+右对齐） */
.form-row label {
    width: 80px; /* 移动端缩小标签宽度 */
    min-width: 80px; /* 保证最小宽度 */
    text-align: right; /* 标签右对齐 */
    margin-right: 10px; /* 标签和输入框间距 */
    font-size: clamp(16px, 3vw, 20px); /* 响应式字体 */
}

/* 输入框通用样式 - 移动端适配 */
input{
    height: 30px;
    width: 100%; /* 改为100%宽度 */
    max-width: 300px; /* 桌面端最大宽度 */
    padding: 0 10px; /* 输入框内边距 */
    box-sizing: border-box;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* 按钮行样式 */
.btn-row {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 20px; /* 按钮间距 */
    flex-wrap: wrap; /* 移动端按钮换行 */
}

/* 按钮样式 */
.btn-row input {
    width: 100px; /* 按钮宽度统一 */
    max-width: 100px;
    height: 35px;
    cursor: pointer;
    background-color: #f0f0f0;
    border: 1px solid #999;
}

/* 导航栏样式 - 核心修复 */
#daohang{
    background-color: #333;
    border-radius: 10px;
    height: 60px; /* 增加高度，适配移动端手指点击 */
    position: fixed;
    top:0;
    left: 1%; /* 规范写法，替代left:2 */
    right: 1%; /* 规范写法，替代right:2 */
    width: 98%; /* 配合左右1%，避免溢出 */
    z-index: 9999;
    /* 移动端导航栏溢出处理 */
    overflow-x: auto; /* 横向滚动 */
    white-space: nowrap; /* 防止导航项换行 */
}

#daohang>a:not(.denglu){
    display: inline-flex;
    color: aliceblue;
    text-decoration: none;
    margin: 0px 8px; /* 移动端缩小间距 */
    box-sizing: border-box;
    padding: 15px 8px; /* 增加上下内边距，方便点击 */
    font-size: clamp(14px, 3vw, 20px); /* 响应式字体 */
    z-index: 9999;
    float: left;
    align-items: center; /* 垂直居中 */
    height: 100%; /* 占满导航栏高度 */
}

#daohang>a:not(.denglu):hover{
    color: rgb(255, 157, 0);
    z-index: 9999;
}

.denglu{
    display: inline-flex;
    color: aliceblue;
    text-decoration: none;
    margin: 0px 8px; /* 移动端缩小间距 */
    box-sizing: border-box;
    padding: 15px 8px; /* 增加上下内边距，方便点击 */
    font-size: clamp(14px, 3vw, 20px); /* 响应式字体 */
    z-index: 9999;
    float: right;
    align-items: center; /* 垂直居中 */
    height: 100%; /* 占满导航栏高度 */
}

.register-link {
    text-align: center;
    margin-top: 15px;
    font-size: clamp(14px, 3vw, 18px); /* 响应式字体 */
    color: #666;
}

.register-link a {
    color: brown;
    text-decoration: none;
    margin-left: 5px;
}

.register-link a:hover {
    color: rgb(255, 157, 0);
    text-decoration: underline;
}

/* 新增：登录提示样式 */
.login-tip {
    width: 90%;
    max-width: 400px;
    margin: 20px auto;
    padding: 12px;
    background-color: #fff8e1;
    border: 1px solid #ffc107;
    border-radius: 6px;
    text-align: center;
    font-size: clamp(14px, 3vw, 16px); /* 响应式字体 */
    color: #d85000;
    box-sizing: border-box;
}

.login-tip i {
    margin-right: 8px;
    font-style: normal;
}

/* 媒体查询：针对小屏幕手机（宽度小于768px）的额外优化 */
@media (max-width: 768px) {
    .form-row {
        justify-content: center; /* 表单行居中 */
    }
    .form-row label {
        text-align: center; /* 标签居中 */
        width: 100%; /* 标签占满一行 */
        margin-right: 0;
        margin-bottom: 5px;
    }
    .box {
        min-height: 350px; /* 缩小表单容器高度 */
        padding: 15px;
    }
    .btn-row input {
        width: 80px; /* 缩小按钮宽度 */
    }
}
