NotFound.vue 1.43 KB
<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push('/');
};
</script>

<template>
  <div class="notfound-view">
    <div class="content-card">
      <div class="error-code">404</div>
      <h1>页面未找到</h1>
      <p>抱歉,您访问的页面不存在或已被删除</p>
      <button @click="goHome" class="btn-home">🏠 返回首页</button>
    </div>
  </div>
</template>

<style scoped>
.notfound-view {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  min-height: 400px;
  margin: 0 auto;
}

.content-card {
  padding: 3rem;
  text-align: center;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}

.error-code {
  margin-bottom: 1rem;
  font-size: 6rem;
  font-weight: 700;
  background: linear-gradient(45deg, #fff, rgb(255 255 255 / 60%));
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-card h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
}

.content-card p {
  margin: 0 0 2rem;
  opacity: 0.9;
}

.btn-home {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  background: rgb(76 175 80 / 80%);
  border: none;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.btn-home:hover {
  background: rgb(76 175 80 / 100%);
  transform: translateY(-2px);
}
</style>