Example 3 In a finite sequence of real numbers, the sum of any seven consecutive terms is negative, while the sum of any eleven consecutive terms is positive. How many terms can such a sequence have at most?

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
Let the known sequence be $a_{1}, a_{2}, \cdots, a_{n}$. From the given information, we have
$$
\begin{array}{l}
a_{k}+a_{k+1}+\cdots+a_{k+6}=0, \quad k=1,2, \cdots, n-10 .
\end{array}
$$

From (1) and (2), it is easy to get
$$
a_{k}+a_{k+1}+a_{k+2}+a_{k+3}>0, \quad a_{k+7}+a_{k+8}+a_{k+9}+a_{k+10}>0, \quad k=1,2, \cdots, n-10 .
$$

From (1) and (3), it is easy to get $a_{k+4}+a_{k+5}+a_{k+6}=0, \quad a_{6}+a_{7}+a_{8}=0$.
Similarly, when $n=16$, $a_{6}>0$.
And when $n=17$, $a_{7}>0$, thus $a_{5}+a_{6}+a_{7}>0$. This contradicts equation (4). Therefore, $n \leqslant 16$. It can be verified that the following 16-term sequence meets the requirements:
$$
6,6,-15 \frac{1}{3}, 6,6,6,-15 \frac{1}{3}, 6,6,-15 \frac{1}{3}, 6,6,6,-15 \frac{1}{3}, 6,6 .
$$