<template>
  <div class="welcome-page">
    <!-- 导航栏 -->
    <header class="navbar">
      <div class="navbar-content">
        <div class="logo">
          <img src="/images/backgrounds/logo.svg" alt="Logo" />
        </div>
        <nav class="nav-links">
          <a href="#" class="nav-link" @click.prevent="goToTextToVideo">{{ $t('welcome.textToVideo') }}</a>
          <a href="#" class="nav-link" @click.prevent="goToImageToVideo">{{ $t('welcome.imageToVideo') }}</a>
          <a href="#" class="nav-link" @click.prevent="goToStoryboardVideo">{{ $t('welcome.storyboardVideo') }}</a>
        </nav>
        <div class="nav-actions">
          <LanguageSwitcher />
          <button class="nav-button" @click="goToLogin">{{ $t('welcome.startExperience') }}</button>
        </div>
      </div>
    </header>

    <!-- 主要内容 -->
    <main class="content">
      <h1 class="title">
        <span class="title-line">
          <span class="bright-text">智创</span><span class="gradient-text">无限,</span>
        </span>
        <span class="title-line">
          <span class="bright-text">灵感</span><span class="gradient-text">变现。</span>
        </span>
      </h1>
      <button class="main-button" @click="goToLogin">立即体验</button>
    </main>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import LanguageSwitcher from '@/components/LanguageSwitcher.vue'

const router = useRouter()

// 跳转到登录页面
const goToLogin = () => {
  router.push('/login')
}

// 跳转到文生视频页面
const goToTextToVideo = () => {
  router.push('/text-to-video/create')
}

// 跳转到图生视频页面
const goToImageToVideo = () => {
  router.push('/image-to-video/create')
}

// 跳转到分镜视频页面
const goToStoryboardVideo = () => {
  router.push('/storyboard-video/create')
}
</script>

<style scoped>
/* 自定义字体 */
@font-face {
  font-family: 'Taipei Sans TC';
  src: url('/fonts/TaipeiSansTC.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.welcome-page {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: 'Taipei Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.welcome-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('/images/backgrounds/welcome-bg.svg') center/cover no-repeat;
  z-index: -1;
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 1200px;
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  height: 60px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-content {
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 35px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 30px;
  margin-left: auto;
  margin-right: 15px;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #4a9eff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-button {
  background: rgba(74, 158, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.nav-button:hover {
  background: rgba(74, 158, 255, 1);
  transform: translateY(-2px);
}

/* 主要内容 */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding-top: 80px;
  position: relative;
  z-index: 10;
}

.title {
  font-family: 'Taipei Sans TC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 6.5rem;
  font-weight: 700;
  color: white;
  line-height: 1.1;
  margin-bottom: 60px;
  letter-spacing: 0.05em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
  font-weight: 400;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.title-line {
  display: block;
  text-align: center;
  width: 100%;
}

.bright-text {
  color: white;
  opacity: 1;
  font-weight: 700;
}

.gradient-text {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.fade-text {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.main-button {
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 22px 60px;
  border-radius: 50px;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 25px rgba(74, 158, 255, 0.3);
  position: relative;
  backdrop-filter: blur(10px);
  color: #2563EB;
}

.main-button::after {
  content: none;
}

.main-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(74, 158, 255, 0.5);
}

.main-button:active {
  transform: translateY(-2px);
}

/* 背景光影效果已删除 */

/* 响应式设计 */
@media (max-width: 1024px) {
  .title {
    font-size: 5.5rem;
    margin-bottom: 50px;
  }
  .main-button {
    padding: 20px 50px;
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .title {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 40px;
  }
  .main-button {
    padding: 18px 40px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 3rem;
    line-height: 1.3;
  }
  .main-button {
    padding: 16px 35px;
    font-size: 16px;
  }
}
</style>

<style>
/* 全局样式 - 隐藏滚动条 */
html:has(.welcome-page),
body:has(.welcome-page) {
  overflow: hidden !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
</style>