The tradition does not think of thinking as something the brain does alone. It gives it a home, the heart, which houses the spirit, 神; a worker, the spleen, which does the actual turning-over of thought, 思; and a bed, the blood, which the spirit lies down in at night. A mind that will not stop at midnight is read as one of those three failing: the bed is too thin, the house is too hot, or the worker has not been allowed to put the day down.
That gives three pictures, and they feel different from the inside. In one, you are exhausted and the thoughts circle slowly and pointlessly. In another, you are hot, sharp and dry-mouthed and the thoughts are fast. In the third, the thoughts are about something: the argument, the email, the thing you should have said. The plain causes sit under all three: caffeine after noon, screens in bed, a late meal, alcohol, and a day with no gap in it.