<template>
  <div class="dashboard-container">
    <!-- 欢迎横幅 -->
    <el-card shadow="never" class="welcome-banner">
      <div class="welcome-content">
        <div class="welcome-text">
          <h2>欢迎回来！</h2>
          <p>准备好开始您的下一次模拟面试了吗？在这里管理您的题库，不断提升面试技巧。</p>
        </div>
        <img src="/src/assets/dashboard-hero.svg" alt="仪表盘插图" class="welcome-illustration" />
      </div>
    </el-card>

    <!-- 功能导航 -->
    <div class="feature-grid">
      <router-link to="/interview" class="feature-card-link">
        <el-card shadow="hover" class="feature-card">
          <div class="card-content">
            <el-icon class="card-icon" style="background-color: #ecf5ff; color: #409eff;"><ChatLineRound /></el-icon>
            <div class="text-content">
              <h3>开始模拟面试</h3>
              <p>上传简历，与AI进行实战演练</p>
            </div>
          </div>
        </el-card>
      </router-link>

      <router-link to="/question-bank" class="feature-card-link">
        <el-card shadow="hover" class="feature-card">
          <div class="card-content">
            <el-icon class="card-icon" style="background-color: #f0f9eb; color: #67c23a;"><MessageBox /></el-icon>
            <div class="text-content">
              <h3>题库管理</h3>
              <p>新增、编辑和导入您的面试题库</p>
            </div>
          </div>
        </el-card>
      </router-link>

      <router-link to="/history" class="feature-card-link">
        <el-card shadow="hover" class="feature-card">
          <div class="card-content">
            <el-icon class="card-icon" style="background-color: #fdf6ec; color: #e6a23c;"><Finished /></el-icon>
            <div class="text-content">
              <h3>面试历史</h3>
              <p>查看过往的面试记录与AI复盘报告</p>
            </div>
          </div>
        </el-card>
      </router-link>
    </div>
  </div>
</template>

<script setup>
// 导入Element Plus图标
import { ChatLineRound, MessageBox, Finished } from '@element-plus/icons-vue';
</script>

<style scoped>
/* 仪表盘容器 */
.dashboard-container {
  padding: 10px;
}

/* 欢迎横幅 */
.welcome-banner {
  border: none;
  margin-bottom: 20px;
}

.welcome-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-text h2 {
  font-size: 1.8em;
  margin-top: 0;
  color: #303133;
}

.welcome-text p {
  color: #606266;
  font-size: 1.1em;
}

.welcome-illustration {
  width: 200px;
  height: auto;
}

/* 功能网格布局 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.feature-card-link {
  text-decoration: none;
}

.feature-card .card-content {
  display: flex;
  align-items: center;
  padding: 20px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.card-icon {
  font-size: 32px;
  padding: 15px;
  border-radius: 50%;
  margin-right: 20px;
}

.text-content h3 {
  margin: 0 0 8px 0;
  color: #303133;
  font-size: 1.1em;
}

.text-content p {
  margin: 0;
  color: #909399;
  font-size: 0.9em;
}
</style>
