Topological quantum and classical materials can exhibit robust properties that are protected against disorder, for example, for noninteracting particles and linear waves. Here, we demonstrate how to construct topologically protected states that arise from the combination of strong interactions and thermal fluctuations inherent to soft materials or miniaturized mechanical structures. Specifically, we consider fluctuating lines under tension (e.g., polymer or vortex lines), subject to a class of spatially modulated substrate potentials. At equilibrium, the lines acquire a collective tilt proportional to an integer topological invariant called the Chern number. This quantized tilt is robust against substrate disorder, as verified by classical Langevin dynamics simulations. This robustness arises because excitations in this system of thermally fluctuating lines are gapped by virtue of interline interactions. We establish the topological underpinning of this pattern via a mapping that we develop between the interacting-lines system and a hitherto unexplored generalization of Thouless pumping to imaginary time. Our work points to a new class of classical topological phenomena in which the topological signature manifests itself in a structural property observed at finite temperature rather than a transport measurement.