Periodic and rational solutions of variable-coefficient modified Korteweg–de Vries equation