Trying to wire a new light fixture in the bathroom - what is going on with these wires?
I did not follow your question completely so I will explain how it should work (per code) A switch leg is where the power is supplied in the attic and then the hot black feed from the attic normally would go down on the white and come back on the black/ red after the switches. All work is done with the breaker off.

you have a fan and a light so at the switches you take the white to both switches (they should be marked as hot black or other color not green) then your red goes back from 1 switch and the black from the other switch.

At the attic tie the light and fan tie the neutrals (white) to the cable from the panel your supply white or neutral.
the fan hot to the red (or black)
The light hot to the black (or red)

The hot black from the panel to the white going to the switch (on the 14-3) this is always hot so it is harder to get confused but the white wire should be marked as a hot like the switches.

This would be the proper way to wire a switch leg to 2 devices through 2 switches.