<template>
  <div class="interactive-container">
    <div class="error-card">
      <div class="liquid"></div>
      <div class="content">
        <h1>404</h1>
        <p>错误(404)：当前页面未找到</p>
        <p>SYSTEM ERROR: PAGE NOT FOUND</p>
        <el-button type="success" plain round
                   class="magnetic-btn" :icon="HomeFilled"
                   @mouseenter="playHoverSound"
                   @click="goHome">
          返回主页
          <span class="hover-effect"></span>
        </el-button>
      </div>
    </div>
  </div>
</template>
<script setup>
  import { useRouter } from 'vue-router';
  import { HomeFilled } from '@element-plus/icons-vue'
  const router = useRouter();

  const goHome = () => {
    router.push('home');
  };
</script>
<style scoped>
  .interactive-container {
    height: 80%;
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .error-card {
    position: relative;
    width: 400px;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 45px rgba(0,0,0,0.2);
  }

  .liquid {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    animation: rotate 10s linear infinite;
  }

  @keyframes rotate {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  .content {
    position: absolute;
    inset: 2px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }

  h1 {
    font-size: 8rem;
    margin: 0;
  }

  p {
    margin: 1rem 0 3rem;
  }

  .magnetic-btn {
    position: relative;
    padding: 1rem 2rem;
    border: 2px solid rgba(255,255,255,0.5);
    overflow: hidden;
    transition: all 0.3s ease;
  }

    .magnetic-btn:hover {
    }

  .hover-effect {
    position: absolute;
    background: radial-gradient(circle at center, rgba(255,255,255,0.4) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.3s ease;
    width: 100px;
    height: 100px;
    pointer-events: none;
  }

  .magnetic-btn:hover .hover-effect {
    transform: scale(2);
  }
</style>
