8. Given a positive integer $n(n \geqslant 2)$. Find the minimum value of $|X|$, such that for any $n$ two-element subsets $B_{1}$, $B_{2}, \cdots, B_{n}$ of the set $X$, there exists a subset $Y$ of $X$ satisfying:
(1) $|Y|=n$;
(2) for $i=1,2, \cdots, n$, we have $\left|Y \cap B_{i}\right| \leqslant 1$.
Here, $|A|$ denotes the number of elements in the finite set $A$.
(Cold Gangsong, problem contributor)
8. $|X|_{\min }=2 n-1$.
(1) When $|X|=2 n-2$, it is not necessarily true that there exists a $Y$ that satisfies the conditions.

In fact, let $X=\{1,2, \cdots, 2 n-2\}$, and consider a partition of $X$:
$$
\begin{array}{l}
B_{1}=\{1,2\}, B_{2}=\{3,4\}, \cdots \cdots \\
B_{n-1}=\{2 n-3,2 n-2\} .
\end{array}
$$

Since $|Y|=n$, there must be at least two elements in $Y$ that belong to the same $B_{j}$. In this case, $\left|Y \cap B_{j}\right|>1$, which is a contradiction.
(2) Next, we prove that $|X|=2 n-1$ satisfies the condition.
Let $B=\bigcup_{i=1}^{n} B_{i},|B|=2 n-1-z$, then there are $z$ elements that do not appear in any $B_{i}$, denoted as $a_{1}, a_{2}, \cdots, a_{i}$. If $z \geqslant n-1$, then we can take $Y=\left\{a_{1}, a_{2}, \cdots, a_{n-1}, d\right\}(d \in B)$.
Assume $z<n-1$.
Suppose there are $t$ elements that appear exactly once in $B_{1}, B_{2}, \cdots, B_{n}$.
Since $\sum_{i=1}^{n}\left|B_{i}\right|=2 n$, then $t+2(2 n-1-z-t) \leqslant 2 n$.
Therefore, $t \geqslant 2 n-2-2 z$.
Hence, the elements that appear more than or equal to 2 times in $B_{1}, B_{2}, \cdots, B_{n}$ appear at most
$$
2 n-(2 n-2-2 z)=2+2 z
$$

times.
Consider the elements $b_{1}, b_{2}, \cdots, b_{t}$ that appear exactly once in $B_{1}, B_{2}, \cdots, B_{n}$. Thus, the number of $B_{j}$ that do not contain $b_{1}, b_{2}, \cdots, b_{t}$ is at most $\frac{2+2 z}{2}=1+z$.

Therefore, at least $n-(z+1)=n-z-1$ $B_{j}$ contain $b_{1}, b_{2}, \cdots, b_{t}$.

Without loss of generality, assume $B_{1}, B_{2}, \cdots, B_{n-1-2}$ each contain one of the elements $b_{1}, b_{2}, \cdots, b_{t}$, denoted as $b_{1}^{\prime}, b_{2}^{\prime}, \cdots, b_{n-1-1}^{\prime}$ (if there are multiple, choose one).

Since $2(n-1-z)+z=2 n-2-z<2 n-1$, there must be an element $d$ that does not appear in $B_{1}, B_{2}, \cdots, B_{n-1-2}$ but appears in $B_{n-1}, \cdots, B_{n}$. Let
$$
Y=\left\{a_{1}, a_{2}, \cdots, a_{z}, b_{1}^{\prime}, b_{2}^{\prime}, \cdots, b_{n-1-z}^{\prime}, d\right\},
$$

then $Y$ satisfies the requirements.
(Liu Shixiong provided)