OK I found your problem.
First I copy my code into my brain and look like .ok?

If I change this code:
background-color: red;
and the background turns completely red. So the problem is here, why?
First, the first childElement element is not span.pvt-message-box-item: nth-child (1), but a space, and the second is such an element. The third is the same, which is also a space between the first span and the second, now if you want to change the background color, alternatively you use this resolution. Change the css odd and even with the actual number, like replacing the odd and even with 1/3/5, and the result will look like your request:

source share