I was reading some erotic fiction on the web earlier when I stumbled into a story that made me think twice. It was from the perspective of a 19 year old girl, thinking back on the nonconsensual sex she had with a man when she was 13.
Written fiction is not normally considered illegal child pornography. There was another thread with some guy who had video footage of himself when he was underage - taken by himself. That was trickier.
AFIK, textual works have never been prosecuted in the U.S. as child pornography, only visual works. The point is to prevent the exploitation of actual children.
Under US federal law, only visual works can be classified as child pornography. There have been earlier threads here about this. Try this one, for example.
In the past purely textual works have been prosecuted in the US as being obscene, but this was ended by a series of court cases. I don’t remember the actual cases offhand, but as far as I know books (as long as they don’t contain pictures) haven’t been in danger of being labeled obscene since the early 60s.