What's the difference in meaning between "You surprised me" and "You took me by surprise"?
These expressions are rather different in meaning.
We tend to use "took me by surprise" when somebody startles us. The dictionary definition is
"To encounter or otherwise engage something or someone who is not prepared or on guard; to shock or startle someone or something by one's sudden appearance or action."
If you were sitting in front of me, and we were talking, and you told me that you had just won the lottery I would be surprised. I could say "You surprised me". But there was no sudden appearance, so you didn't "take me by surprise".
But you didn't "take me by surprise"
If you came up behind me, quietly and tapped me on the shoulder, that would surprise me. "You took me by surprise."
Both mean the same thing.
Although, the former is more commonly used, per Google Ngram