
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
Elective 4-4: Coordinate System and Parametric Equations

In the Cartesian coordinate system $xOy$, the parametric equation of line $l$ is $\left\{ \begin{array}{l} x=3-t, \\ y=1+t, \\ \end{array} \right.$ (where $t$ is the parameter). In the polar coordinate system with the origin as the pole and the positive $x$-axis as the polar axis, the equation of curve $C$ is $\rho=2 \sqrt{2}\cos \left(\theta- \frac{\pi}{4}\right)$.

$(1)$ Find the general equation of line $l$ and the Cartesian equation of curve $C$;

$(2)$ Find the maximum distance from a point on curve $C$ to line $l$.

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