A Multiscale Picture of the Magnetic Field and Gravity from a Large-scale Filamentary Envelope to Core-accreting Dust Lanes in the High-mass Star-forming Region W51