Recent Advances in the Development of Flexible Sensors: Mechanisms, Materials, Performance Optimization, and Applications