Build a prompt token counter with Tailwind CSS: a textarea for the prompt with a live token estimate (an approximation is fine — characters divided by four, documented in a tooltip), a horizontal usage bar showing the estimate against a selectable model's context window (8K / 32K / 128K / 200K) that turns amber near 80% and red when over, and a breakdown listing the largest sections (system prompt, history, user message) as segments of the bar. Add a trim suggestion button that shortens quoted examples first, and warn explicitly that the estimate is approximate.
提示词保持英文原文——直接粘贴进 Claude、Cursor、v0 或任何 AI 编程工具即可使用。