Complex-energy description of molecular and nuclear open quantum systesms