<template>
  <router-view v-slot="{ Component, route }">
    <transition :name="route.meta.transition" mode="out-in">
      <component :is="Component" :key="route.path"/>
    </transition>
  </router-view>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}

/* 翻转动画 */
.flip-enter-active,
.flip-leave-active {
  transition: all 0.6s ease;
  transform-style: preserve-3d;
}

.flip-enter-from .login-box,
.flip-enter-from .register-box {
  transform: rotateY(180deg);
}

.flip-leave-to .login-box,
.flip-leave-to .register-box {
  transform: rotateY(-180deg);
}

/* 确保卡片有3D效果 */
.login-box,
.register-box {
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
</style>
