8. (i) (Grade 11) Given the function
$$
f(x)=2 \cos \left(\frac{k}{4} x+\frac{\pi}{3}\right)
$$

the smallest positive period is no greater than 2. Then the smallest positive integer value of $k$ is $\qquad$ .
(ii) (Grade 12) The line $y=k x-2$ intersects the parabola $y^{2}$ $=8 x$ at points $A$ and $B$. If the x-coordinate of the midpoint of $A B$ is 2, then $|A B|=$ $\qquad$
8. (i) 13.

From the period $T=\frac{8 \pi}{k} \leqslant 2$, we get $k \geqslant 4 \pi > 12.56$.
Therefore, the positive integer $k \geqslant 13$.
(ii) $2 \sqrt{15}$.

Let $A\left(x_{1}, y_{1}\right), B\left(x_{2}, y_{2}\right)$.
Since $y=\frac{k y^{2}}{8}-2$, i.e., $k y^{2}-8 y-16=0$, then
$$
\begin{array}{l}
y_{1}+y_{2}=\frac{8}{k}, y_{1} y_{2}=-\frac{16}{k} . \\
\text { Hence } \frac{8}{k}=y_{1}+y_{2}=k\left(x_{1}+x_{2}\right)-4=4 k-4,
\end{array}
$$

i.e., $k^{2}-k-2=0$.
Since $k=1$ makes the line $y=k x-2$ tangent to the parabola $y^{2}=8 x$, thus, $k=2$.
By solving $y=2 x-2, y^{2}=8 x$, we get
$$
A(2-\sqrt{3}, 2-2 \sqrt{3}), B(2+\sqrt{3}, 2+2 \sqrt{3}) \text {. }
$$

Therefore, $|A B|=2 \sqrt{15}$.