TimesBERT: A BERT-Style Foundation Model for Time Series Understanding