The link I provided in the comments may be hard to apply to a general distribution given it presumes a parametric formulation.
I remembered a more straightforward approach that you may find useful. It's based off the ECDF of a distribution, relies on the DKW inequality which allows one to form exact confidence bands around the ECDF ($F_n$) for the CDF ($F$) (sample size of $n$):
$$P\left(\sup_{x\in \mathbb{R}} \left\vert F_n(x) - F(x)\right\vert > \varepsilon \right)\leq 2e^{-2n\varepsilon^2} \implies CI_{1-\alpha} = F_n(x) \pm \sqrt{\frac{\ln(\frac{\alpha}{2})}{2n}}:=F_n(x)\pm \varepsilon_n$$
The CI for the mean is is simply the integral of the upper and lower tail distribution curves formed from the upper and lower bands:
Let's define the "shifted" tail curve as
$$T(\epsilon):= \sum_0^{2n}\left(1-F_n(x)-\epsilon\right)$$
Also, since $X\geq 0, E[X]=\int_0^{\infty} (1-F_X) dx$ we can form our confidence interval for the expected value from the confidence bands:
$$CI_{1-\alpha}\left(E[X]\right) = \left[T(\varepsilon_n),T(-\varepsilon_n)\right]$$
Where
$$P\left(E[X] \in CI_{1-\alpha}\left(E[X]\right)\right) \geq 1-\alpha$$