Let $K = \mathbb{Q}(\sqrt{-d})$ be an imaginary quadratic field with $d > 3$. Our ultimate goal is to prove the following: $$ h_K < \begin{cases} \dfrac{d}{4}, & -d \equiv 1 \pmod 4, \\ \dfrac{d}{2}, & -d \equiv 2 \text{ or } 3 \pmod 4. \end{cases} $$ where $h_K$ is the class number of $K$. I'm hinted to prove the following claim first:
CLAIM: Let $D = |\Delta_K|$, where $\Delta_K$ is the discriminant of $K$. $$ h_K \leq \dfrac{1}{D}\sum_{1 \leq k < D/2, (k,D)=1} (D-2k) = \dfrac{\phi(D)}{2}-\dfrac{2}{D} \sum_{1 \leq k < D/2, (k,D)=1} k =:H_K. $$
My question is: how to prove the claim and how the claim implies the final estimate.
My attempts for the CLAIM: We have already obtained the class number formula for imaginary quadratic fields as $$ h_K = \dfrac{1}{2-\chi_K(2)} \left\vert \sum_{1 \leq k < D/2} \chi_K(k) \right\vert, $$ where $\chi_K$ is the unique nontrivial character of $K$ with conductor $D$, defined as $$ \chi_K(p)=\begin{cases} 1, &\text{ if } p \text{ splits completely}, \\ -1, &\text{ if } p \text{ inerts}, \\ 0, &\text{ if } p \text{ ramifies}. \end{cases} $$ for primes $p$ and extend it completely-multiplicatively to all integers. $\chi_K$ can be expressed by Legendre symbols in the odd prime cases. Now it is quite challenging for me to estimate the sum of $\chi_K$ over $1 \leq k < D/2$. By comparing with the result, if we simply ignore the term $1/(2-\chi_K(2))$ (since it is always $\leq 1$), we ought to show $$ \sum_{1 \leq k < D/2, (k,D)=1} \chi_K(k) \leq \sum_{1 \leq k < D/2, (k,D)=1} \left( 1 - \dfrac{2k}{D} \right), $$ and I got stuck here. (Clearly, it should not hold in general that for all such $k$, $\chi_K(k) \leq 1 - \frac{2k}{D}$.)
My attempts for the final result: Granting the claim, $$ H_K = \begin{cases} \dfrac{\phi(d)}{2} - \dfrac{2}{d} \sum_{1 \leq k < d/2, (k,d)=1} k, &-d \equiv 1 \pmod 4, \\ \dfrac{\phi(4d)}{2} - \dfrac{1}{2d} \sum_{1 \leq k < 2d, (k,4d)=1} k, &-d \equiv 2 \text{ or } 3 \pmod 4. \end{cases} $$ I found the sum over half of the reduced residue class quite difficult to handle, especially when I hope to make it smaller since it is substracted from the term $\phi(d)/2$ or $\phi(4d)/2$. I have consulted the post here for inspiration but obtained nothing. I think the key stucking me is the half of reduced residue class problem.
P.S. I also viewed the post on another bound of $h_K$. The comment by @Greg Martin mentioned that $L(1, \chi_{-d}) \ll \log d$. He said that it is a standard result in analytic number theory. Could someone provide some reference on this? Though I'm still hoping to get the bound in my post from the claim above, it seems a good point for me to learn more on the estimate of $L$-functions.
I'm a new learner on analytic methods in number theory and sorry for such a long post. Thank you all for commenting and answering! :)