Under investigation in this paper is a (3 + 1)-dimensional variable-coefficient Kadomtsev-Petviashvili equation, which describes the propagation of surface and internal water waves. By virtue of the binary Bell polynomials, symbolic computation and auxiliary independent variable, the bilinear forms, soliton solutions, Backlund transformations and Lax pair are obtained. Variable coefficients of the equation can affect the solitonic structure, when they are specially chosen, while curved and linear solitons are illustrated. Elastic collisions between/among two and three solitons are discussed, through which the solitons keep their original shapes invariant except for some phase shifts.