A thermodynamic damage model for 3D stress-induced mechanical characteristics and brittle–ductile transition of rock