The title is pretty self-explanatory. All text, widgets buttons are rendered fine in night mode but inputs aren’t changed, which cause a very contrasting effect.
This could be easily solved by using a predefined dark mode cheat sheet for Qt (as I think Anki uses Qt), such as this one or this one, instead of writing your own (which could take a lot of time).
By the way, Anki does not autodetect dark mode (at least not on my computer, which is a Linux with Gnome).