<!-- 登录弹窗 -->
<div class="modal-overlay" id="loginModal">
    <div class="modal-container">
        <div class="modal-header">
            <h3 class="modal-title">登录</h3>
            <button class="modal-close" onclick="closeModal('loginModal')">×</button>
        </div>
        <div class="modal-body" style="padding: 20px;">
            <form id="modalLoginForm" onsubmit="handleModalLogin(event)">
                <div class="form-group" id="loginEmailGroup" style="margin-bottom: 14px;">
                    <div class="input-icon-wrap">
                        <span class="input-icon"><span class="iconify" data-icon="mdi:email-outline"></span></span>
                        <input type="email" class="form-input with-icon" name="email" placeholder="邮箱" required>
                    </div>
                </div>
                <div class="form-group" id="loginCodeGroup" style="margin-bottom: 14px;">
                    <div class="input-icon-wrap">
                        <span class="input-icon"><span class="iconify" data-icon="mdi:shield-check-outline"></span></span>
                        <input type="text" class="form-input with-icon" name="code" placeholder="验证码" required maxlength="6" style="flex:1;">
                        <button type="button" class="send-code-btn" onclick="sendModalLoginCode(this)">获取验证码</button>
                    </div>
                </div>
                <div class="form-group" style="margin-bottom: 20px;">
                    <div class="input-icon-wrap">
                        <span class="input-icon"><span class="iconify" data-icon="mdi:key-outline"></span></span>
                        <input type="password" class="form-input with-icon" id="modalLoginPassword" name="password" placeholder="密码（6位以上）" required style="padding-right: 44px;">
                        <button type="button" class="password-toggle-btn" onclick="toggleModalPassword('modalLoginPassword', this)">
                            <span class="iconify" data-icon="mdi:eye"></span>
                        </button>
                    </div>
                </div>
                <button type="submit" class="auth-btn login-btn" id="loginSubmitBtn">
                    <span class="btn-text">登录</span>
                    <span class="btn-loading" style="display:none;">登录中...</span>
                </button>
                <?php if ($registrationOpen): ?>
                <div class="auth-footer">
                    <a href="javascript:void(0)" onclick="switchToRegister()" class="auth-link">还没有账号？立即注册</a>
                </div>
                <?php endif; ?>
            </form>
        </div>
    </div>
</div>
