8. Arrange 4 identical red balls and 4 identical blue balls in a row, with the positions numbered $1,2, \cdots$, 8 from left to right. If balls of the same color are indistinguishable, the number of arrangements where the sum of the positions of the 4 red balls is less than the sum of the positions of the 4 blue balls is $\qquad$.
8.31.
The sum of 8 numbers is 36. Dividing the numbers $1,2, \cdots, 8$ into two groups, there are $\frac{C_{8}^{4}}{2}=35$ ways to do so. When the sums of the two groups are not equal, the smaller sum of 4 numbers is considered the sequence of red balls, and the larger sum of 4 numbers is considered the sequence of blue balls, corresponding to a valid arrangement. Therefore, we only need to exclude the cases where the sums of the two groups are equal to 18.

Let $a_{i}(i=1,2,3,4)$ represent the 4 selected numbers, and $a_{i} \in\{1,2, \cdots, 8\}$. Without loss of generality, assume
$a_{1}18 .
$$

Similarly, $a_{2} \leqslant 4$.
Thus, we can write down 8 solutions to the equation:
$$
\begin{array}{l}
(1,2,7,8),(1,3,6,8),(1,4,5,8), \\
(1,4,6,7),(2,3,5,8),(2,3,6,7), \\
(2,4,5,7),(3,4,5,6) .
\end{array}
$$

Therefore, the number of valid arrangements is $\frac{\mathrm{C}_{8}^{4}}{2}-\frac{8}{2}=31$.