What do the shirt colors mean?

They vary in eras.
In TOS, gold was command and helm(including ops and tactical), red was security and engineering, whereas blue was for medical/sciences.
In TNG era(including VOY and DS9), gold was tactical, security and engineering, red is command and helm, and blue was still for medical and science divisions.Their division, people just read the wiki Ex: Read about starfleet uniforms...Red- command staff, flag officers
green-science officers
yellow-security, engineering
blue-medical

The uniform colors change numerous times a more detailed explanation can be found on memory alpha's "uniforms" pages