/* 登录/注册/忘记密码弹窗 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    /* 手机上表单变长时，弹窗内部可滚动 */
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
}

.login-modal.show .modal-content {
    transform: translateY(0);
}

/* 选项卡 */
.modal-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #2f2f2f;
    border-bottom: 2px solid #2f2f2f;
}

.find-pwd-subtabs {
    display: flex;
    margin: 10px 0 20px;
    border-bottom: 1px solid #eee;
}

.subtab-btn {
    padding: 8px 15px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subtab-btn.active {
    color: #2f2f2f;
    border-bottom: 2px solid #2f2f2f;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f0f0f0;
    border: none;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #ff4444;
    color: white;
}

/* 表单容器切换 */
.form-container {
    display: none;
}

.form-container.active {
    display: block;
}

.find-pwd-form-container {
    display: none;
}

.find-pwd-form-container.active {
    display: block;
}

.login-form, .register-form, .find-pwd-form, .reset-pwd-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group label .optional {
    color: #999;
    font-weight: normal;
    font-size: 0.85rem;
    margin-left: 8px;
}

.form-group .tip-text {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    font-size: 1rem;
}

.form-group input::placeholder {
    color: #999;
}

.form-group input:focus {
    outline: none;
    border-color: #989898;
    box-shadow: 0 0 5px rgba(152, 152, 152, 0.3);
}

/* 验证码行 */
.code-input-row {
    display: flex;
    gap: 10px;
}

.code-input-row input {
    flex: 1;
}

.send-code-btn {
    padding: 0 15px;
    background-color: #669966;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.send-code-btn:hover {
    background-color: #77aa77;
}

.send-code-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 错误提示 */
.error-tip {
    color: #ff4444;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.error-tip.show {
    display: block;
}

.two-choice-error {
    color: #ff4444;
    font-size: 0.85rem;
    margin: 10px 0;
    display: none;
}

.two-choice-error.show {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #2f2f2f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #989898;
}

/* 响应式 */
@media (max-width: 768px) {
    .modal-content {
        width: 94%;
        padding: 20px 18px;
        max-height: 92vh;
    }
    .code-input-row {
        flex-direction: column;
    }
    .send-code-btn {
        padding: 10px;
        width: 100%;
    }
    .modal-close {
        top: 12px;
        right: 12px;
    }
    .modal-tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 1rem;
    }
    .form-group {
        margin-bottom: 16px;
    }
    .form-group input {
        padding: 9px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .tab-btn {
        padding: 8px 15px;
        font-size: 1rem;
    }
    .subtab-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}
