3. In $\triangle A B C$, the sides opposite to $\angle A, \angle B, \angle C$ are $a, b, c$ respectively, and $\tan A=\frac{1}{2}, \cos B=\frac{3 \sqrt{10}}{10}$. If the longest side of $\triangle A B C$ is 1, then the length of the shortest side is ( ).
(A) $\frac{2 \sqrt{5}}{5}$
(B) $\frac{3 \sqrt{5}}{5}$
(C) $\frac{4 \sqrt{5}}{5}$
(D) $\frac{\sqrt{5}}{5}$
3. D.

Given $\cos B=\frac{3 \sqrt{10}}{10}$, we know that $\angle B$ is an acute angle. Thus, $\tan B=\frac{1}{3}$.
Therefore, $\tan C=\tan (\pi-A-B)$
$$
\begin{array}{l}
=-\tan (A+B) \\
=-\frac{\tan A+\tan B}{1-\tan A \cdot \tan B}=-1 .
\end{array}
$$

So, $\angle C=135^{\circ}$.
Thus, the side opposite $\angle C$ is the longest, i.e., $c=1$.
Since $\tan A>\tan B$, the side $b$ is the shortest.
Because $\sin B=\frac{\sqrt{10}}{10}, \sin C=\frac{\sqrt{2}}{2}$, by the Law of Sines, we get $b=\frac{c \sin B}{\sin C}=\frac{\sqrt{5}}{5}$.
Therefore, the length of the shortest side is $\frac{\sqrt{5}}{5}$.