The electromagnetic response to microwaves in the mixed state of YBa2Cu3Oy(YBCO) was measured in order to investigate the electronic state inside and outside the vortex core. The magnetic-field dependence of the complex surface impedance at low temperatures was in good agreement with a general vortex dynamics description assuming that the field-independent viscous damping force and the linear restoring force were acting on the vortices. In other words, both real and imaginary parts of the complex resistivity, rho_1, and rho_2, were linear in B. This is explained by theories for d-wave superconductors. Using analysis based on the Coffey-Clem description of the complex penetration depth, we estimated that the vortex viscosity eta at 10 K was (4 sim 5) times 10^{-7} Ns/m^2. This value corresponds to omega_0 tau sim 0.3 - 0.5, where omega_0 and tau are the minimal gap frequency and the quasiparticle lifetime in the vortex core, respectively. These results suggest that the vortex core in YBCO is in the moderately clean regime. Investigation of the moderately clean vortex core in high-temperature superconductors is significant because physically new effects may be expected due to d-wave characteristics and to the quantum nature of cuprate superconductors. The behavior of Z_s as a function of B across the first order transition (FOT) of the vortex lattice was also investigated. Unlike Bi2Sr2CaCu2Oy (BSCCO), no distinct anomaly was observed around the FOT in YBCO. Our results suggest that the rapid increase of X_s due to the change of superfluid density at the FOT would be observed only in highly anisotropic two-dimensional vortex systems like BSCCO. We discuss these results in terms of the difference of the interlayer coupling and the energy scale between the two materials.