RepreGuard: Detecting LLM-Generated Text by Revealing Hidden Representation Patterns