/* ==============================================
【公共通用样式】三个页面全部共用，必须放在最顶部
文件：login_all.css
适用：index.html / school_login.html / teacher_login.html
============================================== */
/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}
a {
    text-decoration: none;
}

body {
    background-color: #001e5c;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    padding-bottom: 120px;
    overflow-x: hidden;
}

/* 主体布局 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 50px;
}
.text-section {
    text-align: center;
    padding: 0 15px;
}
.main-title {
    font-size: clamp(1.8rem, 5vw, 2.7rem);
    font-weight: bold;
    line-height: 1.3;
}
.title-line {
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    margin: 16px auto;
    opacity: 0.7;
}
.sub-title {
    font-size: clamp(1rem, 3vw, 1.5rem);
    opacity: 0.9;
}

/* 登录卡片通用 */
.login-card {
    background-color: #fff;
    color: #001e5c;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 50px 20px 30px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.login-card::before {
    content: "";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background-image: url(images/logo.png);
    background-size: cover;
    border-radius: 50%;
    background-color: #fff;
    border: 5px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.card-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 10px;
    margin-top: 20px;
}
.card-subtitle {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #666;
    margin-bottom: 35px;
}

/* 登录按钮通用 */
.login-btn {
    display: block;
    width: 92%;
    margin: 0 auto 15px;
    padding: 15px 0;
    background: linear-gradient(to right, #001e5c 0%, #003388 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: clamp(1rem, 2vw, 1.1rem);
    cursor: pointer;
    transition: opacity 0.3s;
    position: relative;
    height: auto;
}
.login-btn:hover {
    opacity: 0.9;
}

/* 注册提示通用 */
.register-tip {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #999;
    margin-top: 35px;
}
.register-tip a {
    color: #001e5c;
    text-decoration: none;
    font-weight: 500;
}
.register-tip a:hover {
    text-decoration: underline;
}

/* 底部通用 */
footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 12px 15px 18px;
    text-align: center;
    background-color: #001e5c;
}
.footer-link-group {
    font-size: clamp(0.9rem, 1.8vw, 0.8rem);
    color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.footer-nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}
.footer-nav-link:hover {
    color: #fff;
    text-decoration: none;
}
.footer-text {
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: rgba(255,255,255,0.7);
    padding-top: 10px;
    border-top: 1px solid rgba(3,26,73,0.5);
}

/* PC端通用适配 */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 40px;
    }
    .text-section {
        text-align: left;
        flex: 1;
    }
    .title-line {
        margin: 16px 0;
    }
    .login-card {
        flex: 0 0 400px;
        margin: 0;
    }
}

/* 小手机通用适配 */
@media (max-width: 480px) {
    footer {
        position: static !important;
        margin-top: 30px;
    }
    body {
        padding-bottom: 0 !important;
    }
    .login-card {
        padding: 40px 15px 30px;
        border-radius: 12px;
    }
    .login-card::before {
        width: 70px;
        height: 70px;
        top: -25px;
    }
    .footer-link-group {
        gap: 12px;
    }
}

/* ==============================================
【第一部分：index.html 首页选择登录 独有样式】
仅首页需要，另外两个登录页面不会触发冲突
============================================== */
.index-only .login-btn::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: cover;
}
.index-only .school-btn::before {
    background-image: url("images/school.svg");
}
.index-only .teacher-btn::before {
   background-image: url("images/teacher.svg");
}

/* ==============================================
【第二部分：school_login.html 校方登录 独有样式】
============================================== */
.school-only .server-error{
    color:#ff4d4f;
    padding:8px;
    margin-bottom:15px;
    border:1px solid #ff4d4f;
    border-radius:4px;
}
.school-only .item {
    margin-bottom: 20px;
    text-align: left;
    padding: 0 4%;
}
.school-only .item label {
    display: block;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #333;
    margin-bottom: 8px;
}
.school-only .item input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d0d7e3;
    border-radius: 4px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #333;
    transition: border 0.2s;
}
.school-only .item input:focus {
    outline: none;
    border-color: #001e5c;
}
.school-only .code-row {
    display: flex;
    gap: 12px;
}
.school-only .code-row input {
    flex: 1;
}
.school-only .code-img {
    width: 120px;
    height: 44px;
    background-color: #e8f0fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #001e5c;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}
.school-only .back-home {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #001e5c;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.school-only .back-home:hover {
    background-color: #001e5c;
    color: #fff !important;
    text-decoration: none !important;
}
.school-only .error-tip {
    color: #ff4d4f;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

/* ==============================================
【第三部分：teacher_login.html 教师登录 独有样式】
============================================== */
.teacher-only .item {
    margin-bottom: 20px;
    text-align: left;
    padding: 0 4%;
}
.teacher-only .item label {
    display: block;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #333;
    margin-bottom: 8px;
}
.teacher-only .item input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d0d7e3;
    border-radius: 4px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #333;
    transition: border 0.2s;
}
.teacher-only .item input:focus {
    outline: none;
    border-color: #001e5c;
}
.teacher-only .code-row {
    display: flex;
    gap: 12px;
}
.teacher-only .code-row input {
    flex: 1;
}
.teacher-only .code-img {
    width: 120px;
    height: 44px;
    background-color: #e8f0fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #001e5c;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
}
.teacher-only .back-home {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #001e5c;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.teacher-only .back-home:hover {
    background-color: #001e5c;
    color: #fff !important;
    text-decoration: none !important;
}
.teacher-only .error-tip {
    color: #ff4d4f;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}
.teacher-only .msg-error {
    color:#ff4d4f;
    padding:8px;
    margin-bottom:15px;
    border:1px solid #ff4d4f;
    border-radius:4px;
}
@media (max-width: 480px) {
    .teacher-only .code-row {
        flex-direction: column;
        gap: 10px;
    }
    .teacher-only .code-img {
        width: 100%;
    }
}
/* ==============================================
【第四部分：reg.html 注册页面 独有样式】
使用方式：<body class="reg-only">
============================================== */
/* 注册页body重置底部间距 */
.reg-only body {
    padding-bottom: 20px !important;
}

/* 注册页卡片加宽 */
.reg-only .login-card {
    max-width: 1000px;
}

/* 表单基础样式 */
.reg-only .item {
    margin-bottom: 20px;
    text-align: left;
    padding: 0 4%;
}
.reg-only .item label {
    display: block;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #333;
    margin-bottom: 8px;
}
.reg-only .item input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d0d7e3;
    border-radius: 4px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #333;
    transition: border 0.2s;
}
.reg-only .item input:focus {
    outline: none;
    border-color: #001e5c;
}

/* 密码输入框容器、密码显隐图标 */
.reg-only .pwd-container {
    position: relative;
    width: 100%;
}
.reg-only .pwd-container input {
    padding-right: 44px;
}
.reg-only .pwd-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.reg-only .pwd-toggle:hover {
    opacity: 0.7;
}

/* 验证码行 */
.reg-only .code-row {
    display: flex;
    gap: 12px;
}
.reg-only .code-row input {
    flex: 1;
}
.reg-only .code-img {
    width: 120px;
    height: 44px;
    background-color: #e8f0fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #001e5c;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

/* 返回首页按钮 */
.reg-only .back-home {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #001e5c;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.reg-only .back-home:hover {
    background-color: #001e5c;
    color: #fff !important;
    text-decoration: none !important;
}

/* 输入框错误高亮样式 */
.reg-only .item input.error {
    border-color: #ff4d4f;
}

/* 注册页错误提示字号微调 */
.reg-only .error-tip {
    color: #ff4d4f;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    margin-top: 5px;
    display: none;
}

/* 注册页底部取消固定定位 */
.reg-only footer {
    position: static;
    margin-top: 50px;
}

/* PC端布局保持纵向居中 */
@media (min-width: 768px) {
    .reg-only .container {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }
    .reg-only .text-section {
        text-align: center;
        flex: none;
    }
}

/* 手机端底部间距微调 */
@media (max-width: 480px) {
    .reg-only footer {
        margin-top: 30px;
        padding: 10px 15px 15px;
    }
}