There were two novels that fit this plot: The Dream of Endless Cataclysm and The Boundary Stone of Life and Death. The former was a mystery detective novel, which told the story of the protagonist transmigrating into a dream to find the secret. The latter was also a mystery detective novel. The girl searched for the truth of life and death in her dreams. Both books are very interesting. I suggest you read them both. I hope you like my recommendation.😗