Chitosan nanofiltration membranes with gradient cross-linking and improved mechanical performance for the removal of divalent salts and heavy metal ions