
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given an ellipse $(C)$: $\frac{x^{2}}{a^{2}}+y^{2}=1 (a > 1)$ with its upper vertex $A$ and left focus $F$, the line $AF$ is tangent to the circle $(M)$: $x^{2}+y^{2}+6x-2y+7=0$ at the point $(0,-\frac{1}{2})$. The line passing through the point $(0,-\frac{1}{2})$ intersects the ellipse $(C)$ at points $P$ and $Q$.

(1) Find the equation of the ellipse $(C)$;

(2) When the area of $\triangle APQ$ reaches its maximum, find the equation of the line.

Present the answer in LaTex format: \boxed{Your answer}
user