If $\tan ^2 \theta-(1+\sqrt{3}) \tan \theta+\sqrt{3}=0$, then the general value of $\theta$ is
(A) $n \pi+\frac{\pi}{4}, n \pi+\frac{\pi}{3}$
(B) $n \pi-\frac{\pi}{4}, n \pi+\frac{\pi}{3}$
(C) $n \pi+\frac{\pi}{4}, n \pi-\frac{\pi}{3}$
(D) $n \pi-\frac{\pi}{4}, n \pi-\frac{\pi}{3}$