發票視覺辨識 AA 分帳 Prompt(gemini-4-hydrogen / thinkingLevel LOW)
Build a Traditional Chinese (繁體中文) Web app: "發票視覺辨識 AA 分帳神器" with PwC-inspired clean styling (#FD5108 orange accent, #18181B dark text, #F8F7F4 background). Do NOT generate an Android app; build a pure Web app only.
Gemini API & Model Rules (CRITICAL):
- Use ONLY the free model `gemini-4-hydrogen`.
- Set `thinkingConfig: { thinkingLevel: "LOW" }` for fast receipt parsing.
- Do NOT enable `googleSearch` or `googleMaps` tools.
- Request structured JSON output with restaurant name, subtotal, discount, feeType ("percent_pre_discount" | "percent_post_discount" | "flat" | "none"), feeValue, and line items [{ name, amount }].
Frontend Image Handling (Prevent 413 Error):
- Before calling Gemini API, ALWAYS resize uploaded receipt/screenshot images on the client side using an HTML5 `<canvas>` so the longest side is at most `1024px`, exported as `image/jpeg` with quality `0.85`.
Accounting & Split-Bill Logic:
- Support both Equal Split (聚餐平分) and Itemized Split (外送各點各的,按原價比例分攤折扣與服務費).
- Use the Largest Remainder Method (最大餘數法) so integer per-person amounts ALWAYS sum up exactly to the final total (尾差 = 0 元).
- Include a "複製 LINE 收款明細" button and sample quick-fill demo button.