Colorimetric Detection of Thiophenol Based on a Phenolphthalein Derivative and Its Application as a Molecular Logic Gate.