<template>
  <div class="gradient-container min-h-screen bg-gradient-to-br from-pink-500 via-purple-500 to-indigo-500">
    <!-- 顶部导航栏 -->
    <div class="gradient-header">
      <div class="gradient-header-content">
        <div class="gradient-logo">
          <img :src="logoUrl" alt="Gradient Logo" class="gradient-logo-img">
          <span class="gradient-logo-text">Gradient</span>
        </div>
        <div class="gradient-nav">
          <a href="#" class="gradient-nav-item active">首页</a>
          <a href="#" class="gradient-nav-item">组件</a>
          <a href="#" class="gradient-nav-item">文档</a>
          <a href="#" class="gradient-nav-item">主题</a>
        </div>
        <div class="gradient-header-actions">
          <button class="gradient-btn text">
            <Search class="w-5 h-5" />
          </button>
          <button class="gradient-btn text">
            <Bell class="w-5 h-5" />
          </button>
          <button class="gradient-btn text">
            <User class="w-5 h-5" />
          </button>
        </div>
      </div>
    </div>

    <!-- 主要内容区 -->
    <div class="gradient-main">
      <!-- 卡片列表 -->
      <div class="gradient-card-list">
        <div v-for="card in cards" :key="card.id" class="gradient-card">
          <div class="gradient-card-cover">
            <img :src="card.cover" :alt="card.title" class="gradient-card-cover-img">
          </div>
          <div class="gradient-card-body">
            <div class="gradient-card-meta">
              <div class="gradient-card-meta-avatar">
                <div class="gradient-avatar" :class="card.avatarClass">
                  {{ card.initials }}
                </div>
              </div>
              <div class="gradient-card-meta-content">
                <h3 class="gradient-card-meta-title">{{ card.title }}</h3>
                <p class="gradient-card-meta-description">{{ card.description }}</p>
              </div>
            </div>
            <p class="gradient-card-content">{{ card.content }}</p>
            <div class="gradient-card-actions">
              <button class="gradient-btn text">
                <Heart class="w-5 h-5" />
                <span>{{ card.likes }}</span>
              </button>
              <button class="gradient-btn text">
                <MessageSquare class="w-5 h-5" />
                <span>{{ card.comments }}</span>
              </button>
              <button class="gradient-btn text">
                <Share2 class="w-5 h-5" />
              </button>
            </div>
          </div>
        </div>
      </div>

      <!-- 表单元素 -->
      <div class="gradient-form">
        <div class="gradient-form-item">
          <label class="gradient-form-item-label">文本输入</label>
          <div class="gradient-form-item-control">
            <input type="text" placeholder="请输入内容" class="gradient-input">
          </div>
        </div>
        <div class="gradient-form-item">
          <label class="gradient-form-item-label">密码输入</label>
          <div class="gradient-form-item-control">
            <input type="password" placeholder="请输入密码" class="gradient-input">
          </div>
        </div>
        <div class="gradient-form-item">
          <label class="gradient-form-item-label">下拉选择</label>
          <div class="gradient-form-item-control">
            <select class="gradient-select">
              <option>选项 1</option>
              <option>选项 2</option>
              <option>选项 3</option>
            </select>
          </div>
        </div>
        <div class="gradient-form-item">
          <label class="gradient-form-item-label">开关</label>
          <div class="gradient-form-item-control">
            <label class="gradient-switch">
              <input type="checkbox">
              <span class="gradient-switch-inner"></span>
            </label>
          </div>
        </div>
      </div>

      <!-- 按钮组 -->
      <div class="gradient-btn-group">
        <button class="gradient-btn primary">主要按钮</button>
        <button class="gradient-btn secondary">次要按钮</button>
        <button class="gradient-btn outline">轮廓按钮</button>
        <button class="gradient-btn text">文本按钮</button>
      </div>

      <!-- 标签页 -->
      <div class="gradient-tabs">
        <div class="gradient-tabs-nav">
          <div 
            v-for="tab in tabs" 
            :key="tab.id"
            class="gradient-tabs-tab"
            :class="{ active: activeTab === tab.id }"
            @click="activeTab = tab.id"
          >
            {{ tab.label }}
          </div>
        </div>
        <div class="gradient-tabs-content">
          <div v-if="activeTab === 'tab1'" class="gradient-tabs-tabpane">
            <p>标签页 1 的内容</p>
          </div>
          <div v-if="activeTab === 'tab2'" class="gradient-tabs-tabpane">
            <p>标签页 2 的内容</p>
          </div>
          <div v-if="activeTab === 'tab3'" class="gradient-tabs-tabpane">
            <p>标签页 3 的内容</p>
          </div>
        </div>
      </div>

      <!-- 对话框 -->
      <div v-if="showDialog" class="gradient-modal-mask">
        <div class="gradient-modal-wrap">
          <div class="gradient-modal">
            <div class="gradient-modal-content">
              <div class="gradient-modal-header">
                <div class="gradient-modal-title">对话框标题</div>
                <button class="gradient-modal-close" @click="showDialog = false">
                  <X class="w-5 h-5" />
                </button>
              </div>
              <div class="gradient-modal-body">
                <p>这是一个渐变风格的对话框示例。</p>
              </div>
              <div class="gradient-modal-footer">
                <button class="gradient-btn" @click="showDialog = false">取消</button>
                <button class="gradient-btn primary" @click="showDialog = false">确定</button>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 消息提示 -->
      <div v-if="showMessage" class="gradient-message">
        <div class="gradient-message-notice">
          <div class="gradient-message-notice-content">
            <Info class="w-5 h-5" />
            <span>这是一条消息提示</span>
          </div>
        </div>
      </div>

      <!-- 通知面板 -->
      <div v-if="showNotifications" class="gradient-notification">
        <div class="gradient-notification-notice">
          <div class="gradient-notification-notice-content">
            <div class="gradient-notification-notice-icon">
              <Bell class="w-5 h-5" />
            </div>
            <div class="gradient-notification-notice-message">通知标题</div>
            <div class="gradient-notification-notice-description">通知内容</div>
          </div>
          <button class="gradient-notification-notice-close" @click="showNotifications = false">
            <X class="w-5 h-5" />
          </button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { 
  Search, Bell, User, MoreVertical,
  Heart, MessageSquare, Share2, X,
  Info
} from 'lucide-vue-next'

const showDialog = ref(false)
const showMessage = ref(false)
const showNotifications = ref(false)
const activeTab = ref('tab1')

const logoUrl = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0idXJsKCNwYWludDApIi8+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJwYWludDAiIHgxPSIwIiB5MT0iMCIgeDI9IjMyIiB5Mj0iMzIiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjRkY2QjAwIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkYwMDAwIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+'

const cards = ref([
  {
    id: 1,
    title: '卡片标题',
    description: '副标题',
    content: '这是卡片的内容，可以包含多行文本。',
    cover: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjI0MCIgdmlld0JveD0iMCAwIDMyMCAyNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE2MCAyMEM4MC4yNjggMjAgMjAgODAuMjY4IDIwIDE2MEMyMCAyMzkuNzMyIDgwLjI2OCAzMDAgMTYwIDMwMEMyMzkuNzMyIDMwMCAzMDAgMjM5LjczMiAzMDAgMTYwQzMwMCA4MC4yNjggMjM5LjczMiAyMCAxNjAgMjBaIiBmaWxsPSJ1cmwoI3BhaW50MCkiLz48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MCIgeDE9IjAiIHkxPSIwIiB4Mj0iMzIwIiB5Mj0iMjQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agc3RvcC1jb2xvcj0iI0ZGNkIwMCIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGMDAwMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==',
    likes: 42,
    comments: 8,
    initials: 'JD',
    avatarClass: 'bg-orange-500'
  },
  {
    id: 2,
    title: '另一个标题',
    description: '另一个副标题',
    content: '这是另一个卡片的内容。',
    cover: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIwIiBoZWlnaHQ9IjI0MCIgdmlld0JveD0iMCAwIDMyMCAyNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE2MCAyMEM4MC4yNjggMjAgMjAgODAuMjY4IDIwIDE2MEMyMCAyMzkuNzMyIDgwLjI2OCAzMDAgMTYwIDMwMEMyMzkuNzMyIDMwMCAzMDAgMjM5LjczMiAzMDAgMTYwQzMwMCA4MC4yNjggMjM5LjczMiAyMCAxNjAgMjBaIiBmaWxsPSJ1cmwoI3BhaW50MCkiLz48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MCIgeDE9IjAiIHkxPSIwIiB4Mj0iMzIwIiB5Mj0iMjQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agc3RvcC1jb2xvcj0iI0ZGNkIwMCIvPjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGMDAwMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjwvc3ZnPg==',
    likes: 36,
    comments: 5,
    initials: 'AB',
    avatarClass: 'bg-orange-600'
  }
])

const tabs = ref([
  { id: 'tab1', label: '标签页 1' },
  { id: 'tab2', label: '标签页 2' },
  { id: 'tab3', label: '标签页 3' }
])
</script>

<style scoped>
.gradient-container {
  font-family: 'Inter', sans-serif;
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-header {
  @apply fixed top-0 left-0 right-0 h-16 backdrop-blur-md bg-white/10 z-10;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-header-content {
  @apply container mx-auto px-4 h-full flex items-center justify-between;
}

.gradient-logo {
  @apply flex items-center;
}

.gradient-logo-img {
  @apply h-8 w-8;
}

.gradient-logo-text {
  @apply ml-2 text-xl font-medium text-white;
  background: linear-gradient(to right, #fff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-nav {
  @apply flex items-center space-x-6;
}

.gradient-nav-item {
  @apply text-white/80 hover:text-white;
  transition: all 0.3s ease;
}

.gradient-nav-item.active {
  @apply text-white;
  background: linear-gradient(to right, #fff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-header-actions {
  @apply flex items-center space-x-2;
}

.gradient-main {
  @apply pt-20 pb-8 px-4;
}

.gradient-card-list {
  @apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4;
}

.gradient-card {
  @apply backdrop-blur-md bg-white/10 rounded-xl overflow-hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.gradient-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.gradient-card-cover {
  @apply relative h-48 overflow-hidden;
}

.gradient-card-cover-img {
  @apply w-full h-full object-cover;
}

.gradient-card-body {
  @apply p-4;
}

.gradient-card-meta {
  @apply flex items-start mb-4;
}

.gradient-card-meta-avatar {
  @apply mr-4;
}

.gradient-avatar {
  @apply w-10 h-10 rounded-full flex items-center justify-center text-white font-medium;
}

.gradient-card-meta-content {
  @apply flex-1;
}

.gradient-card-meta-title {
  @apply text-base font-medium text-white;
}

.gradient-card-meta-description {
  @apply text-sm text-white/80;
}

.gradient-card-content {
  @apply text-white/90 mb-4;
}

.gradient-card-actions {
  @apply flex items-center border-t border-white/10 pt-4;
}

.gradient-form {
  @apply space-y-4 mt-6;
}

.gradient-form-item {
  @apply flex flex-col;
}

.gradient-form-item-label {
  @apply mb-2 text-white/90;
}

.gradient-form-item-control {
  @apply flex-1;
}

.gradient-input,
.gradient-select {
  @apply w-full px-4 py-2 backdrop-blur-md bg-white/10 rounded-xl border border-white/10 focus:border-white/20 focus:ring-1 focus:ring-white/20 text-white;
  transition: all 0.3s ease;
}

.gradient-input:focus,
.gradient-select:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.gradient-switch {
  @apply relative inline-block w-12 h-6;
}

.gradient-switch input {
  @apply hidden;
}

.gradient-switch-inner {
  @apply absolute inset-0 rounded-full backdrop-blur-md bg-white/10 transition-colors duration-300;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-switch-inner:after {
  content: '';
  @apply absolute w-5 h-5 rounded-full bg-white top-0.5 left-0.5 shadow transition-transform duration-300;
}

.gradient-switch input:checked + .gradient-switch-inner {
  background: linear-gradient(to right, #ec4899, #8b5cf6);
}

.gradient-switch input:checked + .gradient-switch-inner:after {
  @apply translate-x-6;
}

.gradient-btn-group {
  @apply flex flex-wrap gap-2 mt-6;
}

.gradient-btn {
  @apply px-4 py-2 rounded-xl text-sm font-medium transition-all duration-300;
}

.gradient-btn.primary {
  background: linear-gradient(to right, #ec4899, #8b5cf6);
  @apply text-white hover:opacity-90;
}

.gradient-btn.secondary {
  background: linear-gradient(to right, #8b5cf6, #6366f1);
  @apply text-white hover:opacity-90;
}

.gradient-btn.outline {
  @apply bg-transparent text-white border border-white/20 hover:border-white/40;
}

.gradient-btn.text {
  @apply bg-transparent text-white/80 hover:text-white;
}

.gradient-tabs {
  @apply mt-6;
}

.gradient-tabs-nav {
  @apply flex border-b border-white/10;
}

.gradient-tabs-tab {
  @apply px-4 py-3 text-white/80 cursor-pointer hover:text-white;
  transition: all 0.3s ease;
}

.gradient-tabs-tab.active {
  @apply text-white;
  background: linear-gradient(to right, #fff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(to right, #ec4899, #8b5cf6) 1;
}

.gradient-tabs-content {
  @apply p-4;
}

.gradient-tabs-tabpane {
  @apply backdrop-blur-md bg-white/10 rounded-xl p-4;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-modal-mask {
  @apply fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50;
}

.gradient-modal-wrap {
  @apply fixed inset-0 overflow-auto;
}

.gradient-modal {
  @apply relative top-20 mx-auto w-full max-w-md;
}

.gradient-modal-content {
  @apply backdrop-blur-md bg-white/10 rounded-xl shadow-lg;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-modal-header {
  @apply flex justify-between items-center p-4 border-b border-white/10;
}

.gradient-modal-title {
  @apply text-lg font-medium text-white;
}

.gradient-modal-close {
  @apply text-white/80 hover:text-white;
}

.gradient-modal-body {
  @apply p-4;
}

.gradient-modal-footer {
  @apply flex justify-end space-x-2 p-4 border-t border-white/10;
}

.gradient-message {
  @apply fixed top-4 right-4 z-50;
}

.gradient-message-notice {
  @apply mb-4;
}

.gradient-message-notice-content {
  @apply flex items-center px-4 py-3 backdrop-blur-md bg-white/10 rounded-xl shadow-lg;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-notification {
  @apply fixed top-4 right-4 z-50;
}

.gradient-notification-notice {
  @apply mb-4 backdrop-blur-md bg-white/10 rounded-xl shadow-lg overflow-hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-notification-notice-content {
  @apply p-4;
}

.gradient-notification-notice-icon {
  @apply float-left mr-4 text-white;
}

.gradient-notification-notice-message {
  @apply text-base font-medium text-white;
}

.gradient-notification-notice-description {
  @apply mt-1 text-sm text-white/80;
}

.gradient-notification-notice-close {
  @apply absolute top-4 right-4 text-white/80 hover:text-white;
}
</style> 