\newlength\myheight
\newcommand\Mysavedprevdepth{}%
\newcommand\UnderlineCentered[3]{%
  \begin{adjustbox}{minipage=[t]{\dimexpr#1\relax},gstore totalheight=\myheight,margin=0pt}%
    \centering\leavevmode#3\par\xdef\Mysavedprevdepth{\the\prevdepth}%
  \end{adjustbox}%
  \hspace*{-\dimexpr#1\relax}%
  \begin{adjustbox}{minipage=[t][\myheight]{\dimexpr#1\relax},margin=0pt}%
    \vphantom{Eg}\lower\dimexpr#2\relax\hbox to\hsize{\leaders\hrule\hfill\kern0pt}\par
    \kern-\dimexpr#2\relax
    \xleaders\vbox to\baselineskip {\vfill\hbox{\lower\dimexpr#2\relax\hbox to\hsize{\leaders\hrule\hfill\kern0pt}}\kern-\dimexpr#2\relax}\vfill
    \kern\Mysavedprevdepth
  \end{adjustbox}%
}%

% \thispagestyle{empty}
\newgeometry{left=0.98in,right=0.98in,top=0.98in,bottom=0.98in}

\newlength{\remainingwidth}
\setlength{\remainingwidth}{25em}

\vspace{39pt}
\begin{center}
    \zihao{1} \textbf{开\, 题\, 报\, 告}
\end{center}

\vspace{180pt}
\zihao{2}
\begin{center}
    \textbf{毕业设计题目：\UnderlineCentered{13.8em}{2mm}{基于机器学习的车位规划}}
\end{center}
\restoregeometry