Rather than forcing a single app solution, I suggest a combo. As a well maintained and feature-rich local FOSS, I chose Zotero + Logseq
https://www.zotero.org/ is not just a citation manager. I look at it as a DB of archived pages, pdfs, and bookmarks.
https://logseq.com/ is an "advanced" outliner. So for gathering thoughts, it is both highly hierarchical (= outlining) and non-linear (through tagging and links).
It is a powerful combo, so it could be overwhelming for simpler use cases.