After publishing to IIS, using the same browser to access the localhost is fine, but using IP to access the styles is messed up. Why? The styles all use ../ absolute paths.
Are you sure the IP address is the same as the folder corresponding to localhost?
The style is messed up probably because the css file is not loaded.
Check if there is a problem with the filter configuration in web.xml
It should be that the css file is not loaded.