6. In the Cartesian coordinate system, line $l$ intersects the positive semi-axes of the $x$-axis and $y$-axis at points $N$ and $M$, respectively. A square $ABCD$ is inscribed in the right triangle $\triangle MON$, with points $A$ and $B$ on segments $MO$ and $NO$, respectively, and points $C$ and $D$ on segment $MN$. If the coordinates of point $D$ are $(3,7)$, then the equation of the line is ( ).
(A) $y=-\frac{3}{4} x+\frac{37}{4}$
(B) $y=-3 x+7$
(C) $y=-\frac{4}{3} x+\frac{37}{4}$
(D) $y=-\frac{3}{4} x+\frac{25}{4}$
6.A.

As shown in Figure 6, draw $D E \perp y$-axis at point $E$. Then $E(0,7)$. It is easy to see that
$$
\begin{array}{l}
\triangle A E D \cong \triangle B O A . \\
\text { Then } A O=E D=3, \\
O B=A E=7-3=4, \\
A D=5 .
\end{array}
$$

In the right triangle $\triangle A D M$, $A D^{2}=A E \cdot A M$, we can get
$$
A M=\frac{A D^{2}}{A E}=\frac{25}{4} \text {. }
$$

Therefore, $M\left(0, \frac{37}{4}\right)$.
Thus, the equation of line $l$ is $y=-\frac{3}{4} x+\frac{37}{4}$.