An Electrocardiogram Foundation Model Built on over 10 Million Recordings with External Evaluation across Multiple Domains