Could be an electrolyte issue. It sounds like a metabolic activity state. Your metabolism is likely raised and for some reason your nervous system is excitable... maybe a prolonged endorphin or adrenal response?
There are two things I would think about, what are you consuming after 6 or 7 PM and how hard are you riding.
If you're taking in a lot calories closer to bed time your metabolism make kick into high gear and be part of the problem. I have problems with this, particularly if I drink any alcohol.
And, if you're riding hard in the morning, maybe just try to scale it back a bit.
It could also just be a matter of relaxing before bed to settle your nervous system. You might like to try meditation. In yoga they encourage lying quietly on your back with your legs extended up the wall for 10 to 15 min for this type of problem.
Hope that helps.
Living life like there's no tomorrow.
http://gorgebikefitter.com/
2007 Look Dura Ace
2010 Custom Tonic cross with discs, SRAM
2012 Moots YBB 2 x 10 Shimano XTR
2014 Soma B-Side SS