Mail in El Capitan keeps showing unread emails
After updating to El Capitan, Mail will routinely display a number of unread messages in my Gmail account. When I go into my Gmail inbox, the unread message number immediately vanishes (as well as the badge number in the dock). After a few minutes, the icon on the dock will show unread messages again. Enter the Gmail inbox, the indicator disappears. There is absolutely no unread mail in my Gmail. I checked on the Gmail website to be sure.
Is El Capitan messing up the IMAP syncing? I tried rebuilding the mailbox and deleting/recreating my Google account in Mail, but the problem persists. My iOS 9 devices don't have this problem, but it started on my mac immediately after updating to El Capitan. I use another IMAP email, and there is no issue. I'm interested to know what might be causing Mail to keep thinking there are unread messages, particularly from Google.
MacBook Pro with Retina display, OS X El Capitan (10.11)