  Systems described by an O(n) symmetrical $\phi^4$ Hamiltonian are considered
in a $d$-dimensional film geometry at their bulk critical points. A detailed
renormalization-group (RG) study of the critical Casimir forces induced between
the film's boundary planes by thermal fluctuations is presented for the case
where the O(n) symmetry remains unbroken by the surfaces. The boundary planes
are assumed to cause short-ranged disturbances of the interactions that can be
modelled by standard surface contributions $\propto \bm{\phi}^2$ corresponding
to subcritical or critical enhancement of the surface interactions. This
translates into mesoscopic boundary conditions of the generic
symmetry-preserving Robin type $\partial_n\bm{\phi}=\mathring{c}_j\bm{\phi}$.
RG-improved perturbation theory and Abel-Plana techniques are used to compute
the $L$-dependent part $f_{\mathrm{res}}$ of the reduced excess free energy per
film area $A\to\infty $ to two-loop order. When $d<4$, it takes the scaling
form $f_{\mathrm{res}}\approx D(c_1L^{\Phi/\nu},c_2L^{\Phi/\nu})/L^{d-1}$ as
$L\to\infty$, where $c_i$ are scaling fields associated with the
surface-enhancement variables $\mathring{c}_i$, while $\Phi$ is a standard
surface crossover exponent. The scaling function $D(\mathsf{c}_1,\mathsf{c}_2)$
and its analogue $\mathcal{D}(\mathsf{c}_1,\mathsf{c}_2)$ for the Casimir force
are determined via expansion in $\epsilon=4-d$ and extrapolated to $d=3$
dimensions. In the special case $\mathsf{c}_1=\mathsf{c}_2=0$, the expansion
becomes fractional. Consistency with the known fractional expansions of D(0,0)
and $\mathcal{D}(0,0)$ to order $\epsilon^{3/2}$ is achieved by appropriate
reorganisation of RG-improved perturbation theory. For appropriate choices of
$c_1$ and $c_2$, the Casimir forces can have either sign. Furthermore,
crossovers from attraction to repulsion and vice versa may occur as $L$
increases.
