/* 登录弹窗样式 - login-popup.css v4.4 - 修复忘记密码排版 */
* {
    box-sizing: border-box;
}

/* ===== 遮罩层 ===== */
#login-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
}

/* ===== 弹窗主体 - 固定尺寸 ===== */
#login-popup-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 820px;
    max-width: 100%;
    height: 560px;
    max-height: 90vh;
    position: relative;
    animation: loginPopupFadeIn 0.35s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    border: none;
}

@keyframes loginPopupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== 关闭按钮 ===== */
#login-popup-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 30px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
}
#login-popup-close:hover {
    color: #333;
}

/* ===== 左右分栏容器 ===== */
#login-popup-container {
    display: flex;
    height: 100%;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

/* ===== 左侧图片区域 ===== */
#login-popup-image {
    flex: 0 0 45%;
    background: #f0f4f8;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
}

#login-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== 右侧表单区域 ===== */
#login-popup-form-area {
    flex: 1;
    padding: 32px 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
    min-width: 0;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

#login-popup-form-area h2 {
    margin: 0 0 2px 0;
    padding: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1.4;
    background: none;
    border: none;
}

.login-subtitle {
    margin: 0 0 14px 0;
    padding: 0;
    color: #888;
    font-size: 13px;
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1.5;
    background: none;
    border: none;
}

/* ===== 表单字段 ===== */
.login-field {
    margin-bottom: 12px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
}

.login-field label {
    display: block;
    margin-bottom: 4px;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    font-family: inherit;
    line-height: 1.5;
    background: none;
    border: none;
}

.login-field input[type="text"],
.login-field input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.25s, box-shadow 0.25s;
    background: #f7fafc;
    outline: none;
    box-sizing: border-box;
    margin: 0;
    color: #333;
    font-family: inherit;
    height: auto;
    line-height: 1.5;
}

.login-field input[type="text"]:focus,
.login-field input[type="password"]:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background: #fff;
}

/* ===== 密码显示切换 ===== */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 18px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    color: #555;
    margin: 0;
    width: auto;
    height: auto;
}

.toggle-password:hover {
    opacity: 1;
}

.toggle-password .eye-icon {
    display: inline-block;
    font-style: normal;
}

/* ===== 安全问题区域 ===== */
.security-question-field label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.security-label {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.security-question-text {
    font-weight: 500;
    color: #4f46e5;
    background: #f0f0ff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    flex: 1;
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.refresh-question {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    line-height: 1;
    margin: 0;
    width: auto;
    height: auto;
}

.refresh-question:hover {
    opacity: 1;
    transform: rotate(180deg);
}

#security-answer {
    margin-top: 0;
}

/* ===== 选项行 - 修复排版 ===== */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    min-height: 32px;
    flex-wrap: nowrap; /* 禁止换行 */
}

.login-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    margin: 0;
    padding: 0;
    white-space: nowrap; /* 禁止文字换行 */
}

.login-options input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #4f46e5;
    cursor: pointer;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.forgot-password {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap; /* 禁止文字换行 */
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}
.forgot-password:hover {
    text-decoration: underline;
}

/* ===== 提交按钮 ===== */
.login-submit-wrap {
    margin-bottom: 6px;
    flex-shrink: 0;
}

#login-popup-submit {
    width: 100%;
    padding: 11px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.1s;
    font-family: inherit;
    line-height: 1.5;
    margin: 0;
}

#login-popup-submit:hover {
    background: #4338ca;
}

#login-popup-submit:active {
    transform: scale(0.98);
}

#login-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 消息提示 ===== */
#login-popup-message {
    margin-top: 4px;
    padding: 4px 0;
    font-size: 13px;
    text-align: center;
    color: #e53e3e;
    min-height: 24px;
    flex-shrink: 0;
    border: none;
    background: none;
}
#login-popup-message.success {
    color: #38a169;
}

/* ===== 注册链接 ===== */
.login-register-link {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 10px;
    flex-shrink: 0;
    background: none;
}

.login-register-link a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}
.login-register-link a:hover {
    text-decoration: underline;
}

/* ===== 触发按钮样式 ===== */
#login-popup-trigger-button {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.1s;
    font-family: inherit;
    line-height: 1.5;
}

#login-popup-trigger-button:hover {
    background: #4338ca;
}

#login-popup-trigger-button:active {
    transform: scale(0.97);
}

/* 菜单中的登录按钮样式 */
.menu-login-btn {
    background: #4f46e5;
    color: #fff !important;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s;
    font-family: inherit;
    line-height: 1.5;
}

.menu-login-btn:hover {
    background: #4338ca;
}

.login-popup-logged-in {
    color: #38a169;
    font-weight: 500;
}

/* ============================================ */
/* ===== 响应式：手机版 ===== */
@media (max-width: 768px) {
    #login-popup-overlay {
        padding: 12px;
        align-items: center;
    }

    #login-popup-modal {
        width: 420px;
        max-width: 100%;
        height: auto;
        max-height: 92vh;
        border-radius: 12px;
        min-height: 0;
    }

    #login-popup-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    #login-popup-image {
        display: none;
    }

    #login-popup-form-area {
        padding: 24px 20px 20px;
        height: auto;
        max-height: 80vh;
        overflow-y: auto;
    }

    #login-popup-form-area h2 {
        font-size: 20px;
    }

    .login-options {
        flex-wrap: nowrap;
        gap: 10px;
        min-height: 30px;
    }
    
    .login-options label {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .forgot-password {
        font-size: 12px;
        white-space: nowrap;
    }

    #login-popup-close {
        top: 10px;
        right: 14px;
        font-size: 26px;
    }

    .security-question-text {
        font-size: 12px;
        min-width: 60px;
        white-space: normal;
    }
}

/* 小屏手机额外调整 */
@media (max-width: 480px) {
    #login-popup-form-area {
        padding: 18px 14px 16px;
    }

    .login-field input[type="text"],
    .login-field input[type="password"] {
        padding: 9px 12px;
        font-size: 14px;
    }

    #login-popup-submit {
        padding: 10px;
        font-size: 15px;
    }

    .security-question-text {
        font-size: 11px;
        padding: 2px 8px;
    }
    
    .login-options {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .login-options label {
        font-size: 11px;
        white-space: nowrap;
    }
    
    .forgot-password {
        font-size: 11px;
        white-space: nowrap;
    }
}

/* 超小屏手机 */
@media (max-width: 380px) {
    .login-options {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
}