7. There is a barrel of pure pesticide. After pouring out $20 \mathrm{~L}$ and then topping up with water, another $10 \mathrm{~L}$ is poured out and topped up with water again. At this point, the volume ratio of pure pesticide to water in the barrel is $3: 5$. Then the capacity of the barrel is $(\quad) L$.
(A) 30
(B) 40
(C) 50
(D) 60
7.B.

Let the capacity of the bucket be $x \mathrm{~L}$.
The first addition of water is $20 \mathrm{~L}$, and when $10 \mathrm{~L}$ is poured out, the $10 \mathrm{~L}$ contains $\frac{20}{x} \times 10 \mathrm{~L}$ of water.
Finally, adding another $10 \mathrm{~L}$ of water, so the amount of water in the bucket is $20-\frac{20 \times 10}{x}+10(\mathrm{~L})$.
At this point, the volume ratio of pure pesticide to water in the bucket is 3:5, so we have $30-\frac{200}{x}=\frac{5}{3+5} x$.
Rearranging gives $x^{2}-48 x+320=0$.
Solving yields $x=40$ ( $x=8$ is discarded).