Heterogeneous investment with dynamical feedback promotes public cooperation and group success in spatial public goods games