More than three dozen states and the District of Columbia accused the tech giant of knowingly using addictive features to draw in and retain children and teenagers.