The best option should have one change, since there are direct trains from Stockholm to Copenhagen, and from Copenhagen to Hamburg (this train goes on the ferry). I would expect an additional change in Malmoe could reduce the cost and increase the time.
If you search for "now", it's 22:52, so you may get odd connections as the journey planner tries to make an overnight journey.
Wow, how does a train go on a ferry? A full, long train with many cars? Then the ferry would have to be that long too, which seems unlikely. Or is it that one or a few cars of the train go on each trip of the ferry, and the cars are all connected back together when back on land?
Interesting, didn't know. It felt like high-tech to me, anyway, since I had not seen or heard of train ferries before, although I did know about ferries that can take cars (automobiles) on board. Been on one such ferry in Goa, and my parents had been on some while visiting the US and Canada, I forget in which city.
If you search for "now", it's 22:52, so you may get odd connections as the journey planner tries to make an overnight journey.