7. Use 6 different colors to color the 4 squares in the figure, with each square being one color. It is required to use at most 3 colors and ensure that adjacent squares have different colors. The number of different coloring methods is $\qquad$ (answer with a number).


If 2 colors are used, the number of different coloring methods is $C_{6}^{2} \cdot 2=30$; if 3 colors are used, the number of different coloring methods is $C_{6}^{3}\left(3 \cdot 2^{3}-C_{3}^{2} \cdot 2\right)=360$, so the total number of different coloring methods is 390.