<template>
    <div class="home">
        <div class="home-container">
            <!-- 背景网格 -->
            <div class="grid-background"></div>

            <!-- 主要内容 -->
            <div class="home-content">
                <div class="home-tag-wrapper">
                    <el-icon class="tag-icon"><Message /></el-icon>
                    <span class="home-tag">短信发送系统 · 首页</span>
                </div>

                <h1 class="home-title">
                    <span class="title-line">欢迎进入</span>
                    <span class="title-line highlight">短信发送管理系统</span>
                </h1>

                <!-- 装饰性图标 -->
                <div class="decorative-icons">
                    <div
                        class="icon-item"
                        v-for="(icon, index) in icons"
                        :key="index"
                        :style="{ animationDelay: `${index * 0.2}s` }"
                    >
                        <el-icon :size="24"><component :is="icon" /></el-icon>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup name="Index">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { Message, Bell, Document, Setting, DataAnalysis, Connection } from '@element-plus/icons-vue'

const router = useRouter()

// 装饰性图标列表
const icons = ref([Message, Bell, Document, Setting, DataAnalysis, Connection])
</script>

<style lang="scss" scoped>
.home {
    // height: 100vh;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f4ff 50%, #d6e4ff 100%);
    overflow: hidden;
}

// 网格背景
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(22, 119, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 119, 255, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    opacity: 0.4;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.home-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.home-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
    width: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-tag-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #1677ff;
    background: rgba(22, 119, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(22, 119, 255, 0.2);
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
    }
    50% {
        box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);
    }
}

.tag-icon {
    font-size: 16px;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.home-tag {
    font-weight: 500;
}

.home-title {
    font-size: 48px;
    line-height: 1.4;
    font-weight: 700;
    margin: 0;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.title-line {
    display: block;
    color: #303133;
    animation: slideInLeft 0.8s ease-out;

    &:nth-child(2) {
        animation-delay: 0.2s;
        animation-fill-mode: both;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.highlight {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 50%, #69b1ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%,
    100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

// 装饰性图标
.decorative-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.icon-item {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(22, 119, 255, 0.15);
    color: #1677ff;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.1);

    &:hover {
        background: rgba(22, 119, 255, 0.1);
        border-color: rgba(22, 119, 255, 0.3);
        transform: translateY(-5px) scale(1.1);
        box-shadow: 0 6px 16px rgba(22, 119, 255, 0.2);
        color: #0958d9;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

// 响应式设计
@media (max-width: 768px) {
    .home-container {
        padding: 15px;
    }

    .home-title {
        font-size: 32px;
        margin-bottom: 30px;
        gap: 12px;
    }

    .home-tag-wrapper {
        font-size: 12px;
        padding: 6px 16px;
        margin-bottom: 24px;
    }

    .decorative-icons {
        gap: 16px;
        margin-top: 30px;
    }

    .icon-item {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .home-title {
        font-size: 24px;
        margin-bottom: 24px;
        gap: 10px;
    }

    .home-tag-wrapper {
        margin-bottom: 20px;
    }

    .decorative-icons {
        gap: 12px;
        margin-top: 24px;
    }

    .icon-item {
        width: 44px;
        height: 44px;
    }
}
</style>
