* {
    /* 去除浏览器默认内外边距 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 去除input的轮廓 */
input {
    outline: none;
}

html,
body {
    height: 100%;
}

body {
    /* 溢出隐藏 */
    overflow-x: hidden;
    display: flex;
    /* 渐变方向从左到右 */
    background: linear-gradient(to right, rgb(247, 209, 215), rgb(191, 227, 241));
}

span {
    position: absolute;
    z-index: 0;
    bottom: 0;
    border-radius: 50%;
    /* 径向渐变 */
    background: radial-gradient(circle at 72% 28%, #fff 3px, #ff7edf 8%, #5b5b5b, #aad7f9 100%);
    /* 泡泡内阴影 */
    box-shadow: inset 0 0 6px #fff,
        inset 3px 0 6px #eaf5fc,
        inset 2px -2px 10px #efcde6,
        inset 0 0 60px #f9f6de,
        0 0 20px #fff;
    /* 动画 */
    animation: myMove 4s linear infinite;
}


@keyframes myMove {
    0% {
        transform: translateY(0%);
        opacity: 1;
    }

    50% {
        transform: translate(10%, -1000%);
    }

    75% {
        transform: translate(-20%, -1200%);
    }

    99% {
        opacity: .9;
    }

    100% {
        transform: translateY(-1800%) scale(1.5);
        opacity: 0;
    }
}

/* 最外层的大盒子 */
.box {
    width: 1050px;
    height: 600px;
    display: flex;
    /* 相对定位 */
    position: relative;
    z-index: 2;
    margin: auto;
    /* 设置圆角 */
    border-radius: 8px;
    /* 设置边框 */
    border: 1px solid rgba(255, 255, 255, .6);
    /* 设置盒子阴影 */
    box-shadow: 2px 1px 19px rgba(0, 0, 0, .1);
}

/* 滑动的盒子 */
.pre-box {
    /* 宽度为大盒子的一半 */
    width: 50%;
    /* width: var(--width); */
    height: 100%;
    /* 绝对定位 */
    position: absolute;
    /* 距离大盒子左侧为0 */
    left: 0;
    /* 距离大盒子顶部为0 */
    top: 0;
    z-index: 99;
    border-radius: 4px;
    background-color: #edd4dc;
    box-shadow: 2px 1px 19px rgba(0, 0, 0, .1);
    /* 动画过渡，先加速再减速 */
    transition: 0.5s ease-in-out;
}

/* 滑动盒子的标题 */
.pre-box h1 {
    margin-top: 150px;
    text-align: center;
    /* 文字间距 */
    letter-spacing: 5px;
    color: white;
    /* 禁止选中 */
    user-select: none;
    /* 文字阴影 */
    text-shadow: 4px 4px 3px rgba(0, 0, 0, .1);
}

/* 滑动盒子的文字 */
.pre-box p {
    height: 30px;
    line-height: 30px;
    text-align: center;
    margin: 20px 0;
    /* 禁止选中 */
    user-select: none;
    font-weight: bold;
    color: white;
    text-shadow: 4px 4px 3px rgba(0, 0, 0, .1);
}

/* 图片盒子 */
.img-box {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    /* 设置为圆形 */
    border-radius: 50%;
    /* 设置用户禁止选中 */
    user-select: none;
    overflow: hidden;
    box-shadow: 4px 4px 3px rgba(0, 0, 0, .1);
}

/* 图片 */
.img-box img {
    width: 100%;
    transition: 0.5s;
}

/* 登录和注册盒子 */
.login-form,
.register-form {
    flex: 1;
    height: 100%;
}

/* 标题盒子 */
.title-box {
    height: 100px;
    line-height: 100px;
    margin-top: 50px;

}

/* 标题 */
.title-box h1 {
    text-align: center;
    color: white;
    /* 禁止选中 */
    user-select: none;
    letter-spacing: 5px;
    text-shadow: 4px 4px 3px rgba(0, 0, 0, .1);

}

/* 输入框盒子 */
.input-box {
    display: flex;
    /* 纵向布局 */
    flex-direction: column;
    /* 水平居中 */
    align-items: center;
}

/* 输入框 */
input {
    width: 60%;
    height: 40px;
    margin-bottom: 20px;
    text-indent: 10px;
    border: 1px solid #fff;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 120px;
    /* 增加磨砂质感 */
    backdrop-filter: blur(10px);
    /* 用户输入的文字：黑色加粗，避免之前那种淡蓝色看不清 */
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}

input:focus {
    /* 聚焦时保持黑色加粗，并让外框稍微高亮提示当前激活 */
    color: #1a1a1a;
    font-weight: 600;
    border-color: #69b3f0;
}

/* 聚焦时隐藏文字 */
input:focus::placeholder {
    opacity: 0;
}

/* 按钮盒子 */
.btn-box {
    display: flex;
    justify-content: center;
}

/* 按钮 */
button {
    width: 100px;
    height: 30px;
    margin: 0 7px;
    line-height: 30px;
    border: none;
    border-radius: 4px;
    background-color: #69b3f0;
    color: white;
}

/* 按钮悬停时 */
button:hover {
    /* 鼠标小手 */
    cursor: pointer;
    /* 透明度 */
    opacity: .8;
}

/* 按钮文字 */
.btn-box p {
    height: 30px;
    line-height: 30px;
    /* 禁止选中 */
    user-select: none;
    font-size: 14px;
    color: white;

}

.btn-box p:hover {
    cursor: pointer;
    border-bottom: 1px solid white;
}

/* 同意协议勾选框——和用户名/密码输入框对齐（同样 60% 宽度），
   覆盖全局 input{width:60%;height:40px} 让 checkbox 回到原生尺寸。 */
.agree-box {
    width: 60%;
    margin: 4px 0 16px 0;
    color: white;
    font-size: 12.5px;
    line-height: 1.6;
    user-select: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .12);
}
.agree-box label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
}
.agree-box input[type="checkbox"] {
    /* 必须把全局 input 规则全部抵消 */
    width: 14px;
    height: 14px;
    margin: 3px 0 0 0;
    flex-shrink: 0;
    padding: 0;
    text-indent: 0;
    border: 1px solid #fff;
    background-color: rgba(255, 255, 255, 0.45);
    border-radius: 3px;
    backdrop-filter: none;
    cursor: pointer;
    /* 让原生勾选标识更明显，原生 accent 颜色 */
    accent-color: #69b3f0;
}
.agree-box a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .6);
}
.agree-box a:hover {
    text-decoration-color: white;
}

/* 忘记密码链接 */
.forgot-link {
    width: 60%;
    margin: -10px 0 14px 0;
    text-align: right;
    font-size: 13px;
    color: white;
    user-select: none;
    opacity: .85;
}

.forgot-link:hover {
    cursor: pointer;
    opacity: 1;
    text-decoration: underline;
}

/* 忘记密码弹窗遮罩 */
.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(3px);
    /* JS 设为 flex 时居中 */
    align-items: center;
    justify-content: center;
}

/* 弹窗卡片 */
.modal-card {
    width: 360px;
    max-width: 90vw;
    padding: 30px 26px 24px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgb(247, 209, 215), rgb(191, 227, 241));
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-card h2 {
    color: white;
    letter-spacing: 3px;
    margin-bottom: 22px;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, .12);
    user-select: none;
}

/* 弹窗里的输入框占满卡片宽度 */
.modal-card input {
    width: 100%;
}

/* 验证码行：输入框 + 发送按钮 */
.fp-code-row {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
}

.fp-code-row input {
    width: 60%;
    margin-bottom: 0;
}

.fp-code-row button {
    width: 40%;
    height: 40px;
    margin: 0 0 0 10px;
    font-size: 12px;
    border-radius: 120px;
    background-color: #f7d1d7;
    color: #555;
}

/* 弹窗底部按钮 */
.modal-btns {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.modal-btns button {
    width: 110px;
    height: 36px;
    line-height: 36px;
}

.modal-btns .modal-cancel {
    background-color: #b9c4cc;
}
/* ============ 顶部「用户/管理员」切换 ============ */
.role-switcher {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.role-tab {
    border: none;
    background: transparent;
    padding: 9px 24px;
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;          /* 防止 emoji + 中文被换行 */
    min-width: 140px;             /* 给「🛡️ 管理员登录」留足横向空间 */
    line-height: 1.2;
    text-align: center;
}
.role-tab:hover { color: #1f2937; }
.role-tab.active {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.3);
}
.role-tab[data-role="admin"].active {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35);
}

/* admin 模式：登录卡片加红色光晕 + 禁注册提示 */
body[data-login-role="admin"] .login-form {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 10px 24px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}
body[data-login-role="admin"] .login-form .btn-box p,
body[data-login-role="admin"] .forgot-link {
    pointer-events: none;
    opacity: 0.3;
}
