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

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

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

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

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

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

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

      <!-- 通知面板 -->
      <div v-if="showNotifications" class="three-d-notification">
        <div class="three-d-notification-notice">
          <div class="three-d-notification-notice-content">
            <div class="three-d-notification-notice-icon">
              <Bell class="w-5 h-5" />
            </div>
            <div class="three-d-notification-notice-message">通知标题</div>
            <div class="three-d-notification-notice-description">通知内容</div>
          </div>
          <button class="three-d-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,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTYgNEwwIDE2TDE2IDI4VDI4IDE2VDE2IDRaIiBmaWxsPSJ1cmwoI3BhaW50MCkiLz48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MCIgeDE9IjAiIHkxPSIwIiB4Mj0iMzIiIHkyPSIzMiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiM0RjU1QjgiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMyRDM0NjAiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4='

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

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

<style scoped>
.three-d-container {
  font-family: 'Orbitron', sans-serif;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.three-d-header {
  @apply fixed top-0 left-0 right-0 h-16 bg-blue-800/90 backdrop-blur-sm z-10;
  transform: translateZ(20px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

.three-d-logo {
  @apply flex items-center;
}

.three-d-logo-img {
  @apply h-8 w-8;
  transform: translateZ(10px);
}

.three-d-logo-text {
  @apply ml-2 text-2xl font-bold text-white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transform: translateZ(10px);
}

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

.three-d-nav-item {
  @apply text-white/90 hover:text-white transition-all duration-300;
  transform: translateZ(10px);
}

.three-d-nav-item.active {
  @apply text-white font-bold;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

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

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

.three-d-card-list {
  @apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6;
}

.three-d-card {
  @apply bg-blue-800/90 backdrop-blur-sm overflow-hidden;
  transform: translateZ(0);
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.three-d-card:hover {
  transform: translateZ(20px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.three-d-card-cover-img {
  @apply w-full h-full object-cover;
  transform: translateZ(0);
  transition: transform 0.3s ease;
}

.three-d-card:hover .three-d-card-cover-img {
  transform: scale(1.1) translateZ(10px);
}

.three-d-card-body {
  @apply p-4;
}

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

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

.three-d-avatar {
  @apply w-10 h-10 flex items-center justify-center text-white font-bold;
  transform: translateZ(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.three-d-card-meta-title {
  @apply text-xl font-bold text-white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transform: translateZ(10px);
}

.three-d-card-meta-description {
  @apply text-sm text-white/70;
  transform: translateZ(5px);
}

.three-d-card-content {
  @apply text-white/90 mb-4;
  transform: translateZ(0);
}

.three-d-card-actions {
  @apply flex items-center border-t border-white/10 pt-4;
  transform: translateZ(5px);
}

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

.three-d-form-item {
  @apply flex flex-col;
}

.three-d-form-item-label {
  @apply mb-2 text-white font-bold;
  transform: translateZ(10px);
}

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

.three-d-input,
.three-d-select {
  @apply w-full px-4 py-2 bg-blue-800/90 backdrop-blur-sm border-2 border-white/20 focus:border-white/40 text-white;
  transform: translateZ(0);
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.three-d-input:focus,
.three-d-select:focus {
  transform: translateZ(10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

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

.three-d-switch input {
  @apply hidden;
}

.three-d-switch-inner {
  @apply absolute inset-0 bg-blue-800/90 backdrop-blur-sm transition-colors duration-300;
  transform: translateZ(0);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border: 2px solid white/20;
}

.three-d-switch-inner:after {
  content: '';
  @apply absolute w-5 h-5 bg-white top-0.5 left-0.5 shadow transition-transform duration-300;
  transform: translateZ(5px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.three-d-switch input:checked + .three-d-switch-inner {
  @apply bg-purple-500;
}

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

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

.three-d-btn {
  @apply px-4 py-2 text-sm font-bold transition-all duration-300;
  transform: translateZ(0);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.three-d-btn:hover {
  transform: translateZ(10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.three-d-btn.primary {
  @apply bg-blue-500 text-white hover:bg-blue-600;
}

.three-d-btn.secondary {
  @apply bg-purple-500 text-white hover:bg-purple-600;
}

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

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

.three-d-tabs {
  @apply mt-6;
}

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

.three-d-tabs-tab {
  @apply px-4 py-3 text-white/90 cursor-pointer hover:text-white transition-all duration-300;
  transform: translateZ(0);
}

.three-d-tabs-tab:hover {
  transform: translateZ(10px);
}

.three-d-tabs-tab.active {
  @apply text-white font-bold;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transform: translateZ(20px);
}

.three-d-tabs-content {
  @apply p-4;
}

.three-d-tabs-tabpane {
  @apply bg-blue-800/90 backdrop-blur-sm p-4;
  transform: translateZ(0);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

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

.three-d-modal {
  @apply relative top-20 mx-auto w-full max-w-md;
  transform: translateZ(50px);
}

.three-d-modal-content {
  @apply bg-blue-800/90 backdrop-blur-sm;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.three-d-modal-title {
  @apply text-xl font-bold text-white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.three-d-modal-close {
  @apply text-white/90 hover:text-white;
}

.three-d-modal-body {
  @apply p-4;
}

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

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

.three-d-message-notice {
  @apply mb-4;
}

.three-d-message-notice-content {
  @apply flex items-center px-4 py-3 bg-blue-800/90 backdrop-blur-sm;
  transform: translateZ(30px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

.three-d-notification-notice {
  @apply mb-4 bg-blue-800/90 backdrop-blur-sm overflow-hidden;
  transform: translateZ(30px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

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

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

.three-d-notification-notice-message {
  @apply text-xl font-bold text-white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.three-d-notification-notice-description {
  @apply mt-1 text-sm text-white/70;
}

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