Chinese search engine operator Baidu Inc booked its first quarterly loss since at least 2015 and forecast quarterly revenue below market estimates, saying a "challenging marketing environment" is sapping income from advertisers.