Polynomial by the size of the output and the input
I wonder why the complexity of algorithms [does not] depend on the size of  [...] the output.


But it does!

The size of the input is often used as a trivial lower bound on the running time ("you need to write the output"). So trivial, indeed, that it's rarely talked about in introductory courses. There, the output is usally not the dominating factor so it's not interesting to discuss is further.

Think about what that would mean on the intuitive: an algorithm that writes more bits than it takes time to compute them. That doesn't seem very efficient in itself; maybe your output encoding is bad.

That said, you do on occasion encounter runtime analyses where characteristics of the output appear in the determined bounds. Search and enumeration algorithms, for instance, can admit non-trivial bounds the separate them from brute force ("I don't have to check all candidates, but only at most three times the number of those I want to find").